Interface ContentViewProvider

All Known Implementing Classes:
DefaultContentViewProvider, WebContentViewProvider

public interface ContentViewProvider
Component responsible to retrieve the view of a content
  • Field Details

  • 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

      default void parseViews() throws ConfigurationException
      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

      Retrieves all the views' configurations declared by the given content type
      Parameters:
      contentType - the content type
      context - the context of view parsing
      Returns:
      the views' configurations
    • getViewConfigurations

      Retrieves the optional view's configuration declared by the given content type
      Parameters:
      contentType - the content type
      viewName - the name of the view to retrieve
      context - 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 type
      viewName - the view name
      context - the context of view parsing
      Returns:
      the view of the given content type
    • getView

      default View getView(String viewName, Content content)
      Get the view for view resulting of the concatenation of views of the given content.
      Parameters:
      viewName - the name of the view to retrieve
      content - the given content
      Returns:
      The view or null if none matches.
    • getView

      View getView(String viewName, String[] contentTypeIds, String[] mixinIds)
      Get the view for view resulting of the concatenation of views of the given content.
      Parameters:
      viewName - the name of the view to retrieve
      contentTypeIds - the identifiers of the content types
      mixinIds - the identifiers of the mixins
      Returns:
      The view or null if none matches.
    • getViewWithFallback

      default View getViewWithFallback(String viewName, String fallbackViewName, Content content)
      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 types
      mixinIds - the identifiers of the mixins
      Returns:
      The view or null if none matches.