thanks that code was very helpful
I also have other questions, all of them linked with the
topic of Automation client, I already red the example
posted in the page
https://doc.nuxeo.com/display/NXDOC/Using+Nuxeo+Automation+Client
// Get The Root
Document root = (Document)
session.newRequest("Document.Fetch").set(
"value", "/").execute();
// Create a File Document
session.newRequest("Document.Create").setInput(root).set("type
", "File").set(
"name", "myfile").set("properties",
"dc:title=My File").execute();
// Upload The file
File file = getTheFileToUpload();
FileBlob fb = new FileBlob(file);
fb.setMimeType("text/xml");
// uploading a file will return null since we used
HEADER_NX_VOIDOP
session.newRequest("Blob.Attach").setHeader(
Constants.HEADER_NX_VOIDOP,
"true").setInput(fb)
.set("document", "/myfile").execute();
// Get the file document where blob was attached
Document doc = (Document) session.newRequest(
"Document.Fetch").setHeader(
Constants.HEADER_NX_SCHEMAS,
"*").set("value", "/myfile").execute();
// get the file content property
PropertyMap map =
doc.getProperties().getMap("file:content");
// get the data URL
String path = map.getString("data");
// download the file from its remote location
blob = (FileBlob) session.getFile(path);
// ... do something with the file
// at the end delete the temporary file
blob.getFile().delete();
In the code section "Get The Root" , Is there where we
create the path to later save the file in there? Does this
mean that if I wanted a path like this /templates/folder1 I
would have to code this, Document root = (Document)
session.newRequest("Document.Fetch").set("value",
"/templates/folder1").execute(); ?
If I create a path and I upload a file, How can I see this
path and this file? Is there any way to see it using nuxeo
shell or something else? Can I modify or download any
path/file that is in any domain in my nuxeo server?
---
Mailing list: [email protected]
Forum: http://forum.nuxeo.org/f/1/