start loading
| API Support | Available since | Last updated | Output |
|---|---|---|---|
| 5.9500 | 6.2000 | xml |
Description
Starts loading the specified loading zone.
Before calling this service, use /upload PUT or /upload POST to upload files into the loading zone.
Following is the xmlspec parameter content showing example files and other default settings. See upload-request-3.0.dtd.
<upload-request version="3.0">
<files>
<file path="lorem_ipsum_files/cat.gif" />
<file path="lorem_ipsum_files/cat.jpg" />
<file path="lorem_ipsum.psml"
docid="lorem1"
title="Lorem Ipsum"
description="This is a test document."
labels="test,basic" />
<file path="sample GIF image.gif" />
<file path="sample DOCX document.docx" >
<action project="default" target="import">
<param name="remove.original" value="true" />
<param name="create.subfolder" value="false" />
<param name="remove.config" value="true" />
</action>
</file>
</files>
<validate>true</validate>
<overwrite summary="false">false</overwrite>
<createxrefs>true</createxrefs>
<index>true</index>
<message subject="File upload"
notification="silent">The file has been uploaded.
</message>
</upload-request>
In the xmlspec files section, the following dynamic tokens can be used in filename, docid or title attributes: filename (without extension), extension, document-type, year, month, date. For example:
<upload-request version="3.0">
<files>
<mediatype value="application/vnd.pageseeder.psml+xml"
docid="[filename]-[document-type]"
title="[filename]"
labels="doc1,doc2"/>
</files>
</upload-request>
Depending on overwrite and summary parameters, the load might be stopped and the following summary returned by the Service: /groups/{group}/threads/{threadid}/progress [GET].
<thread id="8a1955f42b4139bf6ea86334ed62d6cf"
name="Loading 5 document/folders"
username="jsmith"
groupid="4"
status="completed">
<message>Overwrite confirmation needed</message>
<overwrite-summary destination="/ps/acme/specs/documents/lorem-ipsums"
file-overwrites="2"
file-new="2"
[url-orverwrite=""
url-new=""]>
<files>
<file name="lorem"
path="/"
type="folder"
existing="2"
overwrites="1"
new="1">
<file name="lorem_ipsum_files"
path="lorem_ipsum_files"
overwrite="true"
type="folder"
existing="3"
overwrites="1"
new="1">
<file name="cat.gif"
path="lorem_ipsum_files/cat.gif"
extension="gif"
overwrite="true"
... />
<file name="cat.jpg"
path="lorem_ipsum_files/cat.jpg"
extension="jpg"
create="true"
... />
</file>
<file name="lorem_ipsum.psml"
path="lorem_ipsum.psml"
extension="psml"
level="portable"
behavior="psml--"
overwrite="true"
... />
<file name="sample GIF image.gif"
path="sample GIF image.gif"
extension="gif"
create="true"
... />
</file>
<files>
<urls>
[<file ... />]
</urls>
</overwrite-summary>
</thread>
If parameter mode=preview, then xmlspec should only contain one file, for example:
<upload-request version="3.0">
<files>
<file path="Test doc 1.docx">
<action project="default"
target="preview-imports"
delay="2000" />
</file>
</files>
</upload-request>
The load is then stopped after the action script is run and the path to the resulting file is returned by the thread progress service (above) as follows:
<thread id="9c13726540fe2db56d9b0e1278647f60"
name="Preview of Test doc 1.docx"
username="jsmith"
groupid="4"
status="completed">
<message>Success!!</message>
<action progress="0">Script</action>
<previewpath>
/session/EpqLa9LHnB5ivBZPZeCbpDTpvabcdabcd/acme/spec/Test doc 1.psml
</previewpath>
</thread>
If updating code to use this service instead of the obsolete com.pageseeder.load.servlets.StartLoading, note that <upload-request> must be sent as an xmlspec parameter. Also, in the returned XML, <thread> is wrapped by <load-start>.
Parameters
| Name | Description | Required | Type | Default value |
|---|---|---|---|---|
| assignedto | ID of assigned member for workflow (requires status specified) | no | string | |
| createxrefs | Whether to resolve image and cross-references in the files | no | boolean | true |
| description | The workflow description (requires status specified) | no | string | |
| due | The task due date and time in ISO-8601 format – status MUST be set. e.g. 2010-10-25T18:00:00+11:00 | no | datetime | |
| folder | The folder the file should be uploaded into (relative to the root of the group, ignored if url is specified) | no | string | |
| index | Whether to index the files | no | boolean | true |
| mode | If preview then loading is stopped after action scripts are run (requires xmlspec) | no | string | |
| notification-content | Upload notification message text | no | string | |
| notification-labels | Labels for upload message e.g. Important, Typo | no | string | |
| notification-subject | Upload notification subject text | no | string | |
| notify | Upload notification flag, must be silent, normal or announce (notification-* parameters are ignored if silent ) | no | string | |
| overwrite | Whether to overwrite existing files | no | boolean | false |
| overwrite-properties | Whether to overwrite existing properties (labels, docid, title, ...) and metadata | no | boolean | false |
| priority | Priority for workflow e.g. High, Medium, Low (requires status specified) | no | string | |
| status | Status for workflow e.g. Initiated ,In Progress, Complete, Approved, Suspended, Terminated | no | string | |
| summary | Whether to return an overwrite summary, if true and overwrite=true, always return summary, if true and overwrite=false, return summary only if overwrite occurs | no | boolean | |
| uploadid | An ID to uniquely identify this upload (overrides xlinkid) | no | string | |
| url | A URL pointing to the folder the file should be uploaded into | no | url | |
| validate | Whether to validate the files with schematron | no | boolean | true |
| workflow-labels | Labels for workflow e.g. Important, Typo (requires status specified) | no | string | |
| workflow-notify | Workflow notification flag, must be silent, minimal, normal or announce (requires status specified) | no | string | silent |
| xmlspec | The XML specification for the load (overridden by parameters) | no | string |
Permission
Contributor or higher in the group.
Response
<load-start>
<thread id="[thread ID]" ... >
[thread XML]
<thread>
</load-start>
Error Handling
No specific errors expected for this service.