Package com.adobe.cq.sightly
Class WCMScriptHelper
java.lang.Object
com.adobe.cq.sightly.WCMScriptHelper
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMode()voidincludeResource(PrintWriter out, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions) Include the resource and redirect the output into a custom print writer.voidincludeResource(SlingHttpServletResponse customResponse, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions) Include a resource and redirect the output into a custom response.voidincludeResource(SlingHttpServletResponse response, String script, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions, Map<String, Object> resourceProperties) Include aSyntheticResourceand redirect the output into a custom response.voidincludeResource(SlingHttpServletResponse response, Resource resource, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions) Include aResourceand redirect the output into a custom responsevoidincludeScript(String script, String wcmMode, PrintWriter out) Calls the given script.
-
Constructor Details
-
WCMScriptHelper
-
-
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 writerscript- the path of the resource to includedispatcherOptions-key=valuecomma separated pairs as StringresourceType- Sling resource type to be used while including the resourcewcmResourceOptions- 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 responsescript- the path of the resource to includedispatcherOptions-key=valuecomma separated pairs as StringresourceType- Sling resource type to be used while including the resourcewcmResourceOptions- 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 aSyntheticResourceand redirect the output into a custom response.- Parameters:
response- the custom responsescript- the path of the resource to includedispatcherOptions-key=valuecomma separated pairs as StringresourceType- Sling resource type to be used while including the resourcewcmResourceOptions- the WCM specific options for including the resourceresourceProperties- the properties of theSyntheticResourcethat will be included
-
includeResource
public void includeResource(SlingHttpServletResponse response, Resource resource, String dispatcherOptions, String resourceType, WCMResourceOptions wcmResourceOptions) Include aResourceand redirect the output into a custom response- Parameters:
response- the custom responseresource- theResourceto includedispatcherOptions-key=valuecomma separated pairs as StringresourceType- Sling resource type to be used while including the resourcewcmResourceOptions- the WCM specific options for including the resource
-
includeScript
Calls the given script.- Parameters:
script- script path to be calledwcmMode- 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
-