Package org.ametys.web.repository.page
Class DefaultContentTypesAssignmentHandler
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.repository.page.DefaultContentTypesAssignmentHandler
- All Implemented Interfaces:
ContentTypesAssignmentHandler
,Initializable
,LogEnabled
,Serviceable
public class DefaultContentTypesAssignmentHandler
extends AbstractLogEnabled
implements ContentTypesAssignmentHandler, Serviceable, Initializable
This implementation of the content types handler is based on content types declared in the whole application
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
The cache is a HashSet of String + a date -
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
The cache managerprotected ContentTypeExtensionPoint
The content types managerprotected SiteTypesExtensionPoint
The site type managerprotected SourceResolver
The source resolverFields inherited from interface org.ametys.web.repository.page.ContentTypesAssignmentHandler
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getContentTypes
(boolean includePrivate, boolean includeReferenceTable, boolean includeMixin, boolean includeAbstract) Get the public content types._parseContentTypes
(Configuration configuration, long lastModificationDate) Parses the valid content types_parseContentTypes
(Source configFile) Parses the valid content types for the site type_parseTemplateContentTypes
(Source configFile) Parses the valid content types for a template_parseZoneContentTypes
(Source configFile, String zoneName) Parses the valid content types for the given zone.getAvailableContentTypes
(SitemapElement page, String zoneName) Returns the list of available content types for a givenPage
and zone name.getAvailableContentTypes
(SitemapElement page, String zoneName, boolean includePrivate) Returns the list of available content types for a givenPage
and zone name.getAvailableContentTypes
(Site site) Returns the list of available content types for a givenSite
getAvailableContentTypes
(Site site, boolean includePrivate) Returns the list of available content types for a givenSite
void
void
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_cTypeEP
The content types manager -
_siteTypeExtensionPoint
The site type manager -
_srcResolver
The source resolver -
_cacheManager
The cache manager
-
-
Constructor Details
-
DefaultContentTypesAssignmentHandler
public DefaultContentTypesAssignmentHandler()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getAvailableContentTypes
Description copied from interface:ContentTypesAssignmentHandler
Returns the list of available content types for a givenSite
- Specified by:
getAvailableContentTypes
in interfaceContentTypesAssignmentHandler
- Parameters:
site
- the site to consider- Returns:
- the list of available content types id
-
getAvailableContentTypes
Description copied from interface:ContentTypesAssignmentHandler
Returns the list of available content types for a givenSite
- Specified by:
getAvailableContentTypes
in interfaceContentTypesAssignmentHandler
- Parameters:
site
- the site to considerincludePrivate
- true to include private content types- Returns:
- the list of available content types id
-
getAvailableContentTypes
public Set<String> getAvailableContentTypes(SitemapElement page, String zoneName, boolean includePrivate) Description copied from interface:ContentTypesAssignmentHandler
Returns the list of available content types for a givenPage
and zone name.- Specified by:
getAvailableContentTypes
in interfaceContentTypesAssignmentHandler
- Parameters:
page
- the Page to considerzoneName
- the zone name to considerincludePrivate
- true to include private content types- Returns:
- the list of available content types id
-
getAvailableContentTypes
Description copied from interface:ContentTypesAssignmentHandler
Returns the list of available content types for a givenPage
and zone name.- Specified by:
getAvailableContentTypes
in interfaceContentTypesAssignmentHandler
- Parameters:
page
- the Page to considerzoneName
- the zone name to consider- Returns:
- the list of available content types id
-
_getContentTypes
protected Set<String> _getContentTypes(boolean includePrivate, boolean includeReferenceTable, boolean includeMixin, boolean includeAbstract) Get the public content types.- Parameters:
includePrivate
-true
to include private content typesincludeReferenceTable
-true
to include simple content typesincludeMixin
-true
to include mixinsincludeAbstract
-true
to include abstract content types- Returns:
- the public content types.
-
_parseTemplateContentTypes
Parses the valid content types for a template- Parameters:
configFile
- the template configuration file.- Returns:
- the content types' id in a Set
-
_parseZoneContentTypes
protected DefaultContentTypesAssignmentHandler.Cache _parseZoneContentTypes(Source configFile, String zoneName) throws IOException Parses the valid content types for the given zone.- Parameters:
configFile
- the template configuration file.zoneName
- the zone name.- Returns:
- the content types' id in a Set
- Throws:
IOException
- If an error occured while reading the file
-
_parseContentTypes
Parses the valid content types for the site type- Parameters:
configFile
- the configuration file.- Returns:
- the content types' id in a Set
-
_parseContentTypes
protected DefaultContentTypesAssignmentHandler.Cache _parseContentTypes(Configuration configuration, long lastModificationDate) throws ConfigurationException Parses the valid content types- Parameters:
configuration
- the configuration.lastModificationDate
- the date the configuration was lastly modified- Returns:
- the content types' id in a Set
- Throws:
ConfigurationException
- if configuration is invalid
-