Forums de discussion

Conditional statements in portal-ext.properties

Eric Smith, modifié il y a 10 années.

Conditional statements in portal-ext.properties

Junior Member Publications: 66 Date d'inscription: 28/08/12 Publications récentes
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.
thumbnail
Jorge Ferrer, modifié il y a 10 années.

RE: Conditional statements in portal-ext.properties (Réponse)

Liferay Legend Publications: 2871 Date d'inscription: 31/08/06 Publications récentes
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, modifié il y a 10 années.

RE: Conditional statements in portal-ext.properties

Junior Member Publications: 66 Date d'inscription: 28/08/12 Publications récentes
Perfect, that will work for me.