Interface IPluginFormPreRespond

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

    public interface IPluginFormPreRespond
    extends IFormLifecyclePlugin
    Interface for a form pre-respond plugin. This plugin is executed when the form is submitted, after a FormEingang was created workflow processing was run; and immediately before the HTTP response is about to be sent to the browser. Contrast this with a plugin of type IPluginFormPrePersist, which is run before a FormEingang is created; and to IPluginFormPreProcess, which is run before processing the workflow.

    This plugin can be used, for example, to prevent the response from being sent to the user and display an empty page. It can also be used to modify or add HTTP session attributes; or to perform additional logic such as sending the data to a third-party web service.

    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • execute

        IPluginFormPreRespondRetVal execute​(IPluginFormPreRespondParams params)
                                     throws FCPluginException
        The main method of this plugin. Performs any additional actions before the response is sent to the browser.

        When any exception other than FCPluginException is thrown, the response will not be sent to the browser and a general error template is returned to the user who submitted the form.

        Parameters:
        params - The parameters this plugin may make use of. Contains for example the current Projekt, the current FormEingang, session parameters.
        Returns:
        Whether the response should be sent to the browser (or just show a generic error page); and which HTTP session parameters should be modified.
        Throws:
        FCPluginException - May be thrown when this plugin cannot perform is task due to any reason. Please note that throwing this exception will not prevent the response from being sent.
      • shouldExecute

        default boolean shouldExecute​(IFormLifecycleShouldExecuteParams params)
        Description copied from interface: IFormLifecyclePlugin
        Optional test to decide whether a form lifecycle plugin should be executed for a particular form request. Use e.g. params.getRequestContext().getRequestType() to check the type of the request.

        Note: Lifecycle plugins may be queued for execution at points were they were not before. Implementations of this method should prefer narrow checks, e.g.

         return params.getFormRequestContext().getRequestType() == EFormRequestType.PROVIDE}
         
        instead of
         return params.getFormRequestContext().getRequestType() != EFormRequestType.PROCESS
         
        Specified by:
        shouldExecute in interface IFormLifecyclePlugin
        Parameters:
        params - Parameters with the current form request.
        Returns:
        true if the plugin should be executed during the lifecycle of the given form request, false otherwise.