camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zregv...@apache.org
Subject camel git commit: CAMEL-10966 Salesforce Maven Plugin Escape Strings
Date Wed, 08 Mar 2017 18:24:37 GMT
Repository: camel
Updated Branches:
  refs/heads/master a2aaa544b -> 77f203dfd


CAMEL-10966 Salesforce Maven Plugin Escape Strings


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/77f203df
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/77f203df
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/77f203df

Branch: refs/heads/master
Commit: 77f203dfd028f9a9a321529babc6b63a84be5f0b
Parents: a2aaa54
Author: Nicolas Cisco <nicolas.cisco@semperti.com>
Authored: Tue Mar 7 18:36:02 2017 -0300
Committer: Zoran Regvart <zregvart@apache.org>
Committed: Wed Mar 8 19:23:58 2017 +0100

----------------------------------------------------------------------
 .../camel-salesforce/camel-salesforce-maven-plugin/pom.xml      | 5 +++++
 .../main/java/org/apache/camel/maven/CamelSalesforceMojo.java   | 2 ++
 .../src/main/resources/sobject-picklist.vm                      | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/77f203df/components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml b/components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml
index 76b6745..6c10bc4 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml
@@ -118,6 +118,11 @@
       <artifactId>velocity</artifactId>
       <version>${velocity-version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.velocity</groupId>
+      <artifactId>velocity-tools</artifactId>
+      <version>${velocity-tools-version}</version>
+    </dependency>
 
     <!-- logging -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/77f203df/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
index 0b0de84..ee7e1ab 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
@@ -72,6 +72,7 @@ import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.tools.generic.EscapeTool;
 import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.velocity.runtime.log.Log4JLogChute;
 import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
@@ -614,6 +615,7 @@ public class CamelSalesforceMojo extends AbstractMojo {
                     context = new VelocityContext();
                     context.put("packageName", packageName);
                     context.put("utility", utility);
+                    context.put("esc", new EscapeTool());
                     context.put("field", field);
                     context.put("enumName", enumName);
                     context.put("generatedDate", generatedDate);

http://git-wip-us.apache.org/repos/asf/camel/blob/77f203df/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-picklist.vm
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-picklist.vm
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-picklist.vm
index 5212d81..22dda10 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-picklist.vm
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/resources/sobject-picklist.vm
@@ -37,7 +37,7 @@ public enum $enumName {
 #foreach ( $entry in $values)
 #set ( $value = $entry.Value )
     // $value
-    $utility.getEnumConstant($value)("$value")#if ( $foreach.hasNext ),#else;#end
+    $utility.getEnumConstant($value)("$esc.java($value)")#if ( $foreach.hasNext ),#else;#end
 
 #end
 #end


Mime
View raw message