Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.schema
Interface DocumentType

All Superinterfaces:
ComplexType, CompositeType, Serializable, Type, ValueConverter
All Known Implementing Classes:
DocumentTypeImpl

public interface DocumentType
extends CompositeType

Document types are composite types made of several schemas.

Sample document types are Workspace, Section, Domain,... The list of builtin document type is visible at NXCore/OSGI-INF/CoreExtensions.xml.

Author:
Bogdan Stefanescu

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.core.schema.types.Type
ANY
 
Method Summary
 void addSchemas(String[] schemas)
          Adds specified schemas to the document type.
 String[] getChildrenTypes()
          Gets the type names that can be used for children docs.
 Set<String> getFacets()
          Gets all the facets of this document type.
 PrefetchInfo getPrefetchInfo()
          Gets the prefetch info, or null if no prefetch is defined.
 TypeRef<DocumentType> getRef()
          Gets a proxy (or reference to this type).
 DocumentType[] getResolvedChildrenTypes()
          Gets the resolved children doc types.
 boolean isChildTypeAllowed(String name)
           
 boolean isFile()
          Tests whether this type describes a document (not a folder!) or not.
 boolean isFolder()
          Tests whether this type describes a folder or not.
 boolean isOrdered()
          Tests whether this type describe an ordered folder or not.
 void setChildrenTypes(String[] subTypes)
          Sets the names of the allowed children doc types.
 void setDeclaredFacets(String[] facets)
           
 void setPrefetchInfo(PrefetchInfo prefetchInfo)
          Sets the prefetch info.
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.CompositeType
addSchema, addSchema, getSchema, getSchemaByPrefix, getSchemaNames, getSchemas, hasSchema, hasSchemas
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.ComplexType
addField, addField, addField, addField, getField, getField, getFields, getFieldsCount, getNamespace, hasField, hasField, hasFields, isUnstructured
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.Type
decode, encode, getHelper, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isNotNull, isReadOnly, isSimpleType, isSuperTypeOf, newInstance, validate
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.ValueConverter
convert
 

Method Detail

setPrefetchInfo

void setPrefetchInfo(PrefetchInfo prefetchInfo)
Sets the prefetch info.

The prefetch info describes which fields (or entire schemas) should be prefetched when instantiating a document.

This is primarily intended to optimize document initialization time.

The prefetch info is a string array of length multiple of 2 containing a sequence of pairs composed by the schema name and the field name. If the field name is null then the entire schema should be prefetched. Example: "common", null, "dublincore", "title"

Parameters:
prefetchInfo -

getPrefetchInfo

PrefetchInfo getPrefetchInfo()
Gets the prefetch info, or null if no prefetch is defined.

If the prefetch info is not null, the caller should use it when instantiating a document to preload the fields defined by the prefetch info.

If no prefetch is specified by the document type, the caller is free to use a default prefetch info or no prefetch at all.

Returns:
the prefetch info or null

isFile

boolean isFile()
Tests whether this type describes a document (not a folder!) or not.

Returns:
true if the type describes a document folder, otherwise returns false

isFolder

boolean isFolder()
Tests whether this type describes a folder or not.

Returns:
true if the type describes a folder, otherwise returns false

isOrdered

boolean isOrdered()
Tests whether this type describe an ordered folder or not.

Returns:
true if the type describes an ordered folder, otherwise returns false

getFacets

Set<String> getFacets()
Gets all the facets of this document type.

Facets inherited from parents are taken into account.

Returns:
the facets

setDeclaredFacets

void setDeclaredFacets(String[] facets)
Parameters:
facets -

addSchemas

void addSchemas(String[] schemas)
Adds specified schemas to the document type.

Parameters:
schemas -

getRef

TypeRef<DocumentType> getRef()
Description copied from interface: Type
Gets a proxy (or reference to this type).

Specified by:
getRef in interface ComplexType
Specified by:
getRef in interface CompositeType
Specified by:
getRef in interface Type
Returns:
a reference to the type

setChildrenTypes

void setChildrenTypes(String[] subTypes)
Sets the names of the allowed children doc types.

Children types are document types allowed for the children of a document of the current type.

Type names may include '*' for all types.

Parameters:
subTypes - null if no children types have been defined (i.e. this type cannot have children), else an array with children types

getChildrenTypes

String[] getChildrenTypes()
Gets the type names that can be used for children docs.

Returned types may include special group of types like '*'.

Returns:

getResolvedChildrenTypes

DocumentType[] getResolvedChildrenTypes()
Gets the resolved children doc types.

Special group of types like '*' and exclusion filters if any are applied and the set of actual children types is computed and resolved into real doc types.

Returns:
null if no children types was defined (i.e. this type cannot have children) or an array with children types

isChildTypeAllowed

boolean isChildTypeAllowed(String name)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.