AnsweredAssumed Answered

Retrieving associations over CMIS

Question asked by gehriga on Nov 25, 2009
Latest reply on Apr 27, 2011 by fupduck
Hi there,

right now I'm trying to build an application based on Alfresco, connected over its CMIS API.
My current problem while testing the API is following:

How can I retrieve a (child-)association of a document via CMIS? I'm able to retrieve properties, child documents of folders, but no associations on custom document types.

Here's an example of my type definition:
<type name="hits:DownloadTeaser">
   <title>DownloadTeaser</title>
   <parent>hits:Content</parent>
   <associations>
      <child-association name="hits:DownloadTeaser:Headline">
         <title>DownloadTeaser:Headline</title>
         <source>
            <mandatory>false</mandatory>
            <many>false</many>
         </source>
         <target>
            <class>hits:binaryLanguageContent</class>
            <mandatory>false</mandatory>
            <many>false</many>
         </target>
      </child-association>
   </associations>
</type>
After creating the linked target content of type binaryLanguageContent I have linked it to the main document of type DownloadTeaser in the Web Client. By accessing the main document via CMIS I don't get any hint on how to retrieve the linked target document.

Here's what is returned by accessing the document:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="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:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org">
<author><name>admin</name></author>
<content type="text/plain" src="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/content'/><id>urn:uuid:845410d9-03de-4595-a71d-86854ba09e0d</id>
<link rel="self" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d'/>
<link rel="enclosure" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/content" type="text/plain"/>
<link rel="edit" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d'/>
<link rel="edit-media" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/content" type="text/plain"/>
<link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/allowableactions'/>
<link rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/rels'/>
<link rel="up" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/parents" type="application/atom+xml;type=feed"/>
<link rel="version-history" href="http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/845410d9-03de-4595-a71d-86854ba09e0d/versions'/>
<link rel="describedby" href="http://localhost:8080/alfresco/service/cmis/type/D:hits:binaryLanguageContent'/>
<link rel="service" href="http://localhost:8080/alfresco/service/cmis'/>
<published>2009-11-25T10:09:55.200+01:00</published>
<summary></summary>
<title>headline</title>
<updated>2009-11-25T10:27:02.492+01:00</updated>
<app:edited>2009-11-25T10:27:02.492+01:00</app:edited>
<alf:icon>http://localhost:8080/alfresco/images/filetypes/_default.gif</alf:icon>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>D:hits:binaryLanguageContent</cmis:value></cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:checkinComment"/>
<cmis:propertyDateTime propertyDefinitionId="cmis:lastModificationDate"><cmis:value>2009-11-25T10:27:02.492+01:00</cmis:value></cmis:propertyDateTime>
<cmis:propertyBoolean propertyDefinitionId="cmis:isImmutable"><cmis:value>false</cmis:value></cmis:propertyBoolean>
<cmis:propertyString propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/>
<cmis:propertyString propertyDefinitionId="cmis:versionLabel"/>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean>
<cmis:propertyString propertyDefinitionId="cmis:createdBy"><cmis:value>admin</cmis:value></cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:name"><cmis:value>headline</cmis:value></cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:baseTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamFileName"><cmis:value>headline</cmis:value></cmis:propertyString>
<cmis:propertyId propertyDefinitionId="cmis:contentStreamId"><cmis:value>cm:content</cmis:value></cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamMimeType"><cmis:value>text/plain</cmis:value></cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:changeToken"/>
<cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength"><cmis:value>0</cmis:value></cmis:propertyInteger>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesCheckedOutId"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesId"><cmis:value>workspace://SpacesStore/845410d9-03de-4595-a71d-86854ba09e0d</cmis:value></cmis:propertyId>
<cmis:propertyId propertyDefinitionId="cmis:objectId"><cmis:value>workspace://SpacesStore/845410d9-03de-4595-a71d-86854ba09e0d</cmis:value></cmis:propertyId>
<cmis:propertyDateTime propertyDefinitionId="cmis:creationDate"><cmis:value>2009-11-25T10:09:55.200+01:00</cmis:value></cmis:propertyDateTime>
<cmis:propertyBoolean propertyDefinitionId="cmis:isMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean>
<cmis:propertyString propertyDefinitionId="cmis:lastModifiedBy"><cmis:value>admin</cmis:value></cmis:propertyString>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean>
<cmis:propertyBoolean propertyDefinitionId="cmis:isVersionSeriesCheckedOut"><cmis:value>false</cmis:value></cmis:propertyBoolean>
</cmis:properties>
</cmisra:object>
<cmisra:pathSegment>headline</cmisra:pathSegment>
</entry>
Anyone out there who can answer this?
Thanks!

Outcomes