All Operations That Change the State of an Object MUST Use HTTP POST. Since This Binding
Total Page:16
File Type:pdf, Size:1020Kb
POST Data
All operations that change the state of an object MUST use HTTP POST. Since this binding is optimized for use in browser applications, the format of the transferred data is aligned to the capabilities of HTML forms and described here in HTML terms.
The submission method (HTML form attribute “method”) MUST be “POST”. The encoding type (HTML form attribute “enctype”) MUST be either "application/x-www- form-urlencoded" or "multipart/form-data" if no content stream is attached to the form. The encoding type MUST be “multipart/form-data” if a content stream is attached to the form data.
The names of the controls within the form are defined by the patterns in the following sections. All control names are case-insensitive as defined by the HTML specification. Control names MUST be unique within a form. If the control value of an optional parameter is set to an empty string (“”) the default value MUST be used.
A client MAY add controls to a form that are not defined by CMIS if the control names don’t conflict with the patterns described below.
CMIS Action A client MUST include a control named “cmisaction” that indicates the operation that should be performed. See section 1.4.3 for valid control values.
Example:
Structured and Array Parameters Some CMIS operations require structured parameters and arrays of values. HTML forms don’t support that.
In order to overcome this gap, some CMIS operation parameters are split into multiple controls in a form.
For example, a CMIS property is split into a control that holds the property id and another control that hold property value. The association between the two controls is done by convention. The entirety of all properties is made up of an array of these property controls.
Names of controls that are part of an array end with “[
An array of three properties looks like this in a HTML form:
If a client sends invalid, incomplete or inconsistent data the repository SHOULD return an invalidArgument error.
CMIS Controls This sections lists all controls used by CMIS operations.
Ids
Object id: Control name: “objectId” Control value: Object id
Example:
Folder id: Control name: “folderId” Control value: Folder id
Example:
Source folder id: Control name: “sourceFolderId” Control value: Folder id
Example:
Target folder id: Control name: “targetFolderId” Control value: Folder id
Example:
Single-value Property A single-value property is made up of a “propertyId” control and a “propertyValue” control with the same
Property Id: Control name: “propertyId[
Property value: Control name: “propertyValue[
Example:
Multi-value Property A multi-value property is made up a “propertyId” control and a series of “propertyValue” controls with the same
Property Id: Control name: “propertyId[
Property values: Control name: “propertyValue[
Example:
ACEs to add An ACE that should be added is made up of an “addACEPrincipal” control and zero or more “addACEPermission” controls with the same
Principal: Control name: “addACEPrincipal[
Permission: Control name: “addACEPermission[
Example:
ACEs to remove An ACE that should be removed is made up of a “removeACEPrincipal” control and zero or more “removeACEPermission” controls with the same
Principal: Control name: “removeACEPrincipal[
Permission: Control name: “removeACEPermission[
Example:
ACL propagation
ACL propagation: Control name: “ACLPropagation” Control value: ACL propagation enum ("objectonly", "propagate", "repositorydetermined")
Example:
Policies A policy list is made up of a series of “policy” controls.
Policy: Control name: “policy[
Example:
Change Token
Change token: Control name: “changeToken” Control value: Change token If the change token is set to an empty string (“”) then it MUST be treated as it is not set
Example:
Versioning state
Versioning State: Control name: “versioningState” Control value: Versioning state enum ("none", "major", "minor", "checkedout")
Example:
Checkin Comment
Checkin comment: Control name: “checkinComment” Control value: Checkin comment
Example:
Query
Statement: Control name: “statement” Control value: CMIS query statement
Search all versions: Control name: “searchAllVersions” Control value: boolean (“true”, “false”)
Include relationships: Control name: “includeRelationships” Control value: includeRelationships enum ("none", "source" ,"target", "both")
Rendition filter: Control name: “renditionFilter” Control value: rendition filter
Include allowable actions: Control name: “includeAllowableActions” Control value: boolean (“true”, “false”)
Max items: Control name: “maxItems” Control value: non-negative integer
Skip count: Control name: “skipCount” Control value: non-negative integer
Example:
Content A file select control SHOULD be used to attach content.
Content: Control name: “content” Control value: none Control type: “file”
Example:
Control values
Since control values are strings, all other data types have to be serialized to strings. The same rules that apply to the serialization to JSON apply here.