Interface IPluginFormReplacer

  • All Superinterfaces:
    IFCPlugin, INamedUiElement, INameProviding, ITransferable, Serializable

    public interface IPluginFormReplacer
    extends IFCPlugin
    Interface for a form replacer plugin. This plugin can add support for additional form placeholders. A form placeholder is a placeholder with a pattern as defined CmnConst.PH_PATTERN_FORMS:
     [%PLACEHOLDER_NAME%]
     
    Please note that placeholder plugins are run before the built-in form value placeholder replacer. As such, when a form placeholder was already processed and replaced by a plugin, the built-in placeholder will not be applied anymore. Also, when multiple form placeholder replacer plugins are installed, there are not guarantees made regarding the order in which the replacer plugins are applied.
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • replace

        IPluginFormReplacerRetVal replace​(IPluginFormReplacerParams params)
                                   throws FCPluginException
        This is the main method of this plugin that should perform the placeholder replacement. This method is once for each encountered placeholder and passed the name of that placeholder. This plugin does not have to handle each placeholder. Return the name of the placeholder to indicate that this plugin cannot handle that placeholder.

        When any exception other than FCPluginException is thrown, the current process is aborted. For example, when the form is submitted and the workflow is run, this would result in an internal server error and a generic error HTML reponse page.

        Parameters:
        params - The parameters this plugin may make use of, such as the placeholder to be replaced and the current form data.
        Returns:
        The value to be used as the replacement for the given placeholder. In case you do not wish to replace the given placeholder (and let it be handled another placeholder plugin or the default replacer), return null or replacementFailure.
        Throws:
        FCPluginException - May be thrown when this plugin cannot perform the replacement. When an error is thrown, the placeholder is not replaced and may be replaced by another plugin.