Document Copy¶
Creating a document copy/initial move¶
The ability to create an initial document copy was included in the 2016A release. The Move folder can be used to determine valid locations and should be used to populate the cmis:targetId property.
Note that only the initial document copy can be generated via the CMIS service. Any subsequent moves must be performed via ECM in Ci Anywhere.
DotCMIS Sample¶
/* Creates an initial document copy */
internal static IRelationship CreateDocumentCopyRelationship(ISession session, IDocument document, string targetId)
{
var documentIdProperty = document.Properties.FirstOrDefault(x => x.Id.Equals("cmis:objectId", StringComparison.OrdinalIgnoreCase));
var properties = new Dictionary<string, object>();
properties.Add("cmis:objectTypeId", "t1documentcopyrelationshiptype");
properties.Add("cmis:targetId", targetId);
properties.Add("cmis:sourceId", documentIdProperty.ValueAsString);
var id = session.CreateRelationship(properties);
return (Relationship) session.GetObject(id);
}
Sample request¶
POST https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/relationships/?id=document-601000 HTTP/1.1
Host: test.test.net
Connection: keep-alive
Authorization: Basic Y21pczpjbWlz
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: Theme/TECHONE=#Conference; LoggingEnabled=true; Theme/CMIS=#Base; DisableCombinedJs=true; Theme/TECHONE/DEV.TEST.UNIFIED.ORA=Base; Theme/BOB/testORA=Base; Theme/CMIS/CJOSQL=Base; Theme/TECHONE/CJOSQL=#zed44; Theme/TECHONE/testORA=#T1.Workplace.CoreLib.Compatibility.Internal.BasicV`1[System.String]; RequestingArea=Workplace; Theme/test/testSQL=#T1.Workplace.CoreLib.Compatibility.Internal.BasicV`1[System.String]; T1.Workplace.Web=E90438DDC596037527858C713C5B1CDA54CF9F06BAEE6E334EED35400A782EF85155FAB906C7C47E22C8D5E6C9AEA15DD1B95911F201999BED903991C7C517C249D597D8761DA662B3D848A442C6673EBAD0DAB113BF5379FC681E71A92BC3884CC8E5598576A66F70FE29AA81F83FBCF87637390D817FEA31A937F147B7FB8EA9F8A456FD561AFCC236D7E53D60E6CF84B93E1628BABC5CB2F4F500E3F3799AE2035B9ACEAE39A954FEDB0DC8D882F90FC5D919CDE790A714E4D363E93807BE3675EC9BCE4DB3864AE2A5CD02D63F2FD6237639063224B0680562F76F7AEC74BFCD0B7035D9874CCD1E947EE3F05D6F642F545036392423767843C3316FEFAD2E659EEF4F87802BF183721C7029F2BE2931EC389117E16E0B576B9404EEBB964D345CFFDC6D58E6D27645DE8614A14F3268117F2F6712807FE3EE7F0DC0313FF1EE0C81B6C920A648CD61B399D7304EC767E9AEE7004FE7F91BB54453791057BA2DCBE2BDB8294AB9E77335AF36C13977C9318D32CD3882C1FA490652D8C1C8FC613FC026D83E58129D2ECBEF699D6092157F7046925E236499C15C18E58DC5F5FA3EEA596EC2CCBFD5489E664C5E1F25BF6A682720D4C9585886D5ADF3E238C21255AF9541F7FECD0FCA7582DF3408B432F0CAA5CE79D31C2E1AE61507909BFB98FA1BC42EBFF99C7BBEBBA834576B71758345DAC052B3747CDBF451167957605653F57F9FB1B843648E2298C4B5E627E025EF294C11365D6A1B0FE95ABADE39A4A7E08F6EEAF848F036C4FC639B2D459346CF452C6176701A2A066A3023DE3BB1EF8D79CB95C400608F65D0A5F51883B138BABD26444E7DCF38D47B04AAE9AAA06C89D341304E5E171B7A4BC5380C6FA4CCC40AD103224CFAE0E670598D4B23935DD3A552A7175F3639CA2733E2FA86325F5B08BFA3BFF76147CB8D46EE0B2D9F515C12247F62C43FFE56172A93F6B7D1CAD3B0B848515917C2FB76A2BACAA5F820163256554AA05D19490FF67F83DEA2E19F; wl_auth=client_id=0000000044115E4F&status=unchecked
Content-Length: 968
<?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/">
<atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id>
<atom:title/>
<atom:updated>2016-02-23T06:16:28Z</atom:updated>
<cmisra:object xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
<cmis:value>t1documentcopyrelationshiptype</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:targetId">
<cmis:value>indexentry-x-2-4-5-1619380-x-19</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:sourceId">
<cmis:value>document-601000</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.net/test.Web.Start/testSQL/Api/CMIS/T1/object/?id=relationshipdocumentcopy-doccopy-8052-601000-document-601000
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Date: Mon, 17 Oct 2016 04:45:32 GMT
Content-Length: 6819
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://test.test.net/test.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>relationshipdocumentcopy-doccopy-8052-601000-document-601000</atom:id>
<atom:title type="text">Relationship relationshipdocumentcopy-doccopy-8052-601000-document-601000</atom:title>
<atom:published>2016-10-17T14:45:32+10:00</atom:published>
<atom:updated>2016-10-17T14:45:32+10:00</atom:updated>
<atom:link rel="self" type="application/atom+xml;type=entry" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/object/?id=relationshipdocumentcopy-doccopy-8052-601000-document-601000"/>
<atom:link rel="service" type="application/atomsvc+xml" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/servicedoc"/>
<atom:link rel="describedby" type="application/atom+xml;type=entry" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/type/?id="/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" type="application/cmisallowableactions+xml" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/allowableactions/?id=relationshipdocumentcopy-doccopy-8052-601000-document-601000"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" type="application/atom+xml;type=feed" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/policies/?id=relationshipdocumentcopy-doccopy-8052-601000-document-601000"/>
<atom:link rel="edit" type="application/atom+xml;type=entry" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/object/?id=relationshipdocumentcopy-doccopy-8052-601000-document-601000"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/source" type="application/atom+xml;type=entry" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/object/?id=document-601000"/>
<atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/target" type="application/atom+xml;type=entry" href="https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/object/?id=doccopy-8052-601000"/>
<app:edited>2016-10-17T14:45:32.5077456+10:00</app:edited>
<cmisra:object>
<cmis:properties>
<cmis:propertyString propertyDefinitionId="cmis:name" localName="Name" displayName="Name" queryName="cmis:name">
<cmis:value>relationshipdocumentcopy-doccopy-8052-601000-document-601000</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:description" localName="Description" displayName="Description" queryName="cmis:description">
<cmis:value>Relationship to Index Entry: doccopy-8052-601000</cmis:value>
</cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
<cmis:value>relationshipdocumentcopy-doccopy-8052-601000-document-601000</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:baseTypeId" localName="BaseTypeId" displayName="Base Type Id" queryName="cmis:baseTypeId">
<cmis:value>cmis:relationship</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId" localName="ObjectTypeId" displayName="Object Type Id" queryName="cmis:objectTypeId">
<cmis:value>t1indexentryrelationshiptype</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:createdBy" localName="CreatedBy" displayName="Created By" queryName="cmis:createdBy">
<cmis:value>document-601000</cmis:value>
</cmis:propertyString>
<cmis:propertyDateTime propertyDefinitionId="cmis:creationDate" localName="CreationDate" displayName="Creation Date" queryName="cmis:creationDate">
<cmis:value>0001-01-01T00:00:00Z</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyString propertyDefinitionId="cmis:lastModifiedBy" localName="LastModifiedBy" displayName="Last Modified By" queryName="cmis:lastModifiedBy"/>
<cmis:propertyDateTime propertyDefinitionId="cmis:lastModificationDate" localName="LastModificationDate" displayName="Last Modification Date" queryName="cmis:lastModificationDate">
<cmis:value>0001-01-01T00:00:00Z</cmis:value>
</cmis:propertyDateTime>
<cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken"/>
<cmis:propertyId propertyDefinitionId="cmis:sourceId" localName="cmis:sourceId" displayName="SourceId" queryName="cmis:sourceId">
<cmis:value>document-601000</cmis:value>
</cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:targetId" localName="cmis:targetId" displayName="cmis:targetId" queryName="cmis:targetId">
<cmis:value>doccopy-8052-601000</cmis:value>
</cmis:propertyId>
</cmis:properties>
<cmis:allowableActions>
<cmis:canDeleteObject>true</cmis:canDeleteObject>
<cmis:canUpdateProperties>false</cmis:canUpdateProperties>
<cmis:canGetFolderTree>false</cmis:canGetFolderTree>
<cmis:canGetProperties>true</cmis:canGetProperties>
<cmis:canGetObjectRelationships>false</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>false</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>true</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>
</entry>