Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Edouard Perr
How to add portal-wide properties files ?
September 12, 2012 8:58 AM
Answer

Edouard Perr

Rank: Junior Member

Posts: 30

Join Date: August 20, 2012

Recent Posts

Hello there,

I need a specific business feature in my Liferay product, but I don't know how to achieve it.

Scenario :
I need to store data in different property files accessible from several specific portlets (portal-wide). For example, a list of countries identified by a key, a list of reference mapping...
I wish to be able to add/edit/delete these properties from the control panel (a webmaster would be in charge to keep them up to date). I think it would be good to access it from the left panel under [my site] section with the other portlets.
The best would be not to have to restart Liferay after an operation, but no matter if it's not possible (like with portal-ext.properties)

I know that I could make a particular section in the portal-ext.properties, but because properties can be edited direclty from control panel, I think it's not the good solution. Moreover, it would be more maintainable in separate files.

Could you help me to implement this feature ? Can I do that with a Hook ? with an Ext ? If yes, how ?

Regards,
Edouard
Edouard Perr
RE: How to add portal-wide properties files ?
September 13, 2012 1:03 AM
Answer

Edouard Perr

Rank: Junior Member

Posts: 30

Join Date: August 20, 2012

Recent Posts

Does anyone know how to proceed for my scenario ?
Would it be possible to implement a service within an Ext plugin which read some property files defined in the Ext. This service would be available from other portlets ?
Zsolt Balogh
RE: How to add portal-wide properties files ?
September 14, 2012 1:41 AM
Answer

Zsolt Balogh

LIFERAY STAFF

Rank: Expert

Posts: 459

Join Date: March 23, 2009

Recent Posts

Hi Edouard,

Based on your description, I can recommend the following:
  1. Create a portlet with which you can store and edit these properties
  2. Use the service builder and build a service which will be used by other portlets
  3. Copy the new portlet's service.jar into the portlet's class path
  4. Use the service to access the data


I hope this helps you to move forward with the idea.

Zsolt