public class GuideSubmitUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REQ_ATTR_FORWARD_OPTIONS |
static java.lang.String |
REQ_ATTR_FORWARD_PATH |
static java.lang.String |
REQ_ATTR_GUIDE_SUBMIT_OPTIONS |
static java.lang.String |
REQUEST_ATTR_PDF_NAME |
static java.lang.String |
REQUEST_ATTR_REDIRECT_PARAMETER_MAP |
Constructor and Description |
---|
GuideSubmitUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addContextPath(java.lang.String url,
java.lang.String contextPath)
This method will prepend context path to the URL if it starts with a /,
provided url and context path is not blank.
|
static java.util.Map<java.lang.String,java.lang.String> |
getGuideValueMap(FormSubmitInfo formSubmitInfo)
This API returns guideValueMap, that is, Map of all the fields and their values, and portal submit link and submit id
|
static java.util.Map<java.lang.String,java.lang.String> |
getMappedFieldParameters(java.lang.String[] fieldParameterMapping)
Provides map of field name and parameter name pairs.
|
static java.lang.String |
getNameOfCompositeFieldFromChildResource(Resource resource)
Checks if the given resource is a child of composite field.
|
static Resource |
getParentResource(Resource resource,
java.lang.String jcrPrimaryType)
Returns the closest parent with given jcrPrimaryType, if jcrPrimaryType is null or empty,
then returns immediate parent
|
static java.util.Map<java.lang.String,java.lang.String> |
getRedirectParameters(SlingHttpServletRequest request)
This API returns redirect parameters set in the current request.
|
static java.lang.String |
getReqAttrPdfName(SlingHttpServletRequest request)
Returns the name of the PDF set in the request
|
static java.lang.String |
getUserID(SlingHttpServletRequest request)
Returns the current user ID from the request
|
static void |
setForwardPath(SlingHttpServletRequest req,
java.lang.String path,
java.lang.String selector,
java.lang.String suffix)
This API should be used to set the path to forward the current request
|
static void |
setRedirectParameters(SlingHttpServletRequest request,
java.util.Map<java.lang.String,java.lang.String> value)
Sets redirect parameters to the current request
|
static void |
setRedirectUrl(SlingHttpServletRequest req,
java.lang.String redirectUrl)
This API should be used to set the redirect url
|
public static final java.lang.String REQUEST_ATTR_PDF_NAME
public static final java.lang.String REQUEST_ATTR_REDIRECT_PARAMETER_MAP
public static final java.lang.String REQ_ATTR_FORWARD_PATH
public static final java.lang.String REQ_ATTR_FORWARD_OPTIONS
public static final java.lang.String REQ_ATTR_GUIDE_SUBMIT_OPTIONS
public static void setForwardPath(SlingHttpServletRequest req, java.lang.String path, java.lang.String selector, java.lang.String suffix)
req
- Sling http servlet requestpath
- Path to forward the current requestselector
- Sling selector to use while forwarding the request to the path. Null if no selector to be usedsuffix
- Suffix to use while forwarding the request to the path. Null if no selector to be usedSlingHttpServletRequest
public static void setRedirectUrl(SlingHttpServletRequest req, java.lang.String redirectUrl)
req
- Sling http servlet requestredirectUrl
- redirect url to set in the current request objectSlingHttpServletRequest
public static java.lang.String getUserID(SlingHttpServletRequest request)
request
- SlingHttpServletRequest
sling http servlet requestpublic static Resource getParentResource(Resource resource, java.lang.String jcrPrimaryType)
resource
- jcrPrimaryType
- public static java.util.Map<java.lang.String,java.lang.String> getRedirectParameters(SlingHttpServletRequest request)
setRedirectParameters(org.apache.sling.api.SlingHttpServletRequest, java.util.Map)
request
- Sling http servlet requestSlingHttpServletRequest
public static java.lang.String getNameOfCompositeFieldFromChildResource(@Nonnull Resource resource)
resource
- reference to the child of the composite field resourcepublic static java.util.Map<java.lang.String,java.lang.String> getGuideValueMap(FormSubmitInfo formSubmitInfo)
formSubmitInfo
- FormSubmitInfo
object containing the basic information required during form submissionFormSubmitInfo
public static java.util.Map<java.lang.String,java.lang.String> getMappedFieldParameters(java.lang.String[] fieldParameterMapping)
fieldParameterMapping
- array of field mappings in the form of public static void setRedirectParameters(SlingHttpServletRequest request, java.util.Map<java.lang.String,java.lang.String> value)
request
- Sling http servlet requestvalue
- Map represent the redirect paramters to be setSlingHttpServletRequest
public static java.lang.String getReqAttrPdfName(SlingHttpServletRequest request)
request
- Sling http servlet requestpublic static java.lang.String addContextPath(java.lang.String url, java.lang.String contextPath)
url
- Thank You page URLcontextPath
- Context path for the application.Copyright © 2010 - 2020 Adobe. All Rights Reserved