public class ParamHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String |
combineUri(String componentUri,
String templateUri,
boolean escape)
Creates a combined URI from the specified Component and Template URIs.
|
static OffsetDateTime |
dateTimeFromObject(Object input) |
static Double |
doubleFromObject(Object input) |
static String |
escapeAttributeValue(String name,
String text)
Escapes a string so that it can be used to filter a query using an attribute in Elasticsearch.
|
static String |
escapeAttributeValue(String name,
String text,
boolean isIdentifiableFieldValue)
Escapes a string so that it can be used to filter a query using an attribute in Elasticsearch.
|
static List<String> |
escapeAttributeValues(String name,
List<String> values)
Escapes a List of strings so that it can be used to filter a query using an attribute in Elasticsearch.
|
static String |
escapeIdentifier(String text)
Escapes a string so that it can be used for an identifier attribute in Elasticsearch.
|
static String |
getBaseUri(String tcmUri)
Get the base part of an URI.
|
static String |
getComponentUri(String combinedUri,
boolean escape)
Gets the componentUri from a combinedUri.
|
static String |
getLocationFromKeyword(String keywordUri) |
static String |
getTemplateUri(String combinedUri,
boolean escape)
Gets the templateUri from a combinedUri.
|
static Boolean |
isPathRooted(String path)
Gets a value indicating whether the specified path string contains absolute or relative path information.
|
static String |
parseReferrerQuery(String referrerUrl)
Parses the specified referrer string using the SmartTarget referrer configuration and returns
the search query if successful.
|
static String |
stringToMD5(String value)
Creates an MD5 checksum for a given String.
|
static String |
urlDecode(String text)
Decodes a application/x-www-form-urlencoded string using a specific encoding scheme.
|
static String |
urlEncode(String text)
Translates a string into application/x-www-form-urlencoded format using UTF-8 as the encoding scheme.
|
static String |
urlEncodeAndSpace(String text)
Translates a string into application/x-www-form-urlencoded format using UTF-8 as the encoding scheme.
|
public static String getComponentUri(String combinedUri, boolean escape)
combinedUri
- a combination of a component and a template Uriescape
- if true replaces the : with a _public static String getTemplateUri(String combinedUri, boolean escape)
combinedUri
- a combination of a component and a template Uriescape
- if true replaces the : with a _public static String combineUri(String componentUri, String templateUri, boolean escape)
componentUri
- a component UritemplateUri
- a template Uriescape
- if true replaces all : by _public static String getBaseUri(String tcmUri)
tcmUri
- The URI to get the base part of.public static String escapeIdentifier(String text)
text
- The text to escape.public static String escapeAttributeValue(String name, String text)
name
- the name of the attribute.text
- The text to escape.public static String escapeAttributeValue(String name, String text, boolean isIdentifiableFieldValue)
name
- the name of the attribute.text
- The text to escape.isIdentifiableFieldValue
- Set to True if this attribute represents a field that should be an
'identifiable' list field.public static List<String> escapeAttributeValues(String name, List<String> values)
values
- The list of strings to escape.public static String urlEncode(String text)
text
- The value to encode.public static String urlEncodeAndSpace(String text)
text
- The value to encode.public static String urlDecode(String text)
text
- The value to decode.public static String parseReferrerQuery(String referrerUrl) throws com.tridion.smarttarget.SmartTargetException
referrerUrl
- The referrer string that should be parsed.null
.com.tridion.smarttarget.SmartTargetException
public static Boolean isPathRooted(String path)
path
- The path to test.true
if path contains an absolute path; otherwise, false
.public static String getLocationFromKeyword(String keywordUri)
keywordUri
- The Keyword to use when querying for dynamic facet promotionspublic static String stringToMD5(String value)
value
- The string to generate the MD5 checksum for.public static OffsetDateTime dateTimeFromObject(Object input)
Copyright © 2021 RWS Group for and on behalf of its affiliates and subsidiaries. All rights reserved.