IM Developer Guide – Form Filter

About this guide

This document gives an overview of the installation of PhenixID Identity Manager. Additional information is found on PhenixID web site or through PhenixID support.

Summary

This document explains Form Filter in PhenixID Identity Manager. It is assumed reader is familiar with both Identity Manager and Identity Manager Configurator. The document is a part of a collection of documents explaining how to extend and customize Identity Manager. In addition there is also Javadoc and sample code.

Mentioning of abstract base class assumes these are used when developing custom code.
First time readers are recommended to read overview document, IM Developer Overview.

Definition

A Form Filter is linked to an Identity Manager form.

When configured it can affect all attribute controls residing in that form. Typically this is data validation, data presentation or other desired logic.

Multiple Form Filters can be linked to a form, also called chained.

Developing Control Filter

A control filter is a Java class. Required source level is version 8. A control filter must implement: se.nordicedge.interfaces.CustomTabExternalFilter

When developing Form Filter it is recommended that the abstract base class: se.nordicedge.misc.tab.filter.BaseTabFilter is extended. By doing so, one get the basic access to variables and instances of classes most used in Form Filters.

Similar to control filters, Form Filters has trigger types. The difference is that trigger types are not configured, they are applied by code.

Depending on what one want to achieve in a Form Filter one or more of the trigger types can be overridden.

This is explained under Flow of execution.

Flow of Execution

When writing Form Filter one can chose to implement one or more methods for IM to execute. The execution flow is:

  • Init, executes before data is presented for the administrator
  • Presave, executes before data is saved.
  • Postsave, executes after data is saved.

Message to Administrator

By assigning a value to variable errorMessage in the Form Filter, IM will present that message to the administrator.

Stop Execution

In presave trigger type it is possible to stop IM from proceeding with saving data. This is done by returning parameter DO_NOT_SAVE in presave. Combining this with setErrorMessage control filter can notify administrator what actions are necessary to take before trying to save data.

Configuration

Linking a Form Filter to a form is done with IM Configurator. The actual Java class file must be located in the class path for both the Identity Manager and Identity Manager Configurator since class path is not shared between the two.

Start the Configurator and open the desired form in the form designer.

  • Tools -> Tab External Filter
  • Click Add Filter

2

  • Type in the full package name and class name. Do NOT include .class suffix
  • Save the form

3

Additional Information

Form Filter triggers are executed after attribute control filter. This means that all init triggers will be executed in all Form Filters linked to a form after any control filter will execute init trigger. This goes for presave and postsave as well.

If one want to add data for IM to save, Form Filters can do so by calling method:

setAdditionalSaveAttributes(String attrName, String[] values) or
setAdditionalSaveAttribute(String attrName, String str)

See Javadoc for more information.