Interface ChannelPolicyFilter

  • All Superinterfaces:
    java.lang.Comparable, PluginComponent, PolicyFilter
    All Known Implementing Classes:
    BasicChannelPolicyFilter

    public interface ChannelPolicyFilter
    extends PolicyFilter
    This class allow developers to put hooks to change channel mechanism behaviour. To get more information about the current request in hooks, the method Channel#getCurrentJcmsContext() must be called.
    Since:
    jcms-5.7.0
    Version:
    $Revision: 40030 $
    Author:
    Jean-Philippe Encausse
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REVISION  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void checkJAVAMetaTemplates​(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)
      This method is a Hook to generate custom JAVA templates for a given type or extension
      void checkJSPMetaTemplates​(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)
      This method is a Hook to generate custom JSP templates for a given type or extension
      Data getData​(java.lang.String id)
      Retrieve a Data from its id.
      boolean isCompatibleWorkflow​(Workflow workflow, java.lang.Class typeClass)
      This method is a Hook to indicate if a Workflow is compatible with a type class
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • checkJSPMetaTemplates

        void checkJSPMetaTemplates​(java.util.Map templateMap,
                                   java.lang.String className,
                                   org.jdom.Element typeElt,
                                   boolean isExtension)

        This method is a Hook to generate custom JSP templates for a given type or extension

        The templateMap contains the template file to generate.

        • Keys: the name of the file to generate in Type folder
        • Values: the name of the metatemplate file to use (in WEB-INF/template/ folder)
        Parameters:
        templateMap - The map of key/value = file/template
        className - The classname of the processing type
        typeElt - The XML Element of the processing type
        isExtension - boolean true if the type is an Extension Called in private method com.jalios.jcms.TypeProcessor#generateTypeJSP(String, Element)
      • checkJAVAMetaTemplates

        void checkJAVAMetaTemplates​(java.util.Map templateMap,
                                    java.lang.String className,
                                    org.jdom.Element typeElt,
                                    boolean isExtension)

        This method is a Hook to generate custom JAVA templates for a given type or extension

        The templateMap contains the template file to generate.

        • Keys: the name of the file (without .java extension)
        • Values: the name of the metatemplate file to use (in WEB-INF/template/ folder)
        Parameters:
        templateMap - The map of key/value = file/template
        className - The classname of the processing type
        typeElt - The XML Element of the processing type
        isExtension - boolean true if the type is an Extension Called in private method com.jalios.jcms.TypeProcessor#processTypes()
      • getData

        Data getData​(java.lang.String id)
        Retrieve a Data from its id.

        This method is invoked only when JCMS internal method could not find any data associated with the specified id (and if no other ChannelPolicyFilter did return a Data).
        May be invoked frequently !! Ensure high performance.

        This hook can be implemented by plugins creating transient Data (e.g through QueryFilter).

        Example :

          public Data getData(String id) {
            if (!id.startsWith("someprefix_") {
              return null;
            }
            // perform data retrieval (preferably using a internal cache on your side)
            // ...
          }
         
        Parameters:
        id - the id to look for (never null)
        Returns:
        a Data or null if no Data matching the specified id could be found
        Since:
        jcms-6.0
      • isCompatibleWorkflow

        boolean isCompatibleWorkflow​(Workflow workflow,
                                     java.lang.Class typeClass)

        This method is a Hook to indicate if a Workflow is compatible with a type class

        Parameters:
        workflow - the Workflow to test
        typeClass - the type Class
        Returns:
        true if the workflow is compatible with the given type class, false otherwise (or if workflow or type is null) Called in private method com.jalios.jcms.WorkflowManager#isCompatibleWorkflow()