Package org.ametys.cms.contenttype
Class ContentTypesTreeComponent
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.contenttype.ContentTypesTreeComponent
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class ContentTypesTreeComponent extends AbstractLogEnabled implements Component, Serviceable
This component get content types according to a lot of parameters (hide mixin content type, hide non reference content type...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ContentTypesTreeComponent.ExcludeMode
-
Field Summary
Fields Modifier and Type Field Description private ContentTypeExtensionPoint
_contentTypeEP
static String
ROLE
Avalon Role.
-
Constructor Summary
Constructors Constructor Description ContentTypesTreeComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Map<String,Object>
_getContentTypeParams(ContentType contentType, boolean disabled)
private Set<ContentType>
_getContentTypes()
private List<Map<String,Object>>
_getContentTypes(boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean includeMixinOnly, boolean includeReferenceTableOnly, ContentTypesTreeComponent.ExcludeMode excludeMode, boolean hierarchicalView, List<String> strictContentTypeIds)
private List<Map<String,Object>>
_getHierarchicalContentType(ContentType contentType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly, ContentTypesTreeComponent.ExcludeMode excludeMode)
private List<Map<String,Object>>
_getNonHierarchicalContentType(ContentType contentType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly)
private List<String>
_getRestrictedContentTypes(Collection<String> contentTypeIds)
private Set<ContentType>
_getRootContentTypes()
private boolean
_matchCondition(ContentType cType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly)
Map<String,Object>
getContentTypes(Map<String,Object> params)
Get content types to hierarchical or flat representation according to given parametersSet<ContentType>
getMatchingContentTypes(boolean excludeReferenceTable, boolean excludePrivate, boolean excludeAbstract, boolean excludeMixin, boolean mixinOnly, boolean referenceTableOnly)
Get the matching content typesSet<ContentType>
getMatchingContentTypes(String[] contentTypesIds, boolean browseChildren, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeAbstract, boolean excludeMixin, boolean mixinOnly, boolean referenceTableOnly)
Get the matching content types among the given listvoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_contentTypeEP
private ContentTypeExtensionPoint _contentTypeEP
-
-
Constructor Detail
-
ContentTypesTreeComponent
public ContentTypesTreeComponent()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getContentTypes
public Map<String,Object> getContentTypes(Map<String,Object> params)
Get content types to hierarchical or flat representation according to given parameters- Parameters:
params
- The parameters :- {Boolean} excludeReferenceTable : to exclude reference table. Defaults to true.
- {Boolean} excludePrivate : to exclude private content types. Defaults to false.
- {Boolean} excludeMixin : to exclude mixins. Defaults to false.
- {Boolean} excludeAbstract : to exclude asbtract content types. Defaults to false.
- {String} excludeMode : 'hide' or 'disabled'. The mode of exclusion. Defaults to 'disabled'.
- {Boolean} hierarchicalView: true to get a hierarchical representation of content types, or false to get a flat representation. Defaults to true.
- {List<String>} contentTypes: the ids of content types to restrict the list. The child content types will be also returned
- {List<String>} strictContentTypes: the ids of content types to restrict the list. Only these content types will be returned
- Returns:
- The content types according to received parameters
-
_getContentTypes
private List<Map<String,Object>> _getContentTypes(boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean includeMixinOnly, boolean includeReferenceTableOnly, ContentTypesTreeComponent.ExcludeMode excludeMode, boolean hierarchicalView, List<String> strictContentTypeIds)
-
_getRestrictedContentTypes
private List<String> _getRestrictedContentTypes(Collection<String> contentTypeIds)
-
_getHierarchicalContentType
private List<Map<String,Object>> _getHierarchicalContentType(ContentType contentType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly, ContentTypesTreeComponent.ExcludeMode excludeMode)
-
_getNonHierarchicalContentType
private List<Map<String,Object>> _getNonHierarchicalContentType(ContentType contentType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly)
-
_getRootContentTypes
private Set<ContentType> _getRootContentTypes()
-
_getContentTypes
private Set<ContentType> _getContentTypes()
-
_matchCondition
private boolean _matchCondition(ContentType cType, Collection<String> restrictedContentTypes, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeMixin, boolean excludeAbstract, boolean mixinOnly, boolean refTableOnly)
-
getMatchingContentTypes
public Set<ContentType> getMatchingContentTypes(boolean excludeReferenceTable, boolean excludePrivate, boolean excludeAbstract, boolean excludeMixin, boolean mixinOnly, boolean referenceTableOnly)
Get the matching content types- Parameters:
excludeReferenceTable
- true to exclude reference tableexcludePrivate
- true to exclude the private content typesexcludeAbstract
- true to exclude the abstract content typesexcludeMixin
- true to exclude the mixinsmixinOnly
- true to include the mixins onlyreferenceTableOnly
- true to include the reference table only- Returns:
- matching content types
-
getMatchingContentTypes
public Set<ContentType> getMatchingContentTypes(String[] contentTypesIds, boolean browseChildren, boolean excludeReferenceTable, boolean excludePrivate, boolean excludeAbstract, boolean excludeMixin, boolean mixinOnly, boolean referenceTableOnly)
Get the matching content types among the given list- Parameters:
contentTypesIds
- The list of content types to browse. Can be null to browse all available content typesbrowseChildren
- to browse the child content typesexcludeReferenceTable
- true to exclude reference tableexcludePrivate
- true to exclude the private content typesexcludeAbstract
- true to exclude the abstract content typesexcludeMixin
- true to exclude the mixinsmixinOnly
- true to include the mixins onlyreferenceTableOnly
- true to include the reference table only- Returns:
- matching content types
-
_getContentTypeParams
private Map<String,Object> _getContentTypeParams(ContentType contentType, boolean disabled)
-
-