<?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: retrieve label instead of id from a vocabulary in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319677#M6678</link>
    <description>&lt;P&gt;Gregory, thanks for your answer (and sorry for the late response).&lt;/P&gt;</description>
    <pubDate>Sat, 02 Apr 2022 08:20:19 GMT</pubDate>
    <dc:creator>ElmarKnipp_</dc:creator>
    <dc:date>2022-04-02T08:20:19Z</dc:date>
    <item>
      <title>retrieve label instead of id from a vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319674#M6675</link>
      <description>&lt;P&gt;I have defined an vocabulary with the following schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsv="http://www.nuxeo.org/ecm/schemas/core/validation/"
    xmlns:ref="http://www.nuxeo.org/ecm/schemas/core/external-references/"
    targetNamespace="de.knipp.nuxeo.currencies"&amp;gt;

    &amp;lt;xs:element name="id" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="label" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="obsolete" type="xs:integer" default="0"/&amp;gt;
    &amp;lt;xs:element name="ordering" type="xs:integer" default="10000000"/&amp;gt;

&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My test data in CSV format is the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;id,label,obsolete,ordering
eur,EUR,0,1
centeur,centEUR,0,2
usd,USD,0,3
centusd,centUSD,0,4
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Everything works fine: creating and editing my data in the WEBUI.&lt;/P&gt;
&lt;P&gt;But when I want to display the value of the data, only the id is displayed (small letters instead of the camel string). I use the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;div role="widget" hidden$="[[!document.properties.rfs:currency]]"&amp;gt;
    &amp;lt;label&amp;gt;[[i18n('com.mycompany.nuxeo.richfile.currency')]]&amp;lt;/label&amp;gt;
    &amp;lt;div name="currency"&amp;gt;[[document.properties.rfs:currency]]&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can I improve the code above to display the label of the currency?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 08:30:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319674#M6675</guid>
      <dc:creator>ElmarKnipp_</dc:creator>
      <dc:date>2021-12-16T08:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve label instead of id from a vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319675#M6676</link>
      <description>&lt;P&gt;If you want the REST API to return the label, you need to define a directoryResolver in your schema (named "rfs" in your case). Explained here: &lt;A href="https://doc.nuxeo.com/nxdoc/field-constraints-and-validation/#reference-to-nuxeo-directoryvocabulary-entry" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/field-constraints-and-validation/#reference-to-nuxeo-directoryvocabulary-entry&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 15:54:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319675#M6676</guid>
      <dc:creator>Benjamin_Gamar1</dc:creator>
      <dc:date>2021-12-21T15:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve label instead of id from a vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319676#M6677</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You should use the &lt;CODE&gt;nuxeo-directory-suggestion&lt;/CODE&gt; element for your property so that the ID is resolved with the corresponding label:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-directory-suggestion value="{{document.properties.rfs:currency}}" label="[[i18n('com.mycompany.nuxeo.richfile.currency')]]" min-chars="0" directory-name="&amp;lt;NAME-Of-YOUR-VOCABULARY&amp;gt;" name="currency" role="widget"&amp;gt;&amp;lt;/nuxeo-directory-suggestion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 16:14:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319676#M6677</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2021-12-21T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve label instead of id from a vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319677#M6678</link>
      <description>&lt;P&gt;Gregory, thanks for your answer (and sorry for the late response).&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2022 08:20:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319677#M6678</guid>
      <dc:creator>ElmarKnipp_</dc:creator>
      <dc:date>2022-04-02T08:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve label instead of id from a vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319678#M6679</link>
      <description>&lt;P&gt;Benjamin,  thanks for your response (and sorry for the late response).&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2022 10:55:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/retrieve-label-instead-of-id-from-a-vocabulary/m-p/319678#M6679</guid>
      <dc:creator>ElmarKnipp_</dc:creator>
      <dc:date>2022-04-02T10:55:02Z</dc:date>
    </item>
  </channel>
</rss>

