![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Restore Modules Topic Summary: Restore Modules in Batch Mode Created On: 8-Nov-2005 14:08 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Hi Tarun, ok, here is a test run of the whole scenaraio: (last time some how selecting the current folder was missing) 1. Check the local drive for C:\multisite\fromRbin and copy the .dma files there.... 2. Open DOORS 3. Create a folder named test1 in root of the DOORS database. 4. Now run the following script **. If still not working then take a break and try again the same thing.... Cheers, Rony string sProjArchLoc="C:\\multisite\\fromRbin" //Replace this with your source location where all the archived modules are situated string sProjRestorePath="/test1" //Replace where you want to restore (DOORS database folder or project) string file="" string sLog="\n""Restored Modules on "today"\n" void restoreFiless() { string s for file in directory sProjArchLoc do { if ((file == ".") || (file == "..")) { continue } else { current = folder sProjRestorePath s=sProjArchLoc"\\"file print s "\n" string message ="" if(file!="") message = restoreModule( s) //only consider .dma files; Error handling necessary for other type of file if (!null message) { sLog = "Failed to restore" file "\n" continue } else sLog="Restored File" file "\n" } } } restoreFiless() print sLog | |
![]() |
|
Hi all
I have a problem when iam trying to restore a module using DXL either in Batch mode or in normal mode it says it cannot find file paths but the same paths work or open up from command prompt Does any have some experience in restore of Modules using DXL. Regards Tarun |
|
![]() |
|
![]() |
|
You'll have to post the DXL and the stuff that issues the Batch command.
|
|
![]() |
|
![]() |
|
string sProjArchLoc="\\""\\Hi051741\\multisite\\Modules\\fromRbin"
string sProjRestorePath="/" string file string sLog="\n""Restored Modules on "today"\n" void restoreFiless() { for file in directory sProjArchLoc do { string message = restoreModule file if (!null message) { sLog = "Failed to restore" file "\n" continue } else sLog="Restored File" file "\n" } } //restoreFiless() This is the script iam trying to run it from DOORS but still it fails to get the file the same path works fine for counting the number of files in directory Let me know if i am doing some thing wrong |
|
![]() |
|
![]() |
|
Hi Tarun,
some ideas: 1) print out the message if non-null to see *why* it did fail -> send it to this thread 2) check each module is unique within the project it is restored into 3) just a hint: probably mind double backslashes. Regards Hubertus |
|
![]() |
|
![]() |
|
Hi Tarun,
it seems, that you forgot to add the directory to the file name, so the correct line could be string message = restoreModule (sProjArchLoc"\\"file) Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Hi
I have modified as Reik and Hubertus have pointed out Now this is the script string sProjArchLoc="\\""\\Hi051741\\multisite\\fromRbin" string sProjRestorePath="/" string file="" string sLog="\n""Restored Modules on "today"\n" void restoreFiless() { for file in directory sProjArchLoc do { string s=sProjArchLoc"\\"file print s string message ="" if(file!="") message = restoreModule( s,file) if (!null message) { sLog = "Failed to restore" file "\n" continue } else sLog="Restored File" file "\n" } } restoreFiless() print sLog And the error printed is as following This is the path of the files to restore \\Hi051741\multisite\fromRbin\. \\Hi051741\multisite\fromRbin\.. \\Hi051741\multisite\fromRbin\1.dma Restored Modules on 09 November 2005 Failed to restore. Failed to restore.. Failed to restore1.dma |
|
![]() |
|
![]() |
|
Hi Tarun,
please modify the line sLog = "Failed to restore" file "\n" to sLog = "Failed to restore" file "! Reason: " message "\n" to see what is missing and furthermore restrict to files ending with ".dma" by a regexp as your script apparently tries to restore also directories (. and ..). Regards Hubertus |
|
![]() |
|
![]() |
|
Hi Hubertus
The error i get is File not found Regards Tarun |
|
![]() |
|
![]() |
|
Hi Tarun,
Use the following code; it will work... Regards, Rony // string sProjArchLoc="C:\\arch_fol" //Replace this with your source location where all the archived modules are situated string sProjRestorePath="/test1" //Replace where you want to restore (DOORS database folder or project) string file="" string sLog="\n""Restored Modules on "today"\n" void restoreFiless() { string s for file in directory sProjArchLoc do { if ((file == ".") || (file == "..")) { continue } else { s=sProjArchLoc"\\"file print s "\n" string message ="" if(file!="") message = restoreModule( s) //only consider .dma files; Error handling necessary for other type of file if (!null message) { sLog = "Failed to restore" file "\n" continue } else sLog="Restored File" file "\n" } } } restoreFiless() print sLog |
|
![]() |
|
![]() |
|
The same error
C:\multisite\fromRbin\1.dma Failed to restoreFile not found 1.dma I dont understand whay is it not running iam running this script from DOORS on the main window with a empty project open Its really eating up my brain Edited: 9-Nov-2005 at 13:47 by Tarun Inabathuni |
|
![]() |
|
![]() |
|
I tried Ronys Code
still no Luck Edited: 9-Nov-2005 at 13:47 by Tarun Inabathuni |
|
![]() |
|
![]() |
|
Hi Tarun,
before running the script in the dxl window, make sure the following: 1. The folder existis at C:\multisite\fromRbin 1.a: Use the corresponding script variable as string sProjArchLoc="C:\\multisite\\fromRbin" 2. Do not try to restore the module to DOORS root i.e. string sProjRestorePath="/" 2.a: Instead use a folder, for example test1 - string sProjRestorePath="/test1"; this test1 folder should exists in DOORS hierarchy to see the changes - refresh the DOORS window... Hope now no body will eat your brain ;-) Regards, Rony Edited: 9-Nov-2005 at 14:09 by Iftakher Uddin |
|
![]() |
|
![]() |
|
Hi Rony
I have checked the path I am running the script from DOORS window with a project active I ran the printed output path along with the file path in the command line and it opens up in notepad. No idea still whats going on I know its getting really long discussion but i am cornered with this error Regards Tarun Edited: 9-Nov-2005 at 14:19 by Tarun Inabathuni |
|
![]() |
|
![]() |
|
It appears you are restoring the module in the 'current' doors location from the 'current' windows location. the Current DOORS location is the database root when running in batch mode; and I don't know about the current windows location but it may be the most recently used Windows Explorer, and it may not apply to batch mode. Its possible that restoreModule won't work unless its in a project.
My restore modules script sets the current DOORS location to the desired location: current = folder(sProjRestorePath), but I don't know if that is necessary; but it doesn't hurt. After that, I use the base name of the file to determine the module's name; stripping off the ".dma" and leaving, in your case, a module with the name of "1". The more I look at this the more it looks like the "current" command IS necessary and the module's name contains no path information; that is "restoreModules" always restores in the current location. I'd be tempted to check the file name to insure it contains ..err.. ends with ".dma". Your sLog command should look like: sLog = sLog ...message... "\n". Better yet, declare it as a buffer and use += ..messsage.. - Louie |
|
![]() |
|
![]() |
|
Hi Tarun,
ok, here is a test run of the whole scenaraio: (last time some how selecting the current folder was missing) 1. Check the local drive for C:\multisite\fromRbin and copy the .dma files there.... 2. Open DOORS 3. Create a folder named test1 in root of the DOORS database. 4. Now run the following script **. If still not working then take a break and try again the same thing.... Cheers, Rony string sProjArchLoc="C:\\multisite\\fromRbin" //Replace this with your source location where all the archived modules are situated string sProjRestorePath="/test1" //Replace where you want to restore (DOORS database folder or project) string file="" string sLog="\n""Restored Modules on "today"\n" void restoreFiless() { string s for file in directory sProjArchLoc do { if ((file == ".") || (file == "..")) { continue } else { current = folder sProjRestorePath s=sProjArchLoc"\\"file print s "\n" string message ="" if(file!="") message = restoreModule( s) //only consider .dma files; Error handling necessary for other type of file if (!null message) { sLog = "Failed to restore" file "\n" continue } else sLog="Restored File" file "\n" } } } restoreFiless() print sLog |
|
![]() |
|
![]() |
|
Thanks Rony
The script finally decided to work I dont know what triggered the decision Thanks all for the help Regards Tarun |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Restore Modules
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.