![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Customized menu for DB Explorer Topic Summary: Created On: 17-Aug-2004 12:43 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() 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 | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
The autoRunDXLFolder(<directory path>
![]() ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Customized menu for DB Explorer
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.