<?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 Directory suggestion widget in user edit layout won&amp;apos;t show label in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/directory-suggestion-widget-in-user-edit-layout-won-apos-t-show/m-p/316360#M3361</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;I overrode the default user schema to add new columns, one of them is a custom vocabulary. It saves and edits no problem, however, whenever one opens the edit dialog,** the label for the selected vocabulary is missing, only showing the numerical id of the item**, i.e:
&lt;span class="lia-inline-image-display-wrapper" image-alt="The selected item is missing the label"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1880iD6BFB11D4F47FA24/image-size/large?v=v2&amp;amp;px=999" role="button" title="The selected item is missing the label" alt="The selected item is missing the label" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That only happens the first time, as after editing the item, it will correctly show the label, or unless the page is reloaded.
&lt;STRONG&gt;How do I solve this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is the xml contribution that adds the vocabulary:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="mx.gob.ssa.directory.vocabularies"&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.directory.GenericDirectory" point="directories"&amp;gt;
        &amp;lt;directory name="VOC_honorifico" extends="template-xvocabulary"&amp;gt;
            &amp;lt;autoincrementIdField&amp;gt;false&amp;lt;/autoincrementIdField&amp;gt;
            &amp;lt;createTablePolicy&amp;gt;on_missing_columns&amp;lt;/createTablePolicy&amp;gt;
            &amp;lt;table&amp;gt;ssa_VOC_honorifico&amp;lt;/table&amp;gt;
            &amp;lt;dataFile&amp;gt;vocabularies/VOC_honorifico.csv&amp;lt;/dataFile&amp;gt;
            &amp;lt;cacheEntryName&amp;gt;vocab-VOC_honorifico-cache&amp;lt;/cacheEntryName&amp;gt;
            &amp;lt;cacheEntryWithoutReferencesName&amp;gt;vocab-VOC_honorifico-cache-without-references&amp;lt;/cacheEntryWithoutReferencesName&amp;gt;
        &amp;lt;/directory&amp;gt;
    &amp;lt;/extension&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.core.cache.CacheService" point="caches"&amp;gt;
        &amp;lt;cache name="vocab-VOC_honorifico-cache"&amp;gt;
            &amp;lt;option name="maxSize"&amp;gt;1000&amp;lt;/option&amp;gt;
            &amp;lt;option name="concurrencyLevel"&amp;gt;500&amp;lt;/option&amp;gt;
            &amp;lt;ttl&amp;gt;60&amp;lt;/ttl&amp;gt;
        &amp;lt;/cache&amp;gt;
        &amp;lt;cache name="vocab-VOC_honorifico-cache-without-references"&amp;gt;
            &amp;lt;option name="maxSize"&amp;gt;1000&amp;lt;/option&amp;gt;
            &amp;lt;option name="concurrencyLevel"&amp;gt;500&amp;lt;/option&amp;gt;
            &amp;lt;ttl&amp;gt;60&amp;lt;/ttl&amp;gt;
        &amp;lt;/cache&amp;gt;
    &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The custom vocabulary is loaded to storage using a csv file that has the fields : "id","label","obsolete","ordering".&lt;/P&gt;
&lt;P&gt;This is the user schema extension that overrides the default user schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;xs:schema targetNamespace="http://www.nuxeo.org/ecm/schemas/user"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:nxs="http://www.nuxeo.org/ecm/schemas/user"
           xmlns:ref="http://www.nuxeo.org/ecm/schemas/core/external-references/"&amp;gt;

&amp;lt;xs:include schemaLocation="base.xsd" /&amp;gt;

&amp;lt;xs:element name="username" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="password" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="firstName" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="lastName" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="company" type="xs:string" /&amp;gt;

&amp;lt;!-- the new field for the custom vocabulary --&amp;gt;
&amp;lt;xs:element name="honorifico"&amp;gt;
    &amp;lt;xs:simpleType&amp;gt;
        &amp;lt;xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="VOC_honorifico"/&amp;gt;
    &amp;lt;/xs:simpleType&amp;gt;
&amp;lt;/xs:element&amp;gt;

&amp;lt;xs:element name="email"&amp;gt;
    &amp;lt;xs:simpleType&amp;gt;
        &amp;lt;xs:restriction base="xs:string"&amp;gt;
            &amp;lt;!-- the same pattern is used in userinfo.xsd --&amp;gt;
            &amp;lt;xs:pattern value="[^@]+@[^\.]+\..+" /&amp;gt;
        &amp;lt;/xs:restriction&amp;gt;
    &amp;lt;/xs:simpleType&amp;gt;
&amp;lt;/xs:element&amp;gt;

&amp;lt;!-- inverse reference --&amp;gt;
&amp;lt;xs:element name="groups" type="nxs:stringList" /&amp;gt;

&amp;lt;!-- tenant id for the user --&amp;gt;
&amp;lt;xs:element name="tenantId" type="xs:string" /&amp;gt;

&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And finally, this is the widget used at the edit user layout:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-directory-suggestion
      role="widget"
      value="{{user.honorifico}}"
      label="Título"
      directory-name="VOC_honorifico"
      operation="Directory.SuggestEntries"
      min-chars="0"&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Jan 2020 20:20:21 GMT</pubDate>
    <dc:creator>a_c</dc:creator>
    <dc:date>2020-01-27T20:20:21Z</dc:date>
    <item>
      <title>Directory suggestion widget in user edit layout won&amp;apos;t show label</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/directory-suggestion-widget-in-user-edit-layout-won-apos-t-show/m-p/316360#M3361</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;I overrode the default user schema to add new columns, one of them is a custom vocabulary. It saves and edits no problem, however, whenever one opens the edit dialog,** the label for the selected vocabulary is missing, only showing the numerical id of the item**, i.e:
&lt;span class="lia-inline-image-display-wrapper" image-alt="The selected item is missing the label"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1880iD6BFB11D4F47FA24/image-size/large?v=v2&amp;amp;px=999" role="button" title="The selected item is missing the label" alt="The selected item is missing the label" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That only happens the first time, as after editing the item, it will correctly show the label, or unless the page is reloaded.
&lt;STRONG&gt;How do I solve this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is the xml contribution that adds the vocabulary:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="mx.gob.ssa.directory.vocabularies"&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.directory.GenericDirectory" point="directories"&amp;gt;
        &amp;lt;directory name="VOC_honorifico" extends="template-xvocabulary"&amp;gt;
            &amp;lt;autoincrementIdField&amp;gt;false&amp;lt;/autoincrementIdField&amp;gt;
            &amp;lt;createTablePolicy&amp;gt;on_missing_columns&amp;lt;/createTablePolicy&amp;gt;
            &amp;lt;table&amp;gt;ssa_VOC_honorifico&amp;lt;/table&amp;gt;
            &amp;lt;dataFile&amp;gt;vocabularies/VOC_honorifico.csv&amp;lt;/dataFile&amp;gt;
            &amp;lt;cacheEntryName&amp;gt;vocab-VOC_honorifico-cache&amp;lt;/cacheEntryName&amp;gt;
            &amp;lt;cacheEntryWithoutReferencesName&amp;gt;vocab-VOC_honorifico-cache-without-references&amp;lt;/cacheEntryWithoutReferencesName&amp;gt;
        &amp;lt;/directory&amp;gt;
    &amp;lt;/extension&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.core.cache.CacheService" point="caches"&amp;gt;
        &amp;lt;cache name="vocab-VOC_honorifico-cache"&amp;gt;
            &amp;lt;option name="maxSize"&amp;gt;1000&amp;lt;/option&amp;gt;
            &amp;lt;option name="concurrencyLevel"&amp;gt;500&amp;lt;/option&amp;gt;
            &amp;lt;ttl&amp;gt;60&amp;lt;/ttl&amp;gt;
        &amp;lt;/cache&amp;gt;
        &amp;lt;cache name="vocab-VOC_honorifico-cache-without-references"&amp;gt;
            &amp;lt;option name="maxSize"&amp;gt;1000&amp;lt;/option&amp;gt;
            &amp;lt;option name="concurrencyLevel"&amp;gt;500&amp;lt;/option&amp;gt;
            &amp;lt;ttl&amp;gt;60&amp;lt;/ttl&amp;gt;
        &amp;lt;/cache&amp;gt;
    &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The custom vocabulary is loaded to storage using a csv file that has the fields : "id","label","obsolete","ordering".&lt;/P&gt;
&lt;P&gt;This is the user schema extension that overrides the default user schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;xs:schema targetNamespace="http://www.nuxeo.org/ecm/schemas/user"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:nxs="http://www.nuxeo.org/ecm/schemas/user"
           xmlns:ref="http://www.nuxeo.org/ecm/schemas/core/external-references/"&amp;gt;

&amp;lt;xs:include schemaLocation="base.xsd" /&amp;gt;

&amp;lt;xs:element name="username" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="password" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="firstName" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="lastName" type="xs:string" /&amp;gt;
&amp;lt;xs:element name="company" type="xs:string" /&amp;gt;

&amp;lt;!-- the new field for the custom vocabulary --&amp;gt;
&amp;lt;xs:element name="honorifico"&amp;gt;
    &amp;lt;xs:simpleType&amp;gt;
        &amp;lt;xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="VOC_honorifico"/&amp;gt;
    &amp;lt;/xs:simpleType&amp;gt;
&amp;lt;/xs:element&amp;gt;

&amp;lt;xs:element name="email"&amp;gt;
    &amp;lt;xs:simpleType&amp;gt;
        &amp;lt;xs:restriction base="xs:string"&amp;gt;
            &amp;lt;!-- the same pattern is used in userinfo.xsd --&amp;gt;
            &amp;lt;xs:pattern value="[^@]+@[^\.]+\..+" /&amp;gt;
        &amp;lt;/xs:restriction&amp;gt;
    &amp;lt;/xs:simpleType&amp;gt;
&amp;lt;/xs:element&amp;gt;

&amp;lt;!-- inverse reference --&amp;gt;
&amp;lt;xs:element name="groups" type="nxs:stringList" /&amp;gt;

&amp;lt;!-- tenant id for the user --&amp;gt;
&amp;lt;xs:element name="tenantId" type="xs:string" /&amp;gt;

&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And finally, this is the widget used at the edit user layout:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-directory-suggestion
      role="widget"
      value="{{user.honorifico}}"
      label="Título"
      directory-name="VOC_honorifico"
      operation="Directory.SuggestEntries"
      min-chars="0"&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jan 2020 20:20:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/directory-suggestion-widget-in-user-edit-layout-won-apos-t-show/m-p/316360#M3361</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2020-01-27T20:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Directory suggestion widget in user edit layout won&amp;apos;t show label</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/directory-suggestion-widget-in-user-edit-layout-won-apos-t-show/m-p/316361#M3362</link>
      <description>&lt;P&gt;After some research, I found out that the requests use enrichers to get additonal information. Since the only user enricher available is the userProfile, I wrote a &lt;STRONG&gt;custom enricher&lt;/STRONG&gt; that finds the custom vocabulary object by id; also I had to customize the user management views to add this custom enricher to the user request (&lt;NUXEO-RESOURCE&gt;&lt;/NUXEO-RESOURCE&gt;), handle the value changes and the submition of the user form.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 22:56:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/directory-suggestion-widget-in-user-edit-layout-won-apos-t-show/m-p/316361#M3362</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2020-01-28T22:56:53Z</dc:date>
    </item>
  </channel>
</rss>

