|
When the writer is launched from rules or Java code, you can set options to tweak the writer's behavior.
import com.sodius.mdw.metamodel.doors.connectors.dxl.*; ... Map options = new HashMap(); options.put("doors.ignoreConnectorUI", Boolean.TRUE); options.put("mdw.doors.dxl.top_level_elements", "/MyFolder"); Model doorsModel =... doorsModel.write("Application", null, options);
In this example, we ask to write the folder "MyFolder", and all its content, at the root of the DOORS database.
The option "doors.ignoreConnectorUI"
is used to avoid the writer selection dialog.
Here this dialog is not desired as the writing scope is programmatically set.
The writer usually requires a DOORS client to be open in order to writer the data.
It is possible to configure the writer so that DOORS is executed in batch mode, provided you give the writer
the DOORS user identity to connect to.
To use the batch mode, you need to set the
Common.PREFERENCE_DOORS_IS_SILENT
property,
as described in the snippet in DoorsReader
.
When running DOORS in a non-interactive mode, like from a Windows Scheduled Task or a Windows Service,
some files cannot be imported as is into DOORS.
You are strongly encouraged to set the
Common.OPTION_ZIP_FILE_EXTENSIONS
property in such case.
Note: this configuration is not necessary in regular batch mode,
when a user is logged in a Windows session.
The model reader can be configured using many options, which are defined in the class
Common
.
Here is a list of the most significant options:
Common.OPTION_IGNORE_CONNECTOR_UI
false
DoorsWriter.TOP_LEVEL_ELEMENTS_PROPERTY
"<All>"
.
DoorsWriter.MODE_PROPERTY
DoorsWriter.DOORS_BASE_PROPERTY
"/"
.
Common.PREFERENCE_DOORS_IS_SILENT
true
, this setting requires additional properties:
Common.PREFERENCE_DOORS_PATH
- the full path of doors.exe
, used to launch DOORSCommon.PREFERENCE_DOORS_PORTSERVER
- the port and server name of the database to connect to (e.g. 36677@myServer
)Common.PREFERENCE_DOORS_USER
- the name of the DOORS user to make the connectionCommon.PREFERENCE_DOORS_PASSWORD
- the password of the DOORS user to make the connectionCommon.OPTION_IGNORE_CONNECTOR_UI
should also be set true
in such use case.
false
Common.OPTION_ZIP_FILE_EXTENSIONS
When a file (e.g. a Word Document) is to be inserted into a DOORS Object and is not already wrapped into an OLE container, the DXL API oleInsert() is used to perform this operation. This API launches the corresponding application (e.g. Word), using OLE Automation, to request the creation of the OLE container. Microsoft Office applications are known to not support this action when running in a non interactive mode (e.g. when launched from a Windows Service). This can lead to unpredictable behavior.
This option allows to declare a comma separated list of file extensions. When a file matching one of those extensions is to be imported, the file will be wrapped into a zip file before being inserted.
doc,dox,ppt,pptx,xls,xlsx
Common.OPTION_ATTACHMENT_RESOLVER
AttachmentResolver
that determines the physical location of OLE object files
to be written in DOORS.
The API RichTextUtils.createAttachmentResolver(File)
provides a default implementation.
Writing DOORS data
Writing images and OLE objects
Writer Modes
Top Level Elements