Package org.ametys.cms.content
Interface ContentViewProvider
- All Known Implementing Classes:
DefaultContentViewProvider,WebContentViewProvider
public interface ContentViewProvider
Component responsible to retrieve the view of a content
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ViewgetContentTypeView(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.default ViewGet 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 contentdefault ViewgetViewWithFallback(String viewName, String fallbackViewName, Content content) Get the view for view resulting for a given contentdefault voidInitializes the view configurations of the provider.default voidParse the views of the provider This method is called once at application startup, after all content type's views have been parseddefault voidResolve the temporary view references in overridden views
-
Field Details
-
ROLE
Avalon Role
-
-
Method Details
-
initializeViewConfigurations
Initializes the view configurations of the provider. This method is called once at application startup, after all content types have been configured.- Throws:
ConfigurationException- if an error occurs during the initialization of the view configurations
-
parseViews
Parse the views of the provider This method is called once at application startup, after all content type's views have been parsed- Throws:
ConfigurationException- if an error occurs during the parse of the views
-
resolveViewReferences
Resolve the temporary view references in overridden views- 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, ...)
-
getOverriddenContentTypes
Retrieves a Set of content types that have been overridden- Returns:
- the set of overridden content types identifiers
-
getViewConfigurations
Map<String,ContentTypesParserHelper.ViewConfigurations> getViewConfigurations(ContentType contentType, ViewParserContext context) Retrieves all the views' configurations declared by the given content type- Parameters:
contentType- the content typecontext- the context of view parsing- Returns:
- the views' configurations
-
getViewConfigurations
Optional<ContentTypesParserHelper.ViewConfigurations> getViewConfigurations(ContentType contentType, String viewName, ViewParserContext context) Retrieves the optional view's configuration declared by the given content type- Parameters:
contentType- the content typeviewName- the name of the view to retrievecontext- the context of view parsing- Returns:
- the view's configuration
-
getContentTypeView
default View getContentTypeView(ContentType contentType, String viewName, ViewParserContext context) Retrieves the view of the given content type- Parameters:
contentType- the content typeviewName- the view namecontext- the context of view parsing- Returns:
- the view of the given content type
-
getView
Get the view for view resulting of the concatenation of views of the given content.- Parameters:
viewName- the name of the view to retrievecontent- the given content- Returns:
- The view or null if none matches.
-
getView
Get the view for view resulting of the concatenation of views of the given content.- 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
Get the view for view resulting for a given content- 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.content- the content- Returns:
- The view or null if none matches.
-
getViewWithFallback
View getViewWithFallback(String viewName, String fallbackViewName, String[] contentTypeIds, String[] mixinIds) Get the view for view resulting for a given content- 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.
-