5.4.1.3. Content symlinks

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

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).

Via CMIS, you can get a file using its symlink as well as its real path.

Note

Nodetype of symlinks is exo:symlink.

Use Case: Follow Symlinks

  1. Log in intranet website as a developer role.

  2. Go to AdministrationContentSites ExplorerSites Management on the administration bar, then select /intranet/documents folder.

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

  4. Go to /intranet/categories/intranet and add a new category: /intranet/categories/intranet/news.

  5. Back to /intranet/documents/test.txt and add this file to that category. This will create a symlink of /intranet/documents/test.txt in /intranet/categories/intranet/news.

  6. Get content of the /intranet/categories/intranet/news folder via CMIS:

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

    The output file (news.xml) contains the entry with information about the folder, in which you will find a link (to get children) like this:

    
    <link href="http://localhost:8080/rest/private/cmisatom/Managed%20Sites/children/03dcf0827f00000100cf3b9a4cbf3de4" rel="down" type="application/atom+xml; type=feed"/>
  7. Get the children of /intranet/categories/intranet/news using that link:

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

    The output file (children.xml contains an entry (related to test.txt) that has an ID:

    
    <entry>
        <id>03dd409c7f000001010b7e050789d358</id>
        ...
        <title type="text">test.txt</title>
        ...
    </entry>
  8. Finally get the test.txt file by using file service and the ID:

    curl -o test.txt -u root:gtn http://localhost:8080/rest/private/cmisatom/Managed%20Sites/file/03dd409c7f000001010b7e050789d358
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus