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: Saving view settings
Topic Summary:
Created On: 26-Mar-2004 09:28
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 Kristian Bøe, on Monday, March 29, 2004 10:34 AM

Answer:
When I saved the new view I did not include the view definition, as saving the view does not seem to save the view definition none of the changes I made were saved. So I used the two stage save - save (v) and then save (v, vd) and it worked like a charm!

Thanks for the help
 26-Mar-2004 09:28
User is offline View Users Profile Print this message


Kristian Bøe

Posts: 29
Joined: 16-Jun-2003

I'm trying to create new views in aroud 200 modules and therefore would like to use a script for that. The problem is that I cannot save the settings for the view! That is ste check boxes under "remember settings for : current object ..."... I do not want not remember the current object nor do I want to remember the size and position of the window! I've tried using the functions useCurrent and useWindows but as I said I cannot save this! A piece of the code I'm using is below, any help would be great!


load (view("Standard view"))
View v = view("Comments view")
load (v)

// Add columns.....

ViewDef vd = get(v)
useCurrent (vd, off)
useWindows (vd, off)
useFiltering (vd, on)
useSorting (vd, on)

// Save the view
save(v)
save(current Module)

/Kristian Böe

-------------------------
Kristian Bøe
Extenda AB
Kristian.Boe@extenda.se
Report this to a Moderator Report this to a Moderator
 26-Mar-2004 14:01
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Here's some realities of modifying views:
o You cannot deal with views unless the module is open Visibly
(e.g. mod = read(Name, TRUE)).
o Each view has its own access rights. Its entirely possible that you can SAVE
a view but then cannot modify it.
o You save views independantly from the module; so you CAN modify a view
for modules opened read; and you don't need to save the module.
o You cannot modify a "view". You can only modify the current display state of the
module and then save that.
o These view commands presume the "current" module. Be sure to preamble this
code with: "current = mod".
o The "view" is the current display state of the module. The "view def" stuff is the things
you see in the interface when you save a view. Notice that when saving a view you can
say to "remember columns" or not (view def stuff), but you cannot modify columns from there
(view stuff).

I'm not sure what's wrong with your code, unless of course you do NOT have modify access to the view. I'd be tempted to surround your "save(v)" command as follows, to trap any error:

noError()
save(v)
string ErrMess = lastError()
if (!null ErrMess) ack("Error saving view: " ErrMess)

- Louie
Report this to a Moderator Report this to a Moderator
 26-Mar-2004 15:24
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

Kristian,

I've been successful in creating views by handling them in two stages. First by inserting the columns and saving the view, then by setting the options and re-saving the ViewDef.

For example, you could try:
string viewName="Comments view"
ViewDef vd

// Insert your code here to set the columns and save the view
save view viewName

// Get a handle on the newly created ViewDef
vd=get view viewName

// Insert code to set the view options
useCurrent(vd, false)
useWindows(vd, false)
useFiltering(vd, false)
useSorting(vd, false)
useShowExplorer(vd, true)
useLevel(vd, true)

// Save the ViewDef for the view
save(view viewName, vd)


Note that Louie is correct in that the module does need to be open displayed (ie, not hidden), but you do not need write access to the module nor do you need to perform a save(current Module) command in order for the views to be modified.

-Dennis
Report this to a Moderator Report this to a Moderator
 26-Mar-2004 15:37
User is offline View Users Profile Print this message


Kristian Bøe

Posts: 29
Joined: 16-Jun-2003

Thanks! I'll be trying your tips Dennis out on Monday.

As I'm doing this for ~100 modules at the time I have a parsing loop that opens the module visibly in edit mode
m = edit (S_PATH_1 "/" modules, true)
then explicitly sets is as current module (which should be unneccesary as the edit command does that!)

As teh view is new there is no problem with my rights.

I save the module because I'm also adding an attribute - which is the reason I make a new view / modify existing. When I do not have the right to save/modify the view the error message is printed - does not need any capture.

/Kristian

-------------------------
Kristian Bøe
Extenda AB
Kristian.Boe@extenda.se
Report this to a Moderator Report this to a Moderator
 26-Mar-2004 16:27
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The edit command will change the opened module current unless it was already open Edit: if its already edited then there is no change to the current. Its good practice to explicetely set "current" before using commands that presume the current module.

Even if its a new view you MAY have access problems since it can easily occur you have writes to "C"reate a view but not to "M"odify it. Be sure to use a user that has full RMCDA access to the module and the views.

The error message may be printed OK, but your DXL aborts at that point. Capturing it allows the DXL to continue.

Be so kind as to post the successful version of this script; at least the meat of it: "Picture tells a thousand words" and all.

- Louie
Report this to a Moderator Report this to a Moderator
 29-Mar-2004 10:34
User is offline View Users Profile Print this message


Kristian Bøe

Posts: 29
Joined: 16-Jun-2003

Answer Answer
When I saved the new view I did not include the view definition, as saving the view does not seem to save the view definition none of the changes I made were saved. So I used the two stage save - save (v) and then save (v, vd) and it worked like a charm!

Thanks for the help

-------------------------
Kristian Bøe
Extenda AB
Kristian.Boe@extenda.se
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.