public class GuideUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GuideUtils.AuthoringError |
Constructor and Description |
---|
GuideUtils() |
Modifier and Type | Method and Description |
---|---|
static JSONObject |
addTemplateJsonToField(JSONObject currentJsonObject,
java.lang.String resourceType,
ResourceResolver resolver,
java.lang.String guideNodeClass)
Adds the template json of the field from resource type.
|
static void |
addToRequestMap(ParameterMap requestParameterMap,
java.lang.String key,
RequestParameter[] requestParameter)
Deprecated.
|
static boolean |
checkIfForms(Resource resource)
This API check if the given resource is a form
by looking for resource type property of jcr:content/guideContainer
|
static boolean |
checkIfFormsTemplate(Resource resource)
This API check if the given resource(template) is a forms template
by looking for guideComponentType property in jcr:content node of template
|
static java.lang.Object |
consumeContextProperty(java.lang.String contextPropertyName,
SlingHttpServletRequest request) |
static java.lang.String |
convertADAssetPathToWebChannelPagePath(java.lang.String FMDocAssetPath) |
static java.lang.String |
convertFMAssetPathToContainerPath(java.lang.String fragRef)
This API converts DAM asset path to adaptive forms page's container path e.g.
|
static java.lang.String |
convertFMAssetPathToFormPagePath(java.lang.String FMAssetPath) |
static java.lang.String |
convertFormPagePathToFMAssetPath(java.lang.String formPagePath) |
static java.lang.String |
convertGuideContainerPathToFMAssetMetadataPath(java.lang.String guideContainerPath)
Get Form Asset Meatadata path in form manager for given form container path
|
static java.lang.String |
convertGuideContainerPathToFMAssetPath(java.lang.String guideContainerPath)
Get Form Asset path from the given form container path
|
static void |
convertPanelToNewResponsiveLayout(Resource panelResource)
Converts Panel and its decedents having old responsive layout to new responsive layout.
|
static java.util.Map<java.lang.String,java.lang.String> |
convertStringToMap(java.lang.String params)
Generic utility to convert string into Map
|
static java.lang.Boolean |
convertToNewResponsiveLayout(Resource guideContainerResource)
Converts Form / IC web channel / Fragment having old responsive layout to new responsive layout.
|
static java.lang.Boolean |
embedFragmentResources(Resource fragmentPanelResource,
java.lang.String fragmentPath,
java.lang.Boolean processConversion) |
static java.lang.String |
encodeForHtml(java.lang.String str,
XSSAPI xssapi)
Encodes the given string as HTML content
|
static java.lang.String |
encodeForHtmlAttr(java.lang.String str,
XSSAPI xssapi)
Encodes the given string as HTML attribute
|
static java.lang.String |
encodeForJSString(java.lang.String str,
XSSAPI xssapi)
Encodes the given string as java script content
|
static java.lang.String |
escapeXml(java.lang.String unescaped) |
static void |
fillQueue(java.util.Queue<Resource> queue,
Resource resource,
java.lang.String type)
Fill queue with resources (outside guide container) which can be mapped to static text and image in document of record
|
static java.lang.String |
filterHtml(java.lang.String str,
XSSAPI xssapi) |
static FileAttachmentWrapper |
findFileAttachment(java.util.List<FileAttachmentWrapper> attachmentWrappers,
java.lang.String fileName) |
static java.lang.String |
findJsonObjectWithProperty(JSONObject jsonObject,
java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String path)
Finds a fragment/form with the specified property and having the given path (required for getting in context(manipulated bindrefs/ HTML IDs) fragment/form )
|
static java.lang.String |
findJsonObjectWithProperty(JSONObject jsonObject,
java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String path,
boolean ignorePath)
Finds a fragment/form with the specified property and having the given path (required for getting in context(manipulated bindrefs/ HTML IDs) fragment/form )
|
static java.lang.String |
formatDateDefaultValues(java.lang.String htmlVal)
Generic utility to parse adobe sign date fields from HTML and convert date fields default value in its date format.
|
static java.lang.String |
formJsonHtmlString(java.lang.String json,
java.lang.String html,
java.lang.String multipleJson) |
static java.lang.String |
generateSOM(Resource element)
Recursively generates the SOM Expression of an element in guide container.
|
static java.lang.String |
getAcceptLang(SlingHttpServletRequest request) |
static Resource |
getAdaptiveFormBrandingComponents(ResourceResolver resourceResolver,
java.lang.String guideContainerPath,
java.lang.String type,
java.lang.String value,
I18n i18n)
Get components outside guide container which could be mapped to branding components in document of record.
|
static JSONArray |
getAdobeSignFields(java.lang.String htmlVal)
Generic utility to parse adobe sign fields from HTML
|
static java.lang.String |
getAfDataSom(java.lang.String schemaType,
java.lang.String name,
java.lang.String bindRef)
Gives the afDataSom for an adaptive form field
|
static java.lang.String |
getAlternateContainerPathFromCurrentContainer(RequestPathInfo requestPathInfo)
The api returns the alternate (Target B scenario for ABTesting)
Returns path to the alternate Guide Container
|
static java.lang.String |
getAssetHTMLFromFullHTML(java.lang.String templateId,
java.lang.String html) |
static JSONObject |
getCCRData(java.lang.String jsonData) |
static ResourceResolver |
getCloudServiceUserResourceResolver(ResourceResolverFactory resourceResolverFactory) |
static java.util.Map<java.lang.String,java.lang.Object> |
getCommonRepeatableBindRefForTableRow(GuideModelImporter guideModelImporter,
Resource tableRowResource,
Resource guideContainerResource) |
static java.util.Map<java.lang.String,java.lang.Object> |
getCommonRepeatableItemForChart(GuideModelImporter guideModelImporter,
Resource chartResource,
Resource guideContainerResource) |
static java.util.Calendar |
getCurrentLMT(Resource containerResource,
StaleAssetIndicatorService staleAssetIndicatorService) |
static java.lang.String |
getDataMimeType(Resource formResource)
Gives the mime type of data which as per the data model
configured with the form
|
static java.lang.String |
getDefaultLocale(Resource resource) |
static java.lang.String |
getDefaultPattern(java.lang.String componentType) |
static JSONObject |
getDictionaryInfoFromAssetPaths(JSONArray assetList,
java.util.List<java.lang.String> locales)
Need an object like
{
"languages":[
{"lang":"ja","dicts":["/libs/wcm/core/i18n/ja.json","path":"/libs/wcm/core/i18n/ja2.json"]},
{"lang":"fr","dicts":["/libs/wcm/core/i18n/fr.json","/libs/wcm/core/i18n/fr2.json"]},
{"lang":"de","dicts":[ /libs/wcm/core/i18n/de.json","path":"/libs/wcm/core/i18n/de2.json"]}
]
}
|
static java.lang.String |
getDoRTemplateRef(java.lang.String guideContainerPath,
java.lang.String runtimeLocale,
ResourceResolver resourceResolver)
Returns path of XDP used for DoR Template (auto generated or associated)
dorType = none, dorTemplateRef =
|
static java.lang.String |
getFieldLayout(Resource guideContainerResource,
java.lang.String propertyName,
java.lang.String defaultValue)
Returns the field layout related configuration of the field.
|
static java.util.List |
getFileAttachmentList(SlingHttpServletRequest request,
java.lang.String guideContainerPath) |
static java.util.List<FileAttachmentWrapper> |
getFileAttachmentWrapperList(ParameterMap parameterMap)
This method is used to get the List of Attachments passed with the form.
|
static Resource |
getFormBreakpointResource(ResourceResolver resolver,
java.lang.String formPath) |
static JSONObject |
getFormJson(Resource formRes,
GuideModelTransformer guideModelTransformer) |
static Resource |
getFormResource(Resource otherResource,
java.lang.String fragRef) |
static JSONObject |
getGuideContainer(JSONObject guideJson)
This API is for internal purpose only.
|
static ValueMap |
getGuideContainer(SlingHttpServletRequest request,
Resource elementResource)
This API is for internal purpose.
|
static java.util.List<Resource> |
getGuideContainerFromFormPage(Resource formPageResource) |
static java.lang.String |
getGuideContainerPath(SlingHttpServletRequest request,
Resource resource)
This is a public api used to extract the guideContainer asset from the content.
|
static java.lang.String |
getGuideContainerPathFromResource(SlingHttpServletRequest request,
Resource resource)
This function returns the Guide Container path from any resource in the adaptive form.
|
static GuideModuleImporter |
getGuideModuleImporter(SlingHttpServletRequest slingRequest) |
static java.lang.String |
getGuideRuntimeLocale(SlingHttpServletRequest slingRequest,
Resource resource)
Returns the runtime locale in format like en-us
|
static I18n |
getI18n(ResourceBundleProvider resourceBundleProvider,
Resource containerResource,
java.util.Locale locale) |
static I18n |
getI18n(SlingHttpServletRequest request,
Resource guideFieldResource) |
static I18n |
getI18nForDesiredLocale(SlingHttpServletRequest request,
Resource guideContainerResource,
java.util.Locale desiredLocale)
returns the i18 object for the desired locale
|
static java.lang.String |
getInheritedProperty(Resource resource,
java.lang.String propertyName)
Returns the inherited property value of the property from the page containing the resource mentioned.
|
static java.lang.String |
getJsonObjectWithGivenTemplateIds(JSONObject guideJsonObject,
JSONArray jsonArray) |
static java.util.Calendar |
getLastModifiedTimeFromStaleAssetIndicatorService(GuideContainer guideContainer,
StaleAssetIndicatorService staleAssetIndicatorService)
This method calls staleAssetIndicatorService and gets LMT of the form and related assets - Used to validate Caches - both JSON & HTML
|
static java.lang.String |
getLayoutScriptFromContainer(GuideContainer guideContainer) |
static java.lang.String |
getLocale(SlingHttpServletRequest request,
Resource guideContainerResource) |
static int |
getLocaleIndexFromLocale(java.lang.String locale,
java.lang.String[] AEM_SUPPORTED_LOCALES)
returns the index of the locale from the GuideConstants.AEM_SUPPORTED_LOCALES
if locale is not suppoted then index of "en" is returned
|
static Resource |
getMergedFormResource(ResourceResolver resolver,
java.lang.String formPath) |
static JSONArray |
getMergedJSONArray(JSONArray array1,
JSONArray array2) |
static java.lang.String |
getMetaTemplateRef(Resource guideContainerResource)
Get meta-template path associated with guide container.
|
static java.lang.Object |
getNakedBoundJsonData(java.lang.Object data)
Gets the naked bound data from the given data
|
static java.lang.String |
getNamespacedKeys(java.lang.String key) |
static java.lang.String |
getNormalizedNodeType(java.lang.String resourceType,
java.lang.String resourceSuperType) |
static Resource |
getPageResource(Resource resource)
Returns the cq:Page resource by walking up in the resource hierarchy
|
static Resource |
getParentResource(Resource resource,
java.lang.String parentResourceType) |
static java.lang.String |
getRedirectUrl(java.lang.String redirectUrl,
java.lang.String formPath) |
static ResourceResolver |
getResolverFromResource(GuideContainer guideContainer)
Returns resource resolver from GuideContainer
|
static ResourceResolver |
getResolverFromResourceResolverHelper(ResourceResolverHelper resourceResolverHelper) |
static Resource |
getResource(ResourceResolver resourceResolver,
java.lang.String path,
JSONObject json)
Transform JSON into Resource.
|
static Resource |
getResource(ResourceResolver resourceResolver,
java.lang.String path,
JSONObject json,
Resource parentResource)
Transform JSON into Resource.
|
static Resource |
getResource(ResourceResolver resourceResolver,
java.lang.String path,
JSONObject json,
Resource parentResource,
boolean useNameAsResourceIdentifier)
Transform JSON into Resource.
|
static Resource |
getRootPanel(Resource resource) |
static GuidePanel |
getRootPanel(Resource resource,
SlingHttpServletRequest slingRequest) |
static java.lang.String |
getSchemaType(JSONObject formContainerJson)
Deprecated.
Use
GuideContainer.getSchemaType() instead |
static java.lang.String |
getScriptAsStringFromClientLib(HtmlLibraryManager htmlLibraryManager,
java.lang.String clientLibPath,
boolean minify)
Gets the JavaScript as String from the client lib path specified.
|
static java.util.ArrayList<java.lang.String> |
getScriptFromClientLibList(HtmlLibraryManager htmlLibraryManager,
java.lang.String[] clientLibCategories,
boolean minify)
Gets the JavaScript as a string array from clientlib categories.
|
static ResourceResolver |
getServiceResourceResolver(ResourceResolverFactory resourceResolverFactory)
Generic utility to get service resource resolver
|
static java.lang.String |
getSignConfigPath(Resource guideContainerResource)
Generic utility to get adobe sign configuration path.
|
static SlingBindings |
getSlingBinding(SlingHttpServletRequest slingRequest)
Returns
SlingBindings from given SlingHttpServletRequest |
static StrSubstitutor |
getStringSubstitutor(JSONObject valueMap) |
static JSONObject |
getTemplateJsonForField(java.lang.String resourceType,
ResourceResolver resolver)
Gets the template JSON of the field from resource type.
|
static java.util.List<TextVariable> |
getTextVariables(Resource resource)
Generic utility to get Text variable from text resource
|
static java.lang.String |
getThemeClientLibName(Resource resource) |
static java.lang.String |
getThemeContentRef(Resource guideContainerResource)
Returns the theme content path from Guide container resource
|
static Resource |
getThemeResource(Resource formResource)
Gets the theme resource for a given Adaptive Form
|
static Session |
getUserSessionFromRequest(SlingHttpServletRequest slingHttpServletRequest)
To get user session from sling request
|
static java.lang.String |
getXFALocale(java.lang.String locale)
Returns the xfa compliant locale.
|
static java.lang.String |
guideRefToDocPath(java.lang.String guideRefPath)
Utility to convert an MC DOCUMENT meta data path to the actual mc document path
|
static java.lang.String |
guideRefToGuidePath(java.lang.String guideRefPath)
Utility to convert an AF(Adaptive Form) meta data path to the actual adaptive forms path
|
static boolean |
hasFloatingField(JSONObject obj)
Returns true if type equals guideTextDraw or guideAdobeSignBlock and have document fragment
variables inside it
|
static java.lang.Boolean |
hasModifyPermission(Resource resource)
Checks if session has property modification permission on resource.
|
static boolean |
hasNestablePanelLayout(GuideNode parentNode,
GuideNode node) |
static java.lang.Boolean |
hasOldResponsiveLayout(Resource panelResource)
Returns weather the panel resource or any of its hierarchy has old responsive layout in it.
|
static boolean |
isAdobeTargetConfigured(Resource resource)
API to identify if adobe target is configured for the Adaptive form.
|
static boolean |
isCacheableContainerResource(Resource resource)
This API checks weather the resource's HTML should ever be cached
|
static boolean |
isCompositeField(JSONObject obj) |
static java.lang.Boolean |
isDeprecatedAD(Resource containerResource)
Checks if the given container resource is a deprecated AD or not
|
static boolean |
isDORConfigured(Resource formResource)
This method will process the given resource and return a boolean value signifying whether DOR
is present for the AF or not.
|
static boolean |
isDorTemplateRefValid(Resource guideContainer)
returns whether the dorTemplateRef present in the resource is valid or not
todo: Have to check if the schema of XSD and dorTemplateRef match?
|
static java.lang.Boolean |
isEditableTemplateResource(Resource resource)
Checks if given resource lies within any editable template or not
This API is using the logic of TemplateUtils.isAuthoredTemplate() in CQ/wcm
to check for editable template node.
|
static boolean |
isGuideButtonModel(java.lang.String guideNodeClass) |
static boolean |
isGuideCompositeField(java.lang.String guideNodeClass) |
static boolean |
isGuideContainerResource(Resource resource)
This is a public api used to identify if a resource is a Guide Container or Wrapper resource
Returns true if resource is a GuideContainer or Wrapper
else returns false
|
static boolean |
isGuideFieldModel(java.lang.String guideNodeClass)
Checks if given node class belongs to guide field
|
static boolean |
isGuideFileUploadModel(java.lang.String guideNodeClass) |
static boolean |
isGuidePanelModel(java.lang.String guideNodeClass)
Checks if given node class belongs to guide panel
|
static boolean |
isGuideTnCModel(java.lang.String guideNodeClass) |
static boolean |
isJsonBasedSchema(java.lang.String schemaType)
Returns if it's a json based schema type.
|
static boolean |
isLayoutablePanel(GuideNode node) |
static boolean |
isMetaTemplateValid(ResourceResolver resourceResolver,
java.lang.String metaTemplateRef)
Checks if path pointed by metaTemplateRef is valid resource.
|
static java.lang.Boolean |
isOldResponsiveLayout(Resource panelResource) |
static java.lang.Boolean |
isPanel(Resource resource)
Returns wether given resource is of type panel or not.
|
static boolean |
isRepeatable(JSONObject obj) |
static boolean |
isRichTextField(JSONObject jsonObject)
This API is for checking whether the text box field allows filling rich text or not
|
static boolean |
isScriptAuthoringAllowed(java.security.Principal userPrincipal,
UserManager um)
Given user principal returns true if
principal is allowed to write scripts
|
static boolean |
isStaticTextType(java.lang.String type)
Returns true if type equals guideTextDraw or guideAdobeSignBlock
|
static boolean |
isSubmitableField(JSONObject obj) |
static boolean |
isTargetEnabled(Resource guideContainerResource)
API to identify if targeting is enabled for the Adaptive form requested by
the specified guide container
|
static boolean |
isUnboundObj(JSONObject obj) |
static boolean |
isValidFormResource(ResourceResolver resourceResolver,
java.lang.String formPath,
java.lang.String formType)
Check if formPath points to valid resource of type formType
|
static java.lang.Boolean |
isValidGuide(SlingHttpServletRequest request,
Resource resource) |
static boolean |
isWebChannel(Resource resource)
Checks whether resource is a web channel resource.
|
static boolean |
isXDPValid(Resource guideContainer)
Checks if the give adaptive forms(using guidecontainer resource) has a valid XDP Reference to it
|
static java.lang.Boolean |
listContains(java.util.List<java.lang.String> list,
java.lang.String searchString,
java.lang.Boolean ignoreCase)
Checks case-insensitively if a string is present in a list of strings
|
static java.lang.String |
manipulateBindRefForFragments(java.lang.String bindRefPrefixForFragment,
java.lang.String bindRef,
java.lang.String fragmentRoot)
This API is for internal purpose.
|
static java.lang.Object |
marshallDataWithAFWrapper(java.lang.Object data)
Marshalls the naked data with AF wrapper tags.
|
static java.lang.String |
paramToString(RequestParameter param)
Utility to convert a RequestParameter to String
|
static double |
parseSize(java.lang.String size) |
static ParameterMap |
prepareWrappedRequestWithDataXMLAndAttachments(SlingHttpServletRequest request) |
static boolean |
processChartAddition(GuideModelImporter guideModelImporter,
Resource chartResource,
Resource guideContainerResource) |
static SlingHttpServletResponse |
processInternalPostOnRestEndPoint(SlingHttpServletRequest request,
SlingHttpServletResponse response,
java.lang.String postUrl)
Forwards the given request using HTTP Post to the given post url
|
static java.lang.String |
produceHTML(GuideContainer guideContainer,
SlingHttpServletResponse slingHttpServletResponse) |
static void |
putQueryParamsToRedirectRequest(java.lang.String responseString,
java.util.Map<java.lang.String,java.lang.String> redirectParameters) |
static java.lang.String |
removePrefix(java.lang.String str,
java.lang.String prefix) |
static JSONObject |
resourceToJSON(Resource resource)
Get the JSON representation of a Resource
|
static java.lang.String[] |
sanitizeLocaleList(java.lang.String[] locales)
This is to sanitize the localisation service locales
They are in pt-br format, we will try to sanitize them to ptBR format
|
static boolean |
setButtonForPanel(java.lang.String title,
EditContext editContext,
SlingHttpServletRequest request,
java.lang.String currentPanelPath,
java.lang.String bindRef,
java.lang.String handler)
Sets the button in the edit bar for the panel based on the title and handler.
|
static boolean |
setButtonForPanel(java.lang.String title,
EditContext editContext,
SlingHttpServletRequest request,
java.lang.String currentPanelPath,
java.lang.String bindRef,
java.lang.String handler,
java.lang.Integer index)
Sets the button in the edit bar for the panel based on the title, handler and index.
|
static boolean |
setEmbedFragButton(java.lang.String title,
EditContext editContext,
SlingHttpServletRequest request,
java.lang.String fragRef,
java.lang.String currentPanelPath,
java.lang.String bindRef)
Sets the embed fragment button in the edit bar for the panel based on the title, handler and index.
|
static void |
setMasterAuthoringConfig(java.util.Map<java.lang.String,java.lang.Object> authoringConfig,
ValueMap resourceProps) |
static boolean |
setToolbarLabel(java.lang.String name,
java.lang.String title,
EditContext editContext,
SlingHttpServletRequest request) |
static boolean |
showRuleEditor(java.security.Principal userPrincipal,
UserManager um,
java.lang.String[] customGroups)
Given user principal and list of groups returns true if
principal is to be shown rule editor
|
static JSONObject |
somToAdapativeFormItem(JSONObject formContainerJson,
java.lang.String somExpression)
Gives JSONObject of Adaptive Form field/panel corresponding to given SOM Expression
|
static java.lang.String |
translateOrReturnOriginal(java.lang.String original,
I18n i18n) |
static JSONObject |
trimLazyChildren(java.lang.String guideJsonString) |
static java.lang.String |
updateSigner(java.lang.String name,
int signerIndex,
java.lang.String htmlVal)
Utility to update signer information in Static text/ guide textdraw HTML, while creating guideJson
|
static java.util.List<GuideUtils.AuthoringError> |
validateFormAuthoredState(GuideContainer guideContainer,
java.lang.String afInitializationState,
I18n localI18n)
validates Adaptive Form (having Signature Step) authored state
|
static void |
visitToCollectProperties(JSONObject guideTypeJsonObject,
java.lang.String toCheck,
java.lang.String keyToPut,
java.lang.String valueToPut,
JSONArray collection) |
static void |
walkThroughContent(java.util.List<java.lang.String> list,
Resource elementResource,
java.lang.String resourceToBeFound) |
public static java.lang.String getSignConfigPath(Resource guideContainerResource)
guideContainerResource
- - resource representing guide container of the formpublic static JSONArray getAdobeSignFields(java.lang.String htmlVal)
htmlVal
- - html string having adobe sign text tagspublic static java.util.List<TextVariable> getTextVariables(Resource resource)
resource
- - Text resourcepublic static java.lang.String formatDateDefaultValues(java.lang.String htmlVal)
htmlVal
- - stringified html having adobe sign text tagspublic static java.lang.String updateSigner(java.lang.String name, int signerIndex, java.lang.String htmlVal)
public static ResourceResolver getServiceResourceResolver(ResourceResolverFactory resourceResolverFactory)
public static ResourceResolver getCloudServiceUserResourceResolver(ResourceResolverFactory resourceResolverFactory)
public static java.util.Map<java.lang.String,java.lang.String> convertStringToMap(java.lang.String params)
public static boolean hasNestablePanelLayout(GuideNode parentNode, GuideNode node)
public static java.lang.String getGuideContainerPath(SlingHttpServletRequest request, Resource resource)
request
- sling http servlet requestresource
- sling resourcepublic static JSONObject resourceToJSON(Resource resource) throws java.lang.Exception
resource
- Resource to turn into JSONjava.lang.Exception
public static JSONObject getTemplateJsonForField(java.lang.String resourceType, ResourceResolver resolver) throws java.lang.Exception
resourceType
- resolver
- java.lang.Exception
public static JSONObject addTemplateJsonToField(JSONObject currentJsonObject, java.lang.String resourceType, ResourceResolver resolver, java.lang.String guideNodeClass) throws java.lang.Exception
currentJsonObject
- resourceType
- resolver
- guideNodeClass
- java.lang.Exception
public static java.util.List getFileAttachmentList(SlingHttpServletRequest request, java.lang.String guideContainerPath)
request
- guideContainerPath
- public static java.lang.Object consumeContextProperty(java.lang.String contextPropertyName, SlingHttpServletRequest request)
contextPropertyName
- request
- public static boolean isRichTextField(JSONObject jsonObject) throws JSONException
jsonObject
- JSONException
public static boolean setToolbarLabel(java.lang.String name, java.lang.String title, EditContext editContext, SlingHttpServletRequest request)
public static java.lang.String encodeForHtml(java.lang.String str, XSSAPI xssapi)
str
- string to encode as HTML contentxssapi
- XSSAPI
instancepublic static java.lang.String encodeForHtmlAttr(java.lang.String str, XSSAPI xssapi)
str
- string to encode as HTML attributexssapi
- XSSAPI
instancepublic static java.lang.String encodeForJSString(java.lang.String str, XSSAPI xssapi)
str
- string to encode as java script contentxssapi
- XSSAPI
instancepublic static java.lang.String filterHtml(java.lang.String str, XSSAPI xssapi)
public static java.lang.String getDefaultLocale(Resource resource)
public static java.lang.String getThemeClientLibName(Resource resource)
public static java.lang.String getLocale(SlingHttpServletRequest request, Resource guideContainerResource)
request
- guideContainerResource
- public static I18n getI18n(SlingHttpServletRequest request, Resource guideFieldResource)
request
- guideFieldResource
- public static java.lang.Boolean isEditableTemplateResource(Resource resource)
resource
- public static Resource getPageResource(Resource resource)
public static I18n getI18n(ResourceBundleProvider resourceBundleProvider, Resource containerResource, java.util.Locale locale)
resourceBundleProvider
- containerResource
- locale
- public static java.lang.String getDataMimeType(Resource formResource)
formResource
- resource of adaptive form containerpublic static java.lang.String getSchemaType(JSONObject formContainerJson)
GuideContainer.getSchemaType()
insteadformContainerJson
- json of adaptive form containerpublic static java.lang.String getAfDataSom(java.lang.String schemaType, java.lang.String name, java.lang.String bindRef)
schemaType
- of adaptive formname
- of adaptive form fieldbindRef
- of adaptive form fieldpublic static JSONObject somToAdapativeFormItem(JSONObject formContainerJson, java.lang.String somExpression)
formContainerJson
- adaptive form container JSONsomExpression
- som expression of adaptive form panel/fieldpublic static java.lang.String paramToString(RequestParameter param)
param
- RequestParameterpublic static java.lang.String guideRefToGuidePath(java.lang.String guideRefPath)
guideRefPath
- path of the adaptive forms metadata nodepublic static java.lang.String guideRefToDocPath(java.lang.String guideRefPath)
guideRefPath
- path of the mc document metadata nodepublic static java.lang.String manipulateBindRefForFragments(java.lang.String bindRefPrefixForFragment, java.lang.String bindRef, java.lang.String fragmentRoot)
bindRefPrefixForFragment
- this the prefix after which the fragment root would be appendedbindRef
- Reference to thefragmentRoot
- Root of fragmentpublic static java.lang.String getNamespacedKeys(java.lang.String key)
key
- public static java.lang.String translateOrReturnOriginal(java.lang.String original, I18n i18n)
original
- i18n
- public static java.lang.String escapeXml(java.lang.String unescaped)
unescaped
- public static boolean isGuideFileUploadModel(java.lang.String guideNodeClass)
guideNodeClass
- public static boolean isGuideButtonModel(java.lang.String guideNodeClass)
guideNodeClass
- public static boolean isGuideFieldModel(java.lang.String guideNodeClass)
guideNodeClass
- public static boolean isGuidePanelModel(java.lang.String guideNodeClass)
guideNodeClass
- public static boolean isGuideCompositeField(java.lang.String guideNodeClass)
guideNodeClass
- public static boolean isGuideTnCModel(java.lang.String guideNodeClass)
guideNodeClass
- public static JSONObject getGuideContainer(JSONObject guideJson) throws GuideException
guideJson
- GuideException
public static ValueMap getGuideContainer(SlingHttpServletRequest request, Resource elementResource)
request
- elementResource
- elementResource here should be an ancestor if guideContainer, if it a descendent use the generic api getGuideContainerPath present inside GuideELUtilsRepositoryException
public static java.lang.Boolean isValidGuide(SlingHttpServletRequest request, Resource resource) throws RepositoryException
request
- resource
- RepositoryException
public static java.lang.String getNormalizedNodeType(java.lang.String resourceType, java.lang.String resourceSuperType)
resourceType
- resourceSuperType
- public static void walkThroughContent(java.util.List<java.lang.String> list, Resource elementResource, java.lang.String resourceToBeFound)
list
- elementResource
- resourceToBeFound
- public static boolean isLayoutablePanel(GuideNode node)
node
- public static java.lang.String convertFMAssetPathToContainerPath(java.lang.String fragRef)
fragRef
- DAM asset path of Fragmentpublic static java.lang.String convertGuideContainerPathToFMAssetPath(java.lang.String guideContainerPath)
guideContainerPath
- path to the form containerpublic static java.lang.String convertGuideContainerPathToFMAssetMetadataPath(java.lang.String guideContainerPath)
guideContainerPath
- path to the adaptive form containerpublic static java.lang.String getDoRTemplateRef(java.lang.String guideContainerPath, java.lang.String runtimeLocale, ResourceResolver resourceResolver)
guideContainerPath
- runtimeLocale
- localeresourceResolver
- public static ResourceResolver getResolverFromResourceResolverHelper(ResourceResolverHelper resourceResolverHelper)
resourceResolverHelper
- public static ResourceResolver getResolverFromResource(GuideContainer guideContainer)
guideContainer
- public static StrSubstitutor getStringSubstitutor(JSONObject valueMap)
valueMap
- public static java.lang.Boolean isPanel(Resource resource)
resource
- public static java.lang.Boolean hasModifyPermission(Resource resource)
resource
- public static java.lang.Boolean embedFragmentResources(Resource fragmentPanelResource, java.lang.String fragmentPath, java.lang.Boolean processConversion)
public static java.lang.Boolean convertToNewResponsiveLayout(Resource guideContainerResource)
guideContainerResource
- public static void convertPanelToNewResponsiveLayout(Resource panelResource)
panelResource
- public static java.lang.Boolean isOldResponsiveLayout(Resource panelResource)
panelResource
- public static java.lang.Boolean hasOldResponsiveLayout(Resource panelResource)
panelResource
- public static GuidePanel getRootPanel(Resource resource, SlingHttpServletRequest slingRequest)
resource
- slingRequest
- public static GuideModuleImporter getGuideModuleImporter(SlingHttpServletRequest slingRequest)
slingRequest
- public static java.lang.String removePrefix(java.lang.String str, java.lang.String prefix)
str
- prefix
- public static java.util.Calendar getLastModifiedTimeFromStaleAssetIndicatorService(GuideContainer guideContainer, StaleAssetIndicatorService staleAssetIndicatorService)
guideContainer
- staleAssetIndicatorService
- public static boolean isJsonBasedSchema(java.lang.String schemaType)
schemaType
- public static boolean isXDPValid(Resource guideContainer)
guideContainer
- resource of the adaptive form containerpublic static boolean isMetaTemplateValid(ResourceResolver resourceResolver, java.lang.String metaTemplateRef)
resourceResolver
- ResourceResolver to resolve pathpublic static java.lang.String getMetaTemplateRef(Resource guideContainerResource)
guideContainerResource
- guide container resource objectpublic static boolean isGuideContainerResource(Resource resource)
resource
- public static boolean isCacheableContainerResource(Resource resource)
resource
- container resourcepublic static boolean isTargetEnabled(Resource guideContainerResource)
guideContainerResource
- resource to the adaptive form containerpublic static boolean isAdobeTargetConfigured(Resource resource)
resource
- resource to the adaptive form containerpublic static java.lang.String getAlternateContainerPathFromCurrentContainer(RequestPathInfo requestPathInfo)
requestPathInfo
- RequestPathInfo object from the requestpublic static java.util.List<GuideUtils.AuthoringError> validateFormAuthoredState(GuideContainer guideContainer, java.lang.String afInitializationState, I18n localI18n)
guideContainer,
- public static boolean isDorTemplateRefValid(Resource guideContainer)
guideContainer,
- public static java.lang.String getXFALocale(java.lang.String locale)
locale
- AEM supported localepublic static java.lang.String getGuideRuntimeLocale(SlingHttpServletRequest slingRequest, Resource resource)
resource
- resource to the adaptive form containerslingRequest
- client request objectpublic static java.util.Calendar getCurrentLMT(Resource containerResource, StaleAssetIndicatorService staleAssetIndicatorService)
containerResource
- staleAssetIndicatorService
- public static java.lang.String getAcceptLang(SlingHttpServletRequest request)
request
- public static void visitToCollectProperties(JSONObject guideTypeJsonObject, java.lang.String toCheck, java.lang.String keyToPut, java.lang.String valueToPut, JSONArray collection)
guideTypeJsonObject
- toCheck
- keyToPut
- valueToPut
- collection
- public static I18n getI18nForDesiredLocale(SlingHttpServletRequest request, Resource guideContainerResource, java.util.Locale desiredLocale)
public static int getLocaleIndexFromLocale(java.lang.String locale, java.lang.String[] AEM_SUPPORTED_LOCALES)
locale
- public static java.lang.String[] sanitizeLocaleList(java.lang.String[] locales)
locales
- public static java.lang.String getInheritedProperty(Resource resource, java.lang.String propertyName)
resource
- resourcepropertyName
- name of the propertypublic static Session getUserSessionFromRequest(SlingHttpServletRequest slingHttpServletRequest)
public static SlingHttpServletResponse processInternalPostOnRestEndPoint(SlingHttpServletRequest request, SlingHttpServletResponse response, java.lang.String postUrl)
request
- sling requestresponse
- sling responsepostUrl
- URL to forward the current requestpublic static void addToRequestMap(ParameterMap requestParameterMap, java.lang.String key, RequestParameter[] requestParameter)
requestParameterMap
- key
- requestParameter
- public static ParameterMap prepareWrappedRequestWithDataXMLAndAttachments(SlingHttpServletRequest request)
request
- public static java.lang.String getFieldLayout(Resource guideContainerResource, java.lang.String propertyName, java.lang.String defaultValue)
public static boolean setEmbedFragButton(java.lang.String title, EditContext editContext, SlingHttpServletRequest request, java.lang.String fragRef, java.lang.String currentPanelPath, java.lang.String bindRef)
title
- editContext
- request
- fragRef
- currentPanelPath
- bindRef
- public static boolean setButtonForPanel(java.lang.String title, EditContext editContext, SlingHttpServletRequest request, java.lang.String currentPanelPath, java.lang.String bindRef, java.lang.String handler)
title
- editContext
- request
- currentPanelPath
- bindRef
- handler
- public static boolean setButtonForPanel(java.lang.String title, EditContext editContext, SlingHttpServletRequest request, java.lang.String currentPanelPath, java.lang.String bindRef, java.lang.String handler, java.lang.Integer index)
title
- editContext
- request
- currentPanelPath
- bindRef
- handler
- index
- public static void putQueryParamsToRedirectRequest(java.lang.String responseString, java.util.Map<java.lang.String,java.lang.String> redirectParameters)
responseString
- redirectParameters
- public static double parseSize(java.lang.String size)
size
- public static JSONObject trimLazyChildren(java.lang.String guideJsonString)
guideJsonString
- AF Jsonpublic static java.lang.String findJsonObjectWithProperty(JSONObject jsonObject, java.lang.String propertyName, java.lang.String propertyValue, java.lang.String path, boolean ignorePath)
jsonObject
- propertyName
- propertyValue
- path
- ignorePath
- if true then the resource should have same jcr:path path is ignoredpublic static java.lang.String findJsonObjectWithProperty(JSONObject jsonObject, java.lang.String propertyName, java.lang.String propertyValue, java.lang.String path)
jsonObject
- propertyName
- propertyValue
- path
- public static java.lang.String getAssetHTMLFromFullHTML(java.lang.String templateId, java.lang.String html)
templateId
- html
- String
of the templateId providedpublic static java.lang.String formJsonHtmlString(java.lang.String json, java.lang.String html, java.lang.String multipleJson)
json
- html
- public static java.lang.String getLayoutScriptFromContainer(GuideContainer guideContainer)
guideContainer
- GuideContainer
public static java.lang.String produceHTML(GuideContainer guideContainer, SlingHttpServletResponse slingHttpServletResponse)
guideContainer
- slingHttpServletResponse
- public static java.lang.String getJsonObjectWithGivenTemplateIds(JSONObject guideJsonObject, JSONArray jsonArray)
guideJsonObject
- jsonArray
- public static java.lang.String getScriptAsStringFromClientLib(HtmlLibraryManager htmlLibraryManager, java.lang.String clientLibPath, boolean minify)
htmlLibraryManager
- HtmlLibraryManager service.clientLibPath
- String specifying the path of client lib.public static java.util.ArrayList<java.lang.String> getScriptFromClientLibList(HtmlLibraryManager htmlLibraryManager, java.lang.String[] clientLibCategories, boolean minify)
htmlLibraryManager
- HtmlLibraryManager service.clientLibCategories
- Array of all clientlib categories fow which script is required.public static JSONObject getDictionaryInfoFromAssetPaths(JSONArray assetList, java.util.List<java.lang.String> locales)
assetList
- locales
- public static java.lang.String getDefaultPattern(java.lang.String componentType)
componentType
- public static JSONObject getCCRData(java.lang.String jsonData) throws JSONException
jsonData
- JSONException
public static java.lang.Boolean listContains(java.util.List<java.lang.String> list, java.lang.String searchString, java.lang.Boolean ignoreCase)
list
- searchString
- ignoreCase
- public static SlingBindings getSlingBinding(SlingHttpServletRequest slingRequest)
SlingBindings
from given SlingHttpServletRequest
slingRequest
- SlingBindings
public static boolean checkIfForms(Resource resource)
resource
- resource pointing to the pagepublic static Resource getMergedFormResource(ResourceResolver resolver, java.lang.String formPath)
public static boolean checkIfFormsTemplate(Resource resource)
resource
- public static boolean isRepeatable(JSONObject obj)
public static boolean isCompositeField(JSONObject obj)
public static boolean isSubmitableField(JSONObject obj)
public static boolean isStaticTextType(java.lang.String type)
public static boolean hasFloatingField(JSONObject obj)
public static java.lang.Boolean isDeprecatedAD(Resource containerResource)
public static FileAttachmentWrapper findFileAttachment(java.util.List<FileAttachmentWrapper> attachmentWrappers, java.lang.String fileName)
public static Resource getFormResource(Resource otherResource, java.lang.String fragRef)
public static Resource getFormBreakpointResource(ResourceResolver resolver, java.lang.String formPath)
public static JSONObject getFormJson(Resource formRes, GuideModelTransformer guideModelTransformer)
public static java.lang.String getGuideContainerPathFromResource(SlingHttpServletRequest request, Resource resource)
public static boolean isUnboundObj(JSONObject obj)
obj
- : guide json objpublic static java.lang.String getThemeContentRef(Resource guideContainerResource)
guideContainerResource
- resource to the form containerpublic static Resource getResource(ResourceResolver resourceResolver, java.lang.String path, JSONObject json)
resourceResolver
- ResourceResolver to be set for resource being returnedpath
- path on which resource has to be mountedjson
- input JSON which is to be transformed into resourcepublic static Resource getResource(ResourceResolver resourceResolver, java.lang.String path, JSONObject json, Resource parentResource)
resourceResolver
- ResourceResolver to be set for resource being returnedpath
- path on which resource has to be mountedjson
- input JSON which is to be transformed into resourceparentResource
- parent resource of synthetic resource that is being generated.public static Resource getResource(ResourceResolver resourceResolver, java.lang.String path, JSONObject json, Resource parentResource, boolean useNameAsResourceIdentifier)
resourceResolver
- ResourceResolver to be set for resource being returnedpath
- path on which resource has to be mountedjson
- input JSON which is to be transformed into resourceparentResource
- parent resource of synthetic resource that is being generated.useNameAsResourceIdentifier
- use name of resource as the key during resoruce creation from jsonpublic static void fillQueue(java.util.Queue<Resource> queue, Resource resource, java.lang.String type)
queue
- queue to be filledresource
- parent of guide containertype
- either StaticText or Imagepublic static Resource getAdaptiveFormBrandingComponents(ResourceResolver resourceResolver, java.lang.String guideContainerPath, java.lang.String type, java.lang.String value, I18n i18n)
resourceResolver
- guideContainerPath
- type
- either StaticText or Imagevalue
- component which should be selectedpublic static Resource getThemeResource(Resource formResource)
formResource
- Form resource.public static boolean isScriptAuthoringAllowed(java.security.Principal userPrincipal, UserManager um) throws RepositoryException
userPrincipal
- Principal
user principalum
- reference to UserManager serviceRepositoryException
public static boolean showRuleEditor(java.security.Principal userPrincipal, UserManager um, java.lang.String[] customGroups) throws RepositoryException
userPrincipal
- Principal
user principalum
- reference to UserManagercustomGroups
- list of group names to show rule editorRepositoryException
public static java.lang.Object getNakedBoundJsonData(java.lang.Object data)
data
- public static boolean isDORConfigured(Resource formResource)
formResource
- The guideContainer Resource or Form Asset Resource or CQ Page resource.public static java.lang.String generateSOM(Resource element)
element
- - Resource, whose SOM Expression needs to be calculated.public static java.lang.Object marshallDataWithAFWrapper(java.lang.Object data) throws java.lang.Exception
data
- form datajava.lang.Exception
public static java.lang.String getRedirectUrl(java.lang.String redirectUrl, java.lang.String formPath)
public static java.util.List<Resource> getGuideContainerFromFormPage(Resource formPageResource)
public static java.lang.String convertFMAssetPathToFormPagePath(java.lang.String FMAssetPath)
public static java.lang.String convertFormPagePathToFMAssetPath(java.lang.String formPagePath)
public static java.lang.String convertADAssetPathToWebChannelPagePath(java.lang.String FMDocAssetPath)
public static JSONArray getMergedJSONArray(JSONArray array1, JSONArray array2) throws JSONException
JSONException
public static boolean isWebChannel(Resource resource)
resource
- public static Resource getParentResource(Resource resource, java.lang.String parentResourceType)
public static java.util.Map<java.lang.String,java.lang.Object> getCommonRepeatableBindRefForTableRow(GuideModelImporter guideModelImporter, Resource tableRowResource, Resource guideContainerResource)
public static java.util.Map<java.lang.String,java.lang.Object> getCommonRepeatableItemForChart(GuideModelImporter guideModelImporter, Resource chartResource, Resource guideContainerResource)
public static java.util.List<FileAttachmentWrapper> getFileAttachmentWrapperList(ParameterMap parameterMap)
parameterMap
- Map of request parameterspublic static void setMasterAuthoringConfig(java.util.Map<java.lang.String,java.lang.Object> authoringConfig, ValueMap resourceProps)
public static boolean isValidFormResource(ResourceResolver resourceResolver, java.lang.String formPath, java.lang.String formType)
resourceResolver
- formPath
- formType
- - formType is "guide" for AdaptiveForm and "mcdocument" for ICpublic static boolean processChartAddition(GuideModelImporter guideModelImporter, Resource chartResource, Resource guideContainerResource) throws java.lang.Exception
java.lang.Exception
Copyright © 2010 - 2020 Adobe. All Rights Reserved