Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Eric Smith
Conditional statements in portal-ext.properties
May 15, 2013 12:37 PM
Answer

Eric Smith

Rank: Junior Member

Posts: 51

Join Date: August 28, 2012

Recent Posts

Are there any plans on adding conditional statements to portal-ext.properties? They would be useful for standardizing portal-ext.properties files across several developers (and development environments). It would make updating the file and keeping it synchronized much easier. It may also be useful in production in a multi-server configuration.

I'm not sure exactly how it could be implemented, but we would want to base certain properties on IP address, hostname or something like that. One example of a property that we would make dependent is a database connection.
Jorge Ferrer
RE: Conditional statements in portal-ext.properties
May 15, 2013 5:03 PM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2756

Join Date: August 31, 2006

Recent Posts

You can achieve the same by including a file based on a system variable. Don't have the exact syntax right now but it would look something like this:

include-and-override=portal-env-${environment}.properties

Where "environment" could be a sysproperty.

Another commonly used solution is to just place portal-ext.properties in the liferay.home or in the user.home and have it be different in each environment (since it's not inside the distributed packages)
Eric Smith
RE: Conditional statements in portal-ext.properties
May 16, 2013 12:59 PM
Answer

Eric Smith

Rank: Junior Member

Posts: 51

Join Date: August 28, 2012

Recent Posts

Perfect, that will work for me.
Eric Smith
RE: Conditional statements in portal-ext.properties
June 20, 2013 1:15 PM
Answer

Eric Smith

Rank: Junior Member

Posts: 51

Join Date: August 28, 2012

Recent Posts