Forums de discussion

Liferay DXP portlet.properties

thumbnail
Ravi Darji, modifié il y a 7 années.

Liferay DXP portlet.properties

Junior Member Publications: 56 Date d'inscription: 14/05/14 Publications récentes
Hi Everyone,

As we are using PortletProps.get("property.name") in liferay 6.2 to get property value from portlet's portlet.properties file,

Is someone knows that how can i do same in liferay DXP?

Thanks & Regards,
Ravi Darji
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: Liferay DXP portlet.properties

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
It is available for portlet wars, but for OSGi you should be switching over to Configuration Admin (OSGi). There's doco in dev.liferay.com for this and examples in the Liferay source.
thumbnail
Scott Lee, modifié il y a 6 années.

RE: Liferay DXP portlet.properties

Junior Member Publications: 55 Date d'inscription: 26/09/06 Publications récentes
thumbnail
Liferay Dev, modifié il y a 6 années.

RE: Liferay DXP portlet.properties

Junior Member Publications: 81 Date d'inscription: 17/05/15 Publications récentes
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Liferay DXP portlet.properties

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Liferay Dev:
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");


What? This is totally confusing. You're going to use the portal class loader, the one where none of your code is actually running? And what is "portlet"? Did you mean for this to be a placeholder for a portlet name or id or service or what?

Answering forum questions is always welcome, but keep in mind that there are people reading these posts with different levels of experience and often you need to provide some contextual details. A newbie trying this code is going to be completely stymied trying to understand why it is not working or trying to adapt it to their project.








Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Liferay Dev, modifié il y a 6 années.

RE: Liferay DXP portlet.properties

Junior Member Publications: 81 Date d'inscription: 17/05/15 Publications récentes
Use this piece of code to read portlet.properties
Configuration configuration = ConfigurationFactoryUtil.getConfiguration( get Portlet level class loader , "portlet");