1.2.4.1.3. Content Symlinks

Symlinks are used to organize the virtual access to documents in Content, which is implemented like links in Unix/Linux/Mac OS (refer to ln command for more details).

Note

JCR exo:symlink nodetype is used for such nodetypes.

Use Case: Follow Symlinks

  1. Log in to the ACME website as a user with the developer role.

  2. Open GroupSites ExplorerSites Management, go to the /acme/documents folder.

  3. Upload any file (for example test.txt) to /acme/documents.

  4. Add this file to the powers/News category. It will create a symlink to /acme/documents/test.txt in /acme/categories/powers/News.

  5. Get content of the /acme/categories/powers/News folder via CMIS:

    curl -o news.xml -u root:gtn http://localhost:8080/rest/private/cmisatom/Managed%20Sites/objectbypath?path=/acme/categories/powers/News

The requested file (products.xml) contains the entry with information about the folder.


<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
    <id>f59a3539c0a80003625790bdadf566c5</id>
    <published>2010-09-09T18:11:57.707Z</published>
    <updated>2010-09-09T18:11:57.707Z</updated>
    <summary type="text"/>
    <author>
        <name>system</name>
    </author>
    <title type="text">News</title>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites" rel="service" type="application/atomsvc+xml"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f59a3539c0a80003625790bdadf566c5" rel="self"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f59a3539c0a80003625790bdadf566c5" rel="edit"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/typebyid/exo%3Ataxonomy" rel="describedby" type="application/atom+xml; type=entry"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/allowableactions/f59a3539c0a80003625790bdadf566c5" rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" type="application/cmis+xml; type=allowableActions"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/relationships/f59a3539c0a80003625790bdadf566c5" rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" type="application/atom+xml; type=feed"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/policies/f59a3539c0a80003625790bdadf566c5" rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" type="application/atom+xml; type=feed"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/objacl/f59a3539c0a80003625790bdadf566c5" rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" type="application/cmisacl+xml"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/children/f59a3539c0a80003625790bdadf566c5" rel="down" type="application/atom+xml; type=feed"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/descendants/f59a3539c0a80003625790bdadf566c5" rel="down" type="application/cmistree+xml"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/foldertree/f59a3539c0a80003625790bdadf566c5" rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" type="application/atom+xml; type=feed"/>
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f59a3533c0a8000339af97059f243a25" rel="up" type="application/atom+xml; type=entry"/>
    <content type="text">News</content>
    <cmisra:object xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
    <cmis:properties>
     <cmis:propertyId displayName="cmis:allowedChildObjectTypeIds" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds" queryName="cmis:allowedChildObjectTypeIds"/>
     <cmis:propertyString displayName="cmis:path" localName="cmis:path" propertyDefinitionId="cmis:path" queryName="cmis:path">
        <cmis:value>/acme/categories/powers/News</cmis:value>
     </cmis:propertyString>
     <cmis:propertyId displayName="cmis:objectTypeId" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="cmis:objectTypeId">
        <cmis:value>exo:taxonomy</cmis:value>
     </cmis:propertyId>
     <cmis:propertyString displayName="cmis:lastModifiedBy" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="cmis:lastModifiedBy"/>
     <cmis:propertyString displayName="cmis:name" localName="cmis:name" propertyDefinitionId="cmis:name" queryName="cmis:name">
        <cmis:value>News</cmis:value>
     </cmis:propertyString>
     <cmis:propertyString displayName="cmis:createdBy" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy" queryName="cmis:createdBy"/>
     <cmis:propertyId displayName="cmis:objectId" localName="cmis:objectId" propertyDefinitionId="cmis:objectId" queryName="cmis:objectId">
        <cmis:value>f59a3539c0a80003625790bdadf566c5</cmis:value>
     </cmis:propertyId>
     <cmis:propertyDateTime displayName="cmis:creationDate" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate" queryName="cmis:creationDate"/>
     <cmis:propertyString displayName="cmis:changeToken" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken" queryName="cmis:changeToken"/>
     <cmis:propertyId displayName="cmis:baseTypeId" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="cmis:baseTypeId">
        <cmis:value>cmis:folder</cmis:value>
     </cmis:propertyId>
     <cmis:propertyId displayName="cmis:parentId" localName="cmis:parentId" propertyDefinitionId="cmis:parentId" queryName="cmis:parentId">
        <cmis:value>f59a3533c0a8000339af97059f243a25</cmis:value>
     </cmis:propertyId>
     <cmis:propertyDateTime displayName="cmis:lastModificationDate" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="cmis:lastModificationDate"/>
    </cmis:properties>
    <cmis:acl/>
    <cmis:exactACL>false</cmis:exactACL>
    <cmis:policyIds/>
    <cmis:rendition/>
    </cmisra:object>
</entry>

To get the file which has been uploaded above, use the children service to get the list of child nodes of /acme/documents. Find this service URL in the response XML above:

curl -o childs.xml -u root:gtn http://localhost:8080/rest/private/cmisatom/Managed%20Sites/children/f59a3539c0a80003625790bdadf566c5

In the requested file (childs.xml), find the entry related to test.txt file uploaded via the Sites Explorer. Search for the "test.txt" name by title.


<entry xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
  <id>f708e208c0a80003554babb97bd934ba</id>
  <published>2010-09-09T18:06:31.987Z</published>
  <updated>2010-09-09T18:06:31.987Z</updated>
  <summary type="text"/>
  <author>
     <name>system</name>
  </author>
  <title type="text">test.txt</title>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites" rel="service" type="application/atomsvc+xml"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f708e208c0a80003554babb97bd934ba" rel="self"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f708e208c0a80003554babb97bd934ba" rel="edit"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/typebyid/cmis%3Adocument" rel="describedby" type="application/atom+xml; type=entry"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/allowableactions/f708e208c0a80003554babb97bd934ba" rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" type="application/cmis+xml; type=allowableActions"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/relationships/f708e208c0a80003554babb97bd934ba" rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" type="application/atom+xml; type=feed"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/policies/f708e208c0a80003554babb97bd934ba" rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" type="application/atom+xml; type=feed"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/objacl/f708e208c0a80003554babb97bd934ba" rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" type="application/cmisacl+xml"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/versions/f708a0f1c0a8000333e3681f99fab760" rel="version-history" type="application/atom+xml; type=feed"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/object/f708e208c0a80003554babb97bd934ba?returnVersion=latest" rel="current-version" type="application/atom+xml; type=entry"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/parents/f708e208c0a80003554babb97bd934ba" rel="up" type="application/atom+xml; type=feed"/>
  <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/file/f708e208c0a80003554babb97bd934ba" rel="edit-media"/>
  <content src="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/file/f708e208c0a80003554babb97bd934ba" type="text/plain"/>
  <cmisra:object xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
     <cmis:properties>
        <cmis:propertyBoolean displayName="cmis:isLatestMajorVersion" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion" queryName="cmis:isLatestMajorVersion">
           <cmis:value>false</cmis:value>
        </cmis:propertyBoolean>
        <cmis:propertyInteger displayName="cmis:contentStreamLength" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength" queryName="cmis:contentStreamLength">
           <cmis:value>38</cmis:value>
        </cmis:propertyInteger>
        <cmis:propertyId displayName="cmis:contentStreamId" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId" queryName="cmis:contentStreamId">
           <cmis:value>f708a0c2c0a800033bedeb35caddeed1</cmis:value>
        </cmis:propertyId>
        <cmis:propertyId displayName="cmis:objectTypeId" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="cmis:objectTypeId">
           <cmis:value>cmis:document</cmis:value>
        </cmis:propertyId>
        <cmis:propertyString displayName="cmis:versionSeriesCheckedOutBy" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy" queryName="cmis:versionSeriesCheckedOutBy"/>
        <cmis:propertyId displayName="cmis:versionSeriesCheckedOutId" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId" queryName="cmis:versionSeriesCheckedOutId"/>
        <cmis:propertyString displayName="cmis:name" localName="cmis:name" propertyDefinitionId="cmis:name" queryName="cmis:name">
           <cmis:value>test.txt</cmis:value>
        </cmis:propertyString>
        <cmis:propertyString displayName="cmis:contentStreamMimeType" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType" queryName="cmis:contentStreamMimeType">
           <cmis:value>text/plain</cmis:value>
        </cmis:propertyString>
        <cmis:propertyId displayName="cmis:versionSeriesId" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId" queryName="cmis:versionSeriesId">
           <cmis:value>f708a0f1c0a8000333e3681f99fab760</cmis:value>
        </cmis:propertyId>
        <cmis:propertyDateTime displayName="cmis:creationDate" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate" queryName="cmis:creationDate">
           <cmis:value>2010-09-09T18:06:31.987Z</cmis:value>
        </cmis:propertyDateTime>
        <cmis:propertyString displayName="cmis:changeToken" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken" queryName="cmis:changeToken"/>
        <cmis:propertyBoolean displayName="cmis:isLatestVersion" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion" queryName="cmis:isLatestVersion">
           <cmis:value>true</cmis:value>
        </cmis:propertyBoolean>
        <cmis:propertyString displayName="cmis:versionLabel" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel" queryName="cmis:versionLabel">
           <cmis:value>latest</cmis:value>
        </cmis:propertyString>
        <cmis:propertyBoolean displayName="cmis:isVersionSeriesCheckedOut" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut" queryName="cmis:isVersionSeriesCheckedOut">
           <cmis:value>false</cmis:value>
        </cmis:propertyBoolean>
        <cmis:propertyString displayName="cmis:lastModifiedBy" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="cmis:lastModifiedBy"/>
        <cmis:propertyString displayName="cmis:createdBy" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy" queryName="cmis:createdBy"/>
        <cmis:propertyString displayName="cmis:checkinComment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment" queryName="cmis:checkinComment"/>
        <cmis:propertyId displayName="cmis:objectId" localName="cmis:objectId" propertyDefinitionId="cmis:objectId" queryName="cmis:objectId">
           <cmis:value>f708e208c0a80003554babb97bd934ba</cmis:value>
        </cmis:propertyId>
        <cmis:propertyBoolean displayName="cmis:isImmutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable" queryName="cmis:isImmutable">
           <cmis:value>false</cmis:value>
        </cmis:propertyBoolean>
        <cmis:propertyBoolean displayName="cmis:isMajorVersion" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion" queryName="cmis:isMajorVersion">
           <cmis:value>false</cmis:value>
        </cmis:propertyBoolean>
        <cmis:propertyId displayName="cmis:baseTypeId" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="cmis:baseTypeId">
           <cmis:value>cmis:document</cmis:value>
        </cmis:propertyId>
        <cmis:propertyString displayName="cmis:contentStreamFileName" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName" queryName="cmis:contentStreamFileName">
           <cmis:value>test.txt</cmis:value>
        </cmis:propertyString>
        <cmis:propertyDateTime displayName="cmis:lastModificationDate" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="cmis:lastModificationDate">
           <cmis:value>2010-09-09T18:06:31.987Z</cmis:value>
        </cmis:propertyDateTime>
     </cmis:properties>
     <cmis:acl/>
     <cmis:exactACL>false</cmis:exactACL>
     <cmis:policyIds/>
     <cmis:rendition/>
  </cmisra:object>
</entry>

Then, get the test.txt file content via CMIS by using the file service and id of the test.txt file from childs.xml:

curl -o test.txt -u root:gtn http://localhost:8080/rest/private/cmisatom/Managed%20Sites/file/f708e208c0a80003554babb97bd934ba

Get results in the test.txt file in the local folder. In this way, you will get file stored in the Sites Explorer to the /acme/documents/test.txt file via eXo CMIS by the /acme/categories/powers/News/test.txt symlink path. As file's actual content referenced by id in CMIS, the path has no matter for content read or change.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus