<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I compose the Automation Client request for Picture.Create (in 5.4.3) in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318603#M5604</link>
    <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Can you tell me how to compose "???".&lt;/P&gt;
&lt;P&gt;My (pseudo)code so far looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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();
	}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Nov 2011 11:31:29 GMT</pubDate>
    <dc:creator>neilbelford_</dc:creator>
    <dc:date>2011-11-16T11:31:29Z</dc:date>
    <item>
      <title>How do I compose the Automation Client request for Picture.Create (in 5.4.3)</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318603#M5604</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Can you tell me how to compose "???".&lt;/P&gt;
&lt;P&gt;My (pseudo)code so far looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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();
	}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Nov 2011 11:31:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318603#M5604</guid>
      <dc:creator>neilbelford_</dc:creator>
      <dc:date>2011-11-16T11:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compose the Automation Client request for Picture.Create (in 5.4.3)</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318604#M5605</link>
      <description>&lt;P&gt;You have an example of how to do that &lt;A href="http://doc.nuxeo.com/x/vwIz"&gt;here&lt;/A&gt; into the section "Blob upload example".&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2012 14:53:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318604#M5605</guid>
      <dc:creator>Benjamin_Jalon1</dc:creator>
      <dc:date>2012-03-16T14:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compose the Automation Client request for Picture.Create (in 5.4.3)</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318605#M5606</link>
      <description>&lt;P&gt;Answer above is correct, sorry about minus vote, cant correct it.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2012 03:44:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-compose-the-automation-client-request-for-picture/m-p/318605#M5606</guid>
      <dc:creator>neilbelford_</dc:creator>
      <dc:date>2012-03-30T03:44:30Z</dc:date>
    </item>
  </channel>
</rss>

