...
Note: The behaviour of DocIntegrate is influenced by the <editableFileTypes> key in the settings.xml file in /Workspace/Settings/ of your repository.
Please check the information given here to access a document for editing.
...
To download a document from the DMS, you can use the following endpoint:
Code Block |
---|
http://<cbserverip><nuxeoserverip>:<cbport><casebrowserport>/casebrowser/download//<caseRef>,<documentUID>/true |
Note: This is a casebrowser endpoint so you need to use the casebrowser server IP and port.
To get the documentUID from the document's path, you can run a http POST against the Document.Fetch Query endpoint of the DMS:
Code Block |
---|
curl -X POST \ http://<nuxeoserverip>:<nuxeoport>/nuxeo/api/v1/automation/Document.Query \ -H "'authorization: Basic <userAndPassEncoded>"' \ -H "Content'content-Typetype: application/json"' \ -d "'{\"params\":{\"query"value\":\"/default-domain/workspaces/Patricia/<documentPath>/<documentName>\"}}" \ -X POST http://<nuxeoserverip>:<nuxeoport>/nuxeo/api/v1/automation/Document.Fetch:"SELECT * FROM Document WHERE dc:title='\''<documentName>'\'' AND ecm:path STARTSWITH '\''<casePath>'\''"}}' |
Here, the <userAndPassEncoded> represents a Base64 encoded string of the format 'Username:Password'. So, 'Username:Password' would be represented as 'VXNlcm5hbWU6UGFzc3dvcmQ='.
To determine the <documentPath>, please see below. The <documentName> of a specific document can be found in PAT_DOC_LOG.DOC_FILE_NAME of the Patricia database.
The Document.Fetch Query endpoint returns a strong an array of the documents in JSON format, for example:
Code Block |
---|
{ "entity-type": "documents", "isPaginable": true, "resultsCount": 1, "pageSize": 0, "maxPageSize": 1000, "currentPageSize": 1, "currentPageIndex": 0, "numberOfPages": 1, "isPreviousPageAvailable": false, "isNextPageAvailable": false, "isLastPageAvailable": false, "isSortable": true, "hasError": false, "errorMessage": null, "totalSize": 1, "pageIndex": 0, "pageCount": 1, "entries": [ { "entity-type": "document", "repository": "default", "uid": "1241650864acbaf8-5414c963-4eb046a6-9452a5fc-10f2c368e222a7e703826625", "path": "/default-domain/workspaces/Patricia/doc/Documents/2/1000/DE/00/Sample.docx", "type": "File", "state": "deletedproject", "parentRef": "c188a02a650d7a6c-185a9927-45c94485-983585c4-28c01bbcf8954d2cc9b9f08f", "isCheckedOut": true, "changeToken": "15078900290761529682744601", "title": "docSample.docx", "lastModified": "20172018-1006-13T1022T15:2052:2924.07Z60Z", "facets": [ "Versionable", "Publishable", "Commentable", "PiFileFacet", "PiFacet", "HasRelatedText", "Downloadable" ] } ] } |
From this, you can extract the "uid" value.
Since DMS version 1.9.8.2.3-3, the download endpoint allows downloading of multiple documents as follows:
Code Block |
---|
http://<nuxeoserverip>:<nuxeoport>/casebrowser/download/<caseRef1>,<documentUID1>;<caseRef2>,<documentUID2>;<caseRef3>,<documentUID3>;.../true |
Creating a document in the DMS
...
To determine the <documentPath>, please see below. The <docName> is the name that the new document has as per the creation of the container above.
Note:
For the above document creation to work, <documentPath> must exist. As the case may be, you may require creation of the folder path as follows:
Code Block |
---|
curl \
-H "authorization: Basic <...>" \
-H "Content-Type: application/json" \
-d "{\"params\":{\"entity-type\":\"document\",\"type\":\"Folder\",\"name\":\"<folderName>\",\"input\":\"/default-domain/workspaces/Patricia/<folderPath>\"}" \
-X POST http://<nuxeoserverip>:<nuxeoport>/nuxeo/api/v1/automation/Document.Create |
whereby <folderPath>/<folderName> will be created. Note that the folder tree needs to be build recursively (i.e. <folderPath> must also exist).
Deleting a document from the DMS
...