Class DefaultContentView

All Implemented Interfaces:
ContentView, Contextualizable, LogEnabled, Serviceable
Direct Known Subclasses:
WebContentView

Default implementation of a ContentView Will first look in directory context://WEB-INF/stylesheets/content/article/article-[view].[extension] And if the file does not exist will search in plugin:[currentPluginName]://stylesheets/content/article/article-[view].[extension]
  • Field Details

  • Constructor Details

  • Method Details

    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getSource

      public Source getSource(String location, String contentType, String view, String format, String pluginName, String extension) throws IOException
      Description copied from interface: ContentView
      Get the file source for rendering a content
      Specified by:
      getSource in interface ContentView
      Parameters:
      location - the requested location
      contentType - the type of the current Content
      view - the content view
      format - the format of the output (html, pdf, ...)
      pluginName - the current plugin name
      extension - the extension (xsl, xml, ...)
      Returns:
      the file source
      Throws:
      IOException - if the Source cannot be resolved
    • _getSourceURIs

      protected List<String> _getSourceURIs(String contentTypeAlias, String contentTypeId, String view, String format, String pluginName, String extension)
      Returns the ordered list of URI to be tested to find a stylesheet to render the Content.
      Parameters:
      contentTypeAlias - the content type alias for rendering
      contentTypeId - the content type full ID
      view - the content view
      format - the format of the output (html, pdf, ...)
      pluginName - the current plugin name
      extension - the extension (xsl, xml, ...)
      Returns:
      a list of URIs
    • _getDefaultSourceURIsForContentType

      protected List<String> _getDefaultSourceURIsForContentType(ContentTypeDescriptor contentType, String pluginName, String formatSuffix, String extension)
      Get the URIs of default stylesheets
      Parameters:
      contentType - The content type
      pluginName - The current plugin name
      formatSuffix - the format of the output (html, pdf, ...)
      extension - the extension (xsl, xml, ...)
      Returns:
      a list of URIs
    • _getDefaultSourceURIs

      protected List<String> _getDefaultSourceURIs(String pluginName, String formatSuffix, String extension)
      Get the URIs of default stylesheets
      Parameters:
      pluginName - The current plugin name
      formatSuffix - the format of the output (html, pdf, ...)
      extension - the extension (xsl, xml, ...)
      Returns:
      a list of URIs
    • _getSourceURIsForSuperTypes

      protected List<String> _getSourceURIsForSuperTypes(String contentTypeAlias, String contentTypeId, String view, String formatSuffix, String extension)
      Get source for a given content type
      Parameters:
      contentTypeAlias - the content type alias for rendering
      contentTypeId - the content type full ID
      view - the content view
      formatSuffix - the format of the output (html, pdf, ...)
      extension - the extension (xsl, xml, ...)
      Returns:
      the list
    • _getSourceURIsForDynamicContentType

      protected List<String> _getSourceURIsForDynamicContentType(String contentTypeAlias, String view, String formatSuffix, String pluginName, String extension)
      get source for a dynamic content type
      Parameters:
      contentTypeAlias - the content type alias for rendering
      view - the content view
      formatSuffix - the format of the output (html, pdf, ...)
      pluginName - the plugin name
      extension - the extension (xsl, xml, ...)
      Returns:
      the list
    • _getSourceURIsForContentType

      protected List<String> _getSourceURIsForContentType(String contentTypeAlias, String contentTypeId, String view, String formatSuffix, String extension)
      get source for a non dynamic content type
      Parameters:
      contentTypeAlias - the content type alias for rendering
      contentTypeId - the content type full ID
      view - the content view
      formatSuffix - the format of the output (html, pdf, ...)
      extension - the extension (xsl, xml, ...)
      Returns:
      the list
    • _getSourceURIsForContentTypeWithPlugin

      protected List<String> _getSourceURIsForContentTypeWithPlugin(String pluginName, String contentTypeAlias, String contentTypeId, String view, String formatSuffix, String extension)
      Get source for a non dynamic content type, call _getSourceURIsForContentType() which call this method twice if necessary (with the alias and the real content type id).
      Parameters:
      pluginName - the plugin name of the content type
      contentTypeAlias - the content type alias for rendering
      contentTypeId - the content type id used to build the URIs
      view - the content view
      formatSuffix - the format of the output (html, pdf, ...)
      extension - the extension (xsl, xml, ...)
      Returns:
      the list