![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Saving view settings Topic Summary: Created On: 26-Mar-2004 09:28 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() 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 | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Saving view settings
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.