Document is Nuxeo is not just a file (even a folder in Nuxeo is a Document), but a set of fields includes
Document structure is defined using (several) XSD schemas
And facets, which can be associated with zero or more schemas, and other behaviours.
Structural Document Type
Document type is defined by
Document type can inherit from each other
UI document types
To register structural document type so that it becomes visible in platform.
Layouts
Structure templates
- a section of tree of doc nodes to create altogether (is it here? incomplete)
Schema
[ a very simple, sample schema]
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://project.nuxeo.org/sample/schemas/sample/">
<xs:element name="sample1" type="xs:string"/>
<xs:element name="sample2" type="xs:string"/>
</xs:schema>
[ register through "schema" extension point]
<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.types">
<extension target="org.nuxeo.ecm.core.schema.TypeService"
point="schema">
<schema name="sample" src="schemas/sample.xsd" prefix="smp" />
</extension>
</component>
Facet
[sample, adding to a document type]
<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.types">
...
<extension target="org.nuxeo.ecm.core.schema.TypeService"
point="doctype">
<facet name="Rated">
<schema name="rating"/>
Schema
</facet>
...
</extension>
</component>
Structural Document Type
<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.types">
...
<extension target="org.nuxeo.ecm.core.schema.TypeService"
point="doctype">
...
<doctype name="Sample" extends="Document">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="sample"/>
<facet name="Rated"/>
</doctype>
</extension>
</component>
UI document types
[ skeleton]
<?xml version="1.0"?>
<component name="org.nuxeo.project.sample.ecm.types">
<extension target="org.nuxeo.ecm.platform.types.TypeService"
point="types">
<type id="Sample">
<label>Sample document</label>
<description>Sample document to do such and such</description>
<icon>/icons/file.gif</icon>
<bigIcon>/icons/file_100.png</bigIcon>
<category>SimpleDocument</category>
......
<layouts>...</layouts>
...
</type>
</extension>
</component>
[Facelet views - only needed if other than defaults are used]
<type id="Sample">
...
<default-view>view_documents</default-view>
<create-view>create_document</default-view>
<edit-view>edit_document</default-view>
...
</type>
[Layout example]
This refers to layouts definition in another extension point. Layout may be laid inside but that is deprecated.
<type id="Sample">
...
<layouts mode="any">
<layout>heading</layout>
<layout>note</layout>
</layouts>
...
</type>
[subtypes]
what can be placed in what...
Note it's not inside the Sample type but stand alone <type> sections.
Note "hidden" can hide type (not be allowed) as children in some cases (create, paste)
<type id="Folder">
<subtypes>
<type>Sample</type>
</subtypes>
</type>
<type id="Workspace">
<subtypes>
<type>Sample</type>
<type hidden="create, paste">Folder</type>
</subtypes>
</type>