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!

0 votes

1 answers

1053 views

ANSWER



I suggest to read this documentation, especially the UI part and layout part (section Containment rules).

0 votes



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> &lt;extension target="org.nuxeo.ecm.platform.types.TypeService" point="types"&gt;

    &amp;lt;type id=&quot;myContainer&quot;&amp;gt;
        &amp;lt;subtypes&amp;gt;
            &amp;lt;type&amp;gt;Folder&amp;lt;/type&amp;gt;
            &amp;lt;type&amp;gt;File&amp;lt;/type&amp;gt;
            &amp;lt;type&amp;gt;myItem&amp;lt;/type&amp;gt;
        &amp;lt;/subtypes&amp;gt;
        &amp;lt;default-view&amp;gt;view_documents&amp;lt;/default-view&amp;gt;
        &amp;lt;layouts mode=&quot;any&quot;&amp;gt;
            &amp;lt;layout&amp;gt;heading&amp;lt;/layout&amp;gt;
        &amp;lt;/layouts&amp;gt;
        &amp;lt;layouts mode=&quot;edit&quot;&amp;gt;
            &amp;lt;layout&amp;gt;heading&amp;lt;/layout&amp;gt;
            &amp;lt;layout&amp;gt;dublincore&amp;lt;/layout&amp;gt;
        &amp;lt;/layouts&amp;gt;
        &amp;lt;contentViews category=&quot;content&quot;&amp;gt;
            &amp;lt;contentView&amp;gt;document_content&amp;lt;/contentView&amp;gt;
        &amp;lt;/contentViews&amp;gt;
        &amp;lt;contentViews category=&quot;trash_content&quot;&amp;gt;
            &amp;lt;contentView showInExportView=&quot;false&quot;&amp;gt;
                document_trash_content
            &amp;lt;/contentView&amp;gt;
        &amp;lt;/contentViews&amp;gt;
    &amp;lt;/type&amp;gt;
    &amp;lt;type id=&quot;myItem&quot;&amp;gt;
        &amp;lt;layouts mode=&quot;any&quot;&amp;gt;
            &amp;lt;layout&amp;gt;dublincore&amp;lt;/layout&amp;gt;
            &amp;lt;layout&amp;gt;heading&amp;lt;/layout&amp;gt;
            &amp;lt;layout&amp;gt;note&amp;lt;/layout&amp;gt;
        &amp;lt;/layouts&amp;gt;
        &amp;lt;contentViews category=&quot;content&quot;&amp;gt;
            &amp;lt;contentView&amp;gt;document_content&amp;lt;/contentView&amp;gt;
        &amp;lt;/contentViews&amp;gt;
    &amp;lt;/type&amp;gt;&lt;/pre&gt;
09/25/2012

Can you try to just add Folderish facet to your container type ?
09/25/2012

I just tried that, and it doesn't make any difference.
09/27/2012