<?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: Is the function PHP getProperty of a document not yet implemented? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316388#M3389</link>
    <description>&lt;P&gt;This code works fine for me.&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2016 18:13:16 GMT</pubDate>
    <dc:creator>Pierre-Gildas_M</dc:creator>
    <dc:date>2016-05-18T18:13:16Z</dc:date>
    <item>
      <title>Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316385#M3386</link>
      <description>&lt;P&gt;Am I correct that this function in the PHP library/client for REST automation has not been implemented yet?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$docVersion = $this-&amp;gt;documents[$index]-&amp;gt;getProperty('dc:version') ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Where documents[] is the resultset of a call : &lt;CODE&gt;$this-&amp;gt;answer = $this-&amp;gt;session-&amp;gt;newRequest("Document.Query") -&amp;gt;set('params', 'query', $query) -&amp;gt;setSchema($this-&amp;gt;propertiesSchema) -&amp;gt;sendRequest(); &lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 16:09:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316385#M3386</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-05-12T16:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316386#M3387</link>
      <description>&lt;P&gt;Hi Olaf,&lt;/P&gt;
&lt;P&gt;Try :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-php"&gt;$this-&amp;gt;documents[$index]-&amp;gt;getProperty('uid:major_version');
$this-&amp;gt;documents[$index]-&amp;gt;getProperty('uid:minor_version');
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 May 2016 12:58:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316386#M3387</guid>
      <dc:creator>Pierre-Gildas_M</dc:creator>
      <dc:date>2016-05-18T12:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316387#M3388</link>
      <description>&lt;P&gt;Thanks for the feedback. I did some further testing.&lt;/P&gt;
&lt;P&gt;Function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    /**
      *  Generialised PropertyGet function
      *
      *  @param string propertyName
      *  @param string propertyDescription
      *  @param int index
      *
      *  @return string value
      *  or
      *  @return boolean false
      */
    private function getDocumentProperty($name, $desc, $index) {
        global $logdebug;
        if ($index &amp;gt; $this-&amp;gt;getNumberOfDocumentsInResultset() ) {
            if ($logdebug) {
                $this-&amp;gt;logger-&amp;gt;addInfo($desc . " : the index provided (".$index.") is beyond the scope of the document list (".$this-&amp;gt;getNumberOfDocumentsInResultset().")");
            }
            $value = false ;
        }
        else {
            $value = $this-&amp;gt;documents[$index]-&amp;gt;getProperty($name) ; // deviation from regular property queries
            //$value = $this-&amp;gt;documents[$index]-&amp;gt;getProperty("'".$name."'") ;
            //$value = $this-&amp;gt;documents[$index]-&amp;gt;getProperty("'dc:creator'") ;
            if ($logdebug) {
                $this-&amp;gt;logger-&amp;gt;addInfo("Get property ".$name);
                $docname = $this-&amp;gt;getDocumentTitle($index);
                $this-&amp;gt;logger-&amp;gt;addInfo("Getting property from document titled '" . $docname . "'");
            }
            if ($logdebug) {
                $this-&amp;gt;logger-&amp;gt;addDebug("Get ".$desc . " index = ".$index);
                $this-&amp;gt;logger-&amp;gt;addDebug("Get ".$desc . " resultsetsize = ".$this-&amp;gt;getNumberOfDocumentsInResultset());
                $this-&amp;gt;logger-&amp;gt;addDebug($desc . " = ".$value);
            }
        }
        return ($value) ;
    }

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It should be called like: &lt;CODE&gt;$this-&amp;gt;getDocumentProperty('dc:creator', "DocumentCreator", 0)&lt;/CODE&gt;
Result is an empty string. This is regardless of the property.
This is a bit weird as a direct call like: &lt;CODE&gt;$this-&amp;gt;documents[$index]-&amp;gt;getTitle()&lt;/CODE&gt;
produces a proper result.&lt;/P&gt;
&lt;P&gt;This is especially hard to debug as I see no exceptions or errors, just an empty result string.
Any pointers much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 16:12:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316387#M3388</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-05-18T16:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316388#M3389</link>
      <description>&lt;P&gt;This code works fine for me.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 18:13:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316388#M3389</guid>
      <dc:creator>Pierre-Gildas_M</dc:creator>
      <dc:date>2016-05-18T18:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316389#M3390</link>
      <description>&lt;P&gt;I added the following line to my code the make my monolog debugging more verbose&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 15:07:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316389#M3390</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-05-19T15:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316390#M3391</link>
      <description>&lt;P&gt;Have you tried to perform the query manually or at least debug the raw response of the Nuxeo server ?&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 08:53:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316390#M3391</guid>
      <dc:creator>Pierre-Gildas_M</dc:creator>
      <dc:date>2016-05-20T08:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316391#M3392</link>
      <description>&lt;P&gt;I did test on/with the local nuxeo playground. But that was not an exact test of the querry so I did some further testing which provided more questions than answers&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 14:04:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316391#M3392</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-05-20T14:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316392#M3393</link>
      <description>&lt;P&gt;About your original question and a), make sure to query for at least any schema (*) to get the properties (setSchema method with the PHP Client) as I don't see it in your python sample.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 10:30:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316392#M3393</guid>
      <dc:creator>Pierre-Gildas_M</dc:creator>
      <dc:date>2016-05-23T10:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is the function PHP getProperty of a document not yet implemented?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316393#M3394</link>
      <description>&lt;P&gt;Thanks. It turned out that in the PHP code the headers were not set properly. $schema='"&lt;EM&gt;'"; versus $schema='&lt;/EM&gt;'; made the difference. Obviously the schema was not set at all in the Python code.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 15:33:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/is-the-function-php-getproperty-of-a-document-not-yet/m-p/316393#M3394</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-05-23T15:33:17Z</dc:date>
    </item>
  </channel>
</rss>

