<?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 Custom vocabulary with custom columns in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318915#M5916</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to create a new vocabulary extracting the data from a table I have in my database, but I am having problems with operations like "Directory.Suggestion", and with methods like "formatDirectory()".
The problem is my table doesn't have "ID" and "LABEL" columns. Instead of those columns, it has custom columns named "id_j" and "description", and I cannot change them (because other applications use them).&lt;/P&gt;
&lt;P&gt;I have defined my directory:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="myVocabulary" extends="default-template-directory"&amp;gt;
	&amp;lt;schema&amp;gt;tm_vocabulary&amp;lt;/schema&amp;gt;
	&amp;lt;table&amp;gt;VOCABULARY_TABLE&amp;lt;/table&amp;gt;
	&amp;lt;idField&amp;gt;id_j&amp;lt;/idField&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have defined the "tm_vocabulary" schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;

&amp;lt;xs:schema targetNamespace="http://www.nuxeo.org/ecm/schemas/vocabulary"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"&amp;gt;

    &amp;lt;xs:element name="id_j" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="description" type="xs:string"/&amp;gt;

&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And I also have added the schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;schema name="tm_vocabulary" prefix="tmv" src="schema/directories/tm_vocabulary.xsd" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Going to "Vocabularies" in the Nuxeo WebUI, I can see the vocabulary and its eantries without any problem. However, in one view, I have the following element:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-directory-suggestion 
    	role="widget" 
    	label="My property" 
    	name="myProperty"
    	directory-name="myVocabulary" 
    	value="{{document.properties.elem:myProperty}}" 
    	min-chars="0" required&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And this element is not working, because it is invoking "Directory.Suggestion", and this operation says "'label' column cannot be found". What can I do to use the nuxeo-directory-suggestion element with my custom vocabulary?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 12:54:40 GMT</pubDate>
    <dc:creator>Rodri_</dc:creator>
    <dc:date>2019-07-12T12:54:40Z</dc:date>
    <item>
      <title>Custom vocabulary with custom columns</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318915#M5916</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to create a new vocabulary extracting the data from a table I have in my database, but I am having problems with operations like "Directory.Suggestion", and with methods like "formatDirectory()".
The problem is my table doesn't have "ID" and "LABEL" columns. Instead of those columns, it has custom columns named "id_j" and "description", and I cannot change them (because other applications use them).&lt;/P&gt;
&lt;P&gt;I have defined my directory:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="myVocabulary" extends="default-template-directory"&amp;gt;
	&amp;lt;schema&amp;gt;tm_vocabulary&amp;lt;/schema&amp;gt;
	&amp;lt;table&amp;gt;VOCABULARY_TABLE&amp;lt;/table&amp;gt;
	&amp;lt;idField&amp;gt;id_j&amp;lt;/idField&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have defined the "tm_vocabulary" schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;

&amp;lt;xs:schema targetNamespace="http://www.nuxeo.org/ecm/schemas/vocabulary"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"&amp;gt;

    &amp;lt;xs:element name="id_j" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="description" type="xs:string"/&amp;gt;

&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And I also have added the schema:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;schema name="tm_vocabulary" prefix="tmv" src="schema/directories/tm_vocabulary.xsd" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Going to "Vocabularies" in the Nuxeo WebUI, I can see the vocabulary and its eantries without any problem. However, in one view, I have the following element:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-directory-suggestion 
    	role="widget" 
    	label="My property" 
    	name="myProperty"
    	directory-name="myVocabulary" 
    	value="{{document.properties.elem:myProperty}}" 
    	min-chars="0" required&amp;gt;
&amp;lt;/nuxeo-directory-suggestion&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And this element is not working, because it is invoking "Directory.Suggestion", and this operation says "'label' column cannot be found". What can I do to use the nuxeo-directory-suggestion element with my custom vocabulary?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 12:54:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318915#M5916</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2019-07-12T12:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom vocabulary with custom columns</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318916#M5917</link>
      <description>&lt;P&gt;Vocabularies in Nuxeo require the standard &lt;CODE&gt;id&lt;/CODE&gt; and &lt;CODE&gt;label&lt;/CODE&gt; columns. The standard solution to this problem is to define a &lt;CODE&gt;VIEW&lt;/CODE&gt; in your SQL database to have a new virtual table with the required columns that points to your existing table.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 08:41:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318916#M5917</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2019-07-16T08:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom vocabulary with custom columns</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318917#M5918</link>
      <description>&lt;P&gt;Definitely the best solution. Tested and working. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 09:49:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/custom-vocabulary-with-custom-columns/m-p/318917#M5918</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2019-07-16T09:49:17Z</dc:date>
    </item>
  </channel>
</rss>

