Package org.ametys.cms.content
Class DefaultContentViewProvider
java.lang.Object
org.ametys.cms.content.DefaultContentViewProvider
- All Implemented Interfaces:
ContentViewProvider,Component,Serviceable
- Direct Known Subclasses:
WebContentViewProvider
public class DefaultContentViewProvider
extends Object
implements ContentViewProvider, Component, Serviceable
Default implementation of a
ContentViewProvider-
Field Summary
FieldsFields inherited from interface org.ametys.cms.content.ContentViewProvider
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the view for view resulting of the concatenation of views of the given content.getViewConfigurations(ContentType contentType, String viewName, ViewParserContext context) Retrieves the optional view's configuration declared by the given content typegetViewConfigurations(ContentType contentType, ViewParserContext context) Retrieves all the views' configurations declared by the given content typegetViewWithFallback(String viewName, String fallbackViewName, String[] contentTypeIds, String[] mixinIds) Get the view for view resulting for a given contentvoidservice(ServiceManager manager) Methods 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
getContentTypeView, getOverriddenContentTypes, getView, getViewWithFallback, initializeViewConfigurations, parseViews, resolveViewReferences
-
Field Details
-
_contentTypesHelper
The content types helper
-
-
Constructor Details
-
DefaultContentViewProvider
public DefaultContentViewProvider()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
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- Parameters:
contentType- the content typecontext- the context of view parsing- Returns:
- the views' configurations
-
getViewConfigurations
public Optional<ContentTypesParserHelper.ViewConfigurations> getViewConfigurations(ContentType contentType, String viewName, ViewParserContext context) Description copied from interface:ContentViewProviderRetrieves the optional view's configuration declared by the given content type- Specified by:
getViewConfigurationsin interfaceContentViewProvider- Parameters:
contentType- the content typeviewName- the name of the view to retrievecontext- the context of view parsing- Returns:
- the view's configuration
-
getView
Description copied from interface:ContentViewProviderGet the view for view resulting of the concatenation of views of the given content.- Specified by:
getViewin interfaceContentViewProvider- 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.
-
getViewWithFallback
public View getViewWithFallback(String viewName, String fallbackViewName, String[] contentTypeIds, String[] mixinIds) Description copied from interface:ContentViewProviderGet the view for view resulting for a given content- Specified by:
getViewWithFallbackin interfaceContentViewProvider- Parameters:
viewName- the name of the view to retrieve. If null or empty, fallback view will be used.fallbackViewName- the name of the view to retrieve if the initial was not found. If null or empty, "main" view view will be used as fallback view.contentTypeIds- the identifiers of the content typesmixinIds- the identifiers of the mixins- Returns:
- The view or null if none matches.
-