<?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 Re: Nuxeo 5.8 - Single document suggestion - doc schema dublin core not all fields visible in inline JavaScript in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321654#M8655</link>
    <description>&lt;P&gt;Hello me,&lt;/P&gt;
&lt;P&gt;First I did Json neewbie investigations :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function myFormatter(entry) {
var markup = JSON.stringify(entry);
return markup;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This method show ALL the properties that exist in the objet of work named "entry".&lt;/P&gt;
&lt;P&gt;In the properties it looks like that xpath value are not such as default value.&lt;/P&gt;
&lt;P&gt;Default values are: entity-type, type, state, versionLabel, title, lastModified, path, isCheckedOut,repository,uid...&lt;/P&gt;
&lt;P&gt;And then comes "properties" that is hashMap Json.
Here a function to read a special tab in entry.properties and also show a classic propertie "path"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function myFormatter(entry) {
var markup = entry.title + " simple acces " + entry.properties["dc:description"] + " test json " + readJSONTab(readJSONTab(entry,"properties"),"dc:description") ";
return markup;
}

//Test Json
function readJSONTab(data,tagExtracted){
var json = JSON.parse(JSON.stringify(data))
return json[tagExtracted];
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS : To use other kind of xpath properties, have fun with this start and use JSON javascript function&lt;/P&gt;
&lt;P&gt;PS 2 : &lt;A href="http://msdn.microsoft.com/fr-fr/library/ie/cc836466(v=vs.94).aspx"&gt;http://msdn.microsoft.com/fr-fr/library/ie/cc836466(v=vs.94).aspx&lt;/A&gt; JSON.parse need a character chain NOT an objet. So, use JSON.stringify on your objects first.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2014 16:32:43 GMT</pubDate>
    <dc:creator>milonette_</dc:creator>
    <dc:date>2014-01-16T16:32:43Z</dc:date>
    <item>
      <title>Nuxeo 5.8 - Single document suggestion - doc schema dublin core not all fields visible in inline JavaScript</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321653#M8654</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;In Nuxeo 5.8  try to use the single document suggestion widget with inline javascript.&lt;/P&gt;
&lt;P&gt;Document schema are set to "dublincore" and also my custom schema.
Nevertheless this value are not used by inline javascript because I can just see "title" and "path" as results.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function myFormatter(entry) {
var markup = entry.title + " " + entry.description + " " + entry.mycustom + " " + entry.path;
return markup;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here, entry.description and all dublincore fields such as author failed...
entry.mycustom failed too.
But this fields exists on the document(s) suggested ant selected...&lt;/P&gt;
&lt;P&gt;Why ? Is my code wrong ?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 14:26:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321653#M8654</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2014-01-16T14:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nuxeo 5.8 - Single document suggestion - doc schema dublin core not all fields visible in inline JavaScript</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321654#M8655</link>
      <description>&lt;P&gt;Hello me,&lt;/P&gt;
&lt;P&gt;First I did Json neewbie investigations :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function myFormatter(entry) {
var markup = JSON.stringify(entry);
return markup;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This method show ALL the properties that exist in the objet of work named "entry".&lt;/P&gt;
&lt;P&gt;In the properties it looks like that xpath value are not such as default value.&lt;/P&gt;
&lt;P&gt;Default values are: entity-type, type, state, versionLabel, title, lastModified, path, isCheckedOut,repository,uid...&lt;/P&gt;
&lt;P&gt;And then comes "properties" that is hashMap Json.
Here a function to read a special tab in entry.properties and also show a classic propertie "path"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function myFormatter(entry) {
var markup = entry.title + " simple acces " + entry.properties["dc:description"] + " test json " + readJSONTab(readJSONTab(entry,"properties"),"dc:description") ";
return markup;
}

//Test Json
function readJSONTab(data,tagExtracted){
var json = JSON.parse(JSON.stringify(data))
return json[tagExtracted];
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS : To use other kind of xpath properties, have fun with this start and use JSON javascript function&lt;/P&gt;
&lt;P&gt;PS 2 : &lt;A href="http://msdn.microsoft.com/fr-fr/library/ie/cc836466(v=vs.94).aspx"&gt;http://msdn.microsoft.com/fr-fr/library/ie/cc836466(v=vs.94).aspx&lt;/A&gt; JSON.parse need a character chain NOT an objet. So, use JSON.stringify on your objects first.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 16:32:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321654#M8655</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2014-01-16T16:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Nuxeo 5.8 - Single document suggestion - doc schema dublin core not all fields visible in inline JavaScript</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321655#M8656</link>
      <description>&lt;P&gt;Yes, you got it. Any schema properties can simply be accessed via entry.properties["xx&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2014 19:38:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-5-8-single-document-suggestion-doc-schema-dublin-core-not/m-p/321655#M8656</guid>
      <dc:creator>Guillaume_Renar</dc:creator>
      <dc:date>2014-01-20T19:38:24Z</dc:date>
    </item>
  </channel>
</rss>

