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: Module to HTML automatic export.
Topic Summary: HTML Export
Created On: 17-May-2005 17:56
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.
 17-May-2005 17:56
User is offline View Users Profile Print this message


Kyle Dixon

Posts: 2
Joined: 17-May-2005

Does anybody know how to export Modules to HTML format automatically without GUI interaction using standard Telelogic DXL script ?

Any sample code would be highly appreciated.
Thanks.
Report this to a Moderator Report this to a Moderator
 18-May-2005 09:36
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The attached is the Telelogic supplied HTML exporter with the GUI elements removed so it can be run in batch mode. You will need to hard code the parameters to the exportToHtml() function call.


script had bugs - see below for replacement.


-------------------------
Tony Goodman
http://www.smartdxl.com

Edited: 19-May-2005 at 09:16 by Tony Goodman
Report this to a Moderator Report this to a Moderator
 18-May-2005 18:55
User is offline View Users Profile Print this message


Kyle Dixon

Posts: 2
Joined: 17-May-2005

I run into an error when I try to use the Export Module in a Loop. The first time through the loop it actually creates an HTML file, but the second time through the loop the error occurs. Can anyone tell me what the problem might be?

Below is the code snip.

Output Error:
0
1

-R-E- DXL: Line:1303 null Skip parameter was passed into argument position 1

Backtrace:
Line:1379
Line:1490
Line:1574

-I- DXL: execution halted






//****************************************************************************
void findOpenModules()
// DESCRIPTION : saves which modules are currently open

// SIDE EFFECTS : adds the fullname of open modules to the global skpOpenMods


{
Module openModule
f  or openModule in database do {
     if (canRead openModule) {
        string moduleFullname = fullName openModule
        put(skpOpenMods, moduleFullname, moduleFullname) <--- Line 1303
     }
   }
}



/******************************************************************************
MAIN
******************************************************************************/

string DoorsDbPath[] = {
"/ProjectA/Doc1",
"/ProjectA/Doc2",
"/ProjectA/Doc3",
"/ProjectA/Doc4",
"/ProjectA/Doc5",
"/ProjectA/Test/DocTest1",
"/ProjectA/Software/DocSoft1",
"/ProjectA/Software/DocSoft2",
"/ProjectA/Software/DocSoft1"
}

int i = 0

openProject("ProjectA", "foobar", "foo")
current = project "/ProjectA"

for (i=0; i < 3 ; i++)
{
      print i
      exportToHtml(DoorsDbPath, "c:/temp/doc" i ".html", 1, 0, true, false, true)

}
print "end"
closeProject()

/************************************************************************/


Edited: 18-May-2005 at 19:01 by Kyle Dixon
Report this to a Moderator Report this to a Moderator
 19-May-2005 09:16
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Looks like the script was never designed to call the main function more than once.

The skip lists are being deleted at the end of the do_export_file() function and not recreated again.

Fix: the following lines already appear in function do_export_file()

if (null nameList) {
nameList = create
} else {
delete nameList
nameList = create
}

Add the following lines after the above to create the other skip lists:

if (null skpOpenMods) {
skpOpenMods = create
} else {
delete skpOpenMods
skpOpenMods = create
}

if (null skpLinkFiles) {
skpLinkFiles = create
} else {
delete skpLinkFiles
skpLinkFiles = create
}

if (null skpOpenMods) {
skpOpenMods = create
} else {
delete skpOpenMods
skpOpenMods = create
}


Also you need to set one of the skip list to null as follows:

delete skpLinkFiles // this line already exists
skpLinkFiles = null // you need to add this line


It might be easier for you to add your changes again rather than make these, so I have attached the original with the above fixes for you.


batchExpHtml.dxl
batchExpHtml.dxl  (43 KB)



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 31-May-2005 16:32
User is offline View Users Profile Print this message


Craig Forant

Posts: 56
Joined: 21-Feb-2005

Many thanks to all the users of this forum. It is a big help to us new DOORS admins.
I have used this above code and it works. I just changed the destination folder. I like the results.
I would like to know if this script can be made to run during a nightly batch process. This process would need to login to doors, run script to export multiple modules in multiple projects, it would need to automatically overwrite the old html files then close DOORS. First things first, is this possible?


-------------------------
Craig Forant
me@craigforant.com
Report this to a Moderator Report this to a Moderator
 8-May-2008 19:49
User is offline View Users Profile Print this message


Chris Annal

Posts: 36
Joined: 14-Dec-2005

This is a great way to export to HTML as part of a batch process. I've used it on several modules and LOVE it!! The only improvement that might be made is if there were a way to hard-code a particular "View" to export.
Because the default module view is the only view that will export with this script, I sometimes have had to set the default view in some modules as the view I want to export. If there were some way to modify this script to include view information - that would be great. I tried to modify the following

void exportToHtml(string mName,
string vName, //added variable for "View"
string fName,
int useFmt,
int expSrc,
bool usePics,
bool useChMeter,
bool showLnks)
//..............................................................
do_export_file(mName,
vName, //using new variable here
fName,
useFmt,
expSrc)
//...........................................................
exportToHtml("/WAS/ATCBI/ATCBI_VRTM","Export_To_HTML","J:/APPS/Doors/Data/Export_To_HTML/CO-ATCBI/Test.html",1,0,true,true,false)

DOORS doesn't complain when I run the batch process, but it seems to ignore the view I'm trying to export and instead exports the module's default view.
Report this to a Moderator Report this to a Moderator
 8-May-2008 20:33
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Craig:

Make a batch file and here is the syntax.

cd C:\Program Files\Telelogic\DOORS_8.1\bin (or whatever/whereever your doors install is)

Start /b /WAIT doors.exe -d 36677@yourservername -batch "path to script\\yourscript.dxl" -u "ausername" -password "apassword"


Have a batch user with read only permissions to the project/modules of interest.

Chris:

Create a batch user and set the default view for that user to be the one you want. Alternatively you can use the undocumented function to load a view in batch mode.

Here is the unsupported command to change views when the module is hidden:

quote:
"Added a new variant of the view load perm:

"bool load(Module, View, bool, bool)", where the added 4th parameter specifies whether to check that the module is displayed (as other variants always do), and to return false if the module is not displayed and the client is not running in batch mode. If the 4th parameter is set to true, then the behaviour is as for existing variants: the perm does not load the view, and it returns false. If the parameter is set to false, then this check is bypassed, so that a view can be loaded without the module being displayed, even when not running in batch mode.

So use the form "load(Module, View, checkSave, false)" to load a view when the module isn't displayed.

The checkSave parameter tells whether the code should prompt the user to save any unsaved changes to the current view first (if there are any). This parameter is already available, but it doesn't seem to be covered in the DXL manual..."



So load(Module m, View v, false, false) will do it. But remember its unsupported and can change.


This was introduced in 8.1 I believe. I don't know if it still works in 8.2 or 8.3. So I would suggest the first method.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Edited: 8-May-2008 at 20:35 by David Pechacek
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.