Get all types of a document type

Hello, I have a question. In my nuxeo db I have an a table, who name is studio_vocabulary_type_doc but I can't access this through sql out of nuxeo. This table contains a diferent types of documents which I would want get all of this types from php but I don't know the correct way for do it.

I want to get all the types of documents that are set in the vocabulary of nuxeo using php

Any idea? thanks

0 votes

3 answers

1020 views

ANSWER



Hi,

I managed to fix the issue in the client v1.1.1 (if you're using the 1.5-rc1 it's still a WIP).

You should be able to get the entries with the following:

$client = new \Nuxeo\Automation\Client\NuxeoPhpAutomationClient('http://nuxeo:8080/nuxeo/site/automation');

$session = $client->getSession('Administrator', 'Administrator');

$entries = $session->newRequest("Directory.Entries")->set('params', 'directoryName', 'category')->sendRequest();
1 votes



Hi,

As pibou Bouvret mentioned, you can use the playground to find out how to get the content of your vocabulary.

Unfortunately the Automation PHP Client is currently only a client for the Command Endpoint (Automation API). Support for the other endpoints are planned as new features with the next releases.

I recommend you create a ticket to our support so we can work on a dedicated patch for your use-case as soon as possible.

Still, if you have a dependency to the Automation PHP Client v1.0.0+, you have access to the Guzzle HTTP Client as a transitive dependency; you could write your own call to the Resources Endpoint to get the content of your vocabulary.

0 votes



Using automation /api/automation/Directory.Entries can do the trick
12/02/2016

Indeed you're right, I was thinking about that afterwards. I've been running some tests but the APC fails to handle the returned JSON. That's related to https://jira.nuxeo.com/browse/PHPCLIENT-1 for 1.0.0 (I also created a dedicated issue for 1.5.0-rc1 in which we get a NULL value).
12/02/2016


You should have a look at the directory endpoint of the REST API

http://nuxeo.github.io/api-playground/

0 votes