Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Inserting DXL Layout Columns using DXL
Topic Summary:
Created On: 21-Feb-2007 22:43
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 21-Feb-2007 22:43
User is offline View Users Profile Print this message


Paul Miller

Posts: 376
Joined: 2-Oct-2002

Hi,

I need to insert some DXL layout columns using DXL - I know how to insert columns using DXL, but when it comes to creating a DXL layout column, the most common method I've seen to date for inserting the actual DXL layout source code is to represent the source code as one large string of text with zillions of "\" escape and "\n" new line characters everywhere. Is there a way to read in the source DXL code for the layout column from a file rather than defining the source code as a string?

-------------------------
Paul Miller
Specification Practices Specialist,
EuroCyber,
Melbourne, Australia.
Mobile: +61 (0)418 135 103
Web Site: http://www.eurocyber.biz
E-mail: miller@eurocyber.biz">pmiller@eurocyber.biz
Report this to a Moderator Report this to a Moderator
 27-Feb-2007 10:37
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

I don't think there's any way of directly reading the DXL from a file.

However, you could read the file into a string and use the following functions to do the escaping and conversion of newlines:

Report this to a Moderator Report this to a Moderator
 28-Feb-2007 14:54
User is offline View Users Profile Print this message


Kevin James

Posts: 32
Joined: 12-Dec-2005

Hey Paul,

We do this all the time and it works really well.  I have a number of menu options that allow people to insert "dynamic" columns.  It prompts them for input, then reads the DXL from a file, replaces a few constants, and creates the new column.

I've attached basic code that I use...

Let me draw your attention to this note that also in the comments of the code.  I think it will make more sense when you see the code.

NOTE: You will reduce your complexity immensely and save yourself a lot of headaches if you abstract out the actual code for the layout DXL columns.  In my opinion, you should never put actual code in a layout column.  ALWAYS define any constants that make the column unique and include a reference to the actual code.  That way you can always keep code maintainable.  If necessary, parameterize your layout DXL code, then define the parameters as constants (which are input as prompts to the users and replaced) when the column is created.

Overall I found this technique of using dynamic columns to be immensely valuable.  It allows users to create their own DXL columns with user input for parameters and keeps code very maintainable.

Let me know if you have any questions or have any suggestions.

Kevin



Edited: 28-Feb-2007 at 14:55 by Kevin James
Report this to a Moderator Report this to a Moderator
 28-Feb-2007 22:29
User is offline View Users Profile Print this message


Paul Miller

Posts: 376
Joined: 2-Oct-2002

Hi Kevin,

Thankyou for your response.

I liked your use of Constants to help configure a DXL layout function and your sample code showed me how to read in DXL code from an external file - it's a lot easier than I thought - many thanks for that.

The use of #includes to point to a single instance of the DXL code is something that I've used before but becomes a pain when a Project or Module needs to be archived and restored onto another database. We have customers and sub-contractors who also use DOORS and quite often we need to exchange copies of projects and modules. DOORS doesn't handle broken #include paths very elegantly so I've tended to steer clear of this. I would be nice if DXL supported pre-processor commands so that #includes can be used on a conditional basis.

-------------------------
Paul Miller
Specification Practices Specialist,
EuroCyber,
Melbourne, Australia.
Mobile: +61 (0)418 135 103
Web Site: http://www.eurocyber.biz
E-mail: miller@eurocyber.biz">pmiller@eurocyber.biz
Report this to a Moderator Report this to a Moderator
 13-Mar-2007 16:04
User is offline View Users Profile Print this message


Kevin James

Posts: 32
Joined: 12-Dec-2005

Hi Paul,

You've definitely got a more complicated scenario than we do.  I've never even considered that because we've always had a single database and a single team accessing DOORS.

I guess the only way around that issue if you still wanted to use #includes would be standardize the DXL scripts that the different contractors use (probably not worth the effort), or to have some kind of script that takes a module to be archived, makes a copy of it, and in the new module loops through any DXL columns and replaces any include statements with actual code from the file.  That seems like a lot of work too though.

Anyway, I can think of any quick solution to your problem about includes, but I'm glad you can at least use the code about pulling DXL from a file.

Regards,
Kevin
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.