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: Restore Modules
Topic Summary: Restore Modules in Batch Mode
Created On: 8-Nov-2005 14:08
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 Iftakher Uddin, on Wednesday, November 9, 2005 3:41 PM

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
 8-Nov-2005 14:08
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

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
Report this to a Moderator Report this to a Moderator
 8-Nov-2005 23:25
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You'll have to post the DXL and the stuff that issues the Batch command.
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 11:26
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 12:03
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 12:26
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 12:32
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 12:44
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 13:04
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

Hi Hubertus

The error i get is
File not found

Regards
Tarun
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 13:21
User is offline View Users Profile Print this message


Iftakher Uddin

Posts: 56
Joined: 16-Sep-2004

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 13:46
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 13:47
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

I tried Ronys Code
still no Luck

Edited: 9-Nov-2005 at 13:47 by Tarun Inabathuni
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 14:06
User is offline View Users Profile Print this message


Iftakher Uddin

Posts: 56
Joined: 16-Sep-2004

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 14:18
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 14:30
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 14:30
User is offline View Users Profile Print this message


Iftakher Uddin

Posts: 56
Joined: 16-Sep-2004

Answer 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
Report this to a Moderator Report this to a Moderator
 9-Nov-2005 15:41
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

Thanks Rony
The script finally decided to work
I dont know what triggered the decision

Thanks all for the help

Regards
Tarun
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.