<?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: Managing custom directories through the admin center in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323716#M10717</link>
    <description>&lt;P&gt;You are welcome. I usually don't put prefix for directories, as i had some problems in the past&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jan 2013 16:12:54 GMT</pubDate>
    <dc:creator>Aykut_Açikel</dc:creator>
    <dc:date>2013-01-30T16:12:54Z</dc:date>
    <item>
      <title>Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323711#M10712</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to make it possible to manage from the UI the content of custom directories, which I couldn't implement as vocabularies since I needed to add some custom columns. It seems like we can contribute directories to the "Vocabularies" admin tab by setting a custom layout, so I tried to build my own through Studio:&lt;/P&gt;
&lt;P&gt;-I made a custom form layout that uses the &lt;EM&gt;/layouts/directory_layout_template.xhtml&lt;/EM&gt; template&lt;BR /&gt; /&amp;gt;
-I contributed the layout through an XML contribution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;extension target="org.nuxeo.ecm.directory.ui.DirectoryUIManager" point="directories"&amp;gt;
    &amp;lt;directory name="XXX" layout="FormLayoutXXX@edit" sortField="label" /&amp;gt;
  &amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The last part feels a bit hacky, but it actually manages to bring the directory correctly on the admin tab, and I'm even able to edit or delete items correctly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But!&lt;/STRONG&gt; I can't create new entries. I also tried to use the "...@create" layout in case it was different in any way, still I fail to create new entries with the following error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;org.nuxeo.ecm.core.api.ClientException: org.nuxeo.ecm.directory.DirectoryException: Missing id
	at org.nuxeo.ecm.webapp.directory.DirectoryUIActionsBean.createDirectoryEntry(DirectoryUIActionsBean.java:248)

(actually thrown at SQLSession#createEntry(Map&amp;lt;String, Object&amp;gt;), l.180)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code looks for a "id" field among the entry fields ; in the case of custom directories, while "id" is indeed unset, "customSchema:id" is actually set. As far as I could dig, the problem seems to lie in that fields fetched through &lt;CODE&gt;entry.getProperties(schemaName)&lt;/CODE&gt; (SQLSession, l.1086) do not contain the prefix in the case of vocabularies, but they do otherwise, and the SQLSession doesn't like it.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The directory contribution:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="XXX"&amp;gt;
  &amp;lt;schema&amp;gt;schemaXXX&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;table&amp;gt;vocabulary_XXX&amp;lt;/table&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;dataFile&amp;gt;directories/XXX.csv&amp;lt;/dataFile&amp;gt;
  &amp;lt;createTablePolicy&amp;gt;on_missing_columns&amp;lt;/createTablePolicy&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;The schema contents:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;.&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/directory_XXX"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"&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="custom_col_1" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="custom_col_2" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="custom_col_3" 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;UL&gt;
&lt;LI&gt;The csv contents:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;"id","label","custom_col_1","custom_col_2","custom_col_3","obsolete","ordering"
"...","...",,"..","...","0","0"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2013 16:17:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323711#M10712</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-01-08T16:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323712#M10713</link>
      <description>&lt;P&gt;How did you define your directory in XML ?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 11:34:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323712#M10713</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2013-01-09T11:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323713#M10714</link>
      <description>&lt;P&gt;I just added some details on the post, thanks&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 12:15:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323713#M10714</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-01-09T12:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323714#M10715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I don't know if you still have the problem, but...&lt;/P&gt;
&lt;P&gt;I suppose you added a prefix for your custom directory schema, in your schema contrib file :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;schema name="pack" src="directoryschema/pack.xsd" prefix="pp" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this is the case, removing the prefix should resolve the problem.
(Still, it doesn't &lt;EM&gt;really&lt;/EM&gt; solve the problem, this is just a bug workaround)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 15:59:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323714#M10715</guid>
      <dc:creator>Aykut_Açikel</dc:creator>
      <dc:date>2013-01-30T15:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323715#M10716</link>
      <description>&lt;P&gt;Woah, I just tried, and it worked. Awesome! Thank you a lot, I was really out of ideas on this one.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 16:06:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323715#M10716</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-01-30T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Managing custom directories through the admin center</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323716#M10717</link>
      <description>&lt;P&gt;You are welcome. I usually don't put prefix for directories, as i had some problems in the past&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 16:12:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/managing-custom-directories-through-the-admin-center/m-p/323716#M10717</guid>
      <dc:creator>Aykut_Açikel</dc:creator>
      <dc:date>2013-01-30T16:12:54Z</dc:date>
    </item>
  </channel>
</rss>

