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 845186c60ac949f72638a104be65d54a09cb5ba5
Author: Nicolas Filotto <[email protected]>
AuthorDate: Thu Mar 17 12:30:13 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-chunk
---
 .../resources/org/apache/camel/component/chunk/chunk.json    |  4 ++++
 components/camel-chunk/src/main/docs/chunk-component.adoc    | 12 +++---------
 .../org/apache/camel/component/chunk/ChunkConstants.java     |  4 ++++
 .../java/org/apache/camel/component/chunk/ChunkEndpoint.java |  2 +-
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/components/camel-chunk/src/generated/resources/org/apache/camel/component/chunk/chunk.json
 
b/components/camel-chunk/src/generated/resources/org/apache/camel/component/chunk/chunk.json
index e67c821..bd036e9 100644
--- 
a/components/camel-chunk/src/generated/resources/org/apache/camel/component/chunk/chunk.json
+++ 
b/components/camel-chunk/src/generated/resources/org/apache/camel/component/chunk/chunk.json
@@ -27,6 +27,10 @@
     "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": {
+    "ChunkResourceUri": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "A URI for the template resource to use instead of the endpoint 
configured." },
+    "ChunkTemplate": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The template to use instead of the endpoint configured." }
+  },
   "properties": {
     "resourceUri": { "kind": "path", "displayName": "Resource Uri", "group": 
"producer", "label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Path to the resource. You can prefix 
with: classpath, file, http, ref, or bean. classpath, file and http loads the 
resource using these protocols (classpath is default). ref will lookup the 
resource in the registry. bean will [...]
     "allowContextMapAll": { "kind": "parameter", "displayName": "Allow Context 
Map All", "group": "producer", "label": "", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Sets whether the 
context map should allow access to all details. By default only the message 
body and headers can be accessed. This option can be enabled for full access to 
the current Exchange and CamelContext. [...]
diff --git a/components/camel-chunk/src/main/docs/chunk-component.adoc 
b/components/camel-chunk/src/main/docs/chunk-component.adoc
index a18c9e9..8f4c5de 100644
--- a/components/camel-chunk/src/main/docs/chunk-component.adoc
+++ b/components/camel-chunk/src/main/docs/chunk-component.adoc
@@ -83,15 +83,9 @@ location for a template or the template content itself. If 
any of these
 headers is set then Camel uses this over the endpoint configured
 resource. This allows you to provide a dynamic template at runtime.
 
-[width="100%",cols="20%,10%,10%,60%",options="header",]
-|=======================================================================
-|Header |Type |Description |Support Version
-
-|ChunkConstants.CHUNK_RESOURCE_URI |String |A URI for the template resource to 
use instead of the endpoint
-configured. |
-
-|ChunkConstants.CHUNK_TEMPLATE |String |The template to use instead of the 
endpoint configured. |
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Samples
 
diff --git 
a/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkConstants.java
 
b/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkConstants.java
index b58053e..f55b8c7 100644
--- 
a/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkConstants.java
+++ 
b/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkConstants.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.chunk;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Chunk component constants
  */
@@ -24,11 +26,13 @@ public final class ChunkConstants {
     /**
      * Header containing a Chunk template location
      */
+    @Metadata(description = "A URI for the template resource to use instead of 
the endpoint configured.", javaType = "String")
     public static final String CHUNK_RESOURCE_URI = "ChunkResourceUri";
 
     /**
      * Header containing the Chunk template code
      */
+    @Metadata(description = "The template to use instead of the endpoint 
configured.", javaType = "String")
     public static final String CHUNK_TEMPLATE = "ChunkTemplate";
 
     /**
diff --git 
a/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkEndpoint.java
 
b/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkEndpoint.java
index 2c2a24d..f8ad1e0 100644
--- 
a/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkEndpoint.java
+++ 
b/components/camel-chunk/src/main/java/org/apache/camel/component/chunk/ChunkEndpoint.java
@@ -45,7 +45,7 @@ import static 
org.apache.camel.component.chunk.ChunkConstants.CHUNK_TEMPLATE;
  * Transform messages using Chunk templating engine.
  */
 @UriEndpoint(firstVersion = "2.15.0", scheme = "chunk", title = "Chunk", 
syntax = "chunk:resourceUri", producerOnly = true,
-             category = { Category.TRANSFORMATION })
+             category = { Category.TRANSFORMATION }, headersClass = 
ChunkConstants.class)
 public class ChunkEndpoint extends ResourceEndpoint {
 
     private Theme theme;

Reply via email to