Foros de discusión

how to use PortletProps API in liferay DXP

thumbnail
Ravi Darji, modificado hace 7 años.

how to use PortletProps API in liferay DXP

Junior Member Mensajes: 56 Fecha de incorporación: 14/05/14 Mensajes recientes
Hi Everyone,

I struggling to use com.liferay.util.portlet.PortletProps in liferay DXP.

i am using it to get properties which is defined in portlet.properties file.

to use it in liferay DXP i need to add dependency in build.gradle file (to resolve compile time)
i have added it like, compile group: "com.liferay.portal", name: "com.liferay.util.java", version: "2.0.0"

To resolve runtime i need to add it in bnd.bnd file, like as below,
Include-Resource: \
@com.liferay.util.java-2.0.0.jar


now the PortletProps is resovled but it is asking for another dependency com.swabunga.spell.engine
and the module is in installed status, because the dependency is not resolved.

Now when i include com.swabunga.spell.engine dependency, any how,
still it will ask for another dependency, and it is going on.

So, can i not use PortletProps in liferay DXP module?


Thanks & Regards,
Ravi darji
Sudhanshu Kumar Shukla, modificado hace 6 años.

RE: how to use PortletProps API in liferay DXP

Junior Member Mensajes: 35 Fecha de incorporación: 29/08/16 Mensajes recientes
Ravi Darji:
Hi Everyone,

I struggling to use com.liferay.util.portlet.PortletProps in liferay DXP.

i am using it to get properties which is defined in portlet.properties file.

to use it in liferay DXP i need to add dependency in build.gradle file (to resolve compile time)
i have added it like, compile group: "com.liferay.portal", name: "com.liferay.util.java", version: "2.0.0"

To resolve runtime i need to add it in bnd.bnd file, like as below,
Include-Resource: \
@com.liferay.util.java-2.0.0.jar


now the PortletProps is resovled but it is asking for another dependency com.swabunga.spell.engine
and the module is in installed status, because the dependency is not resolved.

Now when i include com.swabunga.spell.engine dependency, any how,
still it will ask for another dependency, and it is going on.

So, can i not use PortletProps in liferay DXP module?

I am Also Facing Same Issue But You Can Alternatively Use Below Code Snnipet To Read properties from portlet.properties file

Configuration configuration=ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
			String mailSubject = ContentUtil.get(configuration.get(EnquiryPortletKeys.ENQUIRY_MAILSUBJECT_TPL));



If You Resolve This How to use PortletProps then Please reply it would be appricated.

Thanks