Using portletHelper linked java object

The Web Experience factory tries to hide the portlet request phases from you. But some time you might be interested in knowing what phase your Linked Java object method is getting executed, If that's the case you should use portletHelper Linked Java Object. So as soon as you add a Portlet Adapter builder to your model, the WPF will add portletHelper Linked Java Object to that model like this
In your Linked Java Object you can call methods of portletHelper LJO like this

public class PortletHelperDemoLJO {
 public String sayHello(WebAppAccess webAppAccess){
  System.out.println("Inside PortletHelperDemo.sayHello() ");
  System.out.println("portletHelper.isPortletActionRequest -> " +webAppAccess.processAction("portletHelper.isPortletActionRequest"));
  System.out.println("portletHelper.isPortletRenderRequest -> " +webAppAccess.processAction("portletHelper.isPortletRenderRequest"));
  return "Hello from PortletHelperDemoLJO.sayHello() " + webAppAccess.getCurrentPage();

If you want you can call this from action list like this

No comments: