<?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 to make a query with properties parameter to fetch in nuxeo in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-make-a-query-with-properties-parameter-to-fetch-in-nuxeo/m-p/313371#M372</link>
    <description>&lt;P&gt;I want to make a request with "dynamic" properties fetch from my Java app with nuxeo 8.10.&lt;/P&gt;
&lt;P&gt;There is the declatation of my NuxeoDocument:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;schema name="TestDocumentProperties" src="data/TestDocumentProperties.xsd" prefix="test" /&amp;gt;
    &amp;lt;doctype name="TestDocument" extends="Document"&amp;gt;
    	&amp;lt;schema name="dublincore"/&amp;gt;
        &amp;lt;schema name="TestDocumentProperties"/&amp;gt;
    &amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is the schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xs:schema ...&amp;gt;  
  &amp;lt;xs:element name="summary" type="xs:string"/&amp;gt;
  &amp;lt;xs:element name="content" type="xs:string"/&amp;gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is a "Get" request to my Nuxeo server:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;https:xxx/nuxeo/site/api/v1/search/lang/NXQL/execute?query=SELECT * FROM Document WHERE ecm:fulltext = 'test'&amp;amp;properties=TestDocumentProperties, dublincore
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When i execute this request directly from my browser, the result contains all of the properties of "dublincore" and "TestDocumentProperties":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;{
    "entity-type": "document",
    "type": "TestDocument",
    ...
    "properties": {
        "test:summary": "test text to search in summary",
        "test:content": "test text to search in content",
        "dc:description": null,
        "dc:language": null,
        "dc:coverage": null,
        "dc:valid": null,
        "dc:creator": "xxx",
        "dc:modified": "2017-12-13T16:28:38.44Z",
        ...
    },...
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, I want to execute a nuxeo nxql request from my Java application with the same parameter.
Before, i execute only the request from my java app, without the "properties" parameter with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;return this.nuxeoClient.repository().query("SELECT * FROM Document WHERE ecm:fulltext = 'test'");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But with "query" method from repository, there isn't possible to specify the properties to fetch. So, today, i try with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	Map&amp;lt;String, Object&amp;gt; parameters = new HashMap&amp;lt;&amp;gt;();
	parameters.put("query", "SELECT * FROM Document WHERE ecm:fulltext = 'test'");
	parameters.put("properties", "TestDocumentProperties, dublincore");
	return this.nuxeoClient.automation("Repository.Query").parameters(parameters).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Unfortunately, the result isn't fetch correctly, i don't have the "dublincore" properties in my response but i have the "TestDocumentProperties". If i remove the "TestDocumentProperties" in the list of fetch properties parameters, there is no change to the response...&lt;/P&gt;
&lt;P&gt;Can you help me to correct this code or indicate me an alternative ?&lt;/P&gt;
&lt;P&gt;Thank's&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 15:42:38 GMT</pubDate>
    <dc:creator>__1</dc:creator>
    <dc:date>2018-02-09T15:42:38Z</dc:date>
    <item>
      <title>How to make a query with properties parameter to fetch in nuxeo</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-make-a-query-with-properties-parameter-to-fetch-in-nuxeo/m-p/313371#M372</link>
      <description>&lt;P&gt;I want to make a request with "dynamic" properties fetch from my Java app with nuxeo 8.10.&lt;/P&gt;
&lt;P&gt;There is the declatation of my NuxeoDocument:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;schema name="TestDocumentProperties" src="data/TestDocumentProperties.xsd" prefix="test" /&amp;gt;
    &amp;lt;doctype name="TestDocument" extends="Document"&amp;gt;
    	&amp;lt;schema name="dublincore"/&amp;gt;
        &amp;lt;schema name="TestDocumentProperties"/&amp;gt;
    &amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is the schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xs:schema ...&amp;gt;  
  &amp;lt;xs:element name="summary" type="xs:string"/&amp;gt;
  &amp;lt;xs:element name="content" type="xs:string"/&amp;gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is a "Get" request to my Nuxeo server:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;https:xxx/nuxeo/site/api/v1/search/lang/NXQL/execute?query=SELECT * FROM Document WHERE ecm:fulltext = 'test'&amp;amp;properties=TestDocumentProperties, dublincore
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When i execute this request directly from my browser, the result contains all of the properties of "dublincore" and "TestDocumentProperties":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;{
    "entity-type": "document",
    "type": "TestDocument",
    ...
    "properties": {
        "test:summary": "test text to search in summary",
        "test:content": "test text to search in content",
        "dc:description": null,
        "dc:language": null,
        "dc:coverage": null,
        "dc:valid": null,
        "dc:creator": "xxx",
        "dc:modified": "2017-12-13T16:28:38.44Z",
        ...
    },...
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, I want to execute a nuxeo nxql request from my Java application with the same parameter.
Before, i execute only the request from my java app, without the "properties" parameter with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;return this.nuxeoClient.repository().query("SELECT * FROM Document WHERE ecm:fulltext = 'test'");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But with "query" method from repository, there isn't possible to specify the properties to fetch. So, today, i try with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	Map&amp;lt;String, Object&amp;gt; parameters = new HashMap&amp;lt;&amp;gt;();
	parameters.put("query", "SELECT * FROM Document WHERE ecm:fulltext = 'test'");
	parameters.put("properties", "TestDocumentProperties, dublincore");
	return this.nuxeoClient.automation("Repository.Query").parameters(parameters).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Unfortunately, the result isn't fetch correctly, i don't have the "dublincore" properties in my response but i have the "TestDocumentProperties". If i remove the "TestDocumentProperties" in the list of fetch properties parameters, there is no change to the response...&lt;/P&gt;
&lt;P&gt;Can you help me to correct this code or indicate me an alternative ?&lt;/P&gt;
&lt;P&gt;Thank's&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:42:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-make-a-query-with-properties-parameter-to-fetch-in-nuxeo/m-p/313371#M372</guid>
      <dc:creator>__1</dc:creator>
      <dc:date>2018-02-09T15:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a query with properties parameter to fetch in nuxeo</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-make-a-query-with-properties-parameter-to-fetch-in-nuxeo/m-p/313372#M373</link>
      <description>&lt;P&gt;Also asked on SO&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:48:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-make-a-query-with-properties-parameter-to-fetch-in-nuxeo/m-p/313372#M373</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2018-02-09T15:48:37Z</dc:date>
    </item>
  </channel>
</rss>

