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. |
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 |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLastModified, setLastModified
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 registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public TypeRegistry getTypeRegistry()
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 © 2015 Nuxeo SA. All rights reserved.