Contact TLCC

Importing and Exporting Domino Design Elements Click here to see all the Developer/Admin Tips

Date tip published:04/23/2007
Description:How do you send a design element, like a form, from one Domino database to another? One way to do this is to simply cut and paste the design elements. This works well when both databases are accessible to you. Suppose you want to mail a design element to another developer? You could mail the entire database, but, then you might be sending more than you wanted. Another way is to cut and paste the design elements into a new blank database. This tip will present a better way to export and then import design elements using DXL.

DXL is a way to express a Domino object (document or design) in an XML file format. This tip will use DXL to export one or more Domino design elements (any type) and then import them into another Domino database.


To learn more about DXL, XML and web services use the following link:

Using XML and Web Services for Domino 7



Importing and Exporting Domino Design Elements

How do you send a design element, like a form, from one Domino database to another? One way to do this is to simply cut and paste the design elements. This works well when both databases are accessible to you. Suppose you want to mail a design element to another developer? You could mail the entire database, but, then you might be sending more than you wanted. Another way is to cut and paste the design elements into a new blank database. This tip will present a better way to export and then import design elements using DXL.

DXL is a way to express a Domino object (document or design) in an XML file format. This tip will use DXL to export one or more Domino design elements (any type) and then import them into another Domino database. An example of a simple form in DXL is shown below. This form design includes some static text, a table, and three fields.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE form SYSTEM 'C:\Notes7\xmlschemas/domino_7_0_2.dtd'>
<form name='survey' xmlns='http://www.lotus.com/dxl' version='7.0' maintenanceversion='2.0'
replicaid='852572B8006993EF' noquery='true' publicaccess='false' designerversion='7'
renderpassthrough='true'>
<noteinfo noteid='1a2' unid='60303C3E16EE75A0852572B8006B97CA' sequence='1'>
<created><datetime dst='true'>20070409T153512,10-04</datetime></created>
<modified><datetime dst='true'>20070409T153715,64-04</datetime></modified>
<revised><datetime dst='true'>20070409T153715,63-04</datetime></revised>
<lastaccessed><datetime dst='true'>20070409T153715,63-04</datetime></lastaccessed>
<addedtofile><datetime dst='true'>20070409T153715,63-04</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Howard D Greenberg/O=TLCC</name></updatedby>
<wassignedby><name>CN=Howard D Greenberg/O=TLCC</name></wassignedby>
<body><richtext>
<pardef id='1'/>
<par def='1'/>
<par def='1'/>
<pardef id='2' align='center'/>
<par def='2'><run>
<font size='13pt' style='bold' color='green'/>Survey</run></par>
<par def='1'/>
<table widthtype='fixedleft' refwidth='6.2806in'><tablecolumn width='1.1250in'/><tablecolumn
width='5.1556in'/>
<tablerow>
<tablecell borderwidth='0px'>
<pardef id='3' keepwithnext='true' keeptogether='true'/>
<par def='3'>Name:</par></tablecell>
<tablecell borderwidth='0px'>
<pardef id='4' keepwithnext='true' keeptogether='true'/>
<par def='4'>
<field type='text' kind='editable' name='name'/></par></tablecell></tablerow>
<tablerow>
<tablecell borderwidth='0px'>
<par def='3'>Job:</par></tablecell>
<tablecell borderwidth='0px'>
<par def='4'>
<field borderstyle='inset' type='keyword' kind='editable' name='jobtype'><keywords
helperbutton='false' columns='1' ui='radiobutton'><textlist><text>Programmer</text><text
>Developer</text><text>User</text></textlist></keywords></field>
</par></tablecell></tablerow>
<tablerow>
<tablecell borderwidth='0px'>
<par def='3'>Comments:</par></tablecell>
<tablecell borderwidth='0px'>
<par def='4'>
<field type='richtext' kind='editable' name='comments'/></par></tablecell></tablerow></table>
<par def='1'/></richtext></body>
<item name='$$ScriptName' summary='false' sign='true'><textlist><text>survey</text></textlist></item></form>



Domino Designer 7 has support to export design elements as DXL. However, there is no menu option to import a DXL file into a Domino database. This tip will show how to both export and import design elements. The code to import DXL was written by Andre Guirard from IBM and was posted in his blog at the following URL:

http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/the-missing-dxl-import-menu-option





Exporting Design Elements

Follow these steps to export design elements:

  1. Select one or more design elements in the Work Pane and then choose Tools | DXL Utilities | Exporter from the menu.



  2. In the DXL Exporter dialog, provide a location and file name for the exported DXL. If you will be editing the file using an XML editor, make sure the file extension is ".xml". Click the [Save] button to export the selected design elements as DXL to the specified file.



Tip
Remember To Export Everything Needed

Many design elements reference other design elements (shared fields, subforms, script libraries, etc.) These referenced design elements are not included in the DXL export and will have to be exported separately. If these referenced elements are not present when the design element is imported than errors will occur when the design element is opened and saved (or used.)

Once exported, a DXL file can be combined with another one by cutting and pasting the appropriate XML from one DXL file to another. The DXL import can import different types of design elements from the same file.





Setup the Import Agent

There is no native way (using the user interface in Domino Designer 7) to import DXL back into a database. However, LotusScript code can be used in an agent which will allow a DXL file to be imported. The following steps can be used to create an agent and import in this code.


Tip
Download the Needed Code

The code used below was written by Andre Guirard, an IBM employee. Visit his blog at:

http://www-10.lotus.com/ldd/bpmpblog.nsf/



Follow steps to setup an agent to allow DXL to be imported into a database.

  1. Click on the attachment below to download the import code and save it to your hard drive:

    dxlimport.lss

  2. Create a new agent in the database that will import the design elements using a DXL file.



  3. Name the agent and set the properties a shown in the following image.



  4. Change the agent type to LotusScript.



  5. Import the agent code from step 1 by choosing File | Import from the menu. Enter the location and name (dxlimport.lss) and click [Import].



  6. Choose [Yes to All] when prompted.



  7. Save and close the agent.






Importing Design Elements


To import a DXL file simply run the agent that was added to the database. This agent will overwrite any existing design elements with the same name.

Follow these steps to import design elements:

  1. Select the (Import DXL) agent in the Agent Design List and choose Agent | Run from the menu.



  2. Choose the DXL file to import and click [Open].



  3. The agent will run and display the following agent log. The Design elements are now imported into the database.