frascati issueshttps://gitlab.ow2.org/frascati/frascati/-/issues2018-02-06T10:32:20Zhttps://gitlab.ow2.org/frascati/frascati/-/issues/119Velocity servlet : allow to configure request encoding2018-02-06T10:32:20ZMarc DutooVelocity servlet : allow to configure request encodingIn Tomcat, Velocity servlet decodes an HTML Form's POST parameters using Tomcat's default encoding ISO-8859-1 (because browsers don't provide encoding), which produces ugly (c)-like badly encoded characters on server side when commonly e...In Tomcat, Velocity servlet decodes an HTML Form's POST parameters using Tomcat's default encoding ISO-8859-1 (because browsers don't provide encoding), which produces ugly (c)-like badly encoded characters on server side when commonly expecting UTF-8.
This is a well known case, see :
* tomcat's own and most common solution, using a ServletFilter doing request.setCharacterEncoding() http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q2 http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Set_Character_Encoding_Filter
* and source http://code.google.com/p/forsecond/source/browse/trunk/compare/src/com/jz/filter/SetCharacterEncodingFilter.java?r=39
* discussion http://stackoverflow.com/questions/8391675/utf-8-encoding-a-servlet-form-submission-with-tomcat
Note that Velocity's own servlet does not handle it (but allows to configure output content type) http://www.docjar.org/html/api/org/apache/velocity/tools/view/servlet/VelocityViewServlet.java.htmlhttps://gitlab.ow2.org/frascati/frascati/-/issues/104Improvement for implementation velocity in FraSCAti. Add the possibility to u...2018-02-06T10:32:19ZJeremie GuillemotteImprovement for implementation velocity in FraSCAti. Add the possibility to use templates in a tree organisation.Improvement for implementation velocity in FraSCAti (ProxyImplementationVelocity.java).
Here is the original code : http://websvn.ow2.org/filedetails.php?repname=frascati&path=%2Ftrunk%2Ffrascati%2Fmodules%2Ffrascati-implementation-velo...Improvement for implementation velocity in FraSCAti (ProxyImplementationVelocity.java).
Here is the original code : http://websvn.ow2.org/filedetails.php?repname=frascati&path=%2Ftrunk%2Ffrascati%2Fmodules%2Ffrascati-implementation-velocity%2Fsrc%2Fmain%2Fjava%2Forg%2Fow2%2Ffrascati%2Fimplementation%2Fvelocity%2FServletImplementationVelocity.java
The proposition is to add this portion of code to offer the possibility to load Velocity templates not only in a base folder but also in a folder tree.
Here is the code addition to solve this problem (can be found also on GitHub : https://github.com/easysoa/EasySOA/blob/master/easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-httpdiscoveryproxy/src/main/java/org/ow2/frascati/implementation/velocity/ProxyImplementationVelocity.java)
....
protected final String invoke(String method, VelocityContext context, String[] args, Object... parameters) {
// VelocityContext context = new VelocityContext(this.velocityContext);
context.put(params, parameters);
// FIXME: should not be called but @Lifecycle does not work as expected.
registerScaProperties();
StringWriter sw = new StringWriter();
// **** EasySOA Hack begin
int pathArgIndex = Integer.parseInt((String) context.get("pathArgIndex")); // pathArgIndex has been set as an SCA xsd:int property
int storeIndex = Integer.parseInt((String) context.get("storeIndex")); // storeIndex has been set as an SCA xsd:int property
Template template = null;
if (parameters.length > pathArgIndex) {
Object templatePathFound = parameters[pathArgIndex];
Object storeNameFound = parameters[storeIndex];
if (templatePathFound instanceof String) {
template = this.velocityEngine.getTemplate((String)storeNameFound + "/" + (String) templatePathFound);
}
}
// *** EasySOA Hack end
if (template == null) {
String name = this.velocityEngine.templateExists(method + ".vm") ? method + ".vm" : this.defaultResource;
template = this.velocityEngine.getTemplate(name);
}
if (!this.velocityEngine.invokeVelocimacro(method, method, args, context, sw)) {
template.merge(context, sw);
.....
Currently, the method parameter contains the name of the velocity template to use. It is not possible to call templates in an other folder or in a folder tree organisation.
The hack uses 2 properties to set the array position of 2 parameters "pathArgIndex" and "storeIndex". The "pathArgIndex" parameter contains the folder where to find the "storeIndex" template.
An other solution is to have a special method name (eg : folder1_folder2_template) to pass the informations.
A third solution is to use a special method name, allowing to pass special params, to be able get templates in a tree folder organisation.
1.5https://gitlab.ow2.org/frascati/frascati/-/issues/85mvn sonar:sonar failed2018-02-06T10:32:18ZPhilippe Merlemvn sonar:sonar failedRunning 'mvn sonar:sonar' failed.
Running 'mvn sonar:sonar' failed.
https://gitlab.ow2.org/frascati/frascati/-/issues/36Support for SCA component implementation with Apache Velocity2018-02-06T10:32:12ZPhilippe MerleSupport for SCA component implementation with Apache Velocity1.5https://gitlab.ow2.org/frascati/frascati/-/issues/15Reflecting FraSCAti modules as OSGi bundles2018-09-10T23:26:45ZRomain RouvoyReflecting FraSCAti modules as OSGi bundlesOSGi defines a standard packaging mechanism, which can be used to better isolate the loading of
software modules within a standard Java Runtime Environment. FraSCAti «à la carte» could benefit from
this mechanism to better control the ...OSGi defines a standard packaging mechanism, which can be used to better isolate the loading of
software modules within a standard Java Runtime Environment. FraSCAti «à la carte» could benefit from
this mechanism to better control the loaded modules as well as their dependencies.
It would therefore be nice to consider the definition of OSGi-compliant manifest files for the module of
the platform. Existing tools, such as BND [1] or Tycho [2] could facilitate this task by generating the
manifest file from the Maven configuration file.
References
1. BND. http://www.aqute.biz/Code/Bnd
2. Tycho. http://tycho.sonatype.org
Romain Rouvoy