Fórum

How to add portal-wide properties files ?

Edouard Perr, modificado 11 Anos atrás.

How to add portal-wide properties files ?

Junior Member Postagens: 30 Data de Entrada: 20/08/12 Postagens Recentes
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, modificado 11 Anos atrás.

RE: How to add portal-wide properties files ?

Junior Member Postagens: 30 Data de Entrada: 20/08/12 Postagens Recentes
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 ?
thumbnail
Zsolt Balogh, modificado 11 Anos atrás.

RE: How to add portal-wide properties files ?

Expert Postagens: 463 Data de Entrada: 23/03/09 Postagens Recentes
Hi Edouard,

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


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

Zsolt