Hello everyone, I am new to dxl programming , can anybody please let me know how to recursively restore the projects (*.dpa) to the doors database. Also, once restored in to the doors database it should align in to a sequence. For example if have 3 projects in my local drive (C or D) the script should restore all the projects one by one in to the doors database. Please suggest and help! Thanks
doors@36677 - Mon Oct 12 04:55:24 EDT 2015 |
Re: Restore Recursive from local disk to Doors DB Hi TMSK,
You can read how to restore a project from a dpa file in https://www.ibm.com/developerworks/community/forums/html/topic?id=ce2ceea4-6560-4e4b-ba6d-0ebb5fba8203 I am not so sure what "recursive" will mean in your specific context. When you have a project "P1", which contains a project "P1.1" and you create an archive of "P1", then the archive file p1.dpa will contain both projects. When you restore this file, your new projects will be called "P1 1" and "P1.1 1" (or, if you delete and purge P1 before the restore or if you rename P1 and P1.1, the new projects will again be called "P1" and "P1.1") Now, when you have a project "P2" and in parallel have a project "P2.1", you can make separate dpa files which only contain the respective project. In this way you could - restore P2.dpa to the new project "P2 1". - make the project "P2 1" the current one (see code in post above), optionally navigate to a subfolder of "P2 1" and from here, restore P2.1.dpa to "P2 1/<subfolder>/P2.1 1" But there's no general approach for this. You need to know where the destination for the subprojects are.
Hope this helps, |
Re: Restore Recursive from local disk to Doors DB I assume by "at one time" you mean "in one script".
the easiest way would of course be to write 10 lines like restoreProject("D:/P1.dpa","Demo 1","Descrip") ; restoreProject("D:/P2.dpa","Demo 2","Descrip") … but I'm sure that's not the solution you are looking for... For each restore you need the parameters 1. which file 2. which destination project 3. which project name 4. which description. I cannot really help you with 2, 3 and 4 - that depends on your requirements. You might say that project name is identical to filename or be a combination of a base name plus a counter or you might have information stored somewhere that tells you more.
About 1: I think you want to have something like "look into directory D:\myfiles, search for all files which match the pattern *.dpa and for each found file do a restoreProject". For this, have a look at the DXL manual, chapter 10 "General language facilities" and look at the "for file in directory" loop. should be something like
string sFilename
Regexp isDPAFile = regexp2 "\\.[dD][pP][aA]$"
for sFilename in directory "D:\\myfiles" do {
if (isDPAFile sFilename ) {
restoreProject (sFilename, ...)
}
}
HTH, Mike |
Re: Restore Recursive from local disk to Doors DB the term "not working" is never a good feedback. What is not working? How is it not working? When I paste the code to my DOORS, I don't see any problems (of course except for the syntax error related to line 5 not being complete and needing your input) |
Re: Restore Recursive from local disk to Doors DB Hi! That's rather strange.
HTH, Mike |
Re: Restore Recursive from local disk to Doors DB Not really sure.. - is there a file d:\doors_projects\xx.dpa in your directory or are the files deeper, like in d:\doors_projects\some_dir\xx.dpa? The latter does not work with this script. - switch "description" and "Restored Project" - perhaps use "\Restored Project" instead of "Restored Project"? - ensure that your script restores into the correct destination project by using sth. like " current = project '/test' " - get the result of the restoreProject perm by using "string sResult = restoreProject..." and "print '->' sResult '<-\n' "
|
Re: Restore Recursive from local disk to Doors DB Hello TMSK, sorry for not being able to reply earlier, I have not been available for some days. Why did you delete all your answers? Is your problem solved?
Regards, |