@Name(value="typesTool") @Scope(value=CONVERSATION) @Install(precedence=10) public class TypesTool extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
protected NavigationContext |
navigationContext |
protected NuxeoSeamHotReloader |
seamReload |
protected Type |
selectedType |
protected TypeManager |
typeManager |
protected Map<String,List<List<Type>>> |
typesMap |
protected Long |
typesMapTimestamp |
Constructor and Description |
---|
TypesTool() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,List<Type>> |
filterTypeMap(Map<String,List<Type>> docTypeMap)
Method to be overridden by subclasses to filter the type Map.
|
protected DocumentModel |
getConfigurationDocument()
Returns the Configuration document to be used as the local configuration of the
TypeManager . |
protected DocumentModel |
getCurrentItem() |
Map<String,List<List<Type>>> |
getOrganizedTypeMapForDocumentType(String type) |
Type |
getSelectedType() |
Type |
getType(String typeName) |
Map<String,List<List<Type>>> |
getTypesList() |
boolean |
hasType(String typeName) |
protected Map<String,List<List<Type>>> |
organizeType(Map<String,List<Type>> types)
Split each @{code List} of
Type in one or more new List , with maximum 4 Type s in each new
List and returns the new computed Map . |
void |
populateTypesList()
Retrieves the list of allowed sub types given a current type.
|
void |
resetTypesList() |
void |
setSelectedType(Type type)
If the selected type is supposed to be automatically injected by Seam through @DataModelSelection callback (i.e.
|
void |
setTypesList(Map<String,List<List<Type>>> typesList) |
protected static final org.apache.commons.logging.Log log
@In(create=true) protected transient TypeManager typeManager
@In(create=true) protected NuxeoSeamHotReloader seamReload
protected Long typesMapTimestamp
protected Type selectedType
@In(create=true) protected transient NavigationContext navigationContext
public TypesTool()
@Observer(value={"contentRootSelectionChanged","documentSelectionChanged","domainSelectionChanged","localConfigurationChanged"}, create=false) @BypassInterceptors public void resetTypesList()
public void populateTypesList()
This is used at creation time. Current type is retrieved thanks to the document model hold and passed by the event.
public Map<String,List<List<Type>>> getOrganizedTypeMapForDocumentType(String type)
protected DocumentModel getConfigurationDocument()
TypeManager
.
This method can be overridden by Subclasses to define a specific Configuration document.
protected Map<String,List<Type>> filterTypeMap(Map<String,List<Type>> docTypeMap)
protected Map<String,List<List<Type>>> organizeType(Map<String,List<Type>> types)
Type
in one or more new List
, with maximum 4 Type
s in each new
List
and returns the new computed Map
.public Type getSelectedType()
public void setSelectedType(Type type)
null
parameter before.@Factory(value="typesMap", scope=EVENT) public Map<String,List<List<Type>>> getTypesList()
protected DocumentModel getCurrentItem()
Copyright © 2017 Nuxeo. All rights reserved.