0

I am trying to use portletpreference in my nested webcontent in Liferay 7.4. In the 7.4 version, there are two tables [PortletPreferences] and [PortletPreferenceValue] for Preferences.

I am able to set the Preferences values but, having trouble in retrieving it in the template.

I have tried below code in my template for retrieving the preferences. I am not able to find any method which retrieves PortletPreferenceValues.

<#assign portletPreferencesService = serviceLocator.findService("com.liferay.portal.kernel.service.PortletPreferencesLocalService") />
<#assign portletPreferncesValueService = serviceLocator.findService("com.liferay.portal.kernel.service.PortletPreferenceValueLocalService") />
<#assign portletKeys = staticUtil["com.liferay.portal.kernel.util.PortletKeys"]>
<#assign ownerId = groupId />
<#assign ownerType = portletKeys.PREFS_OWNER_TYPE_LAYOUT />
<#assign portletId = "com_liferay_journal_content_web_portlet_JournalContentPortlet" />
<#assign plid = 0/>

<#assign portletPreferences = portletPreferencesService.fetchPortletPreferences(ownerId, ownerType, plid, portletId) />
Geek
  • 127
  • 1
  • 12

0 Answers0