Thursday, September 3, 2015

Chrome says it no longer supports the Niagara ax wbapplet plug-in

Upon a log-in attempt via chrome, wbapplet does not start and the browser states "This plug-in is not supported."

There are changes Java compatibility in Chrome:

NPAPI support by Chrome

The Java plug-in for web browsers relies on the cross platform plugin architecture NPAPI, which has long been, and currently is, supported by all major web browsers. Google announced in September 2013 plans to remove NPAPI support from Chrome by "the end of 2014", thus effectively dropping support for Silverlight, Java, Facebook Video and other similar NPAPI based plugins. Recently, Google has revised their plans and now state that they plan to completely remove NPAPI by late 2015. As it is unclear if these dates will be further extended or not, we strongly recommend Java users consider alternatives to Chrome as soon as possible. Instead, we recommend Firefox, Internet Explorer and Safari as longer-term options. As of April 2015, starting with Chrome Version 42, Google has added an additional step to configuring NPAPI based plugins like Java to run — see the section Enabling NPAPI in Chrome Version 42 and later below.

Enabling NPAPI in Chrome Version 42 and later
As of Chrome Version 42, an additional configuration step is required to continue using NPAPI plugins.
  1. In your URL bar, enter:  chrome://flags/#enable-npapi 
  2. Click the Enable link for the Enable NPAPI configuration option.
  3. Click the Relaunch button that now appears at the bottom of the configuration page.

Saturday, February 9, 2013

Configure Niagara Ax to send Email


Configure Niagara Ax to send Email


The below steps explains how to configure the email service in Naigara Ax station, using its workbench. And below you will find the code to use the baja Email api to be able to send email in Niagara.
Navigate to BEmailService service under Station
Double click on the EmailService, you will find the Email Account Manager.
Click New Button
Provide the Outgoing Account information including the smtp server and port. And click ok.

email1


Now right click on the added account manager and choose Actions->Send
Now provide your email id information in from and to address fields. And click Ok.
In your station spy if you have enabled trace for module ‘email’. Then you can see the message below in station console.

 Code to Send Email

public void doSendEmail(){
 BEmailService bemailservice =
 (BEmailService)Sys.getService(BEmailService.TYPE);
 bemailservice.lease(2);
 BOutgoingAccount outGoingAccount =
 (BOutgoingAccount)bemailservice.getDefaultOutgoingAccount();
 if(outGoingAccount == null) {
  System.out.println("Email Service not configured")
  return;
 }
 BEmail mail = new BEmail();
 mail.setFrom(BEmailAddress.make("My Name", "myname@domain.com"));
 //Add to address
 List<BEmailAddress> toEmailList = new ArrayList<BEmailAddress>();
 toEmailList.add(BEmailAddress.make("Your Name","yourname@domain.com"));
 BEmailAddressList listEmail = BEmailAddressList.make(
    toEmailList.toArray(new BEmailAddress[toEmailList.size()]));
 mail.setTo(listEmail);
 mail.setDate(BAbsTime.now());
 mail.setSubject("Test Subject");
 // Add attachment
 BEmailPartList part = new BEmailPartList();
 //part.addAttachment(BOrd.make("ord to attachement file"));
 mail.setAttachments(part);
 //Add body
 StringBuffer body = new StringBuffer();
 body.append("This is a test mail ");
 mail.setBody(new BTextPart(body.toString()));
//send mail
 outGoingAccount.send(mail);
}

Detailed description to configure Email can be found here.