chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <>
Subject Re: Alfresco, OpenCMIS and urls
Date Wed, 01 Jun 2011 11:34:29 GMT
Hi Per-Erik,

The CMIS path is relative to the CMIS root folder ("/") which maps to the folder hierarchy
inside the repository. If this path can be mapped to a URL is repository specific and not
defined by CMIS.
The Web Services binding does not provide a content URL. The AtomPub binding does, but it
might not include the path at all.

The AtomPub content URL is not exposed through the high level API of OpenCMIS. You can access
the URL through the low level API but I don't recommend it. There are all kinds of issues...
Nevertheless, the following code snippet shows how to get hold of the content URL:

String docId = ... // document id
String url = null; // content URL
CmisBinding binding = session.getBinding(); // low level API

if (binding.getObjectService() instanceof LinkAccess) {
  url = ((LinkAccess) binding.getObjectService()).loadContentLink(session.getRepositoryInfo().getId(),


On 24/05/2011 13:54, Per-Erik Svensson wrote:
> Hi people,
> I'm currently trying to understand the chemistry client APIs. The backend
> I'm connecting to is Alfresco and what I would like to know is how to get
> the full URL for folders and documents. The
> org.apache.chemistry.opencmis.client.api.Folder.getPath() and
> Document.getPaths() only returns relative paths and the problem is that I
> have no idea what it is relative to. This might be an Alfresco specific
> question but as I have very little experience from CMIS I'm trying here
> first (and appologies if this is the wrong place).
> So, is there any way to get the full "content url", that is, a url that i
> can paste into a web-browser to get to the document/folder?
> I know the information is in there somewhere because I did this before
> (while managing my own REST-calls/XML-parsing, not using chemistry) but I
> seem to be at a loss on how to do it from the client api of chemistry.
> Best Regards,
> Per-Erik Svensson

View raw message