Interface IPluginFormPreRender

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

    public interface IPluginFormPreRender
    extends IFormLifecyclePlugin
    Interface for form pre-render plugins. This plugin is run when a user requests a form. It may prevent the user from accessing the form, in which case the user gets a general error page that the form could not be found. This plugin may also fetch data from e.g. a webservice and make data available to the form; either as a JavaScript object or by pre-filling form fields.

    This type of plugin is executed on the master server. You may use APIs available on the master server, such as the DAO provider for accessing the database.

    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • execute

        IPluginFormPreRenderRetVal execute​(IPluginFormPreRenderParams params)
                                    throws FCPluginException
        Main method of this plugin. Performs the logic to be run before the form is rendered. This plugin may also prevent to form from being delivered to the user. If it does, the user receives a general error page.

        When any exception other than FCPluginException is thrown, the form will not be rendered and a general error template is returned to the user who attempted to open the form.

        Parameters:
        params - The parameters this plugin may make use of. Contains the IFormRequestContext that can be used, for example, to access the current form, the current form data, or the URL parameters.
        Returns:
        The return value of this plugin that contains (a) whether the the user should be block from accessing the form and (b) the data to be made available to the form
        Throws:
        FCPluginException - May be throw when this plugin cannot perform its task due to any reason. Please note that throwing this exception will not prevent the form from being rendered and sent to the browser.
      • 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.