11-16-2011 03:31 AM
I can create a Picture document without content. I cant pass the correct string for the property "originalPicture=???" According to the fairly terse doco in org.nuxeo.ecm.automation.core.operations.services.CreatePicture.java , "???" should be a JSON encoded JPEG.
Can you tell me how to compose "???".
My (pseudo)code so far looks like this
public void createPictureExample()
{
HttpAutomationClient client = new HttpAutomationClient( "http://localhost:8080/nuxeo/site/automation");
Session session = client.getSession("Administrator", "Administrator");
Document root = null;
try {
root = (Document) session.newRequest("Document.Fetch").set(
"value", "/").execute();
} catch (Exception e) {
e.printStackTrace();
}
File file = getThePictureToUpload();
FileBlob fb = new FileBlob(file);
fb.setMimeType("image/jpeg");
// do something with fb here to JSON encode it
try {
session.newRequest("Picture.Create")
.setInput(root)
.set("name", "mypicture4")
.set("properties", "originalPicture=???\ndc:title=My Picture4").execute();
} catch (Exception e) {
e.printStackTrace();
}
03-16-2012 07:53 AM
You have an example of how to do that here into the section "Blob upload example".
03-16-2012 07:53 AM
You have an example of how to do that here into the section "Blob upload example".
03-29-2012 08:44 PM
Answer above is correct, sorry about minus vote, cant correct it.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.