How to get default views on custom document types
I am trying to get default views on custom document types that extend Folder or support the dublincore schema, but I can't figure out what exactly to contribute to org.nuxeo.ecm.platform.types.TypeService. Here are the types:
<doctype name="myContainer" extends="Folder">
<facet name="myFacet"/>
</doctype>
<doctype name="myItem">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="myItemSchema"/>
</doctype>
The best I have obtained is an empty listing for myContainer. What would it take (not using Studio) for the myContainer page under http://server/nuxeo/nxpath to display like a normal folder page (with items listed and a “New” command to create subfolders)?
Thanks!
I suggest to read this documentation, especially the UI part and layout part (section Containment rules).
I have read that document and the relevant help sections, many times… I have with and without a subtypes element, no difference. The default-view for the container won't list my items. It will if I change the myItem docType to extend File (which I don't want to do in general), but even then clicking the item gives me a page not found. This is the UI Type contribution I am using: <pre> <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
&lt;type id="myContainer"&gt;
&lt;subtypes&gt;
&lt;type&gt;Folder&lt;/type&gt;
&lt;type&gt;File&lt;/type&gt;
&lt;type&gt;myItem&lt;/type&gt;
&lt;/subtypes&gt;
&lt;default-view&gt;view_documents&lt;/default-view&gt;
&lt;layouts mode="any"&gt;
&lt;layout&gt;heading&lt;/layout&gt;
&lt;/layouts&gt;
&lt;layouts mode="edit"&gt;
&lt;layout&gt;heading&lt;/layout&gt;
&lt;layout&gt;dublincore&lt;/layout&gt;
&lt;/layouts&gt;
&lt;contentViews category="content"&gt;
&lt;contentView&gt;document_content&lt;/contentView&gt;
&lt;/contentViews&gt;
&lt;contentViews category="trash_content"&gt;
&lt;contentView showInExportView="false"&gt;
document_trash_content
&lt;/contentView&gt;
&lt;/contentViews&gt;
&lt;/type&gt;
&lt;type id="myItem"&gt;
&lt;layouts mode="any"&gt;
&lt;layout&gt;dublincore&lt;/layout&gt;
&lt;layout&gt;heading&lt;/layout&gt;
&lt;layout&gt;note&lt;/layout&gt;
&lt;/layouts&gt;
&lt;contentViews category="content"&gt;
&lt;contentView&gt;document_content&lt;/contentView&gt;
&lt;/contentViews&gt;
&lt;/type&gt;</pre>