public class DefaultContentTypesAssignmentHandler extends AbstractLogEnabled implements ContentTypesAssignmentHandler, Serviceable
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultContentTypesAssignmentHandler.Cache
The cache is a HashSet of String + a date
|
Modifier and Type | Field and Description |
---|---|
private Map<String,DefaultContentTypesAssignmentHandler.Cache> |
_cache |
protected ContentTypeExtensionPoint |
_cTypeEP
The content types manager
|
protected SiteTypesExtensionPoint |
_siteTypeExtensionPoint
The site type manager
|
protected SourceResolver |
_srcResolver
The source resolver
|
ROLE
Constructor and Description |
---|
DefaultContentTypesAssignmentHandler() |
Modifier and Type | Method and Description |
---|---|
protected Set<String> |
_getContentTypes(boolean includePrivate,
boolean includeReferenceTable,
boolean includeMixin,
boolean includeAbstract)
Get the public content types.
|
private Set<String> |
_getContentTypesForSiteType(String siteType) |
private Set<String> |
_getContentTypesForSkin(String siteType,
String skinName) |
private Set<String> |
_getContentTypesForTemplate(String siteType,
String skinName,
String templateName) |
private Set<String> |
_getContentTypesForZone(String siteType,
String skinName,
String templateName,
String zoneName) |
protected DefaultContentTypesAssignmentHandler.Cache |
_parseContentTypes(Configuration configuration,
long lastModificationDate)
Parses the valid content types
|
protected DefaultContentTypesAssignmentHandler.Cache |
_parseContentTypes(Source configFile)
Parses the valid content types for the site type
|
protected DefaultContentTypesAssignmentHandler.Cache |
_parseTemplateContentTypes(Source configFile)
Parses the valid content types for a template
|
protected DefaultContentTypesAssignmentHandler.Cache |
_parseZoneContentTypes(Source configFile,
String zoneName)
Parses the valid content types for the given zone.
|
Set<String> |
getAvailableContentTypes(Page page,
String zoneName)
Returns the list of available content types for a given
Page and zone name. |
Set<String> |
getAvailableContentTypes(Page page,
String zoneName,
boolean includePrivate)
Returns the list of available content types for a given
Page and zone name. |
Set<String> |
getAvailableContentTypes(Site site)
Returns the list of available content types for a given
Site |
Set<String> |
getAvailableContentTypes(Site site,
boolean includePrivate)
Returns the list of available content types for a given
Site |
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ContentTypeExtensionPoint _cTypeEP
protected SiteTypesExtensionPoint _siteTypeExtensionPoint
protected SourceResolver _srcResolver
private Map<String,DefaultContentTypesAssignmentHandler.Cache> _cache
public DefaultContentTypesAssignmentHandler()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Set<String> getAvailableContentTypes(Site site)
ContentTypesAssignmentHandler
Site
getAvailableContentTypes
in interface ContentTypesAssignmentHandler
site
- the site to considerpublic Set<String> getAvailableContentTypes(Site site, boolean includePrivate)
ContentTypesAssignmentHandler
Site
getAvailableContentTypes
in interface ContentTypesAssignmentHandler
site
- the site to considerincludePrivate
- true to include private content typespublic Set<String> getAvailableContentTypes(Page page, String zoneName, boolean includePrivate)
ContentTypesAssignmentHandler
Page
and zone name.getAvailableContentTypes
in interface ContentTypesAssignmentHandler
page
- the Page to considerzoneName
- the zone name to considerincludePrivate
- true to include private content typespublic Set<String> getAvailableContentTypes(Page page, String zoneName)
ContentTypesAssignmentHandler
Page
and zone name.getAvailableContentTypes
in interface ContentTypesAssignmentHandler
page
- the Page to considerzoneName
- the zone name to considerprivate Set<String> _getContentTypesForZone(String siteType, String skinName, String templateName, String zoneName)
private Set<String> _getContentTypesForTemplate(String siteType, String skinName, String templateName)
private Set<String> _getContentTypesForSkin(String siteType, String skinName)
private Set<String> _getContentTypesForSiteType(String siteType)
protected Set<String> _getContentTypes(boolean includePrivate, boolean includeReferenceTable, boolean includeMixin, boolean includeAbstract)
includePrivate
- true
to include private content typesincludeReferenceTable
- true
to include simple content typesincludeMixin
- true
to include mixinsincludeAbstract
- true
to include abstract content typesprotected DefaultContentTypesAssignmentHandler.Cache _parseTemplateContentTypes(Source configFile)
configFile
- the template configuration file.protected DefaultContentTypesAssignmentHandler.Cache _parseZoneContentTypes(Source configFile, String zoneName) throws IOException
configFile
- the template configuration file.zoneName
- the zone name.IOException
- If an error occured while reading the fileprotected DefaultContentTypesAssignmentHandler.Cache _parseContentTypes(Source configFile)
configFile
- the configuration file.protected DefaultContentTypesAssignmentHandler.Cache _parseContentTypes(Configuration configuration, long lastModificationDate) throws ConfigurationException
configuration
- the configuration.lastModificationDate
- the date the configuration was lastly modifiedConfigurationException
- if configuration is invalid