Importing file attachments

This example shows how an IBM OpenPages® with Watson™ administrator can import file attachments.

About this task

Procedure

  1. Create a .zip file that contains the attachments that you want to import. Name the file <prefix>-op-file-content.zip.
    Note: The zip file must use UTF-8 encoding.
    For example: myfiles-op-file-content.zip
  2. Create an XML loader file. Name the file <prefix>-op-config.xml. Use the same <prefix> as the .zip file.
    For example: myfiles-op-config.xml
  3. In the <prefix>-op-config.xml file, add the following text:
    <?xml version="1.0" encoding="UTF-8"?>
    <openpagesConfiguration>
       <nonFormBasedResources>
          <resource resourceType="Asset" 
    		  shortName="<attachment>" 
    		  name="/_op_sox_documents/Files and Forms/<business_entity>/<attachment>" 
    		  parentFolder="/_op_sox_documents/Files and Forms/<business_entity>" 
    		  contentLocation="/<attachment>" 
    		  description="" 
    		  checkedOut="false" 
    		  checkedOutBy="" 
    		  checkedOutDate="" 
    		  contentLanguage="" 
    		  contentLength="0" 
    		  contentType="SOXDocument" 
    		  creationDate="" 
    		  creator="OpenPagesAdministrator" 
    		  fileType="<file_type>" 
    		  inheritAcls="true" 
    		  modificationDate="" 
    		  modifiedBy="" 
    		  multiVersionable="true" 
    		  sourceResource="" 
    		  storageServer="" 
    		  subResourceType="Normal" 
    		  visibilityType="Normal" />
       </nonFormBasedResources>
       <resourceSets>
          <resourceSet name="SOX.ProjectDefault" description="SOX.ProjectDefault">
             <resourceNode name="/_op_sox/Project/Default/BusinessEntity/<business_entity>/<business_entity_name>.txt">
                <resourceNodeChild name="/_op_sox_documents/Files and Forms/<business_entity>/<attachment>" />
             </resourceNode>
          </resourceSet>
       </resourceSets>
    </openpagesConfiguration>
    • <attachment>: The file name and extension of a file attachment in the <prefix>-op-file-content.zip file.
    • <file_type>: The extension and MINE file type of the attachment in the format <extension> (<MIME_type>). For example:
      docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)
      File types are defined in the File object type. You can find the extensions and MIME types in File Types Information. For more information, see Configuring file types for file attachments.
    • <business_entity>: The path and name of the parent business entity for the file attachment, for example: /Global Financial Services/Corporate.
    • <business_entity_name>: The name of the business entity for the file attachment, for example /Corporate.
    To find the business entity path and name, open the task view for the business entity. The path and name are in the Folder field.
    The task view of the Corporate business entity is shown. The Folder field displays Global Financial Services/Corporate.
    In this example, the attachment is called MyFile.docx and the parent business entity is Global Financial Services/Corporate:
    <?xml version="1.0" encoding="UTF-8"?>
    <openpagesConfiguration>
       <nonFormBasedResources>
          <resource resourceType="Asset" 
    		  shortName="MyFile.docx" 
    		  name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyFile.docx" 
    		  parentFolder="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate" 
    		  contentLocation="/MyFile.docx" 
    		  description="" 
    		  checkedOut="false" 
    		  checkedOutBy="" 
    		  checkedOutDate="" 
    		  contentLanguage="" 
    		  contentLength="0" 
    		  contentType="SOXDocument" 
    		  creationDate="" 
    		  creator="OpenPagesAdministrator" 
    		  fileType="docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)" 
    		  inheritAcls="true" 
    		  modificationDate="" 
    		  modifiedBy="" 
    		  multiVersionable="true" 
    		  sourceResource="" 
    		  storageServer="" 
    		  subResourceType="Normal" 
    		  visibilityType="Normal" />
       </nonFormBasedResources>
       <resourceSets>
          <resourceSet name="SOX.ProjectDefault" description="SOX.ProjectDefault">
             <resourceNode name="/_op_sox/Project/Default/BusinessEntity/Global Financial Services/Corporate/Corporate.txt">
                <resourceNodeChild name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyFile.docx" />
             </resourceNode>
          </resourceSet>
       </resourceSets>
    </openpagesConfiguration>
  4. If you want to import multiple file attachments, add a <resource> element and a <resourceNode> element for each file.
    For example:
    <?xml version="1.0" encoding="UTF-8"?>
    <openpagesConfiguration>
       <nonFormBasedResources>
          <resource resourceType="Asset" 
    		  shortName="MyFile.docx" 
    		  name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyFile.docx" 
    		  parentFolder="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate" 
    		  contentLocation="/MyFile.docx" 
    		  description="" 
    		  checkedOut="false" 
    		  checkedOutBy="" 
    		  checkedOutDate="" 
    		  contentLanguage="" 
    		  contentLength="0" 
    		  contentType="SOXDocument" 
    		  creationDate="" 
    		  creator="OpenPagesAdministrator" 
    		  fileType="docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document)" 
    		  inheritAcls="true" 
    		  modificationDate="" 
    		  modifiedBy="" 
    		  multiVersionable="true" 
    		  sourceResource="" 
    		  storageServer="" 
    		  subResourceType="Normal" 
    		  visibilityType="Normal" />
          <resource resourceType="Asset" 
    		  shortName="MyOtherFile.xlsx" 
    		  name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyOtherFile.docx" 
    		  parentFolder="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate" 
    		  contentLocation="/MyOtherFile.docx" 
    		  description="" 
    		  checkedOut="false" 
    		  checkedOutBy="" 
    		  checkedOutDate="" 
    		  contentLanguage="" 
    		  contentLength="0" 
    		  contentType="SOXDocument" 
    		  creationDate="" 
    		  creator="OpenPagesAdministrator" 
    		  fileType="xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)" 
    		  inheritAcls="true" 
    		  modificationDate="" 
    		  modifiedBy="" 
    		  multiVersionable="true" 
    		  sourceResource="" 
    		  storageServer="" 
    		  subResourceType="Normal" 
    		  visibilityType="Normal" />
       </nonFormBasedResources>
       <resourceSets>
          <resourceSet name="SOX.ProjectDefault" description="SOX.ProjectDefault">
             <resourceNode name="/_op_sox/Project/Default/BusinessEntity/Global Financial Services/Corporate/Corporate.txt">
                <resourceNodeChild name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyFile.docx" />
             </resourceNode>
             <resourceNode name="/_op_sox/Project/Default/BusinessEntity/Global Financial Services/Corporate/Corporate.txt">
                <resourceNodeChild name="/_op_sox_documents/Files and Forms/Global Financial Services/Corporate/MyOtherFile.docx" />
             </resourceNode>
          </resourceSet>
       </resourceSets>
    </openpagesConfiguration>
  5. Put the <prefix>-op-file-content.zip and <prefix>-op-config.xml files info the same directory.
  6. Log on to the application server.
  7. Open a command prompt or a shell.
  8. Go to the <OP_HOME>/bin directory where <OP_HOME> represents the installation location of the OpenPages with Watson application.
  9. Run the following command:
    ObjectManager.cmd|sh l c <admin_user> <admin_password> <file_location> <prefix>
    For example, the following command imports a file that is called myfiles-op-file-content.zip that is located in the C:\TMP directory.
    ObjectManager l c OpenPagesAdministrator password C:\TMP myfiles