How to XOG in/out documents associated with projects

Document ID : KB000055255
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

We would like to XOG in/out documents associated with projects, including their folder hierarchy, both for importing material from another application and for migrating this material from Dev to Test to Prod. I could not see a XOG template to do this.

Solution:

This is the XML script which I used, based on documents_write_ext.xml

<?xml version="1.0" encoding="UTF-8"?>
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_document.xsd">
 <Header action="write" externalSource="OS" objectType="document" version="13.3" />
 <Documents>
  <Parent parentObjectId="5000701" parentObjectType="Projects" documentLocation="C:\Temp/ClarityDocsXOGwrite">
   <General addedBy="admin" addedDate="2015-02-20" />
  </Parent>
 </Documents>
</NikuDataBus>

Important points to note:

The script must reside on the server.
The XOG toolset must be installed on the server
The XOG command must be run from the server.
The documentLocation must be on the server.
The full path must be used for the documentLocation.
parentObjectId is the internal database ID for the project, i.e. the 5000000 series numbers, not the ID which the end user may recognise the project by.
The document hierarchy is prepared, beginning with documentLocation, which becomes "Top" in the project documents.
It most definitely does not work properly if initiated from the XOG client (PC, WinXP or Linux).
The documentLocation cannot be on a mapped network drive. It has to be C:

   
In our example, documentLocation is C:\Temp/ClarityDocsXOGwrite.
On the server,
F:\>dir C:\Temp\ClarityDocsXOGwrite
Volume in drive C has no label.
Volume Serial Number is BC9D-2D3C

Directory of C:\Temp\ClarityDocsXOGwrite

02/20/2015 03:37 PM <DIR> .
02/20/2015 03:37 PM <DIR> ..
02/20/2015 02:18 PM 287 readme.doc
02/20/2015 03:34 PM <DIR> sample 0
02/20/2015 03:38 PM <DIR> sample 1
1 File(s) 287 bytes
4 Dir(s) 4,728,242,176 bytes free

F:\>dir "C:\Temp\ClarityDocsXOGwrite\sample 0"
Volume in drive C has no label.
Volume Serial Number is BC9D-2D3C

Directory of C:\Temp\ClarityDocsXOGwrite\sample 0

02/20/2015 03:34 PM <DIR> .
02/20/2015 03:34 PM <DIR> ..
02/05/2014 04:53 PM 1,429 samplepic.gif
02/20/2015 02:03 PM 40 sampletext.txt
02/20/2015 02:04 PM 19,968 Sampleword.doc
3 File(s) 21,437 bytes
2 Dir(s) 4,728,242,176 bytes free

F:\>

After running the script, xog -propertyfile dev.properties
where dev.properties specifies the XML source as above, the project identified as 5000701 contained all its original documents, plus the new ones in the hierarchy shown above which is correct.


For another example, reference TEC435579: How to XOG in/out documents for an Object