Session variable provider


Interface IPluginSessionReplacer

Position of session variable evaluation plugins in Xima® Formcycle's program flow. They are run before session variables are processed by Xima® Formcycle.

Use cases

Session variables are a special kind of system variables, which are used only when returning HTML templates to the client. Session variables are evaluated after all other variables have been evaluated. It is used for data valid only for the current session such as temporary links.

Session variables have got the following syntax:

[%$<variableName>%]

When multiple session variable evaluation plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.

Session variable evaluation plugins are run for all forms of the client they belong to, or for all existing forms when installed as a system plugin. We recommend you check whether the plugin should be executed for the current form, for example by defining a plugin property containing a list of allowed forms.

Methodensignaturen

IPluginSessionReplacerRetVal replace(IPluginSessionReplacerParams params) throws FCPluginException

Parameters

An object of type IPluginSessionReplacerParams is passed to the execute method, providing access to the following properties:

  • The entire variable string, including its syntax, eg. [%LINK%}. (getPlaceholder())
  • The variable name, without its syntax, eg. LINK. (getPlaceholderContent())
  • The current form record, providing access to attachements, the form, etc. (getVorgang())
  • The current user context for accessing the databases. (getEntityContext())
  • The current session id. (getSessionId())
  • The context name of the application. (getContextName())

Return value

The execute method must return an object implementing IPluginSessionReplacerRetVal.

The class PluginGenericReplacerRetVal provides a reference implementation. Its constructor takes the string containing the evaluated value of the variable.