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 |
lastModified| Constructor and Description |
|---|
TypeService() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context)
Activates the component.
|
protected boolean |
canCreate(String typeName,
Map<String,SubType> allowedSubTypes) |
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. |
protected boolean |
canCreate(SubType subType) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
protected Map<String,SubType> |
filterSubTypesFromConfiguration(Map<String,SubType> allowedSubTypes,
DocumentModel currentDoc) |
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. |
protected Collection<Type> |
findAllAllowedSubTypesFrom(String typeName,
DocumentModel currentDoc,
List<String> alreadyProcessedTypes) |
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. |
protected UITypesConfiguration |
getConfiguration(DocumentModel currentDoc) |
protected Map<String,SubType> |
getFilteredAllowedSubTypes(String containerTypeName,
DocumentModel currentDoc) |
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
Types. |
boolean |
hasType(String typeName)
Returns
true if typeName is a registered Type, false otherwise. |
protected boolean |
isAllowedSubType(String typeName,
Map<String,SubType> allowedSubTypes) |
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) |
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLastModified, setLastModifiedapplicationStarted, getApplicationStartedOrderpublic static final ComponentName ID
public static String DEFAULT_CATEGORY
public static final String HIDDEN_IN_CREATION
public TypeService()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic TypeRegistry getTypeRegistry()
public String[] getSuperTypes(String typeName)
TypeManagergetSuperTypes in interface TypeManagerpublic Type getType(String typeName)
TypeManagerType instance for the given typeName.getType in interface TypeManagerpublic boolean hasType(String typeName)
TypeManagertrue if typeName is a registered Type, false otherwise.hasType in interface TypeManagerpublic Collection<Type> getTypes()
TypeManagerTypes.getTypes in interface TypeManagerpublic Collection<Type> getAllowedSubTypes(String typeName)
getAllowedSubTypes in interface TypeManagerpublic Collection<Type> getAllowedSubTypes(String typeName, DocumentModel currentDoc)
TypeManagertypeName, filtered by a local UI types configuration retrieved
from the currentDoc, if any.getAllowedSubTypes in interface TypeManagerpublic Collection<Type> findAllAllowedSubTypesFrom(String typeName)
TypeManagertypeName.findAllAllowedSubTypesFrom in interface TypeManagerpublic Collection<Type> findAllAllowedSubTypesFrom(String typeName, DocumentModel currentDoc)
TypeManagertypeName, filtered by a local UI types
configuration retrieved from the currentDoc, if any.findAllAllowedSubTypesFrom in interface TypeManagerprotected Collection<Type> findAllAllowedSubTypesFrom(String typeName, DocumentModel currentDoc, List<String> alreadyProcessedTypes)
protected UITypesConfiguration getConfiguration(DocumentModel currentDoc)
public Map<String,List<Type>> getTypeMapForDocumentType(String typeName, DocumentModel currentDoc)
TypeManagertypeName, filtered by a local UI types configuration retrieved from the
currentDoc, if any, and organized by type categories.getTypeMapForDocumentType in interface TypeManagerpublic boolean canCreate(String typeName, String containerTypeName)
TypeManagertrue if typeName is a sub type, allowed in creation mode, of containerTypeName,
false otherwise.canCreate in interface TypeManagerpublic boolean canCreate(String typeName, String containerTypeName, DocumentModel currentDoc)
TypeManagertrue 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 TypeManagerprotected Map<String,SubType> getFilteredAllowedSubTypes(String containerTypeName, DocumentModel currentDoc)
public boolean isAllowedSubType(String typeName, String containerTypeName)
TypeManagertrue if typeName is an allowed sub type of containerTypeName, false
otherwise.isAllowedSubType in interface TypeManagerprotected boolean isAllowedSubType(String typeName, Map<String,SubType> allowedSubTypes)
public boolean isAllowedSubType(String typeName, String containerTypeName, DocumentModel currentDoc)
TypeManagertrue 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 TypeManagerprotected Map<String,SubType> filterSubTypesFromConfiguration(Map<String,SubType> allowedSubTypes, DocumentModel currentDoc)
Copyright © 2017 Nuxeo. All rights reserved.