Restricting Status List on List tab
Author: admin Post Date: March 5 2009Hello;
You may want to restrict status list on some applications. For example in wotrack, on the list table you may want that the user can get status to ‘WAPPR’ . So other statuses like COMP,INPRG must be restricted from the list..
Here you should extend psdi.webclient.beans.workorder.WOChangeStatusBean class. And you must override public synchronized MboSetRemote getList(int nRow, String attribute) method. Here is how it can be done…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | package com.custom.workorder; import java.rmi.RemoteException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; import psdi.app.workorder.WORemote; import psdi.mbo.*; import psdi.security.UserInfo; import psdi.server.MXServer; import psdi.util.*; import psdi.webclient.beans.common.ChangeStatusBean; import psdi.webclient.system.beans.DataBean; import psdi.webclient.system.beans.ResultsBean; import psdi.webclient.system.controller.*; public class newWOChangeStatusBean extends psdi.webclient.beans.workorder.WOChangeStatusBean { public void initialize() throws MXException, RemoteException { super.initialize(); } public synchronized MboSetRemote getList(int nRow, String attribute) throws MXException, RemoteException { if(app.getApp().equalsIgnoreCase("WOTRACK") && app.onListTab()){ MboSetRemote currentList=super.getList(nRow,attribute); currentList.setWhere("value in ('WAPPR') and domainid='WOSTATUS'"); currentList.reset(); return currentList; } else return super.getList(nRow,attribute); } } |
Here currentList is the list of statuses. We restrict it to show only WAPPR…
Now compile it rebuild, redeploy…
Now you have to tell maximo about new class. Go to the application designer..
From select action menu click export system xmls…
Click the arrow next to the LIBRARY.xml… New internet explorer window opens…
From File menu select “Save As”… Now take a back up of the original file in case of any accident…
Open it with a text editor like notepad++ …
Find the string with dialog id=”list_status” and replace psdi.webclient.beans.workorder.WOChangeStatusBean with com.custom.workorder.newWOChangeStatusBean
Import Library.xml to the system… Go to the application and test it…
Have a good day…