<?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 Complex field cannot be updated? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/complex-field-cannot-be-updated/m-p/318989#M5990</link>
    <description>&lt;P&gt;I'm trying to update document's metadata by using  Nuxeo Automation Java Client. It's working on SimpleType fields but every try on complexType fields failed. I red it is possible by updating a document with the JSON values.
So I tried example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    // Fetch the document
Document document = (Document) session.newRequest(DocumentService.GetDocumentChild).setInput(new PathRef("/")).set("name", "testDoc").execute();
 
// Send the fields representation as json
 
// Read the json file
File fieldAsJsonFile = FileUtils.getResourceFileFromContext("creation.json");
String fieldsDataAsJSon = FileUtils.readFile(fieldAsJsonFile);
 
// Don't forget to replace CRLF or LF
fieldsDataAsJSon = fieldsDataAsJSon.replaceAll("\n", "");
fieldsDataAsJSon = fieldsDataAsJSon.replaceAll("\r", "");
 
// Set the json values to the related metadata
document.set("ds:fields", fieldsDataAsJSon);
 
// Document Update
session.newRequest(UpdateDocument.ID).setInput(document).set("properties",document).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Server is sending me back a message: "Property not found: ds:fields". Probably I'm using it wrong, but someone can tell how I should work with it properly?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2013 02:16:36 GMT</pubDate>
    <dc:creator>kapelan_</dc:creator>
    <dc:date>2013-12-11T02:16:36Z</dc:date>
    <item>
      <title>Complex field cannot be updated?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/complex-field-cannot-be-updated/m-p/318989#M5990</link>
      <description>&lt;P&gt;I'm trying to update document's metadata by using  Nuxeo Automation Java Client. It's working on SimpleType fields but every try on complexType fields failed. I red it is possible by updating a document with the JSON values.
So I tried example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    // Fetch the document
Document document = (Document) session.newRequest(DocumentService.GetDocumentChild).setInput(new PathRef("/")).set("name", "testDoc").execute();
 
// Send the fields representation as json
 
// Read the json file
File fieldAsJsonFile = FileUtils.getResourceFileFromContext("creation.json");
String fieldsDataAsJSon = FileUtils.readFile(fieldAsJsonFile);
 
// Don't forget to replace CRLF or LF
fieldsDataAsJSon = fieldsDataAsJSon.replaceAll("\n", "");
fieldsDataAsJSon = fieldsDataAsJSon.replaceAll("\r", "");
 
// Set the json values to the related metadata
document.set("ds:fields", fieldsDataAsJSon);
 
// Document Update
session.newRequest(UpdateDocument.ID).setInput(document).set("properties",document).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Server is sending me back a message: "Property not found: ds:fields". Probably I'm using it wrong, but someone can tell how I should work with it properly?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 02:16:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/complex-field-cannot-be-updated/m-p/318989#M5990</guid>
      <dc:creator>kapelan_</dc:creator>
      <dc:date>2013-12-11T02:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Complex field cannot be updated?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/complex-field-cannot-be-updated/m-p/318990#M5991</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 11:17:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/complex-field-cannot-be-updated/m-p/318990#M5991</guid>
      <dc:creator>Vladimir_Pasqui</dc:creator>
      <dc:date>2013-12-12T11:17:54Z</dc:date>
    </item>
  </channel>
</rss>

