Package org.ametys.web.content
Class WebContentViewProvider
java.lang.Object
org.ametys.cms.content.DefaultContentViewProvider
org.ametys.web.content.WebContentViewProvider
- All Implemented Interfaces:
ContentViewProvider,Initializable,Component,Contextualizable,Serviceable
public class WebContentViewProvider
extends DefaultContentViewProvider
implements Contextualizable, Initializable
This implementation of a
ContentViewProvider looks first if the view has been defined (or overridden) in the current skin-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractCacheManagerThe cache managerprotected ContentTypeExtensionPointThe content type extension pointprotected ContentTypesParserHelperThe content types parser helperprotected ContextThe contextprotected static final org.slf4j.LoggerThe logger.protected SiteManagerThe site managerprotected SkinConfigurationHelperThe skin configuration helperprotected SkinContentTypeOverridesExtensionPointThe extension point with overrides specific to skinsprotected SkinsManagerThe skin managerprotected SourceResolverThe source resolverFields inherited from class org.ametys.cms.content.DefaultContentViewProvider
_contentTypesHelperFields inherited from interface org.ametys.cms.content.ContentViewProvider
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates the cachesvoidcontextualize(Context context) getContentTypeView(ContentType contentType, String viewName, ViewParserContext context) Retrieves the view of the given content typeRetrieves a Set of content types that have been overriddenGet the view for view resulting of the concatenation of views of the given content.getViewConfigurations(ContentType contentType, ViewParserContext context) Retrieves all the views' configurations declared by the given content typevoidInitializevoidInitializes the view configurations of the provider.voidParse the views of the provider This method is called once at application startup, after all content type's views have been parsedvoidResolve the temporary view references in overridden viewsvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.content.DefaultContentViewProvider
getViewConfigurations, getViewWithFallbackMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.content.ContentViewProvider
getView, getViewWithFallback
-
Field Details
-
_LOGGER
The logger. -
_skinsManager
The skin manager -
_contentTypeExtensionPoint
The content type extension point -
_contentTypesParserHelper
The content types parser helper -
_srcResolver
The source resolver -
_skinConfigurationHelper
The skin configuration helper -
_skinContentTypeOverridesExtensionPoint
The extension point with overrides specific to skins -
_siteManager
The site manager -
_cacheManager
The cache manager -
_context
The context
-
-
Constructor Details
-
WebContentViewProvider
public WebContentViewProvider()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classDefaultContentViewProvider- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
Initialize- Specified by:
initializein interfaceInitializable
-
_createCaches
Creates the caches -
initializeViewConfigurations
Description copied from interface:ContentViewProviderInitializes the view configurations of the provider. This method is called once at application startup, after all content types have been configured.- Specified by:
initializeViewConfigurationsin interfaceContentViewProvider- Throws:
ConfigurationException- if an error occurs during the initialization of the view configurations
-
getViewConfigurations
public Map<String,ContentTypesParserHelper.ViewConfigurations> getViewConfigurations(ContentType contentType, ViewParserContext context) Description copied from interface:ContentViewProviderRetrieves all the views' configurations declared by the given content type- Specified by:
getViewConfigurationsin interfaceContentViewProvider- Overrides:
getViewConfigurationsin classDefaultContentViewProvider- Parameters:
contentType- the content typecontext- the context of view parsing- Returns:
- the views' configurations
-
parseViews
Description copied from interface:ContentViewProviderParse the views of the provider This method is called once at application startup, after all content type's views have been parsed- Specified by:
parseViewsin interfaceContentViewProvider- Throws:
ConfigurationException- if an error occurs during the parse of the views
-
resolveViewReferences
Description copied from interface:ContentViewProviderResolve the temporary view references in overridden views- Specified by:
resolveViewReferencesin interfaceContentViewProvider- Throws:
ConfigurationException- if a view reference has a configuration error (the content attribute nesting the reference does not specify any content type, the view does not exist, ...)
-
getContentTypeView
Description copied from interface:ContentViewProviderRetrieves the view of the given content type- Specified by:
getContentTypeViewin interfaceContentViewProvider- Parameters:
contentType- the content typeviewName- the view namecontext- the context of view parsing- Returns:
- the view of the given content type
-
getOverriddenContentTypes
Description copied from interface:ContentViewProviderRetrieves a Set of content types that have been overridden- Specified by:
getOverriddenContentTypesin interfaceContentViewProvider- Returns:
- the set of overridden content types identifiers
-
getView
Description copied from interface:ContentViewProviderGet the view for view resulting of the concatenation of views of the given content.- Specified by:
getViewin interfaceContentViewProvider- Overrides:
getViewin classDefaultContentViewProvider- Parameters:
viewName- the name of the view to retrievecontentTypeIds- the identifiers of the content typesmixinIds- the identifiers of the mixins- Returns:
- The view or null if none matches.
-