Class WCMScriptHelper

java.lang.Object
com.adobe.cq.sightly.WCMScriptHelper

@ProviderType public class WCMScriptHelper extends Object
The WCMScriptHelper class provides helper methods to support CQ Sightly extensions. This is to be used only with the CQ specific Sightly plugins. This class is not meant to be extended.
  • Constructor Details

  • Method Details

    • includeResource

      public void includeResource(PrintWriter out, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions)
      Include the resource and redirect the output into a custom print writer.
      Parameters:
      out - the custom writer
      script - the path of the resource to include
      dispatcherOptions - key=value comma separated pairs as String
      resourceType - Sling resource type to be used while including the resource
      wcmResourceOptions - the WCM specific options for including the resource
    • includeResource

      public void includeResource(SlingHttpServletResponse customResponse, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions)
      Include a resource and redirect the output into a custom response.
      Parameters:
      customResponse - the custom response
      script - the path of the resource to include
      dispatcherOptions - key=value comma separated pairs as String
      resourceType - Sling resource type to be used while including the resource
      wcmResourceOptions - the WCM specific options for including the resource
    • includeResource

      public void includeResource(SlingHttpServletResponse response, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions, Map<String,Object> resourceProperties)
      Include a SyntheticResource and redirect the output into a custom response.
      Parameters:
      response - the custom response
      script - the path of the resource to include
      dispatcherOptions - key=value comma separated pairs as String
      resourceType - Sling resource type to be used while including the resource
      wcmResourceOptions - the WCM specific options for including the resource
      resourceProperties - the properties of the SyntheticResource that will be included
    • includeResource

      public void includeResource(SlingHttpServletResponse response, Resource resource, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions)
      Include a Resource and redirect the output into a custom response
      Parameters:
      response - the custom response
      resource - the Resource to include
      dispatcherOptions - key=value comma separated pairs as String
      resourceType - Sling resource type to be used while including the resource
      wcmResourceOptions - the WCM specific options for including the resource
    • includeScript

      public void includeScript(String script, String wcmMode, PrintWriter out)
      Calls the given script.
      Parameters:
      script - script path to be called
      wcmMode - WCM mode to be used, its an optional parameter. If the current request contains mode attribute, it will be reset after the script call.
    • getMode

      public SightlyWCMMode getMode()