Application default search filters

I know that there is an official IBM Technote that already provides a solution to apply a default filter in a given Maximo application.
However this solution has some drawbacks. The main problem I see is that using this technique the field filters are not displayed in the application so it could be tricky for the user to understand what's happening.

I have found a better solution customizing the application's Java bean class (AppBean) specifying the QBE (Query By Example) parameters to the application DataBean in the initializeApp() method.
Here is a practical example about how to do this on the WOTRACK application.

To determine which Java bean handles the application, open Application Designer and select the application, from the Action menu choose 'Toggle Show All Controls' and display the properties of the 'presentation' section. The 'App Bean Class' defines the Java class that you need to customize. For the WOTRACK application it should be psdi.webclient.beans.workorder.WorkorderAppBean.
You should extend this class and override the initializeApp() method adding your filters as QBEs to the application's DataBean.
Here is how the custom class should look like.

public class CustomWorkorderAppBean extends WorkorderAppBean
{
  public void initializeApp() throws MXException, RemoteException
  {
    DataBean resultsBean = this.app.getResultsBean();
    resultsBean.setQbe("siteid", "XXX");
    resultsBean.setQbe("someotherfield", "1234");
    super.initializeApp();
  }
}

Put the custom AppBean class file in the Maximo tree, rebuild and redeploy the EAR file. Don't forget to change the App Bean Class property setting your own custom class.

Labels: , ,