Fórum

How to override portlet.properties of module in Liferay 7

thumbnail
Jitendra Rajput, modificado 7 Anos atrás.

How to override portlet.properties of module in Liferay 7

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Hi,

I would like to stop indexing all journal article version instead only latest journal article should be indexed. I looked into reindexArticleVersions method of JournalArticleIndexer class and found that it is checking for below property before indexing article version.

#
# Set this to true to index all article versions. Set this to false to index
# only the last indexable version.
#
journal.articles.index.all.versions=true

Above property is available in portlet.properties under journal-service module(modules/apps/web-experience/journal/journal-service/src/main/resources/portlet.properties).

I would like to set this property to false. Question here is how can be override portlet.properties of journal-service module ?

Thanks in Advance !
Jitendra
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
Just create a portlet-ext.properties file in the classpath and set the property.
thumbnail
Jitendra Rajput, modificado 7 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
There are multiple modules having their own portlet.properties. From my custom modules how can i specify which modules's portlet.properties i would like to override ?

I tried by creating portlet-ext.properties [src\main\resources\] in my custom modules but it did n't work.

Thanks !
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7 (Resposta)

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
It didn't work because a file in your module is not in the classpath for the JournalArticleIndexer. Put it in the same location as portal-ext.properties.

As far as multiple portlets using their own portlet[-ext].properties, it is true that they would all use a shared portlet-ext.properties file, but since the properties are keyed to individual portlets there is no real impact to others when you override a property for a specific portlet.
thumbnail
Jitendra Rajput, modificado 7 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Thanks ! It worked after creating portlet-ext.properties file inside [webapps\ROOT\WEB-INF\classes] and setting property to false.

One more thing i noted is that it does not work if i create portlet-ext.properties inside [LIFERAY_HOME] same as portal-ext.

Thanks !
Camilo Wilson, modificado 6 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7

New Member Postagens: 4 Data de Entrada: 23/07/07 Postagens Recentes
Hello,
I have a new, non-legacy, osgi portlet that extends LifearyPortlet and uses @Component annotations.
I build it with gradle deploy.

I have src/main/java, src/main/resources, and src/main/resources/META-INF/resources/css

Where do I put portlet-ext.properties so that it will be in the class path?
I don't have a web.xml. I tried it in resources/content, but it is not getting picked up.

Thank you!
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: How to override portlet.properties of module in Liferay 7

Liferay Legend Postagens: 14917 Data de Entrada: 02/09/06 Postagens Recentes
portlet-ext.properties just put into src/main/resources and it will be in the classpath.

web.xml is not used in portlet modules. Instead you use the whiteboard pattern to add servlets, filters, ...







Come meet me at the 2017 LSNA!