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: updating existing views
Topic Summary:
Created On: 6-Aug-2007 14:05
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.
Answer This question was answered by Khalid Khan, on Monday, August 6, 2007 6:09 PM

Answer:
Hi, I have changed the attribute name in a module. This attribute (with old name) was used (displayed) in many views, now newly named attribute doesn't appears in those existing views. I would like to know, is it possible with dxl code to update the existing views, so that existing views display the new named attribute? Well.... i have many many modules, so i don't want to update all views (with filtering, etc. ) in all these modules manually. i would like to do per dxl script. Any idea? regards, Khalid
 6-Aug-2007 14:05
User is offline View Users Profile Print this message


Khalid Khan

Posts: 2
Joined: 3-Aug-2007

Answer Answer
Hi, I have changed the attribute name in a module. This attribute (with old name) was used (displayed) in many views, now newly named attribute doesn't appears in those existing views. I would like to know, is it possible with dxl code to update the existing views, so that existing views display the new named attribute? Well.... i have many many modules, so i don't want to update all views (with filtering, etc. ) in all these modules manually. i would like to do per dxl script. Any idea? regards, Khalid
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 14:49
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Khalid,

You can do this. Look up Views in the DXL Reference manual. Your code will look something like this (I have NOT checked this)

string vName
Module m = current

for vName in views(m) do {

int colCount = 0
Column c

for c in m do P

colCount++
}

insert(column colCount++)
attribute (column colCount, "Your new attribute")


}


I hope this gets you off on the right foot.

Kevin

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 14:50
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Oh, and obviously you'll want a

if ( vName == "View I want to update" ) {


}

otherwise, the code I put in above will update ALL views.

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 15:04
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

You will need to load each view, and save the view after changing the column.

Try the following.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 18:36
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Tony, thanks so much for the correction! You don't know how many times I've forgotten the simple load(v) function!

I never learn.

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 7-Aug-2007 15:28
User is offline View Users Profile Print this message


Khalid Khan

Posts: 2
Joined: 3-Aug-2007

Hi all, thanks a lot. It works. BR, Khalid
Report this to a Moderator Report this to a Moderator
 8-Aug-2007 00:21
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Golly, I was sure DOORS correctly updated all the views when you renamed an attribute.
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 12:45
User is offline View Users Profile Print this message


Hans Schaller

Posts: 3
Joined: 7-May-2007

If you rename an attribute, Tony's code won't work (DOORS 8.1)
When you load a view with a renamed attribute, this attribute isn't displayed
preventing the loop to find your attribute.

What you can do to update your views is:
1. Create a dummy attribute with the desired name
2. Use Tony's code
3. Delete the dummy attribute
4. Rename the real attribute



-------------------------
Hans Schaller
www.doorstools.de

Edited: 18-Oct-2007 at 13:20 by Hans Schaller
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.