Managing custom directories through the admin center


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:

-I made a custom form layout that uses the /layouts/directory_layout_template.xhtml template
-I contributed the layout through an XML contribution:

  <extension target="" point="directories">
    <directory name="XXX" layout="FormLayoutXXX@edit" sortField="label" />

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.

But! 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:

org.nuxeo.ecm.core.api.ClientException: Missing id

(actually thrown at SQLSession#createEntry(Map<String, Object>), l.180)

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 entry.getProperties(schemaName) (SQLSession, l.1086) do not contain the prefix in the case of vocabularies, but they do otherwise, and the SQLSession doesn't like it.

Thanks for your help.


  • The directory contribution:


<directory name="XXX">
  • The schema contents:


<?xml version="1.0"?>
<xs:schema targetNamespace=""
    <xs:element name="id" type="xs:string"/>
    <xs:element name="label" type="xs:string"/>
    <xs:element name="custom_col_1" type="xs:string"/>
    <xs:element name="custom_col_2" type="xs:string"/>
    <xs:element name="custom_col_3" type="xs:string"/>
    <xs:element name="obsolete" type="xs:integer" default="0"/>
    <xs:element name="ordering" type="xs:integer" default="10000000"/>
  • The csv contents:


0 votes

1 answers



How did you define your directory in XML ?

I just added some details on the post, thanks


I don't know if you still have the problem, but…

I suppose you added a prefix for your custom directory schema, in your schema contrib file :

<schema name="pack" src="directoryschema/pack.xsd" prefix="pp" />

If this is the case, removing the prefix should resolve the problem. (Still, it doesn't really solve the problem, this is just a bug workaround)

1 votes

Woah, I just tried, and it worked. Awesome! Thank you a lot, I was really out of ideas on this one.

You are welcome. I usually don't put prefix for directories, as i had some problems in the past :-)