Package org.nuxeo.ecm.platform.types
Class TypeService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.types.TypeService
- All Implemented Interfaces:
TypeManager
,Adaptable
,Component
,Extensible
,TimestampedService
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final ComponentName
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.boolean
Returnstrue
iftypeName
is a sub type, allowed in creation mode, ofcontainerTypeName
,false
otherwise.boolean
canCreate
(String typeName, String containerTypeName, DocumentModel currentDoc) Returnstrue
iftypeName
is a sub type, allowed in creation, ofcontainerTypeName
,false
otherwise.protected boolean
protected boolean
void
deactivate
(ComponentContext context) Deactivates the component.filterSubTypesFromConfiguration
(Map<String, SubType> allowedSubTypes, DocumentModel currentDoc) findAllAllowedSubTypesFrom
(String typeName) Returns recursively all the allowed sub types from the giventypeName
.findAllAllowedSubTypesFrom
(String typeName, DocumentModel currentDoc) Returns recursively all the allowed sub types from the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any.protected Collection<Type>
findAllAllowedSubTypesFrom
(String typeName, DocumentModel currentDoc, List<String> alreadyProcessedTypes) getAllowedSubTypes
(String typeName) getAllowedSubTypes
(String typeName, DocumentModel currentDoc) Returns the allowed sub types of the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any.protected UITypesConfiguration
getConfiguration
(DocumentModel currentDoc) getFilteredAllowedSubTypes
(String containerTypeName, DocumentModel currentDoc) String[]
getSuperTypes
(String typeName) Gets the super type names for the given type.Returns theType
instance for the giventypeName
.getTypeMapForDocumentType
(String typeName, DocumentModel currentDoc) Returns the sub type of the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any, and organized by type categories.getTypes()
Returns all the registeredType
s.boolean
Returnstrue
iftypeName
is a registered Type,false
otherwise.boolean
isAllowedSubType
(String typeName, String containerTypeName) Returnstrue
iftypeName
is an allowed sub type ofcontainerTypeName
,false
otherwise.boolean
isAllowedSubType
(String typeName, String containerTypeName, DocumentModel currentDoc) Returnstrue
iftypeName
is an allowed sub type ofcontainerTypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any,false
otherwise.protected boolean
isAllowedSubType
(String typeName, Map<String, SubType> allowedSubTypes) void
registerContribution
(Object contribution, String extensionPoint, ComponentInstance contributor) void
unregisterContribution
(Object contribution, String extensionPoint, ComponentInstance contributor) Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
Methods inherited from interface org.nuxeo.runtime.service.TimestampedService
getLastModified, setLastModified
-
Field Details
-
ID
-
DEFAULT_CATEGORY
- See Also:
-
HIDDEN_IN_CREATION
- See Also:
-
-
Constructor Details
-
TypeService
public TypeService()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContribution
in classDefaultComponent
-
getTypeRegistry
-
getSuperTypes
Description copied from interface:TypeManager
Gets the super type names for the given type.- Specified by:
getSuperTypes
in interfaceTypeManager
- Returns:
- an array of supertypes or an empty array if no supertype exists. null is returned if no such type exists
-
getType
Description copied from interface:TypeManager
Returns theType
instance for the giventypeName
.- Specified by:
getType
in interfaceTypeManager
-
hasType
Description copied from interface:TypeManager
Returnstrue
iftypeName
is a registered Type,false
otherwise.- Specified by:
hasType
in interfaceTypeManager
-
getTypes
Description copied from interface:TypeManager
Returns all the registeredType
s.- Specified by:
getTypes
in interfaceTypeManager
-
getAllowedSubTypes
- Specified by:
getAllowedSubTypes
in interfaceTypeManager
-
getAllowedSubTypes
Description copied from interface:TypeManager
Returns the allowed sub types of the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any.- Specified by:
getAllowedSubTypes
in interfaceTypeManager
-
findAllAllowedSubTypesFrom
Description copied from interface:TypeManager
Returns recursively all the allowed sub types from the giventypeName
.- Specified by:
findAllAllowedSubTypesFrom
in interfaceTypeManager
-
findAllAllowedSubTypesFrom
Description copied from interface:TypeManager
Returns recursively all the allowed sub types from the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any.- Specified by:
findAllAllowedSubTypesFrom
in interfaceTypeManager
-
findAllAllowedSubTypesFrom
protected Collection<Type> findAllAllowedSubTypesFrom(String typeName, DocumentModel currentDoc, List<String> alreadyProcessedTypes) -
getConfiguration
-
getTypeMapForDocumentType
Description copied from interface:TypeManager
Returns the sub type of the giventypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any, and organized by type categories.- Specified by:
getTypeMapForDocumentType
in interfaceTypeManager
-
canCreate
Description copied from interface:TypeManager
Returnstrue
iftypeName
is a sub type, allowed in creation mode, ofcontainerTypeName
,false
otherwise.- Specified by:
canCreate
in interfaceTypeManager
-
canCreate
Description copied from interface:TypeManager
Returnstrue
iftypeName
is a sub type, allowed in creation, ofcontainerTypeName
,false
otherwise.It takes care of a local UI types configuration retrieved from the
currentDoc
to filter the sub types oftypeName
before checking the creation mode.- Specified by:
canCreate
in interfaceTypeManager
-
getFilteredAllowedSubTypes
protected Map<String,SubType> getFilteredAllowedSubTypes(String containerTypeName, DocumentModel currentDoc) -
canCreate
-
canCreate
-
isAllowedSubType
Description copied from interface:TypeManager
Returnstrue
iftypeName
is an allowed sub type ofcontainerTypeName
,false
otherwise.- Specified by:
isAllowedSubType
in interfaceTypeManager
-
isAllowedSubType
-
isAllowedSubType
public boolean isAllowedSubType(String typeName, String containerTypeName, DocumentModel currentDoc) Description copied from interface:TypeManager
Returnstrue
iftypeName
is an allowed sub type ofcontainerTypeName
, filtered by a local UI types configuration retrieved from thecurrentDoc
, if any,false
otherwise.- Specified by:
isAllowedSubType
in interfaceTypeManager
-
filterSubTypesFromConfiguration
-