Strapi MonogoDB Connection Setup

Find hostname Login in to mongoDB Atlas. On the 'Connect to Cluster0' popup click on 'Connect with MongoDB Compass'. On the 'Copy the URI Connection String' section click on 'I am using Compass 1.11 or earlier'. Click on 'Copy' to copy the string. Test connection with MongoDB Compass Open MongoDB Compass to add a new …

Liferay.PortletURL.createResourceURL()

// <![CDATA[ Liferay.namespace('HubSSO'); Liferay.provide(Liferay.HubSSO, 'openHub', function(url) { var A = AUI(); A.io.request(url, { cache: 'false', dataType: 'json', on: { success: function() { var data = this.get('responseData'); openWindowLarge(data.url,'HUB'); } } } ); }, ['aui-io-request'] ); Liferay.provide(Liferay.HubSSO, 'openHubURL', function() { var currentURL = location.href + "?" + "p_p_id=HubSSOPortlet_WAR_HubSSOPortlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=getURL"; Liferay.HubSSO.openHub(currentURL); } ); Liferay.provide(Liferay.HubSSO, 'getName', function() { var A …

Liferay – Admin Console Notes

Create URL themeDisplay = actionRequest.getAttribute("LIFERAY_SHARED_THEME_DISPLAY"); plid = themeDisplay.getPlid(); renderParameters = new java.util.HashMap(); String[] values = ["test1", "test2"]; renderParameters.put("test", values); com.liferay.portlet.RenderParametersPool.put(com.liferay.portal.util.PortalUtil.getHttpServletRequest(actionRequest), plid, "0", renderParameters); portletURL = com.liferay.portlet.PortletURLFactoryUtil.create(actionRequest, "0", plid, "RENDER_PHASE"); portletURL.setCopyCurrentRenderParameters(true); out.println(portletURL.toString()); portletURL.clearCache(); out.println(portletURL.toString());

Liferay – Groovy code to get encrypted userID

import com.liferay.portal.service.CompanyLocalServiceUtil import com.liferay.util.Encryptor import com.liferay.portal.model.Company themeDisplay = actionRequest.getAttribute("LIFERAY_SHARED_THEME_DISPLAY"); plid = themeDisplay.getPlid(); companyId = themeDisplay.getCompanyId(); Company company = CompanyLocalServiceUtil.getCompany(companyId); out.println(company.toString()); encDoAsUserId = Encryptor.encrypt(company.getKeyObj(), String.valueOf(10198)); out.println(encDoAsUserId); Impersonation sample link http://localhost:8080/web/guest?doAsUserId=wZb6LPcmNWFJC0NjCSoP7Q==

Liferay Javascript API – Add/delete custom field to/from User

In JavaScript The code below shows you how to add a custom field to User and how to remove it from a user. Liferay.Service( '/expandovalue/get-data', { companyId: 10154, className: 'com.liferay.portal.model.User', tableName: 'CUSTOM_FIELDS', columnName: 'fimStatus', classPK: 11429 }, function(obj) { console.log(obj); } ); CompanyId: themeDisplay.getCompanyId(). ClassName: the User class name. TableName: 'CUSTOM_FIELDS'. ColumnName: custom field key. …