Package de.xima.fc.mdl.placeholder
Class DefaultReplacerParameters
java.lang.Object
de.xima.fc.mdl.placeholder.DefaultReplacerParameters
- All Implemented Interfaces:
ILanguageTagProviding
,IContextReplacerParams
,IFormReplacerParams
,II18nValueReplacerParams
,IPlaceholderValueParams
,IReplacerParams
,ISessionReplacerParams
,ISystemReplacerParams
,ITemplateReplacerParams
,Serializable
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.xima.fc.interfaces.placeholder.params.IContextReplacerParams
IContextReplacerParams.IValueReplacer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultReplacerParameters
(Mandant client) DefaultReplacerParameters
(Vorgang process) DefaultReplacerParameters
(Vorgang process, String sessionId, String baseUrl) DefaultReplacerParameters
(Vorgang process, String sessionId, String baseUrl, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) DefaultReplacerParameters
(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) DefaultReplacerParameters
(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML, boolean encodeFormValuesForPlaceholder) DefaultReplacerParameters
(IFormDataAdapter formData, Vorgang process) Deprecated.DefaultReplacerParameters
(IWorkflowProcessingContext wfpctx, Vorgang formRecord) DefaultReplacerParameters
(IBaseWorkflowExecutionContext wfpctx, Vorgang formRecord) DefaultReplacerParameters
(Map<String, Map<String, String>> contextPlaceholderMap, Map<String, IContextReplacerParams.IValueReplacer> contextReplacerMap) -
Method Summary
Modifier and TypeMethodDescriptiongetClock()
com.alibaba.fastjson.JSONObject
com.alibaba.fastjson.JSONObject
The placeholder escaper, which should applied for the replaced placeholder values before they returned to the documentWhen a form element placeholder is replaced and the form element is repeated, all repeated values are joined with a comman by default and used as the replacement value.javax.servlet.http.HttpServletRequest
javax.servlet.http.HttpServletResponse
com.alibaba.fastjson.JSONObject
Deprecated.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
setBaseUrl
(String baseUrl) void
void
void
setContextPath
(String contextPath) void
setCreatorDataJSON
(com.alibaba.fastjson.JSONObject creatorData) void
setEditorDataJSON
(com.alibaba.fastjson.JSONObject editorData) void
setEncodeForHTML
(boolean encodeForHTML) void
setEncodeFormValuesForPlaceholder
(boolean encodeFormValuesForPlaceholder) void
setEscaper
(IPlaceholderEscaper escaper) void
setFormData
(IFormDataAdapter formData) void
setFormVersion
(FormVersion formVersion) void
setLanguageTag
(String languageTag) void
setProcess
(Vorgang process) void
setProject
(Projekt project) void
setRepetitionContainer
(IRepetitionContainer repetitionContext) void
setRepetitionContainer
(String repeatedContainer, int ordinalIndex) void
setReplaceContextPlaceholders
(boolean replaceContextPlaceholders) void
setReplaceFormPlaceholders
(boolean replaceFormPlaceholders) void
setReplaceI18nPlaceholders
(boolean replaceI18nPlaceholders) void
setReplaceSessionPlaceholders
(boolean replaceSessionPlaceholders) void
setReplaceSystemPlaceholders
(boolean replaceSystemPlaceholders) void
setReplaceTemplatePlaceholders
(boolean replaceTemplatePlaceholders) void
setRequest
(javax.servlet.http.HttpServletRequest request) void
setResponse
(javax.servlet.http.HttpServletResponse response) void
setSessionId
(String sessionId) void
setUserDataJSON
(com.alibaba.fastjson.JSONObject userData) void
-
Constructor Details
-
DefaultReplacerParameters
public DefaultReplacerParameters() -
DefaultReplacerParameters
-
DefaultReplacerParameters
-
DefaultReplacerParameters
-
DefaultReplacerParameters
public DefaultReplacerParameters(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML) -
DefaultReplacerParameters
public DefaultReplacerParameters(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML, boolean encodeFormValuesForPlaceholder) -
DefaultReplacerParameters
-
DefaultReplacerParameters
-
DefaultReplacerParameters
-
DefaultReplacerParameters
- Parameters:
wfpctx
- A workflow processing context.formRecord
- A form record to use, instead of the form record of the given processing context.
-
DefaultReplacerParameters
-
DefaultReplacerParameters
Deprecated.- Parameters:
wfpctx
- A workflow processing context.
-
DefaultReplacerParameters
-
DefaultReplacerParameters
-
-
Method Details
-
isEncodeFormValuesForPlaceholder
public boolean isEncodeFormValuesForPlaceholder()- Specified by:
isEncodeFormValuesForPlaceholder
in interfaceIFormReplacerParams
- Specified by:
isEncodeFormValuesForPlaceholder
in interfaceIReplacerParams
-
setEncodeFormValuesForPlaceholder
public void setEncodeFormValuesForPlaceholder(boolean encodeFormValuesForPlaceholder) -
getWorkflowProcessing
Deprecated.- Specified by:
getWorkflowProcessing
in interfaceISystemReplacerParams
- Returns:
- The current workflow processing context, or
null
if none is available.
-
getWorkflowExecutionContext
- Specified by:
getWorkflowExecutionContext
in interfaceISystemReplacerParams
-
setWorkflowProcessing
-
getClient
- Specified by:
getClient
in interfaceIFormReplacerParams
- Specified by:
getClient
in interfaceII18nValueReplacerParams
- Specified by:
getClient
in interfaceISystemReplacerParams
- Specified by:
getClient
in interfaceITemplateReplacerParams
- Returns:
- the current
Mandant
object
-
setClient
-
getProcess
- Specified by:
getProcess
in interfaceIFormReplacerParams
- Specified by:
getProcess
in interfaceISessionReplacerParams
- Specified by:
getProcess
in interfaceISystemReplacerParams
- Returns:
- the current
Vorgang
object
-
getClock
- Specified by:
getClock
in interfaceIPlaceholderValueParams
- Specified by:
getClock
in interfaceISessionReplacerParams
- Specified by:
getClock
in interfaceISystemReplacerParams
- Returns:
- The clock to use for obtaining the current time.
-
setClock
- Parameters:
clock
- The clock to use for obtaining the current time.
-
setProcess
-
getProject
- Specified by:
getProject
in interfaceISystemReplacerParams
-
setProject
-
getSessionId
- Specified by:
getSessionId
in interfaceISessionReplacerParams
-
setSessionId
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()- Specified by:
getRequest
in interfaceISessionReplacerParams
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request) -
getResponse
public javax.servlet.http.HttpServletResponse getResponse()- Specified by:
getResponse
in interfaceISessionReplacerParams
-
setResponse
public void setResponse(javax.servlet.http.HttpServletResponse response) -
getFormData
- Specified by:
getFormData
in interfaceIFormReplacerParams
- Specified by:
getFormData
in interfaceISystemReplacerParams
-
setFormData
- Specified by:
setFormData
in interfaceIFormReplacerParams
- Specified by:
setFormData
in interfaceISystemReplacerParams
-
getFormVersion
- Specified by:
getFormVersion
in interfaceIFormReplacerParams
- Returns:
- the current
FormVersion
object
-
setFormVersion
-
getContextPath
- Specified by:
getContextPath
in interfaceISessionReplacerParams
- Specified by:
getContextPath
in interfaceISystemReplacerParams
-
setContextPath
-
getRepetitionContainer
Description copied from interface:IFormReplacerParams
When a form element placeholder is replaced and the form element is repeated, all repeated values are joined with a comman by default and used as the replacement value. When a repetition container is given as the context for the replacement and the form element is inside the same reptition container, only the value at the given index is used.For example, let's say we have a form with the following elements:
- ed1
- fs1 (repeated fieldset with the following elements)
- tf1
- tf2
- fs2 (repeated fieldset with the following elements)
- upl1
- upl2
valTf1_1
,valTf1_2
,valTf2_1
,valTf1_2
,valUpl1_1
,valUpl1_2
,valUpl2_1
,valUpl2_2
.Now when we have the placeholder
[%ed1%]_[%tf1%]_[%upl2%]
, it is replaced byvalEd1_valTf1_1,valTf1_2_valUpl2_1,valUpl2_2
by default.But if we are making the replacement within the context of
upl2
, e.g. when that placeholder is used to compute the file name forupl2
, we want to use only the value of the current repetition forupl2
, not a values joined with a comma.To do this, we can set the repetition container to
(name="fs2", index=0)
. Then the placeholder evaluates tovalEd1_valTf1_1,valTf1_2_valUpl2_1
. If we set the context to(name="fs2", index=1)
instead, the placeholder evaluatesvalEd1_valTf1_1,valTf1_2_valUpl2_2
.- Specified by:
getRepetitionContainer
in interfaceIFormReplacerParams
- Returns:
- The repetition context where the replacement is made. May be
null
.
-
setRepetitionContainer
-
setRepetitionContainer
-
getBaseUrl
- Specified by:
getBaseUrl
in interfaceISessionReplacerParams
-
setBaseUrl
-
getLanguageTag
- Specified by:
getLanguageTag
in interfaceIFormReplacerParams
- Specified by:
getLanguageTag
in interfaceILanguageTagProviding
- Returns:
- The language tag (
Locale.toLanguageTag()
) provided by this object.
-
setLanguageTag
-
isEncodeForHTML
public boolean isEncodeForHTML()- Specified by:
isEncodeForHTML
in interfaceIFormReplacerParams
- Specified by:
isEncodeForHTML
in interfaceII18nValueReplacerParams
-
setEncodeForHTML
public void setEncodeForHTML(boolean encodeForHTML) -
getEscaper
Description copied from interface:IPlaceholderValueParams
The placeholder escaper, which should applied for the replaced placeholder values before they returned to the document- Specified by:
getEscaper
in interfaceIFormReplacerParams
- Specified by:
getEscaper
in interfaceIPlaceholderValueParams
- Specified by:
getEscaper
in interfaceIReplacerParams
- Returns:
- an instance of
IPlaceholderEscaper
-
setEscaper
-
getReplacerMap
- Specified by:
getReplacerMap
in interfaceIContextReplacerParams
-
getPlaceholderMap
- Specified by:
getPlaceholderMap
in interfaceIContextReplacerParams
-
getCreatorDataJSON
public com.alibaba.fastjson.JSONObject getCreatorDataJSON()- Specified by:
getCreatorDataJSON
in interfaceISystemReplacerParams
-
setCreatorDataJSON
public void setCreatorDataJSON(com.alibaba.fastjson.JSONObject creatorData) -
getEditorDataJSON
public com.alibaba.fastjson.JSONObject getEditorDataJSON()- Specified by:
getEditorDataJSON
in interfaceISystemReplacerParams
-
setEditorDataJSON
public void setEditorDataJSON(com.alibaba.fastjson.JSONObject editorData) -
getUserDataJSON
public com.alibaba.fastjson.JSONObject getUserDataJSON()- Specified by:
getUserDataJSON
in interfaceISystemReplacerParams
-
setUserDataJSON
public void setUserDataJSON(com.alibaba.fastjson.JSONObject userData) -
isReplaceContextPlaceholders
public boolean isReplaceContextPlaceholders()- Specified by:
isReplaceContextPlaceholders
in interfaceIContextReplacerParams
- Returns:
- When
false
, context placeholders are not replaced.
-
setReplaceContextPlaceholders
public void setReplaceContextPlaceholders(boolean replaceContextPlaceholders) -
isReplaceSystemPlaceholders
public boolean isReplaceSystemPlaceholders()- Specified by:
isReplaceSystemPlaceholders
in interfaceISystemReplacerParams
- Returns:
- When
false
, system placeholders are not replaced.
-
setReplaceSystemPlaceholders
public void setReplaceSystemPlaceholders(boolean replaceSystemPlaceholders) -
isReplaceFormPlaceholders
public boolean isReplaceFormPlaceholders()- Specified by:
isReplaceFormPlaceholders
in interfaceIFormReplacerParams
- Returns:
- When
false
, form placeholders are not replaced.
-
setReplaceFormPlaceholders
public void setReplaceFormPlaceholders(boolean replaceFormPlaceholders) -
isReplaceTemplatePlaceholders
public boolean isReplaceTemplatePlaceholders()- Specified by:
isReplaceTemplatePlaceholders
in interfaceITemplateReplacerParams
- Returns:
- When
false
, template placeholders are not replaced.
-
setReplaceTemplatePlaceholders
public void setReplaceTemplatePlaceholders(boolean replaceTemplatePlaceholders) -
isReplaceI18nPlaceholders
public boolean isReplaceI18nPlaceholders()- Specified by:
isReplaceI18nPlaceholders
in interfaceII18nValueReplacerParams
- Returns:
- When
false
, i18n placeholders are not replaced.
-
setReplaceI18nPlaceholders
public void setReplaceI18nPlaceholders(boolean replaceI18nPlaceholders) -
isReplaceSessionPlaceholders
public boolean isReplaceSessionPlaceholders()- Specified by:
isReplaceSessionPlaceholders
in interfaceISessionReplacerParams
-
setReplaceSessionPlaceholders
public void setReplaceSessionPlaceholders(boolean replaceSessionPlaceholders)
-
DefaultReplacerParameters(IBaseWorkflowExecutionContext)