掲示板

How to invoke the resource method for announcement view page

7年前 に Kiran Kumar Boyini によって更新されました。

How to invoke the resource method for announcement view page

Expert 投稿: 287 参加年月日: 11/06/02 最新の投稿
Hi All,

I am trying to customize the announcement existed view page (html/portlet/announcements/view.jsp).
For this I am using the liferay hook and configurations as below.
<struts-action>
		<struts-action-path>/announcements/view</struts-action-path>
		<struts-action-impl> com.unisys.vantagepoint.struts.action.AnnouncementListingAction</struts-action-impl>
	</struts-action>

The class code as below

public class AnnouncementListingAction extends  BaseStrutsPortletAction  {
public String render(
			 StrutsPortletAction originalStrutsPortletAction,
	            PortletConfig portletConfig, RenderRequest renderRequest,
	            RenderResponse renderResponse)
		throws Exception {
   }
   public void serveResource(StrutsPortletAction originalStrutsPortletAction,
            PortletConfig portletConfig,
            ResourceRequest resourceRequest,
            ResourceResponse resourceResponse)
     throws Exception{

}
}

I can call render method of the above class ,Now I want to call the resource method in this class.

I am trying to use the below resource url formation which I have got some forums.
AUI().ready('liferay-portlet-url', function(A) { console.log('testing');
	resourceUrl = Liferay.PortletURL.createResourceURL();
	resourceUrl.setPortletId('84');
	resourceUrl.setPortletMode("view");
	resourceUrl.setWindowState("normal");
	resourceUrl.setParameter("userAnnouncementType","company");
	resourceUrl.setResourceId('getViewListResults');
	resourceUrl.setParameter("struts_action", "/announcements/view");
	});  

How can I call this resource method.

Regards,
Kiran