Document.BlobGet VS Repository.GetDocument

Can someone explain to me the difference between Blob.Get and Document.Fetch or nowadays called: Document.GetBlob and Repository.GetDocument ?

At first I was under the impression that getDocument would download the document and getBlob could download attachments to a document, but this seems to be wrong when I play with it using the REST API (in PHP).

Document.Fetch results in my case in an object with meta-data of the document instead of the document itself.

Blob.Get results in error 666 (no message!) in my own code. Next I tried PHP samplecode B5bis.php which I adapted to my own situation (I changed the filename/path to fit to the contents of my Nuxeo server). This resulted in:

http-bio-0.0.0.0-8080-exec-382] [org.nuxeo.ecm.webengine.app.WebEngineExceptionMapper] Exception in JAX-RS process

which originates from:

> ****** chain ******
Name: Document.GetBlob
Aliases: [Blob.Get]
Exception: TypeAdaptException
Caught error: org.nuxeo.ecm.core.api.DocumentNotFoundException: /default-domain/workspaces/Trial workspace/Olympia/mydoc.pdf
Caused by: org.nuxeo.ecm.core.api.DocumentNotFoundException: /default-domain/workspaces/Trial workspace/Olympia/mydoc.pdf
        org.nuxeo.ecm.automation.core.operations.blob.GetDocumentBlob
0 votes

1 answers

2987 views

ANSWER



Repository.GetDocument retrieves the document : system info and properties (schemas)

whereas Document.GetBlob retrieves one of the binary file associated with a document

0 votes



pibou Bouvret: thanks for the confirmation.

Regarding the errors: there was a typo in my code , instead of . which caused these issue. Hard to spot given the error. Now it works ok.

05/26/2016