Posts

Showing posts from December, 2020

Opening portlet in popup

  Sometimes, we may get requirements to open portlet in a popup. We can use below Javascrpit function to open in apopup. AUI().use('aui-base','aui-component','aui-parse-content','aui-node','liferay-form',     'liferay-portlet-url', 'liferay-util-window', 'plugin','aui-io-request', function(A){                    var renderURL = Liferay.PortletURL.createRenderURL();       renderURL .setWindowState("exclusive");        renderURL.setPortletId(" <portlet-name> ");       var  url = renderURL.toString();             A.io.request(url, {                 on: {                  success: function(event, id, obj) {                        var responseData = this.get('responseData');                        if (responseData) {                              Liferay.Util.openWindow({                                                                                               dialog: { 

Redirecting Post Values from Third Party application to Liferay

  Whenever we do Post in Liferay, Liferay will auto generate P_auth token.  But whenever we are doing posting(Post Request) from third party application and redirecting to Liferay application ,  liferay application will expect p_auth token. But third party applications cannot provide p_auth as it is Liferay specific.  But in liferay, we can design to ignore p_auth token for specific URL. First , Write a below class to ignore Auth token for specific URL @Component( immediate = true, property = { "auth.token.ignore.mvc.action=true", "javax.portlet.name=" + SamplePortletKeys.PortletName, "mvc.command.name=/redirect/liferay" }, service = MVCActionCommand.class ) public class RedirectPath extends BaseMVCActionCommand { } Here we have created MVCActionCommand Class  auth.token.ignore.mvc.action=true                This Property will ensure to ignore p_auth token.      2.  "mvc.command.name=/redirect/liferay"             Here we