Hi, |
Re: Creating Object headings via script look the attached file. Pierre Attachments attachment_14568974_HeadinsAttributViews_DXLcreate.zip |
Re: Creating Object headings via script Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Creating Object headings via script Sounds like you want to create templates - as Mathius has already pointed out, it's possibly easier to create a template manually from a blank formal module rather than via DXL. They can be located under a folder and users can then copy and paste the template into another folder and start work. For each template doc type, just build up a blank formal module with the attributes, views and headings required to support the document type. I would recommend prefixing each template view with a number so that they always sit at the top of the view list and don't get mixed up with users views - also set the access permissions on these views so that users can't fiddle with them. I've been doing it this way for years, seems to be the easiest option. This records all changes to the module version and who made them on which date Yes - you can place a table structure before the first heading - are you wanting to populate this revision history table automatically via DXL or will users do this manually? Paul Miller Melbourne, Australia |
Re: Creating Object headings via script SystemAdmin - Fri Jan 07 16:31:28 EST 2011 Paul Miller Melbourne, Australia I'll have a look at that zip file. Yes, I am in fact creating a template, but the reason why I haven't used the manual method is because I've already created the script for module generation. I've got this customized toolkit set up already, so at the moment it will choke up a new project template that has all the bits my company usually uses. That's why I thought that populating modules via DXL would be more efficient... The modules come up already with all the views, etc. They're grouped in such a way no common combination of text will separate these specific views. The headings have also been generated via DXL and so have the attributes and their attribute types. All I need now is to populate the thing, so employees can just enter underneath each heading. Is this do-able? I guess I am willing to invest in any amount of code to do it. Besides being very automated,...it sure makes things impressive : P TooDiff |
Re: Creating Object headings via script TooDifficult - Mon Jan 10 00:04:20 EST 2011 Many thanks for the code; it looks like exactly what I need but I don't understand a few things; What is the Module_AttributsWEXP file doing? Thanks, TooDiff |
Re: Creating Object headings via script TooDifficult - Mon Jan 10 00:07:57 EST 2011 we use TXEP (Doors Trek Exporter) to generate Word document from Doors modules. Module_AttributsWEXP file create attributs used by this tool (all WEXP... attributs) and attributs used in the document as title, author, ... (all WORD... attributs). WEXP attributs are not useful for you. Pierre |
Re: Creating Object headings via script PDU - Mon Jan 10 01:37:50 EST 2011 So which part of the code is actually creating the headings inside the module? Initially I thought it was the create object type etc, but you just said it creates the Word document format. Which code file is inserting object headings into an empty module? Thanks, TooDiff |
Re: Creating Object headings via script TooDifficult - Mon Jan 10 16:41:40 EST 2011
Which code file is inserting object headings into an empty module?
Template A = template "SCOPE"
"APPLICABLE DOCUMENTS" <<
"Government Documents"
"Non-Government Document" >> 1
"REQUIREMENTS" <<
"Definition"
"Characteristics" <<
"Performance Characteristics"
"Physical Characteristics"
"Reliability"
"Maintainability"
"Environmental Conditions"
"Transportability" >> 1
"Design and Construction" <<
"Materials"
"Electromagnetic Radiation"
"Nameplates or Product Markings"
"Workmanship"
"Interchangeability"
"Safety"
"Human Engineering"
instance A
Paul Miller
|
Re: Creating Object headings via script SystemAdmin - Mon Jan 10 17:23:32 EST 2011
Which code file is inserting object headings into an empty module?
Template A = template "SCOPE"
"APPLICABLE DOCUMENTS" <<
"Government Documents"
"Non-Government Document" >> 1
"REQUIREMENTS" <<
"Definition"
"Characteristics" <<
"Performance Characteristics"
"Physical Characteristics"
"Reliability"
"Maintainability"
"Environmental Conditions"
"Transportability" >> 1
"Design and Construction" <<
"Materials"
"Electromagnetic Radiation"
"Nameplates or Product Markings"
"Workmanship"
"Interchangeability"
"Safety"
"Human Engineering"
instance A
Paul Miller
Thanks for this. I'll give it a shot and get back to you. Thanks! TooDiff |
Re: Creating Object headings via script TooDifficult - Mon Jan 10 23:24:55 EST 2011 Forgot to answer your previous question; I am hoping that I can do the revision table update via DXL as there's more automation, but if that's not possible then I will be fine with just manual. Can this table be inserted via, again, DXL? Thanks, Dillon |
Re: Creating Object headings via script TooDifficult - Mon Jan 10 23:27:56 EST 2011
Can this table be inserted via, again, DXL?
Object o = current Object tableTopMost = table(current Module, 10, 3) Object tableOneLevelBelow = table(below(o),5, 4)
Paul Miller
|
Re: Creating Object headings via script SystemAdmin - Tue Jan 11 00:21:27 EST 2011
Can this table be inserted via, again, DXL?
Object o = current Object tableTopMost = table(current Module, 10, 3) Object tableOneLevelBelow = table(below(o),5, 4)
Paul Miller
I've tried out the table functions with some splendid results! The DXL manual has an example that prints cell identifiers of each cell in the table. I was wondering whether it's possible to enter text into these cells via DXL, like, Rev | Date | Changer |Changesmade Haven't found any in the DXL manual Thanks! TooDiff |
Re: Creating Object headings via script TooDifficult - Tue Jan 11 17:21:15 EST 2011
Module m = current
//insert a table first, based on current revtables seems like best choice is r4 c5
Object RevTable = table(m,4,5)
//object template
Template MRDheadings = template "Purpose"
"Scope"
"References" <<
"Reference 1 - add more below" >>
"Product Purpose"
"Critical Market Driven Features"
"Intended use(s)"
"Patient Group"
"Target Markets (Geographical, Organisations, etc.)"
"Timing"
"Saleable Product Life Span"
"Competitive positions/devices"
"Target COGS"
"Volume Forecasts"
"Risks"
"Requirements"
//RevTable = current
instance below MRDheadings
|
Re: Creating Object headings via script TooDifficult - Tue Jan 11 19:07:57 EST 2011
Module m = current
//insert a table first, based on current revtables seems like best choice is r4 c5
Object RevTable = table(m,4,5)
//object template
Template MRDheadings = template "Purpose"
"Scope"
"References" <<
"Reference 1 - add more below" >>
"Product Purpose"
"Critical Market Driven Features"
"Intended use(s)"
"Patient Group"
"Target Markets (Geographical, Organisations, etc.)"
"Timing"
"Saleable Product Life Span"
"Competitive positions/devices"
"Target COGS"
"Volume Forecasts"
"Risks"
"Requirements"
//RevTable = current
instance below MRDheadings
Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Creating Object headings via script Mathias Mamsch - Tue Jan 11 20:43:47 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS I've tried the current = getTable current, there was no debug error so I guess it was logically correct. But the crash is still there. With this one, I looked up the DXL Ref Manual and it says that it retrieves the table header. So I guess this method should be able to work. In regards to the set current to first object, how do I do that? Also, doesn't that mean that I'm setting current to point to the first cell in my case? The code creates the table before putting any headings in. So it should appear before the "1 heading" object. If it's pointing to the first cell then it's trying to create the template in between the first and second cell. Regardless I'll give it a shot. I'm guessing you're talking about the current = Object object function? So technically my commented bit with RevTable = current is sort of correct right? Just not syntactically. To set the object to the first, it's current = first current Module. Does this count the whole table as an object? Also after doing some debugging I found that after running the code, and letting it crash, by trying to open it again after a Doors.exe restart, it would crash again. So I'm thinking that the template was created already, just that DOORS was having a lot of trouble trying to display it. I've also tried splitting the function into two, creating the table first then the headings, but to no avail. I'll try this out and get back to you. Thanks! TooDiff |
Re: Creating Object headings via script TooDifficult - Tue Jan 11 22:14:55 EST 2011 instance t creates template t AFTER the current object. This means it should appear as a separate object after the last cell doesn't it? So if I print identifier cell and try to set current to the last cell, and insert template after that last cell, should it work? Or is it doing the same thing as DOORS itself, since you said the last object after the function has been executed is in fact the last cell. What's the difference between below and after? Thanks, TooDiff |
Re: Creating Object headings via script TooDifficult - Tue Jan 11 19:07:57 EST 2011
Module m = current
//insert a table first, based on current revtables seems like best choice is r4 c5
Object RevTable = table(m,4,5)
//object template
Template MRDheadings = template "Purpose"
"Scope"
"References" <<
"Reference 1 - add more below" >>
"Product Purpose"
"Critical Market Driven Features"
"Intended use(s)"
"Patient Group"
"Target Markets (Geographical, Organisations, etc.)"
"Timing"
"Saleable Product Life Span"
"Competitive positions/devices"
"Target COGS"
"Volume Forecasts"
"Risks"
"Requirements"
//RevTable = current
instance below MRDheadings
Firstly - create your table after the headings have been created, it seems as though it is dependent on there being other objects in existance first - I think I understand why but it's a long story. Secondly - each heading in the Template function must be defined with one of the level operators - I noticed that in the code example I gave you recently that some level operators are being stripped out by the forums code markup text function - IBM needs to fix that problem. Instead, I have attached a revised version of your code which works for me without error - I've added a couple of headings to demonstrate use of the level operators and put the table creation function last. When defining the template headings as a top down list, each level operator refers to the level that next heading in the list will be inserted relative to the preceding heading. This is why the last heading in the list does not have a level operator. You'll need to play around with these to get them right - the level operators will allow you to jump more than one level using an integer value instead of successive operators e.g. << 4 <> - this means jump up 4 levels and insert at that level. Paul Miller Melbourne, Australia Attachments attachment_14570265_InsertHeadingsAndTable.dxl |
Re: Creating Object headings via script SystemAdmin - Tue Jan 11 23:29:52 EST 2011 Paul Miller Melbourne, Australia Thanks for the help! It worked! What I find funny is that even though you put the table below the instance activation in the code, the table still appears above the first heading. Why is this? I thought that the code would execute from top to bottom... Thanks a lot for this, it really helps. Also, is it possible to insert text via script into those table cells? I noticed that in the DXL reference manual there's the print identifier cell function in one of the example codes. When run, it prints the cell's tag, so I am guessing there's a way to use that tag to write information into the cell? Thanks! TooDiff |
Re: Creating Object headings via script TooDifficult - Wed Jan 12 16:50:37 EST 2011 You need to refer to the DXL Reference manual - the DXL "table" function is an overloaded function and has many forms, the one that I used in my example specifically locates the table as the very first object in the module object hierarchy. This concept of a "first object" may seem odd as a DOORS table is essentially a 2 dimensional array of many module objects. "first object" refers to a hidden table header object that represents where the table starts (which can be made to appear when you deselect View > Show > Table cells from the module menu), each row of a table also has a hidden row header object - may seem strange but it's a long story and hard to explain without a diagram - I recommend that you read the DXL Reference manual on tables. Paul Miller Melbourne, Australia |
Re: Creating Object headings via script TooDifficult - Wed Jan 12 16:50:37 EST 2011
Also, is it possible to insert text via script into those table cells?
Object tableRow
Object tableCell
int rowref=0
int colref=0
for tableRow in table current Object do { //For each row in a table
rowref++
colref=0
for tableCell in row tableRow do { //For each cell in a row
colref++
print "r" rowref"" "c" colref"" "\t"
}
print "\n"
}
Paul Miller
|
Re: Creating Object headings via script SystemAdmin - Wed Jan 12 19:21:46 EST 2011
Also, is it possible to insert text via script into those table cells?
Object tableRow
Object tableCell
int rowref=0
int colref=0
for tableRow in table current Object do { //For each row in a table
rowref++
colref=0
for tableCell in row tableRow do { //For each cell in a row
colref++
print "r" rowref"" "c" colref"" "\t"
}
print "\n"
}
Paul Miller
I had a look at the reference manual and it doesn't say much in terms of actual manipulation of cells, only the overall manipulation of attributes and the table itself. If I wanted to limit your loop to just one row, I'd cancel the outer loop and keep the inner loop right? However, because DOORS' starts loops from the first row TableRow, then I would need to tell DOORS which row to manipulate if I removed the outer loop. Is there a way to mark tableRow, i.e., give it a tag and tell DOORS to deal with that row only? Also, is inserting text a generic function? Can I treat it like entering textual headings? I ask this because there don't seem to be specific tabular text functions. From what I understand, there's one overall header object called the table header. Then each row is counted as objects, and cells are then the subdivisions of each of those objects. I THINK I would be able to tackle text editing using the templates? What do you think? TooDiff |
Re: Creating Object headings via script TooDifficult - Wed Jan 12 22:37:46 EST 2011 I forgot to ask you; you know how we can define the level of the heading to insert as an integer. What level is plain text/rich text considered? Thanks, TooDiff |
Re: Creating Object headings via script TooDifficult - Wed Jan 12 23:18:39 EST 2011 if(isDeleted tableRow) continue if(isDeleted tableCell) continue I hope this helps ignore deleted rows and columns/cells. |