Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #987 from mbarto/geos6947_ftl_environment
GEOS-6947: added support for custom variables from various sources to HT...
- Loading branch information
Showing
5 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/wms/src/main/java/org/geoserver/wms/featureinfo/EnvironmentVariablesTemplateModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* (c) 2015 Open Source Geospatial Foundation - all rights reserved | ||
* This code is licensed under the GPL 2.0 license, available at the root | ||
* application directory. | ||
*/ | ||
package org.geoserver.wms.featureinfo; | ||
|
||
import org.geoserver.platform.GeoServerExtensions; | ||
|
||
import freemarker.template.SimpleScalar; | ||
import freemarker.template.TemplateHashModel; | ||
import freemarker.template.TemplateModel; | ||
import freemarker.template.TemplateModelException; | ||
|
||
public class EnvironmentVariablesTemplateModel implements TemplateHashModel { | ||
|
||
@Override | ||
public TemplateModel get(String propertyName) throws TemplateModelException { | ||
return new SimpleScalar(GeoServerExtensions.getProperty(propertyName)); | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() throws TemplateModelException { | ||
return false; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/wms/src/test/resources/org/geoserver/wms/featureinfo/test_env_content.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${environment.TEST_PROPERTY},${environment.TEST_INIT_PARAM} |