Thursday 15 June 2017

Adding Bulletin Board Message ID field on Maximo Start Center

We can't add Bulletin Board Message ID field through maximo configuration level.

So we need to modify 3 base class files.

\maximo\applications\maximo\maximouiweb\webmodule\WEB-INF\classes\psdi\webclient\controls
BulletinBoard.class

\maximo\applications\maximo\businessobjects\classes\psdi\app\bulletinboard
BulletinBoardCache.class
BBSet.class

Moreover we can't extend these classes since we need to modify some private methods. So we have to do our changes in base class itself.


1) Add below line in BulletinBoard class

columnHeading.put("bulletinboardid", bbset.getMboValueInfoStatic("bulletinboardid").getTitle());

       

package psdi.webclient.controls;

   ....
   ....

public class BulletinBoard extends HyperLink

   ....
   ....

  public Vector getResultSetAttributes()
    throws MXException, RemoteException
  {
    WebClientSession ws = getWebClientSession();
    Vector bbcols = (Vector)ws.getStartCenterCache("bbportletcolumns");
    if (bbcols == null)
    {
      BBSetRemote bbset = (BBSetRemote)getDataBean().getMboSet();
      Vector vecAttributes = new Vector();
      
      Map columnHeading = new LinkedHashMap();
      
      columnHeading.put("subject", bbset.getMboValueInfoStatic("subject").getTitle());
      columnHeading.put("message", bbset.getMboValueInfoStatic("message").getTitle());
      columnHeading.put("postdate", bbset.getMboValueInfoStatic("postdate").getTitle());
      columnHeading.put("expiredate", bbset.getMboValueInfoStatic("expiredate").getTitle());
      columnHeading.put("bulletinboardid", bbset.getMboValueInfoStatic("bulletinboardid").getTitle()); 
      if (!this.isTrackViewedUnViewed.equalsIgnoreCase("N"))
      {
        BBoardMSGStatusSetRemote bBMsgStatusSet = (BBoardMSGStatusSetRemote)bbset.getBBMsgStatusSet();
        columnHeading.put("viewstatus", bBMsgStatusSet.getMboValueInfoStatic("isviewed").getTitle());
      }
      
      for (Iterator i = columnHeading.entrySet().iterator(); i.hasNext();)
      {
        Map.Entry me = (Map.Entry)i.next();
        String[] arrColumn = new String[2];
        arrColumn[0] = ((String)me.getKey());
        arrColumn[1] = ((String)me.getValue());
        vecAttributes.add(arrColumn);
      }
      ws.setStartCenterCache("bbportletcolumns", vecAttributes);
      System.out.println("\n >>> Bulletin Board 2.1");
      return vecAttributes;
    }
    return bbcols;
  }

   ....
   ....

}


2) Add below line in BulletinBoardCache class

columnHeading.put("bulletinboardid", bbset.getMboValueInfoStatic("bulletinboardid").getTitle());


package psdi.app.bulletinboard;

   ....
   ....

public class BulletinBoardCache
  implements MaximoCache, FixedLoggers
{

   ....
   ....
  
  public Vector<String[]> getResultSetAttributes(boolean reload)
    throws MXException, RemoteException
  {
    if (reload)
    {
      UserInfo userInfo = this.mxserver.getSystemUserInfo();
      BBSetRemote bbset = (BBSetRemote)this.mxserver.getMboSet("BULLETINBOARD", userInfo);
      BBoardMSGStatusSetRemote bBMsgStatusSet = (BBoardMSGStatusSetRemote)bbset.getBBMsgStatusSet();
      this.viewedTitle = bBMsgStatusSet.getMboValueInfoStatic("isviewed").getTitle();
      
      Vector<String[]> vecAttributes = new Vector();
      
      Map<String, String> columnHeading = new LinkedHashMap();
      
      columnHeading.put("subject", bbset.getMboValueInfoStatic("subject").getTitle());
      columnHeading.put("message", bbset.getMboValueInfoStatic("message").getTitle());
      columnHeading.put("postdate", bbset.getMboValueInfoStatic("postdate").getTitle());
      columnHeading.put("expiredate", bbset.getMboValueInfoStatic("expiredate").getTitle());
      columnHeading.put("bulletinboardid", bbset.getMboValueInfoStatic("bulletinboardid").getTitle());
      columnHeading.put("viewstatus", bBMsgStatusSet.getMboValueInfoStatic("isviewed").getTitle());
      
      for (Iterator i = columnHeading.entrySet().iterator(); i.hasNext();)
      {
        Map.Entry me = (Map.Entry)i.next();
        String[] arrColumn = new String[2];
        arrColumn[0] = ((String)me.getKey());
        arrColumn[1] = ((String)me.getValue());
        vecAttributes.add(arrColumn);
      }
      System.out.println("\n >>> Bulletin Board 1.1");
      return vecAttributes;
    }
    return getResultSetAttributes();
  }
  
   ....
   ....

}



3) change below code in BBSet class

private String[] attribs = { "bulletinboarduid", "subject", "message", "postdate", "expiredate", "bulletinboardid" };

and

else if (j == 5) {
          attName = "bulletinboardid";
        }

package psdi.app.bulletinboard;

   ....
   ....

public class BBSet
  extends MboSet
  implements BBSetRemote
{
  private ArrayList personGroups;
  private ArrayList personOrgs;
  private ArrayList personSites;
  private ArrayList personMessages;
  private Vector messageIds;
  private Vector systemWideMessages;
  private BBAudienceSetRemote bb_group;
  private BBAudienceSetRemote bb_site;
  private BBAudienceSetRemote bb_org;
  private boolean queryExists = true;
  private int noOfRecords = 0;
  private String[] attribs = { "bulletinboarduid", "subject", "message", "postdate", "expiredate", "bulletinboardid" }; 
  
   ....
   ....
  
  public MboSetData getResultSetData(int start, int rowcount, String sortBy, Hashtable qbes)
    throws RemoteException, MXException
  {

     ....
     ....

    List filteredMbo = new ArrayList();
    for (int i = 0; i < this.personMessages.size(); i++)
    {
      String arrayId = "";
      boolean nextMboValueData = false;
      MboValueData[] data = (MboValueData[])this.personMessages.get(i);
      for (int j = 0; j < data.length; j++)
      {
        String attName = "";
        if (j == 0) {
          attName = "bulletinboarduid";
        } else if (j == 1) {
          attName = "subject";
        } else if (j == 2) {
          attName = "message";
        } else if (j == 3) {
          attName = "postdate";
        } else if (j == 4) {
          attName = "expiredate";
        } else if (j == 5) {
            attName = "bulletinboardid"; 
        }
        
        String attvalue = data[j].getData();
        if (j == 0) {
          arrayId = data[j].getData();
        }

         ....
         ....

    return data;
  }
  
   ....
   ....

}


Re-build and deploy maximo.ear.
Now the MessageID field available in maximo Start Center.


No comments:

Post a Comment