Technote (FAQ)
Question
You want to export all design elements of a particular type, for example, all agents, forms or views, from a database to Domino XML (DXL). How can this be achieved?
Answer
Using the NotesDXLExporter class and NotesNoteCollection class in LotusScript, you can export all or selected design elements to an .xml or .dxl file type. The sample LotusScript code below demonstrates one way in which you can export design elements. Additional examples can be found in the Lotus Domino Designer Help.
NOTE: The code below is a sample script provided to illustrate one way to approach this issue. In order for this example to perform as intended, the script must be laid out exactly as indicated below. IBM Support cannot customize this script for specific environments or applications.
The agent's Target property should be set to "None". The code initially creates a NotesNoteCollection object containing no design notes by specifying "False" as a parameter in the CreateNoteCollection method of the NotesDatabase class.
This settings sets all the "Select" properties of the NotesNoteCollection to "False". Then in the NotesNoteCollection object, the "Select" property corresponding to the required type of design element is set to "True".
For example, to export all agents from the database the SelectAgents property is set to "True". To export all forms, the SelectForms property is set to "True". The BuildCollection method of the NotesNoteCollection class builds a collection containing the specified design elements. This collection is then passed as the input parameter when creating a NotesDXLExporter object.
-
Sub Initialize
-
'This agent is designed to export the specified design elements to .dxl (.xml in Notes).
Dim db As NotesDatabase
Dim nc As NotesNoteCollection
Dim stream As NotesStream
Dim exporter As NotesDXLExporter
Const filename = "c:\filename.xml" 'Change as required
Set db = session.CurrentDatabase
Set stream = session.CreateStream
Call stream.Open(filename)
Call stream.Truncate
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents=True 'Change as required
Call nc.BuildCollection
Set exporter = session.CreateDXLExporter(nc, stream)
Call exporter.Process
End Sub
Any combination of the following properties can be set to "True" to specify the design elements to be exported to DXL:
- SelectActions,
- SelectAgents,
- SelectDatabaseScript,
- SelectDocuments,
- SelectForms,
- SelectFrameSets,
- SelectJavaResources,
- SelectNavigators,
- SelectOutlines,
- SelectPages,
- SelectScriptLibraries,
- SelectSharedFields,
- SelectStyleSheetResources,
- SelectSubforms
- SelectViews
Related information
How to use LotusScript to .dxl/.xml format
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.