Publishing

Publishing PageSeeder data to print, the Web or both

Task upload

This task lets the Ant Script go through the files referenced by the fileset and upload them on a PageSeeder server.

Note

This task is available in PageSeeder v5.8115 and above.

Definition

<ps:upload
    group="[groupname]"
    folder="[folder]"
    doclabels="[label1,label2]"
    docidisfilename="[true|false]"
    overwrite="[true|false]"
    overwriteproperties="[true|false]"
    unzip="[true|false]"
    deletezip="[true|false]"
    resolve="[true|false]"
    index="[true|false]"
    validate="[true|false]"
    saveuris="[file path]"
    failonerror="[true|false]"
    pollinginterval="[milliseconds]"
    config="[config name]">
  <notification subject="[subject]" content="[content]"
     labels="[label3,label4]" notify="[silent|normal|announce]" />
  <workflow status="[status]" priority="[priority]"    
     assignto="[member id]" due="[due date]" content="[content]"
     labels="[label3,label4]" notify="[silent|normal|announce]" />
  <fileset dir="upload" includes="*.psml">
</ps:upload> 

 

Attributes

AttributeDescriptionRequired
groupThe name of the group to upload toYes
folderThe folder for the upload (default is group root folder)No
doclabelsA comma separated list of labels to apply to all documentsNo
docidisfilenameIf "true", sets the doc id to the filename of the uploaded document (without the extension)No
overwriteOverwrite existing files - default "false".No
overwritepropertiesOverwrite existing document properties such as title, docid, labels - requires "overwrite=true" - default "false".No
unzipIf "true", unzip any .zip files that are uploaded - default "false".No
deletezipIf "true" delete a zip file after unzipping it - default "true".No
resolveIf "true", cross-references and images found in the content are resolved - default "true".No
indexIf "true", uploaded files are indexed - default "true".No
validateIf "true", uploaded files are validated using their default.sch schematron if defined - default "true".No
saveurisIf specified save the URIs uploaded to this path as XMLNo
failonerrorIf "true" stop ANT build script on error - default "true".No
pollingintervalThe number of milliseconds between each check to see if the upload is complete - default "5000".No
configUniversal PS config name - default "default".No

Elements

Element <notification>

If specified set the notification message details.

AttributeDescriptionRequired
subjectThe subject of the messageYes
contentThe content of the messageYes
labelsA comma separated list of labels for the messageNo
notify

Can be one of the following (default silent):

  • silent – no email notification
  • normal – send email notification to the group
  • announce – send email notification to ALL group members.
No

Element <workflow>

If specified create a workflow step for all documents uploaded.

Note

If there are more than maxWorkflowNotifications (default 20) documents uploaded then notify will be forced to silent.
AttributeDescriptionRequired
statusThe document status to set (e.g. Initiated, In Progress, Complete)Yes
priorityThe priority of the workflow (e.g. Low, Medium, High)No
assigntoThe member ID to assign the workflow to (a positive integer)No
dueThe due date of the workflow in ISO date format (e.g. 2016-10-25)No
labelsA comma separated list of labels for the messageNo
notify

Can be one of the following (default silent):

  • silent – no email notification
  • normal – send email notification to the group
  • announce – send email notification to ALL group members.
No

Element <fileset>

The standard ANT fileset  element must be used to specify the files to be uploaded.

Environment

This task uses the following ps:config environment properties:

  • scheme – scheme for connecting to PageSeeder
  • host – host for connecting to PageSeeder
  • port – port for connecting to PageSeeder
  • servlet.prefix – servlet prefix for connecting to PageSeeder - default  /ps/servlet
  • site.prefix – site prefix for connecting to PageSeeder - default  /ps
  • jsessionid or username/password – jsessionid pr username/password for connecting to PageSeeder

Save URIs format

Below is the XML format used to save the uploaded URIs if saveuris is specified.

    <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>

 

Errors

Possible errors are:

  • Document already exists and overwrite is disabled.
  • Validation errors
  • No source URIs belong to specified group
  • Failed to load URI with ID
  • A source URI is not within the specified context

Examples

Stand alone script examples:

<ps:upload
    group="acme-demo"
    folder="documents">
  <fileset dir="c:\ps\upload" includes="**"/>
</ps:upload>
<ps:upload
    group="acme-demo"
    folder="documents/demo"
    overwrite="true"
    overwriteproperties="true"    
    unzip="true"
    resolve="false"
    saveuris="c:\ps\uris.xml">
  <notificaion subject="New demo" content="This demo was just uploaded"
    notify="normal" />
  <workflow status="In Progress" />
  <fileset dir="zip">
    <include name="demo.zip"/>
  </fileset>
</ps:upload>

 Publish script examples:

<ps:upload
    group="${ps.config.default.group.name}"
    folder="documents">
  <fileset dir="${ps.config.default.working}/upload" includes="**"/>
</ps:upload>
<ps:upload
    group="${ps.config.default.group.name}"
    folder="documents/demo"
    overwrite="true"
    overwriteproperties="true"    
    unzip="true"
    resolve="false"
    saveuris="${ps.config.default.working}/uris.xml">
  <notificaion subject="New demo" content="This demo was just uploaded"
    notify="normal" />
  <workflow status="In Progress" />
  <fileset dir="${ps.config.default.working}/zip">
    <include name="demo.zip"/>
  </fileset>
</ps:upload>

Created on , last edited on