-
Notifications
You must be signed in to change notification settings - Fork 1
GSIP 181
The aim of the enhancement is to make Math functions available in free marker templates,that at the moment doesn't allow the execution of static methods.
- Andrea Aime
- Lorenzo Pini
- Marco Volpini
This proposal is for GeoServer 2.16; backport to 2.15 is needed also.
- Under Discussion
- In Progress
- Completed
- Rejected
- Deferred
The enhancement will allow the use of Math functions directly inside free marker templates.
Difference: ${Math.abs( variable )}
According to the documentation the aim can be achived using the TemplateHashModel returned from BeansWrapper.getStaticModels(), that is capable of creating hash models for accessing static methods and fields of an arbitrary class:
BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
TemplateHashModel staticModels = wrapper.getStaticModels();
TemplateHashModel maths = (TemplateHashModel) staticModels.get("java.lang.Math");
Changes are foreseen in HTMLFeatureInfoOutputFormat.java to add the math hash model to the root model.
No backwards compatibility issues are foreseen.
Jody requests example and documentation.
Project Steering Committee:
- Alessio Fabiani:+1
- Andrea Aime: +0
- Ian Turton: +1
- Jody Garnett: +1
- Jukka Rahkonen:
- Kevin Smith:
- Simone Giannecchini: +0
©2020 Open Source Geospatial Foundation