...
- Deletes John Doe's documents with IDs 136 and 137.
Folders API
POST http://localhost:8080/social/rest/folders/john.doe/@self/1?parentId=100
- Creates a folder whose parent is identified by parentId. If no parentId is given, the folder is created under the repository root folder.
- Example minimal POST body:
Code Block |
---|
{
"properties": {
"cmis:objectTypeId": {
"id": "cmis:objectTypeId",
"localName": "cmis:objectTypeId",
"queryName": "cmis:objectTypeId",
"value": "cmis:folder",
"displayName": "CMIS Object Type Id Property",
"type": "ID",
"cardinality": "single"
}, {
"cmis:name": {
"id": "cmis:name",
"localName": "cmis:name",
"queryName": "cmis:name",
"value": "Erics Folder 2",
"displayName": "CMIS Name Property",
"type": "STRING",
"cardinality": "single"
}
}
}
|
PUT http://localhost:8080/social/rest/folders/john.doe/@self/1?folderId=139
- Updates the folder, identified by folderId. The PUT body is the same as the POST body (but with updated properties).
DELETE http://localhost:8080/social/rest/folders/john.doe/@self/1?folderId=139
- Delets the folder, identified by folderId.
GET http://localhost:8080/social/rest/folders/john.doe/@self/1
- Gets all of John Doe's folders.
GET http://localhost:8080/social/rest/folders/john.doe/@self/1?folderId=139
- Gets John Doe's folder with ID=139.
GET http://localhost:8080/social/rest/folders/john.doe/@self/1?folderId=139,140
- Gets John Doe's folders with IDs 139 and 140.
Notes
- I used Apache Chemistry's InMemory Repository to build this patch. 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.
...