<?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: Add your own vocabulary in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325281#M12282</link>
    <description>&lt;P&gt;It's working, and don't forget to add the schema for the new vocabulary.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2015 12:42:05 GMT</pubDate>
    <dc:creator>Dalal_</dc:creator>
    <dc:date>2015-06-12T12:42:05Z</dc:date>
    <item>
      <title>Add your own vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325279#M12280</link>
      <description>&lt;P&gt;I'm writing a layout contribution, I added a suggestOneDirectory widget named city but I don't know where can I change/add my own directoryName (instead of l10ncoverage) that contains the vocabulary of cities to be shown on the list.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;     &amp;lt;widget name="city" type="suggestOneDirectory"&amp;gt;
        &amp;lt;labels&amp;gt;
          &amp;lt;label mode="any"&amp;gt;City :&amp;lt;/label&amp;gt;
        &amp;lt;/labels&amp;gt;
        &amp;lt;translated&amp;gt;true&amp;lt;/translated&amp;gt;
        &amp;lt;fields&amp;gt;
          &amp;lt;field&amp;gt;adr:city&amp;lt;/field&amp;gt;
        &amp;lt;/fields&amp;gt;
        &amp;lt;properties mode="any"&amp;gt;
          &amp;lt;property name="width"&amp;gt;300&amp;lt;/property&amp;gt;
          &amp;lt;property name="labelFieldName"&amp;gt;label_{lang}&amp;lt;/property&amp;gt;
          &amp;lt;property name="dbl10n"&amp;gt;true&amp;lt;/property&amp;gt;
          &amp;lt;property name="minChars"&amp;gt;0&amp;lt;/property&amp;gt;
          &amp;lt;property name="hideHelpLabel"&amp;gt;true&amp;lt;/property&amp;gt;
          &amp;lt;property name="directoryName"&amp;gt;l10ncoverage&amp;lt;/property&amp;gt;
          &amp;lt;property name="keySeparator"&amp;gt;/&amp;lt;/property&amp;gt;
          &amp;lt;property name="placeholder"&amp;gt;Ville&amp;lt;/property&amp;gt;
          &amp;lt;property name="documentSchemas"&amp;gt;dublincore,layout_demo_schema&amp;lt;/property&amp;gt;
          &amp;lt;property name="repository"&amp;gt;default&amp;lt;/property&amp;gt;
        &amp;lt;/properties&amp;gt;
        &amp;lt;controls mode="any"&amp;gt;
          &amp;lt;!-- enable ajax submit on change/click/select on demo application --&amp;gt;
          &amp;lt;control name="supportInsideInputWidgetEffects"&amp;gt;true&amp;lt;/control&amp;gt;
        &amp;lt;/controls&amp;gt;
      &amp;lt;/widget&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm not using Nuxeo Studio.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 12:28:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325279#M12280</guid>
      <dc:creator>Dalal_</dc:creator>
      <dc:date>2015-06-01T12:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add your own vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325280#M12281</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;A csv file can be used as a source to define your own vocabulary&lt;/P&gt;
&lt;P&gt;First specify the vocabulary in a file, for example "my-vocabulary.csv":&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"id","label","obsolete","ordering"&lt;/P&gt;
&lt;P&gt;"now","now","0","0"&lt;/P&gt;
&lt;P&gt;"later","later","0","0"&lt;/P&gt;
&lt;P&gt;"never","never","0","0"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Add this file to your project in the "resources" folder:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;resources:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;+-- data
    +-- schemas
  &amp;nbsp; +-- my-schema.xsd
    +-- vocabularies
        +-- my-vocabulary.csv
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then use this extension point to source the csv file and update the model:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"
	point="directories"&amp;gt;
	&amp;lt;directory name="my_business_purpose"&amp;gt;
		&amp;lt;schema&amp;gt;vocabulary&amp;lt;/schema&amp;gt;
		&amp;lt;dataSource&amp;gt;java:/nxsqldirectory&amp;lt;/dataSource&amp;gt;
		&amp;lt;cacheTimeout&amp;gt;3600&amp;lt;/cacheTimeout&amp;gt;
		&amp;lt;cacheMaxSize&amp;gt;1000&amp;lt;/cacheMaxSize&amp;gt;
		&amp;lt;idField&amp;gt;id&amp;lt;/idField&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;my_business_purpose&amp;lt;/table&amp;gt;
		&amp;lt;dataFile&amp;gt;data/vocabularies/my-vocabulary.csv&amp;lt;/dataFile&amp;gt;
	&amp;lt;/directory&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jun 2015 09:07:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325280#M12281</guid>
      <dc:creator>Antoine_Cordier</dc:creator>
      <dc:date>2015-06-04T09:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add your own vocabulary</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325281#M12282</link>
      <description>&lt;P&gt;It's working, and don't forget to add the schema for the new vocabulary.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:42:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/add-your-own-vocabulary/m-p/325281#M12282</guid>
      <dc:creator>Dalal_</dc:creator>
      <dc:date>2015-06-12T12:42:05Z</dc:date>
    </item>
  </channel>
</rss>

