Sunday, May 3, 2015

Portal properties and portal-ext.properties in liferay

Liferay provides many portal properties which can be used to set up & configure Liferay portal.
When we configure liferay server first time, it will create portal-setup-wizard.properties file under <<Liferay-tomcat-bundle>>
folder.


Liferay defines few more portal properties in portal.properties file. This file is located in
<>/tomcat-7.0.25/webapps/ROOT/WEB-INF/lib/portal-impl.jar. We can override these properties (defined in portal.properties) using
portal-ext.properties file.
open portal-impl jar file using WinRaR achiever or any other



For overriding portal.properties in portal-ext.properties file, we need to create this file(portal-ext.properties) manually with extention
.properties

We can either override existing properties and/or can define new properties  in portal-ext.properties file.

Then we can place this file in following location :

Location 1 : <<Liferay-Tomcat-Bundle>>/ folder

or

Location 2 : <>/tomcat-7.0.25/webapps/ROOT/WEB-INF/classes


On sever startup, Liferay first reads portal properties from portal.properties file followed by portal-ext.properties file defined at
location 1 then it reads from location 2 (if we have used in both location). Finally it reads from portal-setup-wizard.properties file.

Means,

Any properties defined in portal.properties file, can be overridden in portal-ext.properties placed at location 1.
Any properties defined in portal-ext.properties file at location 1, can be overridden in portal-ext.properties defined at location 2.

Instead of placing portal-ext.properties at two different location we can place at any one location mention above.

portal-ext.properties

In above screenshot we can see that i have override one property using portal-ext.properties and define one property with overrided value.

theme.portlet.decorate.default = false

If we use this property with value false , then automatically it will hide portlet border.
No need to hide manually. Like this there are more properties which we can over ride.

location :
Output:



0 comments:

Post a Comment