Package com.adobe.cq.sightly
Class WCMScriptHelper
- java.lang.Object
-
- com.adobe.cq.sightly.WCMScriptHelper
-
@ProviderType public class WCMScriptHelper extends java.lang.Object
TheWCMScriptHelper
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 Constructor Description WCMScriptHelper(SlingScriptHelper sling)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SightlyWCMMode
getMode()
void
includeResource(java.io.PrintWriter out, java.lang.String script, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions)
Include the resource and redirect the output into a custom print writer.void
includeResource(SlingHttpServletResponse customResponse, java.lang.String script, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions)
Include a resource and redirect the output into a custom response.void
includeResource(SlingHttpServletResponse response, java.lang.String script, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions, java.util.Map<java.lang.String,java.lang.Object> resourceProperties)
Include aSyntheticResource
and redirect the output into a custom response.void
includeResource(SlingHttpServletResponse response, Resource resource, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions)
Include aResource
and redirect the output into a custom responsevoid
includeScript(java.lang.String script, java.lang.String wcmMode, java.io.PrintWriter out)
Calls the given script.
-
-
-
Constructor Detail
-
WCMScriptHelper
public WCMScriptHelper(SlingScriptHelper sling)
-
-
Method Detail
-
includeResource
public void includeResource(java.io.PrintWriter out, java.lang.String script, java.lang.String dispatcherOptions, java.lang.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=value
comma 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, java.lang.String script, java.lang.String dispatcherOptions, java.lang.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=value
comma 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, java.lang.String script, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions, java.util.Map<java.lang.String,java.lang.Object> resourceProperties)
Include aSyntheticResource
and redirect the output into a custom response.- Parameters:
response
- the custom responsescript
- the path of the resource to includedispatcherOptions
-key=value
comma 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 theSyntheticResource
that will be included
-
includeResource
public void includeResource(SlingHttpServletResponse response, Resource resource, java.lang.String dispatcherOptions, java.lang.String resourceType, WCMResourceOptions wcmResourceOptions)
Include aResource
and redirect the output into a custom response- Parameters:
response
- the custom responseresource
- theResource
to includedispatcherOptions
-key=value
comma separated pairs as StringresourceType
- Sling resource type to be used while including the resourcewcmResourceOptions
- the WCM specific options for including the resource
-
includeScript
public void includeScript(java.lang.String script, java.lang.String wcmMode, java.io.PrintWriter out)
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
public SightlyWCMMode getMode()
-
-