You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/04/20 12:02:58 UTC

[camel] branch camel-2.25.x updated (0ddcfaf -> b6aa6da)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.25.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 0ddcfaf  [Backport] fix(mongodb): converter failure (#5192)
     new 415bbb5  Regen
     new 2723cc6  XML DSL should mark top level elements as deprecated if they are in the XSD documentation.
     new b6aa6da  CAMEL-16533: Spring and Blueprint XML XSD now include completion documentation for EIP elements also (before it was only attributes).

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/resources/camel-connector-schema.json |  2 +-
 .../src/main/resources/camel-connector.json        |  4 +--
 .../components-starter/camel-corda-starter/pom.xml |  8 ------
 .../apache/camel/maven/DocumentationEnricher.java  | 11 +++++---
 .../java/org/apache/camel/maven/DomFinder.java     |  6 +++++
 .../camel/maven/EipDocumentationEnricherMojo.java  | 29 +++++++++++++++-------
 6 files changed, 36 insertions(+), 24 deletions(-)

[camel] 02/03: XML DSL should mark top level elements as deprecated if they are in the XSD documentation.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.25.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2723cc64f1669249a909a909ee8b69c5a956543b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 20 11:20:39 2021 +0200

    XML DSL should mark top level elements as deprecated if they are in the XSD documentation.
---
 .../src/main/java/org/apache/camel/maven/DocumentationEnricher.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
index 1153de8..e601974 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
@@ -66,6 +66,10 @@ public class DocumentationEnricher {
         for (Map<String, String> row : rows) {
             if (row.containsKey(Constants.DESCRIPTION_ATTRIBUTE_NAME)) {
                 String descriptionText = row.get(Constants.DESCRIPTION_ATTRIBUTE_NAME);
+                String deprecatedText = row.get(Constants.DEPRECATED_ATTRIBUTE_NAME);
+                if ("true".equals(deprecatedText)) {
+                    descriptionText = "Deprecated: " + descriptionText;
+                }
                 addDocumentation(item, descriptionText);
                 break;
             }

[camel] 01/03: Regen

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.25.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 415bbb5c5aec9e54e6b4d8758b92762f7fb0117d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 20 11:09:14 2021 +0200

    Regen
---
 .../src/main/resources/camel-connector-schema.json                | 2 +-
 platforms/myfoo-connector/src/main/resources/camel-connector.json | 4 ++--
 .../spring-boot/components-starter/camel-corda-starter/pom.xml    | 8 --------
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json b/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
index f66447e..0c39526 100644
--- a/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
+++ b/platforms/myfoo-connector/src/main/resources/camel-connector-schema.json
@@ -14,7 +14,7 @@
     "javaType":"org.myfoo.connector.MyFooComponent",
     "groupId":"org.apache.camel",
     "artifactId":"myfoo-connector",
-    "version":"2.25.3-SNAPSHOT"
+    "version":"2.25.4-SNAPSHOT"
   },
   "componentProperties":{
     
diff --git a/platforms/myfoo-connector/src/main/resources/camel-connector.json b/platforms/myfoo-connector/src/main/resources/camel-connector.json
index e5cd921..3382d4d 100644
--- a/platforms/myfoo-connector/src/main/resources/camel-connector.json
+++ b/platforms/myfoo-connector/src/main/resources/camel-connector.json
@@ -2,14 +2,14 @@
   "baseScheme" : "timer",
   "baseGroupId" : "org.apache.camel",
   "baseArtifactId" : "camel-core",
-  "baseVersion" : "2.25.3-SNAPSHOT",
+  "baseVersion" : "2.25.4-SNAPSHOT",
   "baseJavaType" : "org.apache.camel.component.timer.TimerComponent",
   "name" : "MyFoo",
   "scheme" : "my-foo",
   "javaType" : "org.myfoo.connector.MyFooComponent",
   "groupId" : "org.myfoo",
   "artifactId" : "myfoo-connector",
-  "version" : "2.25.3-SNAPSHOT",
+  "version" : "2.25.4-SNAPSHOT",
   "description" : "Something cool",
   "labels" : [ "foo", "timer" ],
   "pattern" : "From",
diff --git a/platforms/spring-boot/components-starter/camel-corda-starter/pom.xml b/platforms/spring-boot/components-starter/camel-corda-starter/pom.xml
index bb20a48..a75ea43 100644
--- a/platforms/spring-boot/components-starter/camel-corda-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/camel-corda-starter/pom.xml
@@ -41,14 +41,6 @@
       <!--START OF GENERATED CODE-->
       <exclusions>
         <exclusion>
-          <groupId>ch.qos.logback</groupId>
-          <artifactId>logback-classic</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>ch.qos.logback</groupId>
-          <artifactId>logback-core</artifactId>
-        </exclusion>
-        <exclusion>
           <groupId>org.apache.logging.log4j</groupId>
           <artifactId>log4j-core</artifactId>
         </exclusion>

[camel] 03/03: CAMEL-16533: Spring and Blueprint XML XSD now include completion documentation for EIP elements also (before it was only attributes).

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.25.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b6aa6da46c99e745e189541e2b2586e97f31bed4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 20 13:00:19 2021 +0200

    CAMEL-16533: Spring and Blueprint XML XSD now include completion documentation for EIP elements also (before it was only attributes).
---
 .../apache/camel/maven/DocumentationEnricher.java  |  7 +++---
 .../java/org/apache/camel/maven/DomFinder.java     |  6 +++++
 .../camel/maven/EipDocumentationEnricherMojo.java  | 29 +++++++++++++++-------
 3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
index e601974..284609d 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
@@ -54,9 +54,9 @@ public class DocumentationEnricher {
         }
     }
 
-    public void enrichTypeAttributesDocumentation(Log log, NodeList attributeElements, File jsonFile) throws IOException {
-        for (int j = 0; j < attributeElements.getLength(); j++) {
-            Element item = (Element) attributeElements.item(j);
+    public void enrichElementDocumentation(Log log, NodeList elements, File jsonFile) throws IOException {
+        for (int j = 0; j < elements.getLength(); j++) {
+            Element item = (Element) elements.item(j);
             addAttributeDocumentation(log, item, jsonFile);
         }
     }
@@ -77,7 +77,6 @@ public class DocumentationEnricher {
     }
 
     private void addAttributeDocumentation(Log log, Element item, File jsonFile) throws IOException {
-
         String name = item.getAttribute(Constants.NAME_ATTRIBUTE_NAME);
         if (isNullOrEmpty(name)) {
             return;
diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DomFinder.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DomFinder.java
index 64b4a20..c7ddbb9 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DomFinder.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DomFinder.java
@@ -46,6 +46,12 @@ public class DomFinder {
                 .evaluate(document, XPathConstants.NODESET);
     }
 
+    public NodeList findElementsElements(String name) throws XPathExpressionException {
+        return (NodeList) xPath.compile(
+                "/xs:schema/xs:complexType[@name='" + name + "']//xs:element")
+                .evaluate(document, XPathConstants.NODESET);
+    }
+
     public String findBaseType(String name) throws XPathExpressionException {
         return (String) xPath.compile(
                 "/xs:schema/xs:complexType[@name='" + name + "']//xs:extension/@base")
diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
index 8364dcc..e82120a 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/EipDocumentationEnricherMojo.java
@@ -166,7 +166,12 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
             if (jsonFileExistsForElement(jsonFiles, elementName)) {
                 getLog().debug("Enriching " + elementName);
                 File file = jsonFiles.get(elementName);
-                injectAttributesDocumentation(domFinder, documentationEnricher, file, elementType, injectedTypes);
+                injectChildElementsDocumentation(domFinder, documentationEnricher, file, elementType, injectedTypes);
+            } else {
+                boolean ignore = "ExpressionDefinition".equalsIgnoreCase(elementName);
+                if (!ignore) {
+                    getLog().warn("Cannot find json metadata to use for enriching element " + elementName);
+                }
             }
         }
 
@@ -187,13 +192,15 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
     }
 
     /**
-     * Recursively injects documentation to complex type attributes and it's parents.
+     * Recursively injects documentation to complex type attributes and elements and it's parents.
      */
-    private void injectAttributesDocumentation(DomFinder domFinder,
-                                               DocumentationEnricher documentationEnricher,
-                                               File jsonFile,
-                                               String type,
-                                               Set<String> injectedTypes) throws XPathExpressionException, IOException {
+    private void injectChildElementsDocumentation(
+            DomFinder domFinder,
+            DocumentationEnricher documentationEnricher,
+            File jsonFile,
+            String type,
+            Set<String> injectedTypes)
+            throws XPathExpressionException, IOException {
         if (injectedTypes.contains(type)) {
             return;
         }
@@ -201,13 +208,17 @@ public class EipDocumentationEnricherMojo extends AbstractMojo {
         injectedTypes.add(type);
         NodeList attributeElements = domFinder.findAttributesElements(type);
         if (attributeElements.getLength() > 0) {
-            documentationEnricher.enrichTypeAttributesDocumentation(getLog(), attributeElements, jsonFile);
+            documentationEnricher.enrichElementDocumentation(getLog(), attributeElements, jsonFile);
+        }
+        NodeList elementElements = domFinder.findElementsElements(type);
+        if (elementElements.getLength() > 0) {
+            documentationEnricher.enrichElementDocumentation(getLog(), elementElements, jsonFile);
         }
 
         String baseType = domFinder.findBaseType(type);
         if (baseType != null && !StringUtils.isEmpty(baseType)) {
             baseType = truncateTypeNamespace(baseType);
-            injectAttributesDocumentation(domFinder, documentationEnricher, jsonFile, baseType, injectedTypes);
+            injectChildElementsDocumentation(domFinder, documentationEnricher, jsonFile, baseType, injectedTypes);
         }
     }