You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/30 16:37:39 UTC

[camel] 04/16: CAMEL-17792: Add doc about the message headers of camel-jcr

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

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 38caeb6860f2e2b2f9afaba43f444b5df9590a64
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Mar 30 11:11:32 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-jcr
---
 .../resources/org/apache/camel/component/jcr/jcr.json        |  5 +++++
 components/camel-jcr/src/main/docs/jcr-component.adoc        |  4 ++++
 .../java/org/apache/camel/component/jcr/JcrConstants.java    | 12 ++++++++++--
 .../java/org/apache/camel/component/jcr/JcrEndpoint.java     |  2 +-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/components/camel-jcr/src/generated/resources/org/apache/camel/component/jcr/jcr.json b/components/camel-jcr/src/generated/resources/org/apache/camel/component/jcr/jcr.json
index accc7e3..2e52f22 100644
--- a/components/camel-jcr/src/generated/resources/org/apache/camel/component/jcr/jcr.json
+++ b/components/camel-jcr/src/generated/resources/org/apache/camel/component/jcr/jcr.json
@@ -27,6 +27,11 @@
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
   },
+  "headers": {
+    "CamelJcrNodeName": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "The exchange id", "description": "The name of the target node" },
+    "CamelJcrOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CamelJcrInsert", "description": "The operation to perform. Possible values: CamelJcrInsert or CamelJcrGetById" },
+    "CamelJcrNodeType": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The node type of the target node" }
+  },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of the javax.jcr.Repository to lookup from the Camel registry to be used." },
     "base": { "kind": "path", "displayName": "Base", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Get the base node when accessing the repository" },
diff --git a/components/camel-jcr/src/main/docs/jcr-component.adoc b/components/camel-jcr/src/main/docs/jcr-component.adoc
index 861b240..767e6d1 100644
--- a/components/camel-jcr/src/main/docs/jcr-component.adoc
+++ b/components/camel-jcr/src/main/docs/jcr-component.adoc
@@ -57,6 +57,10 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
+
 == Example
 
 The snippet below creates a node named `node` under the `/home/test`
diff --git a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConstants.java b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConstants.java
index c2742b0..c4c5820 100644
--- a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConstants.java
+++ b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConstants.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.jcr;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * JCR Constants.
  */
@@ -24,10 +26,16 @@ public final class JcrConstants {
     /**
      * Property key for specifying the name of a node in the repository
      */
-    public static final String JCR_NODE_NAME = "CamelJcrNodeName";
-    public static final String JCR_OPERATION = "CamelJcrOperation";
     public static final String JCR_INSERT = "CamelJcrInsert";
     public static final String JCR_GET_BY_ID = "CamelJcrGetById";
+    @Metadata(label = "producer", description = "The name of the target node", javaType = "String",
+              defaultValue = "The exchange id")
+    public static final String JCR_NODE_NAME = "CamelJcrNodeName";
+    @Metadata(label = "producer",
+              description = "The operation to perform. Possible values: " + JCR_INSERT + " or " + JCR_GET_BY_ID,
+              javaType = "String", defaultValue = JCR_INSERT)
+    public static final String JCR_OPERATION = "CamelJcrOperation";
+    @Metadata(label = "producer", description = "The node type of the target node", javaType = "String")
     public static final String JCR_NODE_TYPE = "CamelJcrNodeType";
 
     private JcrConstants() {
diff --git a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
index b3a5d01..39e661d 100644
--- a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
+++ b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrEndpoint.java
@@ -41,7 +41,7 @@ import org.apache.camel.util.StringHelper;
  */
 @UriEndpoint(firstVersion = "1.3.0", scheme = "jcr", title = "JCR", syntax = "jcr:host/base",
              alternativeSyntax = "jcr:username:password@host/base",
-             category = { Category.DATABASE, Category.CMS })
+             category = { Category.DATABASE, Category.CMS }, headersClass = JcrConstants.class)
 public class JcrEndpoint extends DefaultEndpoint {
 
     private Credentials credentials;