留言板

How to override portlet.properties of module in Liferay 7

thumbnail
Jitendra Rajput,修改在7 年前。

How to override portlet.properties of module in Liferay 7

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Just create a portlet-ext.properties file in the classpath and set the property.
thumbnail
Jitendra Rajput,修改在7 年前。

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

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

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

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
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,修改在6 年前。

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

New Member 帖子: 4 加入日期: 07-7-23 最近的帖子
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,修改在6 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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!