Document¶
Create a large document¶
To import a large document, start with a new empty document: Create an empty document
Once the empty document has been created append a file to it using the following process: Append content stream
Potential issues¶
Temporary File Expiration: | |
---|---|
Temporary files will be overwritten if nothing is appended to them before they expire. The expiration can be configured using the following setting in CMIS Configuration. |
Create an empty document¶
Note that a created document will initially be set to unregistered. To register the document, use the updateproperties service to change the isregistered
property value to true.
Empty documents cannot be registered until a content stream has been set. Once this has been set, they will become normal documents.
Sample request¶
POST https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/children/?id=ROOTFOLDER HTTP/1.1
Host: test.test.com
Content-Length: 903
<?xml version="1.0" encoding="UTF-8"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:chemistry="http://chemistry.apache.org/">
<atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id>
<atom:title>Test</atom:title>
<atom:updated>2014-11-24T05:01:37.891Z</atom:updated>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
<cmis:value>t1DocumentType</cmis:value>
</cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:name">
<cmis:value>Test Precis</cmis:value>
</cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:typeIdDescription">
<cmis:value>Empty</cmis:value>
</cmis:propertyId>
</cmis:properties>
</cmisra:object>
</atom:entry>
Sample response¶
HTTP/1.1 201 Created
Cache-Control: private
Content-Type: application/atom+xml;type=entry
Location: https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/object/?id=document-599949
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Strict-Transport-Security: max-age=10886400
Date: Wed, 05 Oct 2016 07:10:17 GMT
Content-Length: 19034
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/" xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<atom:id>document-599949</atom:id>
<atom:title type="text">Document 599949</atom:title>
<atom:published>2016-10-05T17:09:24+10:00</atom:published>
<atom:updated>2016-10-05T17:09:24+10:00</atom:updated>
<atom:author/>
<atom:link rel="self" type="application/atom+xml;type=entry" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/object/?id=document-599949"/>
<atom:link rel="service" type="application/atomsvc+xml" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/servicedoc"/>
<atom:link rel="describedby" type="application/atom+xml;type=entry" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/type/?id=cmis:folder"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" type="application/cmisallowableactions+xml" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/allowableactions/?id=document-599949"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" type="application/atom+xml;type=feed" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/policies/?id=document-599949"/>
<atom:link rel="edit" type="application/atom+xml;type=entry" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/object/?id=document-599949"/>
<atom:link rel="edit-media" type="application/octet-stream" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/content/?id=document-599949"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" type="application/atom+xml;type=feed" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/relationships/?id=document-599949"/>
<atom:link rel="via" type="application/atom+xml;type=entry" href="https://test.test.com/testO.Web.Start/testSQL/Api/CMIS/T1/object/?id=folder-565695"/>
<app:edited>2016-10-05T17:09:24.427+10:00</app:edited>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:baseTypeId" localName="BaseTypeId" displayName="Base Type Id" queryName="cmis:baseTypeId">
<cmis:value>cmis:document</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken"/>
<cmis:propertyString propertyDefinitionId="cmis:checkinComment" localName="cmis:checkinComment" displayName="cmis:checkinComment" queryName="cmis:checkinComment"/>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamFileName" localName="cmis:contentStreamFileName" displayName="cmis:contentStreamFileName" queryName="cmis:contentStreamFileName"/>
<cmis:propertyId propertyDefinitionId="cmis:contentStreamId" localName="cmis:contentStreamId" displayName="cmis:contentStreamId" queryName="cmis:contentStreamId"/>
<cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength" localName="ContentStreamLength" displayName="Content Stream Length" queryName="cmis:contentStreamLength"/>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamMimeType" localName="ContentStreamMimeType" displayName="Content Stream MIME Type" queryName="cmis:contentStreamMimeType"/>
<cmis:propertyDateTime propertyDefinitionId="cmis:creationDate" localName="CreationDate" displayName="Creation Date" queryName="cmis:creationDate">
<cmis:value>2016-10-05T17:09:24+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyBoolean propertyDefinitionId="cmis:isImmutable" localName="cmis:isImmutable" displayName="cmis:isImmutable" queryName="cmis:isImmutable">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean propertyDefinitionId="cmis:isMajorVersion" localName="cmis:isMajorVersion" displayName="cmis:isMajorVersion" queryName="cmis:isMajorVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestMajorVersion" localName="cmis:isLatestMajorVersion" displayName="cmis:isLatestMajorVersion" queryName="cmis:isLatestMajorVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestVersion" localName="cmis:isLatestVersion" displayName="cmis:isLatestVersion" queryName="cmis:isLatestVersion">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyString propertyDefinitionId="cmis:versionLabel" localName="cmis:versionLabel" displayName="cmis:versionLabel" queryName="cmis:versionLabel">
<cmis:value>1</cmis:value>
</cmis:propertyString>
<cmis:propertyBoolean propertyDefinitionId="cmis:isVersionSeriesCheckedOut" localName="cmis:isVersionSeriesCheckedOut" displayName="cmis:isVersionSeriesCheckedOut" queryName="cmis:isVersionSeriesCheckedOut">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyDateTime propertyDefinitionId="cmis:lastModificationDate" localName="LastModificationDate" displayName="Last Modification Date" queryName="cmis:lastModificationDate">
<cmis:value>2016-10-05T17:09:24+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyString propertyDefinitionId="cmis:lastModifiedBy" localName="LastModifiedBy" displayName="Last Modified By" queryName="cmis:lastModifiedBy">
<cmis:value>TECHONE</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:createdBy" localName="CreatedBy" displayName="Created By" queryName="cmis:createdBy">
<cmis:value>TECHONE</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:name" localName="Name" displayName="Name" queryName="cmis:name">
<cmis:value>Test Precis</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:description" localName="Description" displayName="Description" queryName="cmis:description">
<cmis:value>Test Precis</cmis:value>
</cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
<cmis:value>document-599949</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId" localName="ObjectTypeId" displayName="Object Type Id" queryName="cmis:objectTypeId">
<cmis:value>t1documenttype</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:secondaryObjectTypeIds" localName="secondaryObjectTypeIds" displayName="Ids of the objects secondary types." queryName="cmis:secondaryObjectTypeIds"/>
<cmis:propertyString propertyDefinitionId="cmis:versionSeriesCheckedOutBy" localName="cmis:versionSeriesCheckedOutBy" displayName="cmis:versionSeriesCheckedOutBy" queryName="cmis:versionSeriesCheckedOutBy">
<cmis:value>0</cmis:value>
</cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesCheckedOutId" localName="cmis:versionSeriesCheckedOutId" displayName="cmis:versionSeriesCheckedOutId" queryName="cmis:versionSeriesCheckedOutId"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesId" localName="cmis:versionSeriesId" displayName="cmis:versionSeriesId" queryName="cmis:versionSeriesId">
<cmis:value>565695</cmis:value>
</cmis:propertyId>
<cmis:propertyBoolean propertyDefinitionId="cmis:isPrivateWorkingCopy" localName="cmis:isPrivateWorkingCopy" displayName="cmis:isPrivateWorkingCopy" queryName="cmis:isPrivateWorkingCopy">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyString propertyDefinitionId="cmis:path" localName="Path" displayName="Path" queryName="cmis:path">
<cmis:value>/folder-565695/document-599949</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:relativePathSegment" localName="relativePathSegment" displayName="Relative Path Segment" queryName="cmis:relativePathSegment">
<cmis:value>document-599949</cmis:value>
</cmis:propertyString>
<cmis:propertyInteger propertyDefinitionId="cmis:qapId" localName="cmis:qapId" displayName="cmis:qapId" queryName="cmis:qapId">
<cmis:value>1</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:revisionText1" localName="RevText1" displayName="cmis:revisionText1" queryName="cmis:revisionText1">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText2" localName="RevText2" displayName="cmis:revisionText2" queryName="cmis:revisionText2">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText3" localName="RevText3" displayName="cmis:revisionText3" queryName="cmis:revisionText3">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText4" localName="RevText4" displayName="cmis:revisionText4" queryName="cmis:revisionText4">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyDateTime propertyDefinitionId="cmis:revisionDate1" localName="RevDate1" displayName="RevDate1" queryName="cmis:revisionDate1">
<cmis:value>1900-01-01T00:00:00+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyDateTime propertyDefinitionId="cmis:revisionDate2" localName="RevDate2" displayName="RevDate2" queryName="cmis:revisionDate2">
<cmis:value>1900-01-01T00:00:00+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:revisionLong1" localName="RevLong1" displayName="RevLong1" queryName="cmis:revisionLong1">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:revisionLong2" localName="RevLong2" displayName="RevLong2" queryName="cmis:revisionLong2">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyDateTime propertyDefinitionId="cmis:documentDate" localName="DocDate" displayName="cmis:documentDate" queryName="cmis:documentDate">
<cmis:value>2016-10-05T17:09:24+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyDateTime propertyDefinitionId="cmis:documentReceivedAt" localName="ReceivedAt" displayName="cmis:documentReceivedAt" queryName="cmis:documentReceivedAt">
<cmis:value>2016-10-05T17:09:24+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:classId" localName="cmis:classId" displayName="cmis:classId" queryName="cmis:classId">
<cmis:value>288</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:internalReference" localName="IntRef" displayName="cmis:internalReference" queryName="cmis:internalReference">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:externalReference" localName="ExtRef" displayName="cmis:externalReference" queryName="cmis:externalReference">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyInteger propertyDefinitionId="cmis:callSiteNo" localName="cmis:callSiteNo" displayName="cmis:callSiteNo" queryName="cmis:callSiteNo">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:callTypeNo" localName="cmis:callTypeNo" displayName="cmis:callTypeNo" queryName="cmis:callTypeNo">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:author" localName="Author" displayName="cmis:author" queryName="cmis:author">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyBoolean propertyDefinitionId="cmis:registered" localName="Registered" displayName="cmis:registered" queryName="cmis:registered">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyBoolean propertyDefinitionId="cmis:pending" localName="Pending" displayName="cmis:pending" queryName="cmis:pending">
<cmis:value>false</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyDateTime propertyDefinitionId="cmis:closedDate" localName="ClosedDate" displayName="cmis:closedDate" queryName="cmis:closedDate">
<cmis:value>1900-01-01T00:00:00+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:closedEcmUserId" localName="closedEcmUserId" displayName="cmis:closedEcmUserId" queryName="cmis:closedEcmUserId">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:creatorEcmUserId" localName="cmis:creatorEcmUserId" displayName="CreatorEcmUserId" queryName="cmis:creatorEcmUserId">
<cmis:value>584</cmis:value>
</cmis:propertyInteger>
<cmis:propertyBoolean propertyDefinitionId="cmis:current" localName="current" displayName="cmis:current" queryName="cmis:current">
<cmis:value>true</cmis:value>
</cmis:propertyBoolean>
<cmis:propertyDateTime propertyDefinitionId="cmis:documentDate" localName="DocDate" displayName="cmis:documentDate" queryName="cmis:documentDate">
<cmis:value>2016-10-05T17:09:24.427+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:documentId" localName="DocId" displayName="cmis:documentId" queryName="cmis:documentId">
<cmis:value>599949</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:documentSetId" localName="DocSetId" displayName="cmis:documentSetId" queryName="cmis:documentSetId">
<cmis:value>565695</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:documentTypeId" localName="cmis:documentTypeId" displayName="cmis:documentTypeId" queryName="cmis:documentTypeId">
<cmis:value>6</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:typeIdDescription" localName="cmis:typeIdDescription" displayName="cmis:typeIdDescription" queryName="cmis:typeIdDescription">
<cmis:value>Unknown</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:externalReference" localName="ExtRef" displayName="cmis:externalReference" queryName="cmis:externalReference">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:internalReference" localName="IntRef" displayName="cmis:internalReference" queryName="cmis:internalReference">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyInteger propertyDefinitionId="cmis:lockedSeq" localName="lockedSeq" displayName="cmis:lockedSeq" queryName="cmis:lockedSeq">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:precis" localName="Precis" displayName="cmis:precis" queryName="cmis:precis">
<cmis:value>Test Precis</cmis:value>
</cmis:propertyString>
<cmis:propertyDateTime propertyDefinitionId="cmis:receivedAt" localName="ReceivedAt" displayName="cmis:receivedAt" queryName="cmis:receivedAt">
<cmis:value>2016-10-05T17:09:24.427+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyDateTime propertyDefinitionId="cmis:registeredAt" localName="RegdAt" displayName="cmis:registeredAt" queryName="cmis:registeredAt">
<cmis:value>2016-10-05T17:09:24.427+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:responsibleEcmUserId" localName="responsibleEcmUserId" displayName="cmis:responsibleEcmUserId" queryName="cmis:responsibleEcmUserId">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyDateTime propertyDefinitionId="cmis:revisionDate1" localName="RevDate1" displayName="cmis:revisionDate1" queryName="cmis:revisionDate1">
<cmis:value>1900-01-01T00:00:00+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyDateTime propertyDefinitionId="cmis:revisionDate2" localName="RevDate2" displayName="cmis:revisionDate2" queryName="cmis:revisionDate2">
<cmis:value>1900-01-01T00:00:00+10:00</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyInteger propertyDefinitionId="cmis:revisionEcmUserId" localName="revisionEcmUserId" displayName="cmis:revisionEcmUserId" queryName="cmis:revisionEcmUserId">
<cmis:value>584</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:revisionLong1" localName="RevLong1" displayName="cmis:revisionLong1" queryName="cmis:revisionLong1">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyInteger propertyDefinitionId="cmis:revisionLong2" localName="RevLong2" displayName="cmis:revisionLong2" queryName="cmis:revisionLong2">
<cmis:value>0</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:revisionText1" localName="RevText1" displayName="cmis:revisionText1" queryName="cmis:revisionText1">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText2" localName="RevText2" displayName="cmis:revisionText2" queryName="cmis:revisionText2">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText3" localName="RevText3" displayName="cmis:revisionText3" queryName="cmis:revisionText3">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:revisionText4" localName="RevText4" displayName="cmis:revisionText4" queryName="cmis:revisionText4">
<cmis:value/>
</cmis:propertyString>
<cmis:propertyInteger propertyDefinitionId="cmis:version" localName="Version" displayName="cmis:version" queryName="cmis:version">
<cmis:value>1</cmis:value>
</cmis:propertyInteger>
<cmis:propertyString propertyDefinitionId="cmis:mailMessageId" localName="Mail Message Id" displayName="cmis:mailMessageId" queryName="cmis:mailMessageId">
<cmis:value/>
</cmis:propertyString>
</cmis:properties>
<cmis:allowableActions>
<cmis:canDeleteObject>false</cmis:canDeleteObject>
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
<cmis:canGetFolderTree>false</cmis:canGetFolderTree>
<cmis:canGetProperties>true</cmis:canGetProperties>
<cmis:canGetObjectRelationships>true</cmis:canGetObjectRelationships>
<cmis:canGetObjectParents>false</cmis:canGetObjectParents>
<cmis:canGetFolderParent>false</cmis:canGetFolderParent>
<cmis:canGetDescendants>false</cmis:canGetDescendants>
<cmis:canMoveObject>false</cmis:canMoveObject>
<cmis:canDeleteContentStream>false</cmis:canDeleteContentStream>
<cmis:canCheckOut>false</cmis:canCheckOut>
<cmis:canCancelCheckOut>false</cmis:canCancelCheckOut>
<cmis:canCheckIn>false</cmis:canCheckIn>
<cmis:canSetContentStream>true</cmis:canSetContentStream>
<cmis:canGetAllVersions>false</cmis:canGetAllVersions>
<cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder>
<cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder>
<cmis:canGetContentStream>false</cmis:canGetContentStream>
<cmis:canApplyPolicy>false</cmis:canApplyPolicy>
<cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies>
<cmis:canRemovePolicy>false</cmis:canRemovePolicy>
<cmis:canGetChildren>false</cmis:canGetChildren>
<cmis:canCreateDocument>false</cmis:canCreateDocument>
<cmis:canCreateFolder>false</cmis:canCreateFolder>
<cmis:canCreateRelationship>false</cmis:canCreateRelationship>
<cmis:canDeleteTree>false</cmis:canDeleteTree>
<cmis:canGetRenditions>false</cmis:canGetRenditions>
<cmis:canGetACL>false</cmis:canGetACL>
<cmis:canApplyACL>false</cmis:canApplyACL>
</cmis:allowableActions>
</cmisra:object>
<cmisra:relativePathSegment>document-599949</cmisra:relativePathSegment>
<cmisra:pathSegment>document-599949</cmisra:pathSegment>
</entry>
Append content stream¶
This service allows for large files to be created without significantly impacting the server. Each file is broken into ‘chunks’ and submitted separately. These chunks are merged into one file on the server and then processed once the last chunk has been received.
Parallel requests should ensure that they do not call this service on the same document. A temporary file will be created for each document, however no attempt is made to distinguish between callers. Chunks will be appended to the temporary file in the order that they are received.
Note that if uploading an xml file using this service a content-type header value of raw will be required. Xml files without this value will return an error.
C# sample¶
public void AppendContentStream(string targetId, IContentStream contentStream)
{
var buffer = new byte[ByteArraySize];
int bytesRead;
var firstRun = true;
while ((bytesRead = contentStream.Stream.Read(buffer, 0, buffer.Length)) > 0)
{
AppendDocumentRequest(contentStream.FileName, buffer.Take(bytesRead).ToArray(), false, firstRun, targetId);
firstRun = false;
}
AppendDocumentRequest(contentStream.FileName, null, true, firstRun, targetId);
}
private void AppendDocumentRequest(string fileName, byte[] buffer, bool isLastChunk, bool overwriteFlag, string targetId)
{
var url = $"{BaseUrl}/content/?id={targetId}&isLastChunk={isLastChunk}&append=true";
using (var client = new WebClient())
{
client.Headers.Add(HttpRequestHeader.Authorization, "Basic " + Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes("cmis:cmis")));
client.Headers.Add("Content-Disposition", $"attachment; filename=\"{fileName}\"");
if(!isLastChunk)
{
client.UploadData(url, WebRequestMethods.Http.Put, buffer);
}
else
{
client.UploadValues(url, WebRequestMethods.Http.Put, new NameValueCollection());
}
}
}
Sample request¶
POST https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/content/?id=document-10000&isLastChunk=false&append=true HTTP/1.1
Authorization: Basic Q01JUzpDTUlTcXVhbGl0eQ==
Content-Length: 19
Host: ecmpartner.onespresso.net
first chunk content
Sample response¶
HTTP/1.1 201 Created
Cache-Control: private
Content-Type: application/atom+xml;type=entry
Content-Location: https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/content/?id=document-10000
Location: https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/content/?id=document-10000
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Strict-Transport-Security: max-age=10886400
Date: Mon, 07 Aug 2017 07:35:05 GMT
Content-Length: 252
<?xml version="1.0" encoding="utf-8"?>
<entry
xmlns="http://www.w3.org/2005/Atom">
<id>uuid:2d25450e-1f6f-481e-b242-1bc3f805ef02;id=1</id>
<title type="text">File Size</title>
<updated>2017-08-07T07:35:05Z</updated>
<content type="text">19</content>
</entry>
Retrieve a Document Content Stream¶
A document’s content stream can be retrieved by making a GET request to /content
and passing through an id parameter containing the document’s id. Note that additional rendition types can be retrieved based on the id passed to this service.
document-2988 | Retrieves the original version of document 2988 |
folder-2534 | Retrieves the original version of the latest document in folder-2534 |
streamorig-2988 | Retrieves the original version of document 2988 |
streampdf-2988 | Retrieves the pdf rendition of document 2988 |
streamthumbl-2988 | Retrieves the large thumbnail of document 2988 |
streamthumbs-2988 | Retrieves the small thumbnail of document 2988 |
Hint
- The default behavior for browser viewable files is to be viewed inline. These can now be downloaded directly by adding the parameter
- &forcedownload=true
C# sample¶
Please note that the following examples assume that dotCMIS is being used.
// Retrieve a content stream via document object
largeDocument.GetContentStream();
// Retrieves the original file of the specified document object
session.GetContentStream(new ObjectId("document-2988"));
Sample request¶
GET https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/content/?id=document-2988 HTTP/1.1
User-Agent: Apache Chemistry DotCMIS
Authorization: Basic Q01JUzpDTUlTcXVhbGl0eQ==
Host: ecmpartner.onespresso.net
Sample response¶
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: image/png
Server: Microsoft-IIS/7.5
X-Filename: ECM_2534_v1_New Test 4 01 2017 11 21 14 AM.png
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Strict-Transport-Security: max-age=10886400
Date: Wed, 04 Jan 2017 01:49:06 GMT
Content-Length: 3117
PNG (Truncated)
Retrieve a Document Set Content Stream¶
Different content streams for the current version document cann be retrieved directly from the document set. To retrieve streams other than the original, both the id parameter and the stream parameter must be provided. This request can be used for all stream types.
id=folder-2534&streamId=streampdf-2534 will retrieve the pdf rendition of the current version document for document set 2534.
Sample request¶
GET https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/content/?id=folder-2534&streamId=streampdf-2534 HTTP/1.1
Authorization: Basic Q01JUzpDTUlTcXVhbGl0eQ==
Host: ecmpartner.onespresso.net
Sample response¶
HTTP/1.1 200 OK
Content-Type: application/pdf
X-Filename: ECM_2534_v1_New Test.pdf
Content-Length: 3117
PDF (Truncated)