Skip to main content

 Version 5

Legacy documentation for PageSeeder v5

Task ps-upload

This task has been removed as of PageSeeder v6. Use Task upload instead.

This task lets the Ant Script go through the files referenced by the fileset and upload them on a PageSeeder server. The response from the server is saved to an output file.

Definition

<ps:ps-upload
      jsessionid="[jsessionid]"
                  port="[port]"
                  host="[host]"
      siteprefix="[siteprefix]"
servletprefix="[servletprefix]"
              output="[output]"
        groupName="[groupname]"
    doclabels="[label1,label2]"
messagelabels="[label3,label4]"
              folder="[folder]"
                title="[title]"
              status="[status]"
            message="[message]"
                unzip="[true|
                        false]"
                index="[true|
                        false]"
          createxrefs="[true|
                        false]"
             validate="[true|
                        false]"
     validateoption="[ignore|
                         fail]"
      docidisfilename="[true|
                        false]"
               notify="[true|
                        false]"
      notifyapprovers="[true|
                        false]"
            overwrite="[true|
                        false]"
  overwriteProperties="[true|
                        false]">

          <fileset dir="upload"
              includes="*.pmsl">
</ps:ps-upload>

Attributes

AttributeDescriptionRequired
jsessionidThe jsessionid attribute (optional) is used for authentication. It is not required but it will always be used if specified.Yes, unless username/password or propertiesfile are specified
usernameIf jsessionid is not specified this can be used for authentication.Yes, unless jsessionid or propertiesfile are specified
passwordIf jsessionid is not specified this can be used for authentication.Yes, unless jsessionid or propertiesfile are specified
propertiesfileThe propertiesfile attribute (optional) describes the location of the properties file to use to connect to the PageSeeder Server.
The value of the attribute can be the full path of the file, the relative path (the base directory is the location of the Ant script) or simply its name, in which case it MUST be located on the classpath.
Yes, unless (jsessionid or username/password) and host are specified
portThe port address of the PageSeeder Server - default: 80
(used when no properties file is specified)
No
hostThe host name of the PageSeeder Server
(used when no properties file is specified)
Yes, unless propertiesfile is specified
siteprefixThe PageSeeder site prefix defined - default: /ps
(used when no properties file is specified)
No
servletprefixThe PageSeeder servlet prefix defined - default: /servlet
(used when no properties file is specified)
No
outputSpecifies the path of the file to write the response toYes
groupNameThe name of the group to upload toYes
folderThe folder for the upload (default is group root folder)No
titleThe title for the upload (default is "Document Upload")No
messageThe message for the upload (default is "The above document(s) have been uploaded.")No
notifySend email notification for the upload (default is false)No
notifyapproversSend email notification to approvers for the upload (default is false) - DEPRECATED.No
overwriteOverwrite existing files (default is false)No
overwritePropertiesOverwrite existing document properties such as title, docid, labels - requires overwrite=true (default false)No
indexIf true, uploaded files are indexed (default is true)No
createxrefsIf true, cross-references found in the content of the uploaded document(s) are created (default true)No
validateIf true, uploaded files are validated if a schema is found (default is true)No
validateoptionBehavior if validation is turned on and an error was encountered (options are "fail" or "ignore", default is "ignore") - DEPRECATED.No
unzipIf true, unzip any .zip files that are uploaded (default is false)No
doclabelsA comma separated list of general labels to apply to the documentNo
messagelabelsA comma separated list of general labels to apply to the notification messageNo
docidisfilenameIf true, sets the doc id to the filename of the uploaded document (without the extension) if doc id is not already set.No

Output

The output file contains the response from the PageSeeder Server. It should always be parsed to know if the upload was successful.

Its format is as follow:

  <root>
    <status>[success-reload|success-message|error|access-denied]</status>
    <message>[message]</message>
    <uris>
      <uri id="[id]" scheme="[scheme]" host="[host]" port="[port]"
           path="[path]" decodedpath="[decodedpath]" external="[true|false]"
           [archived="true"] [folder="true"] [docid="[docid]"]
           [mediatype="[mediatype]"] [documenttype="[documenttype]"] [title="My Document"]
           [created="[created]"] [modified="[modified]"]>
         <displaytitle>My Document</displaytitle>
         [<description>This is my document</description>]
         [<labels>mylabel1,mylabel2</labels>]
      </uri>
      ...
    </uris>
  </root>

 The root element is named root. It contains a status element used to determine what the outcome of the upload action on the server was. The possible values are access-denied, error, success-message, or success-reload.

The message element contains some information coming from the server, it could be an error message (if status is error) or a warning or information message (if status is success-message).

If the status is success-message or success-reload, the root element contains an element uris containing a list of uri element. Each of these uri elements corresponds to a URI object created on the server for a document uploaded. It will contain details about the URI created (ID, path, type, format, labels...).

Examples

Stand alone script example:

<ps:ps-upload
    groupName="acme-demo"
    folder="upload" output="c:\output\results.xml"
    host="mycompany.com"
    username="jsmith"
    password="xyz">
  <fileset dir="c:\upload" includes="**"/>
</ps:ps-upload>

 Publish script example:

<ps:ps-upload
    groupName="${ps-groupName}"
    folder="upload" output="${ps-working}/results.xml"
    jsessionid="${ps-jsessionid}"  host="${ps-host}" port="${ps-port}"
    servletPrefix="${ps-servletPrefix}" sitePrefix="${ps-sitePrefix}">
  <fileset dir="${ps-working}/upload" includes="**"/>
</ps:ps-upload>
Created on , last edited on