...
- Check out Apache Shindig.
- Apply CMIS patch to Shindig.
- Build Apache Shindig.
- Deploy Shindig to your favorite application server.
- Check out Apache Chemistry.
- Build Apache Chemistry using Maven.
- Via command line, navigate to the checked out Chemistry project.
- Run: mvn clean install -Dmaven.test.skip=true
- Deploy Apache Chemistry's in-memory repository to your favorite application server.
- The WAR file is located under chemistry-opencmis-server > chemistry-opencmis-server-inmemory > target.
- The patch is currently hardcoded to look for a CMIS repository at http://localhost:8081/repository, so deploy the WAR to port 8081 with context root "repository".
- For more information, refer to Chemistry's documentation for building and deploying the in-memory repository.
- Deploy Apache Chemistry's browser tool.
- The WAR file is located under chemistry-opencmis-test > chemistry-opencmis-test-browser-app > target.
- E.g. http://localhost:8081/repository/browser/
- Restart servers.
- Confirm environment setup.
- Point your browser to the CMIS browser tool (e.g. http://localhost:8081/repository/browser/browse)
- Enter *http://localhost:8081/repository/atom* into the browser tool.
- Verify you can browse the CMIS repository using the tool.
- Point your browser to the OpenSocial documents service (e.g. http://localhost:8080/social/rest/documents/john.doe/@self/1/)
- Verify that john's documents are returned (John may not have any documents, but shouldn't thrown an error).
...
Documents API
POST http://localhost:8080/social/rest/documents/john.doe/@self/1?parentId=100
- Posts a document for John Doe. The document's parent is identified by parentId [required].
- Example minimal POST body:
{
"properties":{
"cmis:name":{
"cardinality":"single",
"displayName":"CMIS Name Property",
"id":"cmis:name",
"localName":"cmis:name",
"queryName":"cmis:name",
"type":"STRING",
"value":"Erics Doc"
{color:#666666}},
"cmis:objectTypeId":{
"cardinality":"single",
"displayName":"CMIS Object Type Id Property",
"id":"cmis:objectTypeId",
"localName":"cmis:objectTypeId",
"queryName":"cmis:objectTypeId",
"type":"ID",
"value":"cmis:document"
{color:#666666}}
{color:#666666}}
}
GET http://localhost:8080/social/rest/documents/john.doe/@self/1
- Retrieves all of John Doe's documents
GET http://localhost:8080/social/rest/documents/john.doe/@self/1?documentId=136
- Retrieves John Doe's document with ID 136.
GET http://localhost:8080/social/rest/documents/john.doe/@self/1?documentId=136,137
- Retrieves John Doe's documents with IDs 136 and 137.
DELETE http://localhost:8080/social/rest/documents/john.doe/@self/1?documentId=136,137
- Deletes John Doe's documents with IDs 136 and 137.
Notes
- I used Apache Chemistry's InMemory Repository to build this patch. The repository that It's appropriate because it's lightweight and resets all data on each restart, like Shindig's JSON DB.
- The CMIS repository is currently hardcoded to point to http://localhost:8081/repository/atom in JsonDbOpensocialService.java. To change the repository, change this hardcoding (near the bottom of the file).
- The OpenSocial sample JSON DB is only persisting document & folder IDs; no document & folder metadata are being persisted in the JSON DB. This is to circumvent caching issues. If another user changes a document on the CMIS back-end, the OpenSocial metadata will become stale. By only persisting the document/folder ID, the latest document/folder metadata is retrieved from the server when requested.
References
11/30/2011 Update: We will be referencing the up-and-coming CMIS 1.1 draft spec for this work. This draft spec is here: CMIS 1.1 Draft Spec
...