public class TypeService extends DefaultComponent implements TypeManager
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CATEGORY |
static String |
HIDDEN_IN_CREATION |
static ComponentName |
ID |
Constructor and Description |
---|
TypeService() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
boolean |
canCreate(String typeName,
String containerTypeName)
Returns
true if typeName is a sub type, allowed in
creation mode, of containerTypeName , false otherwise. |
boolean |
canCreate(String typeName,
String containerTypeName,
DocumentModel currentDoc)
Returns
true if typeName is a sub type, allowed in
creation, of containerTypeName , false otherwise. |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
Collection<Type> |
findAllAllowedSubTypesFrom(String typeName)
Returns recursively all the allowed sub types from the given
typeName . |
Collection<Type> |
findAllAllowedSubTypesFrom(String typeName,
DocumentModel currentDoc)
Returns recursively all the allowed sub types from the given
typeName , filtered by a local UI types configuration retrieved
from the currentDoc , if any. |
Collection<Type> |
getAllowedSubTypes(String typeName) |
Collection<Type> |
getAllowedSubTypes(String typeName,
DocumentModel currentDoc)
Returns the allowed sub types of the given
typeName , filtered by
a local UI types configuration retrieved from the currentDoc , if
any. |
String[] |
getSuperTypes(String typeName)
Gets the super type names for the given type.
|
Type |
getType(String typeName)
Returns the
Type instance for the given typeName . |
Map<String,List<Type>> |
getTypeMapForDocumentType(String typeName,
DocumentModel currentDoc)
Returns the sub type of the given
typeName , filtered by a local
UI types configuration retrieved from the currentDoc , if any, and
organized by type categories. |
TypeRegistry |
getTypeRegistry() |
Collection<Type> |
getTypes()
Returns all the registered
Type s. |
TypeWidgetRegistry |
getTypeWidgetRegistry() |
boolean |
hasType(String typeName)
Returns
true if typeName is a registered Type, false otherwise. |
boolean |
isAllowedSubType(String typeName,
String containerTypeName)
Returns
true if typeName is an allowed sub type of
containerTypeName , false otherwise. |
boolean |
isAllowedSubType(String typeName,
String containerTypeName,
DocumentModel currentDoc)
Returns
true if typeName is an allowed sub type of
containerTypeName , filtered by a local UI types configuration
retrieved from the currentDoc , if any, false otherwise. |
void |
registerExtension(Extension extension)
Registers the given extension.
|
void |
registerTypeWidgetExtension(Extension extension) |
void |
unregisterExtension(Extension extension)
Unregisters the given extension.
|
void |
unregisterTypeWidgetExtension(Extension extension) |
applicationStarted, getAdapter, registerContribution, unregisterContribution
public static final ComponentName ID
public static String DEFAULT_CATEGORY
public static final String HIDDEN_IN_CREATION
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerExtension(Extension extension)
Extensible
registerExtension
in interface Extensible
registerExtension
in class DefaultComponent
extension
- the extension to registerpublic void unregisterExtension(Extension extension)
Extensible
unregisterExtension
in interface Extensible
unregisterExtension
in class DefaultComponent
extension
- the extension to unregisterpublic void registerTypeWidgetExtension(Extension extension)
public void unregisterTypeWidgetExtension(Extension extension)
public TypeRegistry getTypeRegistry()
public TypeWidgetRegistry getTypeWidgetRegistry()
public String[] getSuperTypes(String typeName)
TypeManager
getSuperTypes
in interface TypeManager
public Type getType(String typeName)
TypeManager
Type
instance for the given typeName
.getType
in interface TypeManager
public boolean hasType(String typeName)
TypeManager
true
if typeName
is a registered Type, false
otherwise.hasType
in interface TypeManager
public Collection<Type> getTypes()
TypeManager
Type
s.getTypes
in interface TypeManager
public Collection<Type> getAllowedSubTypes(String typeName)
getAllowedSubTypes
in interface TypeManager
public Collection<Type> getAllowedSubTypes(String typeName, DocumentModel currentDoc)
TypeManager
typeName
, filtered by
a local UI types configuration retrieved from the currentDoc
, if
any.getAllowedSubTypes
in interface TypeManager
public Collection<Type> findAllAllowedSubTypesFrom(String typeName)
TypeManager
typeName
.findAllAllowedSubTypesFrom
in interface TypeManager
public Collection<Type> findAllAllowedSubTypesFrom(String typeName, DocumentModel currentDoc)
TypeManager
typeName
, filtered by a local UI types configuration retrieved
from the currentDoc
, if any.findAllAllowedSubTypesFrom
in interface TypeManager
public Map<String,List<Type>> getTypeMapForDocumentType(String typeName, DocumentModel currentDoc)
TypeManager
typeName
, filtered by a local
UI types configuration retrieved from the currentDoc
, if any, and
organized by type categories.getTypeMapForDocumentType
in interface TypeManager
public boolean canCreate(String typeName, String containerTypeName)
TypeManager
true
if typeName
is a sub type, allowed in
creation mode, of containerTypeName
, false
otherwise.canCreate
in interface TypeManager
public boolean canCreate(String typeName, String containerTypeName, DocumentModel currentDoc)
TypeManager
true
if typeName
is a sub type, allowed in
creation, of containerTypeName
, false
otherwise.
It takes care of a local UI types configuration retrieved from the
currentDoc
to filter the sub types of typeName
before
checking the creation mode.
canCreate
in interface TypeManager
public boolean isAllowedSubType(String typeName, String containerTypeName)
TypeManager
true
if typeName
is an allowed sub type of
containerTypeName
, false
otherwise.isAllowedSubType
in interface TypeManager
public boolean isAllowedSubType(String typeName, String containerTypeName, DocumentModel currentDoc)
TypeManager
true
if typeName
is an allowed sub type of
containerTypeName
, filtered by a local UI types configuration
retrieved from the currentDoc
, if any, false
otherwise.isAllowedSubType
in interface TypeManager
Copyright © 2011 Nuxeo SA. All Rights Reserved.