Package de.xima.fc.placeholder
Class PlaceholderReplacer
java.lang.Object
de.xima.fc.placeholder.PlaceholderReplacer
Class to replace placeholders
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractAndReplace(String text, String replacement, IReplacerParams params) Searches after all placeholders (with pattern:CmnConst.PH_PATTERN_ALLin given text.static booleanmatchPlaceholder(String text) static Stringparse(IEntityContext ec, String text, Vorgang formRecord, boolean encodeForHTML) Deprecated.static Stringparse(IEntityContext ec, String text, IFormDataAdapter fda, Mandant client, FormVersion formVersion, boolean encodeForHTML) Deprecated.static Stringparse(IEntityContext ec, String text, IFormDataAdapter fda, Mandant client, Vorgang formRecord, boolean encodeForHTML) Deprecated.static Stringparse(IEntityContext ec, String text, IFormDataAdapter fda, IWorkflowProcessingContext wpc, Vorgang vorgang, Mandant mandant, boolean encodeForHTML) Deprecated.static Stringparse(IEntityContext ec, String text, IReplacerParams parameters) Deprecated.static Stringstatic Stringparse(String text, IExtendedFormRequestContext requestCtx, boolean encodeForHTML) Replaces as much as it can with the given information of the request Ctxstatic Stringparse(String text, IFormDataAdapter fda, Mandant client, FormVersion formVersion, boolean encodeForHTML) This method applies all available placeholder replacers on the given text.static Stringparse(String text, IFormDataAdapter fda, Mandant client, Vorgang formRecord, boolean encodeForHTML) This method applies all available placeholder replacers on the given text.static Stringparse(String text, IFormDataAdapter fda, IWorkflowProcessingContext wpc, Vorgang vorgang, Mandant mandant, boolean encodeForHTML) Deprecated.static Stringparse(String text, IReplacerParams parameters) static Stringparse(String text, IWorkflowProcessingContext wpc) Deprecated.static Stringparse(String text, IWorkflowProcessingContext wpc, boolean encodeUserInput) Deprecated.static StringparseForContextValues(IEntityContext ec, String text, IContextReplacerParams parameters) Deprecated.static StringparseForContextValues(String text, IContextReplacerParams parameters) static StringparseForFormValues(IEntityContext ec, String text, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated.static StringparseForFormValues(IEntityContext ec, String text, IFormReplacerParams parameters) Deprecated.static StringparseForFormValues(String text, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated.static StringparseForFormValues(String text, IFormReplacerParams parameters) static StringparseForI18nValues(String text, II18nValueReplacerParams parameters) Diese Methode dient dazu, Formularelementplatzhalter durch Formularwerte zu ersetzten.static StringparseForSessionValues(IEntityContext ec, String text, Vorgang process, String baseUrl, String sessionId) Deprecated.static StringparseForSessionValues(IEntityContext ec, String text, ISessionReplacerParams parameters) Deprecated.static StringparseForSessionValues(String text, Vorgang process, String baseUrl, String sessionId) Deprecated.static StringparseForSessionValues(String text, ISessionReplacerParams parameters) static StringparseForSystemAttributes(IEntityContext ec, String text, Vorgang process, IWorkflowProcessingContext wfpctx) Deprecated.static StringparseForSystemAttributes(IEntityContext ec, String text, ISystemReplacerParams parameters) Deprecated.static StringparseForSystemAttributes(String text, Vorgang process, IWorkflowProcessingContext wfpctx) Deprecated.static StringparseForSystemAttributes(String text, ISystemReplacerParams parameters) static StringparseForTemplates(IEntityContext ec, String text, Mandant client) Deprecated.static StringparseForTemplates(IEntityContext ec, String text, ITemplateReplacerParams parameters) Deprecated.static StringparseForTemplates(String text, Mandant client) Deprecated.static StringparseForTemplates(String text, ITemplateReplacerParams parameters) static IParsedPlaceholderparsePlaceholderRepresentation(String representation) Parses theIParsedPlaceholder.getRepresentation()of a placeholder into a placeholder instance with details about the placeholder.static StringreplaceFormValue(IEntityContext ec, String placeholder, String placeholderContent, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated.static StringreplaceFormValue(String placeholder, String placeholderContent, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated.static StringreplaceI18nValue(String placeholder, String placeholderContent, II18nValueReplacerParams parameters) static StringreplaceSessionValues(IEntityContext ec, String placeholder, String placeholderContent, Vorgang process, String sessionId, String baseUrl) Deprecated.static StringreplaceSessionValues(IEntityContext ec, String placeholder, String placeholderContent, IContextReplacerParams parameters, String contextPath) Deprecated.static StringreplaceSessionValues(String placeholder, String placeholderContent, Vorgang process, String sessionId, String baseUrl) Deprecated.static StringreplaceSessionValues(String placeholder, String placeholderContent, IContextReplacerParams parameters, String contextPath) Deprecated.static StringreplaceSystemValue(IEntityContext ec, String placeholder, String placeholderContent, IWorkflowProcessingContext wfpctx) Deprecated.static StringreplaceSystemValue(String placeholder, String placeholderContent, IWorkflowProcessingContext wfpctx) Deprecated.static StringreplaceTemplateValue(IEntityContext ec, String placeholder, String placeholderContent, Mandant client) Deprecated.static StringreplaceTemplateValue(String placeholder, String placeholderContent, Mandant client) Deprecated.static voidsetDefaultFormValueReplacer(IFormValueReplacer formReplacer) static voidsetDefaultI18nValueReplacer(II18nValueReplacer i18nReplacer) static voidsetDefaultSessionValueReplacer(ISessionValueReplacer sessionReplacer) static voidsetDefaultSystemValueReplcaer(ISystemValueReplacer systemReplacer) static voidsetDefaultTemplateValueReplacer(ITemplateValueReplacer templateReplacer) static void
-
Field Details
-
PARAMS_SPLITCHAR
- See Also:
-
-
Constructor Details
-
PlaceholderReplacer
public PlaceholderReplacer()
-
-
Method Details
-
parsePlaceholderRepresentation
Parses theIParsedPlaceholder.getRepresentation()of a placeholder into a placeholder instance with details about the placeholder.- Parameters:
representation- Representation of a placeholder to parse, e.g.[%$PROJECT_ID%]. Note that the entire string must be an entire placeholder, you may not pass a string that only contains placeholders.- Returns:
- The parsed placeholder, or
nullwhen not a valid placeholder.
-
parse
-
parse
@Deprecated public static String parse(String text, IFormDataAdapter fda, IWorkflowProcessingContext wpc, Vorgang vorgang, Mandant mandant, boolean encodeForHTML) Deprecated.Diese Methode dient dazu, all verfügbaren Parser auf einen Text anzuwenden. Wir an entsprechender Stellenullübergeben, so kann ein Parser ausgelassen werden- Parameters:
text- Text der geparst werden sollfda- Parsen des Texts mit Formdateninhalten (nullumreplaceFormValue(IEntityContext, String, String, IFormDataAdapter, FormVersion, boolean)zu überspringen)wpc- Parsen des Texts mitIWorkflowProcessingContext-Inhalten (nullumparseForSystemAttributes(IEntityContext, String, Vorgang, de.xima.fc.interfaces.processing.IWorkflowProcessingContext)zu überspringen)vorgang- Parsen des Texts mit Systemattributen (nullumparseForSystemAttributes(IEntityContext, String, Vorgang, de.xima.fc.interfaces.processing.IWorkflowProcessingContext)zu überspringen)mandant-Mandantauf dessenTextbaustein-Instanzen zugegriffen werden soll- Returns:
- Zeichenkette mit den ersetzten Platzhaltern
-
parse
public static String parse(String text, IFormDataAdapter fda, Mandant client, Vorgang formRecord, boolean encodeForHTML) This method applies all available placeholder replacers on the given text. Passnullfor one of the arguments to skip all placeholder replaces that require this argument.- Parameters:
text- The text to be processed.fda- Required for form element placeholders. Passnullto skipreplaceFormValue(IEntityContext, String, String, IFormDataAdapter, FormVersion, boolean).formRecord- Required form form value placeholders. Passnullto skipreplaceFormValue(IEntityContext, String, String, IFormDataAdapter, FormVersion, boolean).client- Client whose template resources are used. Required for template placeholders. Pass null to skipparseForTemplates(IEntityContext, String, Mandant).- Returns:
- The text with all applicable placeholders replaced with their value.
-
parse
-
parse
public static String parse(String text, IExtendedFormRequestContext requestCtx, boolean encodeForHTML) Replaces as much as it can with the given information of the request Ctx- Parameters:
text-Stringtext to parse for placeholdersrequestCtx-IExtendedFormRequestContextholding information for replacement- Returns:
- The text with all applicable placeholders replaced with their value.
-
parse
public static String parse(String text, IFormDataAdapter fda, Mandant client, FormVersion formVersion, boolean encodeForHTML) This method applies all available placeholder replacers on the given text. Passnullfor one of the arguments to skip all placeholder replacements that require this argument.- Parameters:
text- The text to be processed.fda- Required for form element placeholders. Passnullto skipreplaceFormValue(IEntityContext, String, String, IFormDataAdapter, FormVersion, boolean).formVersion- Required form form value placeholders. Passnullto skipreplaceFormValue(IEntityContext, String, String, IFormDataAdapter, FormVersion, boolean).client- Client whose template resources are used. Required for template placeholders. Pass null to skipparseForTemplates(IEntityContext, String, Mandant).- Returns:
- The text with all applicable placeholders replaced with their value.
-
parse
Deprecated.Diese Methode dient dazu, all verfügbaren Parser auf einen Text anzuwenden.- Parameters:
text- Text der geparst werden sollwpc- Parsen des Texts mitIWorkflowProcessingContext-Inhalten- Returns:
- Zeichenkette mit den ersetzten Platzhaltern
-
parse
@Deprecated public static String parse(String text, IWorkflowProcessingContext wpc, boolean encodeUserInput) Deprecated. -
parseForFormValues
-
parseForSessionValues
-
parseForContextValues
-
parseForSystemAttributes
-
parseForTemplates
-
parseForI18nValues
Diese Methode dient dazu, Formularelementplatzhalter durch Formularwerte zu ersetzten.- Parameters:
text- - Zeichenkette in der zu ersetzende Platzhalter vorkommenparameters- - the map of i18n variables- Returns:
- geparste Zeichenkette
-
replaceI18nValue
public static String replaceI18nValue(String placeholder, String placeholderContent, II18nValueReplacerParams parameters) -
cleanUp
- Parameters:
text- Text to be cleaned from placeholders.- Returns:
- The given text, cleaned such that all placeholders are removed.
-
extractAndReplace
public static org.apache.commons.lang3.tuple.Pair<String,List<String>> extractAndReplace(String text, String replacement, IReplacerParams params) Searches after all placeholders (with pattern:CmnConst.PH_PATTERN_ALLin given text. Extracts them into an list and replace it with the given replacement-string. All extracted placeholders in the list will be processed with placeholder-replacer.- Parameters:
text- a string with placeholders insidereplacement- a replacement for all placeholders in the given textparams- parameters for the placeholder-replacer- Returns:
- a
Pairwith changed text (on the left side) and a list of parsed placeholders (on the right side)
-
setDefaultSessionValueReplacer
- Parameters:
sessionReplacer- the sessionReplacer to set
-
setDefaultSystemValueReplcaer
- Parameters:
systemReplacer- the systemReplcaer to set
-
setDefaultTemplateValueReplacer
- Parameters:
templateReplacer- the templateReplacer to set
-
setDefaultFormValueReplacer
- Parameters:
formReplacer- the formReplacer to set
-
setDefaultI18nValueReplacer
- Parameters:
i18nReplacer- the i18nReplacer to set
-
getPatternList
-
setECFactory
-
matchPlaceholder
-
replaceTemplateValue
@Deprecated public static String replaceTemplateValue(String placeholder, String placeholderContent, Mandant client) Deprecated. -
replaceSessionValues
@Deprecated public static String replaceSessionValues(String placeholder, String placeholderContent, Vorgang process, String sessionId, String baseUrl) Deprecated. -
replaceSessionValues
@Deprecated public static String replaceSessionValues(String placeholder, String placeholderContent, IContextReplacerParams parameters, String contextPath) Deprecated. -
replaceSystemValue
@Deprecated public static String replaceSystemValue(String placeholder, String placeholderContent, IWorkflowProcessingContext wfpctx) Deprecated. -
replaceFormValue
@Deprecated public static String replaceFormValue(String placeholder, String placeholderContent, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated. -
parseForTemplates
Deprecated. -
parseForSystemAttributes
@Deprecated public static String parseForSystemAttributes(String text, Vorgang process, IWorkflowProcessingContext wfpctx) Deprecated. -
parseForSessionValues
@Deprecated public static String parseForSessionValues(String text, Vorgang process, String baseUrl, String sessionId) Deprecated. -
parseForFormValues
@Deprecated public static String parseForFormValues(String text, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated. -
parse
Deprecated. -
parse
@Deprecated public static String parse(IEntityContext ec, String text, IFormDataAdapter fda, IWorkflowProcessingContext wpc, Vorgang vorgang, Mandant mandant, boolean encodeForHTML) Deprecated. -
parse
@Deprecated public static String parse(IEntityContext ec, String text, IFormDataAdapter fda, Mandant client, Vorgang formRecord, boolean encodeForHTML) Deprecated. -
parse
@Deprecated public static String parse(IEntityContext ec, String text, Vorgang formRecord, boolean encodeForHTML) Deprecated. -
parse
@Deprecated public static String parse(IEntityContext ec, String text, IFormDataAdapter fda, Mandant client, FormVersion formVersion, boolean encodeForHTML) Deprecated. -
parseForFormValues
@Deprecated public static String parseForFormValues(IEntityContext ec, String text, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated. -
parseForFormValues
@Deprecated public static String parseForFormValues(IEntityContext ec, String text, IFormReplacerParams parameters) Deprecated. -
parseForSessionValues
@Deprecated public static String parseForSessionValues(IEntityContext ec, String text, Vorgang process, String baseUrl, String sessionId) Deprecated. -
parseForSessionValues
@Deprecated public static String parseForSessionValues(IEntityContext ec, String text, ISessionReplacerParams parameters) Deprecated. -
parseForContextValues
@Deprecated public static String parseForContextValues(IEntityContext ec, String text, IContextReplacerParams parameters) Deprecated. -
parseForSystemAttributes
@Deprecated public static String parseForSystemAttributes(IEntityContext ec, String text, Vorgang process, IWorkflowProcessingContext wfpctx) Deprecated. -
parseForSystemAttributes
@Deprecated public static String parseForSystemAttributes(IEntityContext ec, String text, ISystemReplacerParams parameters) Deprecated. -
parseForTemplates
Deprecated. -
parseForTemplates
@Deprecated public static String parseForTemplates(IEntityContext ec, String text, ITemplateReplacerParams parameters) Deprecated. -
replaceTemplateValue
@Deprecated public static String replaceTemplateValue(IEntityContext ec, String placeholder, String placeholderContent, Mandant client) Deprecated. -
replaceSessionValues
@Deprecated public static String replaceSessionValues(IEntityContext ec, String placeholder, String placeholderContent, Vorgang process, String sessionId, String baseUrl) Deprecated. -
replaceSessionValues
@Deprecated public static String replaceSessionValues(IEntityContext ec, String placeholder, String placeholderContent, IContextReplacerParams parameters, String contextPath) Deprecated. -
replaceSystemValue
@Deprecated public static String replaceSystemValue(IEntityContext ec, String placeholder, String placeholderContent, IWorkflowProcessingContext wfpctx) Deprecated. -
replaceFormValue
@Deprecated public static String replaceFormValue(IEntityContext ec, String placeholder, String placeholderContent, IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) Deprecated.
-