I'm a GSoC'13 intern. I'm working on developing a CMIS UCP for Apache OpenOffice. I wanted to know how to divide a url into its parts. To fill the session parameters I need the url + path of the object in repo. separately. Is there any other way?
Asked
Active
Viewed 416 times
0
-
Normally you just want the URL of the AtomPub (or other) binding endpoint, then you get everything from that. What exactly are you trying to do? – Gagravarr Jun 24 '13 at 13:38
-
I dont want to ask for atompub url and the path of the object separately. I want it in a single path. for example a folder stored on: http://localhost:8080/inmemory/atom with path /My_Folder-0-0 in repository A1, should be represented by http://localhost:8080/inmemory/atom/A1/My_Folder-0-0 . So, I want to make use of an existing scheme, or define one myself. – Rajath S Jun 26 '13 at 18:45
-
How would the user know such a (possibly made up) URL thought? Surely all they'd know is the CMIS endpoint, and possibly the path? – Gagravarr Jun 26 '13 at 20:02
1 Answers
1
If you know the path of an object, you can retrieve it using getObjectByPath, which is a method on org.apache.chemistry.opencmis.client.api.Session.
If you have an object and you want to know its path, you can call the object's getPaths() method, which returns a list of paths for the object (in repositories that support multi-filing, documents can have multiple paths, but folders can never be multi-filed).
The actual URL you would construct to navigate directly to the object using its path is repository-specific, unless you are using the browser binding (new in CMIS 1.1). But there aren't any production implementations of the CMIS 1.1 browser binding yet.

Jeff Potts
- 10,468
- 17
- 40
-
Is there a way to request the repository to return the url scheme it follows? – Rajath S Jun 26 '13 at 18:50
-
Using the Atom Pub binding you can invoke the repository's service URL, then inspect the cmisra:uritemplate elements that come back. There is one with a cmisra:type of "objectbypath" that might be useful to you for this. – Jeff Potts Jul 01 '13 at 18:44