-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rahul] | BAH-3382 | Add. FreeMarker As Default Template Engine
- Loading branch information
1 parent
db774b0
commit eeb9146
Showing
9 changed files
with
173 additions
and
70 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
20 changes: 20 additions & 0 deletions
20
openerp-client/src/main/java/org/bahmni/openerp/web/config/FreeMarkerConfig.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,20 @@ | ||
package org.bahmni.openerp.web.config; | ||
|
||
import freemarker.template.Configuration; | ||
import freemarker.template.TemplateModelException; | ||
|
||
import java.io.IOException; | ||
|
||
public class FreeMarkerConfig { | ||
|
||
private static Configuration config; | ||
|
||
public static Configuration getConfiguration() throws IOException, TemplateModelException { | ||
if (config == null) { | ||
config = new Configuration(Configuration.VERSION_2_3_23); | ||
config.setClassForTemplateLoading(FreeMarkerConfig.class, "/request/template/"); | ||
config.setDefaultEncoding("UTF-8"); | ||
} | ||
return config; | ||
} | ||
} |
11 changes: 4 additions & 7 deletions
11
openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/Parameter.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
59 changes: 41 additions & 18 deletions
59
openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/RequestBuilder.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
10 changes: 10 additions & 0 deletions
10
openerp-client/src/main/resources/request/template/rest_template.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,10 @@ | ||
{ | ||
"id": "${id}", | ||
"params": { | ||
"data": { | ||
<#list parametersList as param> | ||
"${param.name}": "${param.value}"<#if param_has_next>,</#if> | ||
</#list> | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
openerp-client/src/main/resources/request/template/xml_template.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,31 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<methodCall> | ||
<methodName>execute</methodName> | ||
<params> | ||
<param> | ||
<value><string>${database}</string></value> | ||
</param> | ||
<param> | ||
<value><int>${id}</int></value> | ||
</param> | ||
<param> | ||
<value><string>${password}</string></value> | ||
</param> | ||
<param> | ||
<value><string>${resource}</string></value> | ||
</param> | ||
<param> | ||
<value><string>${operation}</string></value> | ||
</param> | ||
<param> | ||
<value><struct> | ||
<#list parametersList as param> | ||
<member> | ||
<name>${param.name}</name> | ||
<value><${param.type}>${(param.value?xml)!}</${param.type}></value> | ||
</member> | ||
</#list> | ||
</struct></value> | ||
</param> | ||
</params> | ||
</methodCall> |
31 changes: 0 additions & 31 deletions
31
openerp-client/src/main/resources/request/template/xml_template.vm
This file was deleted.
Oops, something went wrong.
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