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: Polish catalog
Date Fri, 02 Oct 2015 08:09:00 GMT
Polish catalog


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

Branch: refs/heads/master
Commit: 3580583c9eb006fc10cf667e4a74752b5c1bb96f
Parents: 87802a4
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Oct 2 09:51:36 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Oct 2 09:51:36 2015 +0200

----------------------------------------------------------------------
 .../maven/packaging/PackageDataFormatMojo.java  |  2 +-
 .../maven/packaging/PackageLanguageMojo.java    | 28 +++++++++++++++++---
 2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3580583c/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 ca61d3e..b1301e7 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
@@ -363,7 +363,7 @@ public class PackageDataFormatMojo extends AbstractMojo {
 
     private static String createParameterJsonSchema(DataFormatModel dataFormatModel, String
schema) {
         StringBuilder buffer = new StringBuilder("{");
-        // component model
+        // dataformat model
         buffer.append("\n \"dataformat\": {");
         buffer.append("\n    \"name\": \"").append(dataFormatModel.getName()).append("\",");
         buffer.append("\n    \"kind\": \"").append("dataformat").append("\",");

http://git-wip-us.apache.org/repos/asf/camel/blob/3580583c/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java
index fda5af3..070188a 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageLanguageMojo.java
@@ -110,7 +110,7 @@ public class PackageLanguageMojo extends AbstractMojo {
         // first we need to setup the output directory because the next check
         // can stop the build before the end and eclipse always needs to know about that
directory 
         if (projectHelper != null) {
-            projectHelper.addResource(project, languageOutDir.getPath(), Collections.singletonList("**/dataformat.properties"),
Collections.emptyList());
+            projectHelper.addResource(project, languageOutDir.getPath(), Collections.singletonList("**/language.properties"),
Collections.emptyList());
         }
 
         if (!PackageHelper.haveResourcesChanged(log, project, buildContext, "META-INF/services/org/apache/camel/language"))
{
@@ -180,10 +180,14 @@ public class PackageLanguageMojo extends AbstractMojo {
                                 List<Map<String, String>> rows = JSonSchemaHelper.parseJsonSchema("model",
json, false);
                                 for (Map<String, String> row : rows) {
                                     if (row.containsKey("title")) {
-                                        languageModel.setTitle(row.get("title"));
+                                        // title may be special for some languages
+                                        String title = asTitle(name, row.get("title"));
+                                        languageModel.setTitle(title);
                                     }
                                     if (row.containsKey("description")) {
-                                        languageModel.setDescription(row.get("description"));
+                                        // description may be special for some languages
+                                        String desc = asDescription(name, row.get("description"));
+                                        languageModel.setDescription(desc);
                                     }
                                     if (row.containsKey("label")) {
                                         languageModel.setLabel(row.get("label"));
@@ -314,6 +318,22 @@ public class PackageLanguageMojo extends AbstractMojo {
         return name;
     }
 
+    private static String asTitle(String name, String title) {
+        // special for some languages
+        if ("file".equals(name)) {
+            return "File";
+        }
+        return title;
+    }
+
+    private static String asDescription(String name, String description) {
+        // special for some languages
+        if ("file".equals(name)) {
+            return "For expressions and predicates using the file/simple language";
+        }
+        return description;
+    }
+
     private static Artifact findCamelCoreArtifact(MavenProject project) {
         // maybe this project is camel-core itself
         Artifact artifact = project.getArtifact();
@@ -340,7 +360,7 @@ public class PackageLanguageMojo extends AbstractMojo {
 
     private static String createParameterJsonSchema(LanguageModel languageModel, String schema)
{
         StringBuilder buffer = new StringBuilder("{");
-        // component model
+        // language model
         buffer.append("\n \"language\": {");
         buffer.append("\n    \"name\": \"").append(languageModel.getName()).append("\",");
         buffer.append("\n    \"kind\": \"").append("language").append("\",");


Mime
View raw message