Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Check out Apache Shindig.
  2. Apply CMIS patch to Shindig.
  3. Build Apache Shindig.
  4. Deploy Shindig to your favorite application server.
  5. Check out Apache Chemistry.
  6. Build Apache Chemistry using Maven.
    1. Via command line, navigate to the checked out Chemistry project.
    2. Run: mvn clean install -Dmaven.test.skip=true
  7. Deploy Apache Chemistry's in-memory repository to your favorite application server.
    1. The WAR file is located under chemistry-opencmis-server > chemistry-opencmis-server-inmemory > target.
    2. 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".
    3. For more information, refer to Chemistry's documentation for building and deploying the in-memory repository.
  8. Deploy Apache Chemistry's browser tool.
    1. The WAR file is located under chemistry-opencmis-test > chemistry-opencmis-test-browser-app > target.
    2. E.g. http://localhost:8081/repository/browser/
  9. Restart servers.
  10. Confirm environment setup.
    1. Point your browser to the CMIS browser tool (e.g. http://localhost:8081/repository/browser/browse)
    2. Enter *http://localhost:8081/repository/atom* into the browser tool.
    3. Verify you can browse the CMIS repository using the tool.
    4. Point your browser to the OpenSocial documents service (e.g. http://localhost:8080/social/rest/documents/john.doe/@self/1/)
    5. 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

...