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
Attribute | Description | Required |
---|---|---|
jsessionid | The 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 |
username | If jsessionid is not specified this can be used for authentication. | Yes, unless jsessionid or propertiesfile are specified |
password | If jsessionid is not specified this can be used for authentication. | Yes, unless jsessionid or propertiesfile are specified |
propertiesfile | The 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 |
port | The port address of the PageSeeder Server - default: 80 (used when no properties file is specified) | No |
host | The host name of the PageSeeder Server (used when no properties file is specified) | Yes, unless propertiesfile is specified |
siteprefix | The PageSeeder site prefix defined - default: /ps (used when no properties file is specified) | No |
servletprefix | The PageSeeder servlet prefix defined - default: /servlet (used when no properties file is specified) | No |
output | Specifies the path of the file to write the response to | Yes |
groupName | The name of the group to upload to | Yes |
folder | The folder for the upload (default is group root folder) | No |
title | The title for the upload (default is "Document Upload") | No |
message | The message for the upload (default is "The above document(s) have been uploaded.") | No |
notify | Send email notification for the upload (default is false) | No |
notifyapprovers | Send email notification to approvers for the upload (default is false) - DEPRECATED. | No |
overwrite | Overwrite existing files (default is false) | No |
overwriteProperties | Overwrite existing document properties such as title, docid, labels - requires overwrite=true (default false) | No |
index | If true, uploaded files are indexed (default is true) | No |
createxrefs | If true, cross-references found in the content of the uploaded document(s) are created (default true) | No |
validate | If true, uploaded files are validated if a schema is found (default is true) | No |
validateoption | Behavior if validation is turned on and an error was encountered (options are "fail" or "ignore", default is "ignore") - DEPRECATED. | No |
unzip | If true, unzip any .zip files that are uploaded (default is false) | No |
doclabels | A comma separated list of general labels to apply to the document | No |
messagelabels | A comma separated list of general labels to apply to the notification message | No |
docidisfilename | If 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>