camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] camel git commit: CAMEL-8558: Camel component docs now include a human readable title for the component names.
Date Fri, 27 Mar 2015 11:19:29 GMT
CAMEL-8558: Camel component docs now include a human readable title for the component names.


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

Branch: refs/heads/camel-2.15.x
Commit: 577244aeb505fdba85cd16445202b77ea48863d0
Parents: b0642b8
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Mar 27 11:30:38 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Mar 27 12:21:31 2015 +0100

----------------------------------------------------------------------
 .../maven/packaging/PackageDataFormatMojo.java  | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/577244ae/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
index 49f2b85..3132f19 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
@@ -176,7 +176,8 @@ public class PackageDataFormatMojo extends AbstractMojo {
                                 List<Map<String, String>> rows = JSonSchemaHelper.parseJsonSchema("model",
json, false);
                                 for (Map<String, String> row : rows) {
                                     if (row.containsKey("title")) {
-                                        dataFormatModel.setTitle(row.get("title"));
+                                        String title = asModelTitle(row.get("title"));
+                                        dataFormatModel.setTitle(title);
                                     }
                                     if (row.containsKey("label")) {
                                         dataFormatModel.setLabel(row.get("label"));
@@ -262,6 +263,24 @@ public class PackageDataFormatMojo extends AbstractMojo {
         return name;
     }
 
+    private static String asModelTitle(String name) {
+        // special for some data formats
+        if ("json-gson".equals(name)) {
+            return "JSon GSon";
+        } else if ("json-jackson".equals(name)) {
+            return "JSon Jackson";
+        } else if ("json-xstream".equals(name)) {
+            return "JSon XStream";
+        } else if ("bindy-csv".equals(name)) {
+            return "Bindy CSV";
+        } else if ("bindy-fixed".equals(name)) {
+            return "Bindy Fixed Length";
+        } else if ("bindy-kvp".equals(name)) {
+            return "Bindy Key Value Pair";
+        }
+        return name;
+    }
+
     private static Artifact findCamelCoreArtifact(MavenProject project) {
         // maybe this project is camel-core itself
         Artifact artifact = project.getArtifact();


Mime
View raw message