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
public class DefaultReplacerParameters extends Object implements IPlaceholderValueParams
- Author:
 - XIMA MEDIA GmbH
 - See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface de.xima.fc.interfaces.placeholder.params.IContextReplacerParams
IContextReplacerParams.IValueReplacer 
 - 
 
- 
Constructor Summary
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetBaseUrl()MandantgetClient()ClockgetClock()StringgetContextPath()com.alibaba.fastjson.JSONObjectgetCreatorDataJSON()com.alibaba.fastjson.JSONObjectgetEditorDataJSON()IPlaceholderEscapergetEscaper()The placeholder escaper, which should applied for the replaced placeholder values before they returned to the documentIFormDataAdaptergetFormData()FormVersiongetFormVersion()StringgetLanguageTag()Map<String,Map<String,String>>getPlaceholderMap()VorganggetProcess()ProjektgetProject()IRepetitionContainergetRepetitionContainer()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.Map<String,IContextReplacerParams.IValueReplacer>getReplacerMap()javax.servlet.http.HttpServletRequestgetRequest()javax.servlet.http.HttpServletResponsegetResponse()StringgetSessionId()com.alibaba.fastjson.JSONObjectgetUserDataJSON()IBaseWorkflowExecutionContextgetWorkflowExecutionContext()IWorkflowProcessingContextgetWorkflowProcessing()Deprecated.booleanisEncodeForHTML()booleanisEncodeFormValuesForPlaceholder()booleanisReplaceContextPlaceholders()booleanisReplaceFormPlaceholders()booleanisReplaceI18nPlaceholders()booleanisReplaceSessionPlaceholders()booleanisReplaceSystemPlaceholders()booleanisReplaceTemplatePlaceholders()voidsetBaseUrl(String baseUrl)voidsetClient(Mandant client)voidsetClock(Clock clock)voidsetContextPath(String contextPath)voidsetCreatorDataJSON(com.alibaba.fastjson.JSONObject creatorData)voidsetEditorDataJSON(com.alibaba.fastjson.JSONObject editorData)voidsetEncodeForHTML(boolean encodeForHTML)voidsetEncodeFormValuesForPlaceholder(boolean encodeFormValuesForPlaceholder)voidsetEscaper(IPlaceholderEscaper escaper)voidsetFormData(IFormDataAdapter formData)voidsetFormVersion(FormVersion formVersion)voidsetLanguageTag(String languageTag)voidsetProcess(Vorgang process)voidsetProject(Projekt project)voidsetRepetitionContainer(IRepetitionContainer repetitionContext)voidsetRepetitionContainer(String repeatedContainer, int ordinalIndex)voidsetReplaceContextPlaceholders(boolean replaceContextPlaceholders)voidsetReplaceFormPlaceholders(boolean replaceFormPlaceholders)voidsetReplaceI18nPlaceholders(boolean replaceI18nPlaceholders)voidsetReplaceSessionPlaceholders(boolean replaceSessionPlaceholders)voidsetReplaceSystemPlaceholders(boolean replaceSystemPlaceholders)voidsetReplaceTemplatePlaceholders(boolean replaceTemplatePlaceholders)voidsetRequest(javax.servlet.http.HttpServletRequest request)voidsetResponse(javax.servlet.http.HttpServletResponse response)voidsetSessionId(String sessionId)voidsetUserDataJSON(com.alibaba.fastjson.JSONObject userData)voidsetWorkflowProcessing(IWorkflowProcessingContext wfpctx) 
 - 
 
- 
- 
Constructor Detail
- 
DefaultReplacerParameters
public DefaultReplacerParameters()
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(Map<String,Map<String,String>> contextPlaceholderMap, Map<String,IContextReplacerParams.IValueReplacer> contextReplacerMap)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(Vorgang process, String sessionId, String baseUrl)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(Vorgang process, String sessionId, String baseUrl, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IFormDataAdapter formData, FormVersion formVersion, boolean encodeForHTML, boolean encodeFormValuesForPlaceholder)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IBaseWorkflowExecutionContext wfpctx)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IBaseWorkflowExecutionContext wfpctx, Vorgang formRecord)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IReplacerParams params)
 
- 
DefaultReplacerParameters
@Deprecated public DefaultReplacerParameters(IWorkflowProcessingContext wfpctx, Vorgang formRecord)
- Parameters:
 wfpctx- A workflow processing context.formRecord- A form record to use, instead of the form record of the given processing context.
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(IFormDataAdapter formData, Vorgang process)
 
- 
DefaultReplacerParameters
@Deprecated public DefaultReplacerParameters(IWorkflowProcessingContext wfpctx)
Deprecated.- Parameters:
 wfpctx- A workflow processing context.
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(Vorgang process)
 
- 
DefaultReplacerParameters
public DefaultReplacerParameters(Mandant client)
 
 - 
 
- 
Method Detail
- 
isEncodeFormValuesForPlaceholder
public boolean isEncodeFormValuesForPlaceholder()
- Specified by:
 isEncodeFormValuesForPlaceholderin interfaceIFormReplacerParams- Specified by:
 isEncodeFormValuesForPlaceholderin interfaceIReplacerParams
 
- 
setEncodeFormValuesForPlaceholder
public void setEncodeFormValuesForPlaceholder(boolean encodeFormValuesForPlaceholder)
 
- 
getWorkflowProcessing
@Deprecated public IWorkflowProcessingContext getWorkflowProcessing()
Deprecated.- Specified by:
 getWorkflowProcessingin interfaceISystemReplacerParams- Returns:
 - The current workflow processing context, or 
nullif none is available. 
 
- 
getWorkflowExecutionContext
public IBaseWorkflowExecutionContext getWorkflowExecutionContext()
- Specified by:
 getWorkflowExecutionContextin interfaceISystemReplacerParams
 
- 
setWorkflowProcessing
public void setWorkflowProcessing(IWorkflowProcessingContext wfpctx)
 
- 
getClient
public Mandant getClient()
- Specified by:
 getClientin interfaceIFormReplacerParams- Specified by:
 getClientin interfaceII18nValueReplacerParams- Specified by:
 getClientin interfaceISystemReplacerParams- Specified by:
 getClientin interfaceITemplateReplacerParams- Returns:
 - the current 
Mandantobject 
 
- 
setClient
public void setClient(Mandant client)
 
- 
getProcess
public Vorgang getProcess()
- Specified by:
 getProcessin interfaceIFormReplacerParams- Specified by:
 getProcessin interfaceISessionReplacerParams- Specified by:
 getProcessin interfaceISystemReplacerParams- Returns:
 - the current 
Vorgangobject 
 
- 
getClock
public Clock getClock()
- Specified by:
 getClockin interfaceIPlaceholderValueParams- Specified by:
 getClockin interfaceISessionReplacerParams- Specified by:
 getClockin interfaceISystemReplacerParams- Returns:
 - The clock to use for obtaining the current time.
 
 
- 
setClock
public void setClock(Clock clock)
- Parameters:
 clock- The clock to use for obtaining the current time.
 
- 
setProcess
public void setProcess(Vorgang process)
 
- 
getProject
public Projekt getProject()
- Specified by:
 getProjectin interfaceISystemReplacerParams
 
- 
setProject
public void setProject(Projekt project)
 
- 
getSessionId
public String getSessionId()
- Specified by:
 getSessionIdin interfaceISessionReplacerParams
 
- 
setSessionId
public void setSessionId(String sessionId)
 
- 
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Specified by:
 getRequestin interfaceISessionReplacerParams
 
- 
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
 
- 
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
- Specified by:
 getResponsein interfaceISessionReplacerParams
 
- 
setResponse
public void setResponse(javax.servlet.http.HttpServletResponse response)
 
- 
getFormData
public IFormDataAdapter getFormData()
- Specified by:
 getFormDatain interfaceIFormReplacerParams- Specified by:
 getFormDatain interfaceISystemReplacerParams
 
- 
setFormData
public void setFormData(IFormDataAdapter formData)
- Specified by:
 setFormDatain interfaceIFormReplacerParams- Specified by:
 setFormDatain interfaceISystemReplacerParams
 
- 
getFormVersion
public FormVersion getFormVersion()
- Specified by:
 getFormVersionin interfaceIFormReplacerParams- Returns:
 - the current 
FormVersionobject 
 
- 
setFormVersion
public void setFormVersion(FormVersion formVersion)
 
- 
getContextPath
public String getContextPath()
- Specified by:
 getContextPathin interfaceISessionReplacerParams- Specified by:
 getContextPathin interfaceISystemReplacerParams
 
- 
setContextPath
public void setContextPath(String contextPath)
 
- 
getRepetitionContainer
public IRepetitionContainer getRepetitionContainer()
Description copied from interface:IFormReplacerParamsWhen 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_2by 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:
 getRepetitionContainerin interfaceIFormReplacerParams- Returns:
 - The repetition context where the replacement is made. May be 
null. 
 
- 
setRepetitionContainer
public void setRepetitionContainer(IRepetitionContainer repetitionContext)
 
- 
setRepetitionContainer
public void setRepetitionContainer(String repeatedContainer, int ordinalIndex)
 
- 
getBaseUrl
public String getBaseUrl()
- Specified by:
 getBaseUrlin interfaceISessionReplacerParams
 
- 
setBaseUrl
public void setBaseUrl(String baseUrl)
 
- 
getLanguageTag
public String getLanguageTag()
- Specified by:
 getLanguageTagin interfaceIFormReplacerParams- Specified by:
 getLanguageTagin interfaceILanguageTagProviding- Returns:
 - The language tag (
Locale.toLanguageTag()) provided by this object. 
 
- 
setLanguageTag
public void setLanguageTag(String languageTag)
 
- 
isEncodeForHTML
public boolean isEncodeForHTML()
- Specified by:
 isEncodeForHTMLin interfaceIFormReplacerParams- Specified by:
 isEncodeForHTMLin interfaceII18nValueReplacerParams
 
- 
setEncodeForHTML
public void setEncodeForHTML(boolean encodeForHTML)
 
- 
getEscaper
public IPlaceholderEscaper getEscaper()
Description copied from interface:IPlaceholderValueParamsThe placeholder escaper, which should applied for the replaced placeholder values before they returned to the document- Specified by:
 getEscaperin interfaceIFormReplacerParams- Specified by:
 getEscaperin interfaceIPlaceholderValueParams- Specified by:
 getEscaperin interfaceIReplacerParams- Returns:
 - an instance of 
IPlaceholderEscaper 
 
- 
setEscaper
public void setEscaper(IPlaceholderEscaper escaper)
 
- 
getReplacerMap
public Map<String,IContextReplacerParams.IValueReplacer> getReplacerMap()
- Specified by:
 getReplacerMapin interfaceIContextReplacerParams
 
- 
getPlaceholderMap
public Map<String,Map<String,String>> getPlaceholderMap()
- Specified by:
 getPlaceholderMapin interfaceIContextReplacerParams
 
- 
getCreatorDataJSON
public com.alibaba.fastjson.JSONObject getCreatorDataJSON()
- Specified by:
 getCreatorDataJSONin interfaceISystemReplacerParams
 
- 
setCreatorDataJSON
public void setCreatorDataJSON(com.alibaba.fastjson.JSONObject creatorData)
 
- 
getEditorDataJSON
public com.alibaba.fastjson.JSONObject getEditorDataJSON()
- Specified by:
 getEditorDataJSONin interfaceISystemReplacerParams
 
- 
setEditorDataJSON
public void setEditorDataJSON(com.alibaba.fastjson.JSONObject editorData)
 
- 
getUserDataJSON
public com.alibaba.fastjson.JSONObject getUserDataJSON()
- Specified by:
 getUserDataJSONin interfaceISystemReplacerParams
 
- 
setUserDataJSON
public void setUserDataJSON(com.alibaba.fastjson.JSONObject userData)
 
- 
isReplaceContextPlaceholders
public boolean isReplaceContextPlaceholders()
- Specified by:
 isReplaceContextPlaceholdersin interfaceIContextReplacerParams- Returns:
 - When 
false, context placeholders are not replaced. 
 
- 
setReplaceContextPlaceholders
public void setReplaceContextPlaceholders(boolean replaceContextPlaceholders)
 
- 
isReplaceSystemPlaceholders
public boolean isReplaceSystemPlaceholders()
- Specified by:
 isReplaceSystemPlaceholdersin interfaceISystemReplacerParams- Returns:
 - When 
false, system placeholders are not replaced. 
 
- 
setReplaceSystemPlaceholders
public void setReplaceSystemPlaceholders(boolean replaceSystemPlaceholders)
 
- 
isReplaceFormPlaceholders
public boolean isReplaceFormPlaceholders()
- Specified by:
 isReplaceFormPlaceholdersin interfaceIFormReplacerParams- Returns:
 - When 
false, form placeholders are not replaced. 
 
- 
setReplaceFormPlaceholders
public void setReplaceFormPlaceholders(boolean replaceFormPlaceholders)
 
- 
isReplaceTemplatePlaceholders
public boolean isReplaceTemplatePlaceholders()
- Specified by:
 isReplaceTemplatePlaceholdersin interfaceITemplateReplacerParams- Returns:
 - When 
false, template placeholders are not replaced. 
 
- 
setReplaceTemplatePlaceholders
public void setReplaceTemplatePlaceholders(boolean replaceTemplatePlaceholders)
 
- 
isReplaceI18nPlaceholders
public boolean isReplaceI18nPlaceholders()
- Specified by:
 isReplaceI18nPlaceholdersin interfaceII18nValueReplacerParams- Returns:
 - When 
false, i18n placeholders are not replaced. 
 
- 
setReplaceI18nPlaceholders
public void setReplaceI18nPlaceholders(boolean replaceI18nPlaceholders)
 
- 
isReplaceSessionPlaceholders
public boolean isReplaceSessionPlaceholders()
- Specified by:
 isReplaceSessionPlaceholdersin interfaceISessionReplacerParams
 
- 
setReplaceSessionPlaceholders
public void setReplaceSessionPlaceholders(boolean replaceSessionPlaceholders)
 
 - 
 
 -