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?
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.
'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
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents=True 'Change as required
Set exporter = session.CreateDXLExporter(nc, stream)
Any combination of the following properties can be set to "True" to specify the design elements to be exported to DXL: