<?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 add a &amp;quot;vocabulary&amp;quot; field to the nuxeo user profile? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-add-a-quot-vocabulary-quot-field-to-the-nuxeo-user/m-p/314901#M1902</link>
    <description>&lt;P&gt;Hello everyone, I am currently trying to add a new attribute of type "&lt;STRONG&gt;vocabulary&lt;/STRONG&gt;" to the user profile. I followed the following documentation: &lt;A href="https://doc.nuxeo.com/nxdoc/how-to-add-new-fields-to-the-user-profile-or-group-profile/"&gt;# HOWTO: Add New Fields to the User Profile or Group Profile&lt;/A&gt;, for a field of type string everything is fine. I was able to make it work, but on the other hand when I changed the type of the new field to be a "&lt;STRONG&gt;vocabulary&lt;/STRONG&gt;" instead of string, I encountered an error, in fact, the "&lt;STRONG&gt;nuxeo-directory-suggestion&lt;/STRONG&gt;" component displays the vocabulary identifier instead of the label. Here is my code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- nuxeo-edit-user.html --&amp;gt;
&amp;lt;!-- edit new community field --&amp;gt;
...
&amp;lt;nuxeo-directory-suggestion label="[[i18n('editUser.community')]]"
                            directory-name="VOC_Community"
                            min-chars="0"
                            value="{{user.community}}" name="community" required&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- nuxeo-view-user.html --&amp;gt;
&amp;lt;!-- view new community field --&amp;gt;
...
      &amp;lt;div class="layout vertical flex"&amp;gt;
        &amp;lt;nuxeo-directory-suggestion label="[[i18n('viewUser.community')]]"
                 value="[[user.properties.community]]" readonly="true"
                 min-chars="0"  directory-name="VOC_Community"
                 name="community"&amp;gt;
        &amp;lt;/nuxeo-directory-suggestion&amp;gt;
      &amp;lt;/div&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I looked in the documentation and saw that you need to define a reference and an inverse reference, so I did, but it didn't work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;component name="org.nuxeo.ecm.directory.storage"&amp;gt;
  &amp;lt;require&amp;gt;org.nuxeo.ecm.platform.digestauth.config&amp;lt;/require&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.directory.GenericDirectory" point="directories"&amp;gt;
  &amp;lt;directory name="userDirectory" extends="template-user"&amp;gt;
      &amp;lt;schema&amp;gt;user&amp;lt;/schema&amp;gt;
      &amp;lt;types&amp;gt;
        &amp;lt;type&amp;gt;system&amp;lt;/type&amp;gt;
      &amp;lt;/types&amp;gt;
      &amp;lt;idField&amp;gt;username&amp;lt;/idField&amp;gt;
      &amp;lt;references&amp;gt;
        &amp;lt;reference field="community" directory="VOC_Community" name="user2community" source="userId" target="id"/&amp;gt;
      &amp;lt;/references&amp;gt;
    &amp;lt;/directory&amp;gt;
  &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please does anyone have an idea?&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 21:54:28 GMT</pubDate>
    <dc:creator>Belgacem_Ghilou</dc:creator>
    <dc:date>2021-04-29T21:54:28Z</dc:date>
    <item>
      <title>How to add a "vocabulary" field to the nuxeo user profile?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-add-a-quot-vocabulary-quot-field-to-the-nuxeo-user/m-p/314901#M1902</link>
      <description>&lt;P&gt;Hello everyone, I am currently trying to add a new attribute of type "&lt;STRONG&gt;vocabulary&lt;/STRONG&gt;" to the user profile. I followed the following documentation: &lt;A href="https://doc.nuxeo.com/nxdoc/how-to-add-new-fields-to-the-user-profile-or-group-profile/"&gt;# HOWTO: Add New Fields to the User Profile or Group Profile&lt;/A&gt;, for a field of type string everything is fine. I was able to make it work, but on the other hand when I changed the type of the new field to be a "&lt;STRONG&gt;vocabulary&lt;/STRONG&gt;" instead of string, I encountered an error, in fact, the "&lt;STRONG&gt;nuxeo-directory-suggestion&lt;/STRONG&gt;" component displays the vocabulary identifier instead of the label. Here is my code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- nuxeo-edit-user.html --&amp;gt;
&amp;lt;!-- edit new community field --&amp;gt;
...
&amp;lt;nuxeo-directory-suggestion label="[[i18n('editUser.community')]]"
                            directory-name="VOC_Community"
                            min-chars="0"
                            value="{{user.community}}" name="community" required&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- nuxeo-view-user.html --&amp;gt;
&amp;lt;!-- view new community field --&amp;gt;
...
      &amp;lt;div class="layout vertical flex"&amp;gt;
        &amp;lt;nuxeo-directory-suggestion label="[[i18n('viewUser.community')]]"
                 value="[[user.properties.community]]" readonly="true"
                 min-chars="0"  directory-name="VOC_Community"
                 name="community"&amp;gt;
        &amp;lt;/nuxeo-directory-suggestion&amp;gt;
      &amp;lt;/div&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I looked in the documentation and saw that you need to define a reference and an inverse reference, so I did, but it didn't work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;component name="org.nuxeo.ecm.directory.storage"&amp;gt;
  &amp;lt;require&amp;gt;org.nuxeo.ecm.platform.digestauth.config&amp;lt;/require&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.directory.GenericDirectory" point="directories"&amp;gt;
  &amp;lt;directory name="userDirectory" extends="template-user"&amp;gt;
      &amp;lt;schema&amp;gt;user&amp;lt;/schema&amp;gt;
      &amp;lt;types&amp;gt;
        &amp;lt;type&amp;gt;system&amp;lt;/type&amp;gt;
      &amp;lt;/types&amp;gt;
      &amp;lt;idField&amp;gt;username&amp;lt;/idField&amp;gt;
      &amp;lt;references&amp;gt;
        &amp;lt;reference field="community" directory="VOC_Community" name="user2community" source="userId" target="id"/&amp;gt;
      &amp;lt;/references&amp;gt;
    &amp;lt;/directory&amp;gt;
  &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please does anyone have an idea?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 21:54:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-add-a-quot-vocabulary-quot-field-to-the-nuxeo-user/m-p/314901#M1902</guid>
      <dc:creator>Belgacem_Ghilou</dc:creator>
      <dc:date>2021-04-29T21:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a "vocabulary" field to the nuxeo user profile?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-add-a-quot-vocabulary-quot-field-to-the-nuxeo-user/m-p/314902#M1903</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;To be displayed correctly, you need to use the following formatter: &lt;CODE&gt;[[formatDirectory(document.properties.&amp;lt;XPATH&amp;gt;)]]&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;For the listing in edit mode, use formatter too (as &lt;A href="https://github.com/nuxeo/nuxeo-studio-community-cookbook/tree/master/modules/nuxeo/document-suggestion-result-formatters)" target="test_blank"&gt;https://github.com/nuxeo/nuxeo-studio-community-cookbook/tree/master/modules/nuxeo/document-suggestion-result-formatters)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 12:31:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-add-a-quot-vocabulary-quot-field-to-the-nuxeo-user/m-p/314902#M1903</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2021-05-03T12:31:29Z</dc:date>
    </item>
  </channel>
</rss>

