.. _indexentry: Index Entries ============= Id explanation """""""""""""" An index entry id consists of eight components, the object type, six level ids and an index number. These components can be manipulated in order to navigate index levels and retrieve additional properties. The following example shows a level two index entry that belongs to the Connected Content Attachments index: ``indexentry-549-309-x-x-x-x-600`` ``{objectType}-{level1Id}-{level2Id}-{level3Id}-{level4Id}-{level5id}-{indexnumber}`` .. image:: /_static/img/index-entry-id-explanation-1.PNG :alt: Index entry id explanation This level two Connected Content Attachments index has the following properties: ===================== =========== ============== Caption Index Level Field Name ===================== =========== ============== Entity Key 1 2 UserText1 Entity Key 2 2 UserText2 Entity Key 3 2 UserText3 Entity Key 4 2 UserText4 Entity Key 5 2 UserText5 Entity Key 6 2 UserText6 Entity Key 7 2 UserText7 Entity Key 8 2 UserText8 Entity Key 9 2 UserText9 Entity Key 10 2 UserText10 Key Description 2 UserText11 Entity Description 2 UserText12 Internal Key 2 2 UserInteger1 ===================== =========== ============== The parent of this index entry can be reached by modifying the object’s id. For example, ``indexentry-549-309-x-x-x-x-600`` becomes ``indexentry-549-x-x-x-x-x-600)``: .. image:: /_static/img/index-entry-id-explanation-2.PNG :alt: Index entry id explanation #2 This level one Connected Content Attachments index entry exposes the following properties: ===================== =========== ============== Caption Index Level Field Name ===================== =========== ============== Suite Id 1 UserText1 Entity Type 2 UserText2 Attachment Type 2 UserText3 Document Type 2 UserText4 ===================== =========== ============== Create an index entry """""""""""""""""""""""""""""" Request properties ^^^^^^^^^^^^^^^^^^ :objectTypeId: This element must be set to ``t1IndexEntryType``. :levelNumber: This property indicates the level number of the index entry. If it is greater than one the parentIndexEntryId property must also be included. :indexNumber: The index to which the entry belongs. This value can also be seen as a property on index entry and index objects that have been retrieved via the GetObject service. :User fields: User fields correspond with custom fields on an index entry. They will likely have different meanings depending on the index and level that they are associated with. A user text field will have a displayName attribute that contains the label used in ECM. :parentIndexEntryId: If the level number is greater than one then this property must contain the parent index entries cmis id. For level one index entries this property should be omitted. This value should be the actual cmis id of parent object ``indexentry-860-x-x-x-x-x-11``. DotCMIS sample ^^^^^^^^^^^^^^^ .. code-block:: C# internal static Folder CreateL1SubjectIndexEntry(string name, ISession session) { var indexEntryProperties = new Dictionary { { "cmis:indexNumber", 40 }, { "cmis:levelNumber", 1 }, { "cmis:objectTypeId", "t1indexentrytype" }, { "cmis:usertext1", name } }; var indexEntryObjectId = session.CreateFolder(indexEntryProperties, new ObjectId("ROOTFOLDER")); var indexEntry = (Folder) session.GetObject(indexEntryObjectId); return indexEntry; } Sample request ^^^^^^^^^^^^^^ .. code-block:: xml POST https://test.test.net/testO.Web.Start/test/Api/CMIS/T1/children/?id=ROOTFOLDER HTTP/1.1 Host: test.test.net Content-Length: 903 urn:uuid:00000000-0000-0000-0000-00000000000 Test 2014-11-24T05:01:37.891Z t1indexentrytype Customer Name Test Customer Description Test 11 1 Sample response ^^^^^^^^^^^^^^^ .. code-block:: xml HTTP/1.1 201 Created Cache-Control: private Content-Type: application/atom+xml;type=entry Location: https://test.test.com/testO.Web.Start/test/Api/CMIS/T1/object/?id=indexentry-2977-x-x-x-x-x-40 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:59:58 GMT Content-Length: 38423 indexentry-2977-x-x-x-x-x-40 Index Entry indexentry-2977-x-x-x-x-x-40 2016-10-05T17:59:58+10:00 2016-10-05T17:59:58+10:00 2016-10-05T17:59:58.1262315+10:00 Test Value 1231 Test Value 1231 indexentry-2977-x-x-x-x-x-40 cmis:folder t1indexentrytype 2016-10-05T00:00:00+10:00 N/A 2016-10-05T00:00:00+10:00 N/A 166049x1475654350 /OTHER/INDEXES/indexentry-2977-x-x-x-x-x-40 2016-10-05T00:00:00+10:00 0x0AD403F6 17:59:10 TECHONE UNKNOWN Test Value 1231 2977 2977 40 2016-10-05T00:00:00+10:00 0x0AD403F6 17:59:10 TECHONE UNKNOWN 1 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0 0 0 0 0 0 0 0 0 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Test Value 1231 false true false true true true true false false false false false false false false false false false false false false true false false false false false false false relationshipindex-index-40-indexentry-2977-x-x-x-x-x-40 relationshipindex-index-40-indexentry-2977-x-x-x-x-x-40 relationshipindex-index-40-indexentry-2977-x-x-x-x-x-40 cmis:relationship t1indexrelationshiptype 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z indexentry-2977-x-x-x-x-x-40 index-40 false false false true false false false false false false false false false false false false false false false false false false false false false false false false false Update an Index Entry """"""""""""""""""""""""""""""""""""" The following samples demonstrate how to update an index entry. Note that field numbers are able to be identified by their display name or using the field details objects available in the following folder: ``/OTHER/FIELDDETAILS`` Request sample ^^^^^^^^^^^^^^ .. code-block:: xml POST https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/object/?id=indexentry-9-x-x-x-x-x-41 HTTP/1.1 Authorization: Basic Q01JUzpDTUlTcXVhbGl0eQ== Host: ecmpartner.onespresso.net Content-Length: 1076 urn:uuid:0000000000000000000000000000000 Changed 20161119T05:03:07.073Z 2 40 Test Birds 4 Response sample ^^^^^^^^^^^^^^^ .. code-block:: xml HTTP/1.1 200 OK Cache-Control: private Content-Type: application/atom+xml;type=entry 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:27:15 GMT Content-Length: 38384 indexentry-9-x-x-x-x-x-41 Index Entry indexentry-9-x-x-x-x-x-41 2017-08-07T17:27:15+10:00 2017-08-07T17:27:15+10:00 2017-08-07T17:27:15.1292059+10:00 Test Birds 4 Test Birds 4 indexentry-9-x-x-x-x-x-41 cmis:folder t1indexentrytype 2017-08-07T00:00:00+10:00 N/A 2017-08-07T00:00:00+10:00 N/A 5206x1502090834 /OTHER/INDEXES/indexentry-9-x-x-x-x-x-41 2017-08-07T00:00:00+10:00 0x3441B59E 17:27:14 CMIS UNKNOWN Test Birds 4 9 9 41 2017-08-07T00:00:00+10:00 0x3441B59E 17:27:14 CMIS UNKNOWN 1 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z 0 0 0 0 0 0 0 0 0 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Test Birds 4 false true false true true true true false false false false false false false false false false false false false false true false false false false false false false relationshipindex-index-41-indexentry-9-x-x-x-x-x-41 relationshipindex-index-41-indexentry-9-x-x-x-x-x-41 relationshipindex-index-41-indexentry-9-x-x-x-x-x-41 cmis:relationship t1indexrelationshiptype 0001-01-01T00:00:00Z 0001-01-01T00:00:00Z indexentry-9-x-x-x-x-x-41 index-41 false false false true false false false false false false false false false false false false false false false false false false false false false false false false false Associated document sets """""""""""""""""""""""" Index entries are generally associated with document sets. In order to retrieve any document sets that are linked to an entry, a getChildren() service call can be passed a t1foldertype filter. For example, suppose that the id of the Native index entry above is t1indexentry-2-5-4-x-x-x-40. Invoking /Api/CMIS/{repositoryId}/Children?id=t1indexentry-2-5-4-x-x-x-40&filter=t1foldertype will return the following document sets: - Barramundi 101 - About Barramundi - Catching Stonefish - Native Creek Fish If there are no associated document sets, the service will simply return an empty result set. Document sets can be retrieved for the current level index entry as well as all index levels on an index which has more than 1 level. The default behavior will return document sets linked at all levels of the index entry. Retrieving document sets for the current level index entry only can be achieved by adding an additional filter **currentLevelDocsOnly** to the request DotCMIS sample ^^^^^^^^^^^^^^^ .. code-block:: C# /* Retrieve document sets associated with an index entry */ internal static List GetIndexEntryDocumentSets(IFolder indexEntry, ISession session, bool currentLevelDocsOnly = false) { var filters = new HashSet { "t1foldertype"}; // Restrict results returned to document sets only if (currentLevelDocsOnly) filters.Add("currentleveldocsonly"); var children = indexEntry.GetChildren(new OperationContext{ Filter = filters }); return children.Select(x => (IFolder)x).ToList(); } Request sample ^^^^^^^^^^^^^^ Return document sets for ALL levels of the index entry. :: GET http:/baseurl.net/x/Api/CMIS/IDXDOCCHILDTEST/children/?id=indexentry-2586-x-x-x-x-x-40&filter=t1foldertype%2Ccmis%3AobjectId%2Ccmis%3AbaseTypeId%2Ccmis%3AobjectTypeId&includeAllowableActions=true&includeRelationships=none&includePathSegment=true&maxItems=100&skipCount=0 HTTP/1.1 User-Agent: Apache Chemistry DotCMIS Authorization: Basic Y21pczpjbWlz Host: baseurl.net Return document sets for the current level of the index entry. :: GET http:/baseurl.net/x/Api/CMIS/IDXDOCCHILDTEST/children/?id=indexentry-2586-x-x-x-x-x-40&filter=t1foldertype%2Ccurrentleveldocsonly%2Ccmis%3AobjectId%2Ccmis%3AbaseTypeId%2Ccmis%3AobjectTypeId&includeAllowableActions=true&includeRelationships=none&includePathSegment=true&maxItems=100&skipCount=0 HTTP/1.1 User-Agent: Apache Chemistry DotCMIS Authorization: Basic Y21pczpjbWlz Host: baseurl.net Link an index entry to a document set """"""""""""""""""""""""""""""""""""" Index to Document Set linking samples have been moved to the :ref:`Document Set ` page. Create an Index to Index Link """"""""""""""""""""""""""""" The following code shows how index entries can be linked to each other. It is also referred to as creating an index link. Note that a role id is required to for this request. Roles can be found in the ``/OTHER/ROLES`` folder. C# Sample ^^^^^^^^^ .. code-block:: C# // DotCMIS Example public void CreateIndexLink(IFolder sourceIndexEntry, IFolder targetIndexEntry, long roleId) { Console.WriteLine(string.Format("Creating an index link between: {0} and {1} with the {2} as the role.", sourceIndexEntry.Id, targetIndexEntry.Id, roleId)); var indexLinkProperties = new Dictionary { { PropertyHelper.CreateCmisPropertyTargetId(null).PropertyDefinitionId, sourceIndexEntry.Id }, { PropertyHelper.CreateCmisPropertySourceId(null).PropertyDefinitionId, targetIndexEntry.Id }, { PropertyHelper.CreateCmisPropertyObjectTypeId(null).PropertyDefinitionId, SalesForceIntegration.Constants.TypeIds.T1IndexLinkType }, { "cmis:roleId", Configuration.RoleId } }; var indexEntryObjectId = Session.CreateItem(indexLinkProperties, new ObjectId("ROOTFOLDER")); } Request sample ^^^^^^^^^^^^^^ .. code-block:: xml POST https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/children/?id=ROOTFOLDER User-Agent: Apache Chemistry DotCMIS Authorization: Basic Q01JUzpDTUlTcXVhbGl0eQ== Host: ecmpartner.onespresso.net Content-Length: 929 urn:uuid:00000000-0000-0000-0000-00000000000 2017-08-07T23:42:42Z indexentry-9-x-x-x-x-x-57 indexentry-1-x-x-x-x-x-58 t1indexlinktype 123 Response sample ^^^^^^^^^^^^^^^ .. code-block:: xml HTTP/1.1 201 Created Cache-Control: private Content-Type: application/atom+xml;type=entry Location: https://ecmpartner.onespresso.net/T1Dev/CiAnywhere/Web/DEV/Api/CMIS/T1/object/?id=indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 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, 04 Jan 2017 03:25:11 GMT Content-Length: 6815 indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 Index Entry INDEXLINK-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 2017-08-08T09:43:05Z 2017-08-08T09:43:05Z 2017-08-08T09:43:05.3687997Z indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 cmis:item t1indexlinktype N/A 1900-01-01T00:00:00+10:00 N/A 1900-01-01T00:00:00+10:00 INDEXENTRY-9-X-X-X-X-X-57 INDEXENTRY-1-X-X-X-X-X-58 123 true false false true false false false false false false false false false false false false false false false false false false false false false false false false false .. _bulkindexindexlinks: Creating Index to Index Links in bulk """"""""""""""""""""""""""""""""""""" The following code shows how index entries can be linked to each other in bulk. Note that a role id is required to for this request. Roles can be found in the ``/OTHER/ROLES`` folder. A sourceId, targetId and a roleId MUST be provided for each link. DotCMIS Sample ^^^^^^^^^^^^^^ .. code-block:: C# // index=>index linking var props = new Dictionary() { { "cmis:objectTypeId", "t1indexlinktype" }, { "cmis:sourceId", new List { "indexentry-42705-x-x-x-x-x-520", "indexentry-42705-x-x-x-x-x-520", "indexentry-397351-x-x-x-x-x-521" } }, { "cmis:targetId", new List { "indexentry-2909410-x-x-x-x-x-11", "indexentry-2909421-x-x-x-x-x-11", "indexentry-42705-x-x-x-x-x-520" } }, { "cmis:roleId", new List { "132", "132", "133" } } }; var links = session.BulkUpdate(props); // returns a list of objectId Request sample ^^^^^^^^^^^^^^ .. code-block:: xml POST https://test.test.net/test.Web.Start/testSQL/Api/CMIS/T1/bulkupdate/ HTTP/1.1 Host: test.test.net Connection: keep-alive Content-Type: application/xml Authorization: Basic Y21pczpjbWlz urn:uuid:00000000-0000-0000-0000-00000000000 Test 2014-11-26T03:54:24.435Z t1indexlinktype indexentry-2909410-x-x-x-x-x-11 indexentry-2909421-x-x-x-x-x-11 indexentry-42705-x-x-x-x-x-520 indexentry-42705-x-x-x-x-x-520 indexentry-42705-x-x-x-x-x-520 indexentry-397351-x-x-x-x-x-521 132 132 133 Response sample ^^^^^^^^^^^^^^^ .. code-block:: xml HTTP/1.1 201 Created Cache-Control: private Content-Type: application/atom+xml;type=feed Server: Microsoft-IIS/10.0 Index Index Links c9c69ff7-cce6-4ffa-91ce-17b3b7cd4deb 2020-05-06T10:32:16Z false 3 indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 Index Entry indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 2020-05-06T10:32:16Z 2020-05-06T10:32:16Z 2020-05-06T10:32:16.8930459Z indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 cmis:item t1indexlinktype N/A 1900-01-01T00:00:00+10:00 N/A 1900-01-01T00:00:00+10:00 indexentry-2909410-x-x-x-x-x-11 indexentry-42705-x-x-x-x-x-520 132 true false false true false false false false false false false false false false false false false false false false false false false false false false false false false b7436360ded84ddbb48a1821e458ff39 indexlink-indexentry-2909410-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 Index Entry indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 2020-05-06T10:32:16Z 2020-05-06T10:32:16Z 2020-05-06T10:32:16.8930459Z indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 cmis:item t1indexlinktype N/A 1900-01-01T00:00:00+10:00 N/A 1900-01-01T00:00:00+10:00 indexentry-2909421-x-x-x-x-x-11 indexentry-42705-x-x-x-x-x-520 132 true false false true false false false false false false false false false false false false false false false false false false false false false false false false false de340e5aab8d4d738d93373d59b92cd8 indexlink-indexentry-2909421-x-x-x-x-x-11-indexentry-42705-x-x-x-x-x-520 indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 Index Entry indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 2020-05-06T10:32:16Z 2020-05-06T10:32:16Z 2020-05-06T10:32:16.8930459Z indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 cmis:item t1indexlinktype N/A 1900-01-01T00:00:00+10:00 N/A 1900-01-01T00:00:00+10:00 indexentry-42705-x-x-x-x-x-520 indexentry-397351-x-x-x-x-x-521 133 true false false true false false false false false false false false false false false false false false false false false false false false false false false false false 5b0c2a1cd44449f9988fef061a3c9c7e indexlink-indexentry-42705-x-x-x-x-x-520-indexentry-397351-x-x-x-x-x-521 Delete an Index to Index Link """"""""""""""""""""""""""""""""""""""""""" The following code shows how an index to index relationship can be removed. It is also referred to as deleting an index link. C# Sample ^^^^^^^^^ .. code-block:: C# // DotCMIS Example public void DeleteIndexLink(string sourceIndexEntryId, string targetIndexEntryId) { Console.WriteLine(string.Format("Deleting index link between: {0} and {1}.", sourceIndexEntryId, targetIndexEntryId)); var indexLink = string.Format("{0}-{1}-{2}", Constants.TypeIds.T1IndexLinkType, sourceIndexEntryId, targetIndexEntryId); Session.Delete(new ObjectId(indexLink)); } Request sample ^^^^^^^^^^^^^^ .. code-block:: text DELETE https://test.test.net/test/testSQL/Api/CMIS/T1/object/?id=indexlink-INDEXENTRY-9-X-X-X-X-X-57-INDEXENTRY-1-X-X-X-X-X-58 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 Response sample ^^^^^^^^^^^^^^^ .. code-block:: text HTTP/1.1 204 No Content Cache-Control: private Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET X-UA-Compatible: IE=edge Date: Tue, 18 Oct 2016 00:57:50 GMT