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: Customized menu for DB Explorer
Topic Summary:
Created On: 17-Aug-2004 12: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.
Answer This question was answered by Lenka Koskova-Triskova, on Wednesday, August 18, 2004 9:26 AM

Answer:
So, I got it. Thanks you for redirecting me to the baseWindowMenuFiles folder.
I placed there a script containing my code to generate the menu and now it works exactly as I want to.
So I suppose it should behave similar for all the other menus for other windows.
Is this feature documented anywhere?
Lenka
 17-Aug-2004 12:43
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Hi all,
I would like to modify the main menu for the DOORS DB Explorer. I would like to have a different menu for standard users and a different one for the database or project managers.

Inspirated by succes with config/formal.dxl I looked for similar file affecting the DOORS DB Explorer. I found, that it is possible to add some dxl code to the dxl/config/project.inc file. (Well, but it seems to be ABSOLUTELY undocumented.) I have already tried to add here a function creating my menu. It's code is following:

void createSkodaMenu() {
createMenu(alwaysOn, "Skoda", 'S', null)
createItem(alwaysOn, "Lastehneft generator", 'L', null, modKeyCtrl, null, null, "", "", ptDOORSHome "/lib/dxl/skoda/projects/lg/lg.dxl")

if (verifyType("databaseManager") || verifyType("administrator")) {
createMenu(alwaysOn, "Admin", 'A', null)
createItem(alwaysOn,"My first item",'M',null,modKeyCtrl,null,null,"","","")
end menu
}

end menu
}

The function verifyType is just a function testing the userClass. ptDOORSHome is just a string constant and lg.dxl script contains some my wizard. The wizard itselfs works correctly.

The problem is, that sometimes it works correctly and all the menus are displayed and working. But sometimes the menu is semi active - it appears when DOORS start, but instead of the function called in the dxl script it openes Explorer with Telelogic's help pages. And sometimes DOORS crash when started. The behaviour seems to be totally unpredictive. For some users, it works correctly, for some it doesn't.

So, any idea what's wrong? Is there any other better way how to create such a menu? I know about the possiblilty to create a subfolder in addins folder but - in this case is there any way how to control what menu item will be accessible for different user types?

Thanks for answers,

Lenka
Report this to a Moderator Report this to a Moderator
 17-Aug-2004 14:44
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You are aware of using the "projectaddins" environment variable to define extra menus? It works like the "addins" variable for modules. This method won't let you distinquish between standard users and admins; but you can tell have a different menu for admins then you do for standard users. We use this and each tricky DXL checks to insure the user is an admin.

As you to your issue: perhaps use baseWindowMenu.inc. Perhaps its also possible that the user hasn't been quite defined yet which would result in verifyType failing. I'd add a debug print statement in verifyType that prints the current user's name and type.

- Louie
Report this to a Moderator Report this to a Moderator
 17-Aug-2004 15:11
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Thanks for that idea with debug pring. So, for administrator it works correctly, for standard user it seems the function is called twice instead of once and the user type is incorrect. Well, let's accept it as a feature.

So I will probably try the "projectaddins" possibility.

Lenka
Report this to a Moderator Report this to a Moderator
 17-Aug-2004 19:13
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If I intuitively nailed the issue then the following intuition is probably sound:
User uCurr = find() // User handle of the current user
ensureUserRecordLoaded(uCurr) // Loads the user record
.. or combine them: ensureUserRecordLoaded(find())
if (verifyType(yaddy....)) // The above load and delay should make this work.

On second thought, put those first two lines INSIDE verifyType. Yup, that's it.

- Louie
Report this to a Moderator Report this to a Moderator
 18-Aug-2004 08:36
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Thanks for help. User type verification works now correctly, I added following to the beginning of the function:
ensureUserRecordLoaded(find())
User userRef = find()

But it didn't affect the behaviour of the menus. So, I will continue in my research...
Lenka
Report this to a Moderator Report this to a Moderator
 18-Aug-2004 09:26
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Answer Answer
So, I got it. Thanks you for redirecting me to the baseWindowMenuFiles folder.
I placed there a script containing my code to generate the menu and now it works exactly as I want to.
So I suppose it should behave similar for all the other menus for other windows.
Is this feature documented anywhere?
Lenka
Report this to a Moderator Report this to a Moderator
 18-Aug-2004 16:28
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

And finally, as a warning to anybody having the same problem, reported non predictive behaviour of my script has really funny reason:

if DOORS run automatically all the scripts form some folder, it doesn't interpret only *.dxl files, but it takes ALL FILES WHOSE DOS NAME ENDS WITH .DXL. In my case it were *.dxl~ files, the backup files created by my text editor. It means, that DOORS interpreted the real script and also a backup containing similar code. Well, it usually ended with some error message. I spent at least 2 days searching for a not existing bug in my scripts and thinking why today doesn't work the code tested day before.

The same behaviour I tested with *.dxllll files and all similar possibilities.
Report this to a Moderator Report this to a Moderator
 19-Aug-2004 09:39
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The autoRunDXLFolder(<directory path> function actually runs ALL files in the directory that contain VALID dxl code, regardless of the file name.




-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 19-Aug-2004 11:25
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Wow, that's something I absolutelly didn't know. Where can I found such kind of docummentation? It is not mentioned in the DXL manual... (well, there is nothing about the function itself, neither it's features). Do I have to buy a DXL training to know it? I have started with DOORS DXL just a few months ago and DXL reference is the only documentation I have. Is there anything else?

Lenka
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.