Methods of Bean Classes of Maximo
Reset
Method
This method is called when a new filter is
applied for the dialog's MboSet.
@see
psdi.webclient.system.beans.DataBean#reset()
@Override
public void reset() throws MXException
{
try
{
saveCurrentSelection();
}
catch (RemoteException e)
{
handleRemoteException(e);
}
super.reset();
}
Initialize
It is used to initialize values on a
dialog
@Override
protected void initialize() throws MXException, RemoteException
{
uids = new ArrayList<Long>();
super.initialize();
}
Call
Method
This method is called whenever an
event is generated in the dialog (e.g. OK button is pressed). It is
overridden to merge all previously saved selections and reset the
resulting MboSet accordingly.
*@see
psdi.webclient.system.beans.MultiselectDataBean#callMethod(psdi.webclient.system.controller.WebClientEvent)
@Override
public int callMethod(WebClientEvent event) throws MXException {
mergeAllSelections();
return super.callMethod(event);
}
• Setting a value of Appbean Mbo from
dialog
DataBean appbean=app.getAppBean();
AssetRemote asm=(AssetRemote) appbean.getMbo();
asm.setValue("DESCRIPTION", "Created from Bean");
•
Since there is not save method on mbo
so we used appbean.save
appbean.save();
•
Finding dialog details from its id
String userValue=ci.getId();
•
To Close a dialog to close a dialog
method utility.sendevent(webclientevent we)
Utility.sendEvent(new
WebClientEvent("dialogclose", app.getCurrentPageId(), null,
sessionContext));
(Refer this tutorial for dialog values
•
To get Datasource from XML
DataBean databean =
this.app.getDataBean("TEST_ds1");
•
To
get default value control of the property
ControlInstance ctr1 =
this.clientSession.findControl("testmail_emailsubject");
String subjecttemplate =
ctr1.getProperty("value");
•
To get data from Appbean
app.getAppBean().getString("wonum")
•
To Run a Birt remote from java class
steps: 1. Take BirtRemote from
Mxserver lookup method
2.
Run Birt Report by passing folloing param -
reportservice.
runReport(ui,reportname,this.appName,para,outputFile.getName(),"pdf"
ReportAdminServiceRemote reportservice = (ReportAdminServiceRemote)MXServer.getMXServer().lookup("BIRTREPORT");
byte[]
reportOutput = reportservice.runReport(ui, reportname, this.appName, para,
outputFile.getName(), "pdf");
•
To send report in a email
public static void sendEMail(String to, String cc, String bcc, String
from, String subject, String message, String ReplyTo, String[] fileName,
String[] urlName)
MXServer.sendEMail(emailto, emailcc, null,
emailfrom, emailsubject, emailbody, null,
new String[] {outputFile.getAbsolutePath()}, (String[])null);
•
To add where clause to Report
ReportParameterData para = new
ReportParameterData();
para.addParameter("where",
mbo.getUniqueIDName() + " = " + mbo.getUniqueIDValue());
•
Showing msg box to user
Declation
public
void showMessageBox(WebClientEvent srcEvent, String messageFile, String key,
String[] params)
this.
clientSession.showMessageBox(this.clientSession.getCurrentEvent(),
"messagebox", "CustomMessage", params);
•
To apply QBE when dialog load
protected void initialize()
throws MXException, RemoteException
{
MXSession mxSession = sessionContext.getMXSession();
setQbe("historyflag",
MXFormat.getDisplayNoValue(mxSession.getLocale()));
super.initialize();
}
•
To Display a dialog from bean class
if(woRemote.isNull())
{
RequestHandler.showDialog(sessionContext, "myDialog");
return 1;
}
•
To get Mboset from databean
Databean dbBean=app.getDataBean(“1”)
MboSetRemote ms=dbBean.getMboSet();
Excellent article and this helps to enhance your knowledge regarding new things. Waiting for more updates.
ReplyDeleteAdvantages of Angular JS
Benefits of Angularjs
Thanks for this blog keep sharing your thoughts like this...
ReplyDeleteWhat is Sales
Importance Of Sales
Thank you for this blog. It is very useful. Share more like this.
ReplyDeleteSoftware Testing Online Course
Software Testing Institute Near Me