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/16 19:12:53 UTC

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

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 b90dabb4a17ec66388b0041271fc9e2cce6f6666
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue Mar 15 12:08:29 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-atlasmap
---
 .../resources/org/apache/camel/component/atlasmap/atlasmap.json   | 5 +++++
 components/camel-atlasmap/src/main/docs/atlasmap-component.adoc   | 3 +++
 .../org/apache/camel/component/atlasmap/AtlasMapConstants.java    | 8 ++++++++
 .../org/apache/camel/component/atlasmap/AtlasMapEndpoint.java     | 2 +-
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/components/camel-atlasmap/src/generated/resources/org/apache/camel/component/atlasmap/atlasmap.json b/components/camel-atlasmap/src/generated/resources/org/apache/camel/component/atlasmap/atlasmap.json
index bc0e07a..6ffd2614 100644
--- a/components/camel-atlasmap/src/generated/resources/org/apache/camel/component/atlasmap/atlasmap.json
+++ b/components/camel-atlasmap/src/generated/resources/org/apache/camel/component/atlasmap/atlasmap.json
@@ -27,6 +27,11 @@
     "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 [...]
     "propertiesFile": { "kind": "property", "displayName": "Properties File", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The URI of the properties file which is used for AtlasContextFactory initialization." }
   },
+  "headers": {
+    "CamelAtlasResourceUri": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The new resource URI to use." },
+    "CamelAtlasMapping": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Atlas mapping to use." },
+    "Content-Type": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The content type that is set according to the datasource (json or xml)." }
+  },
   "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-atlasmap/src/main/docs/atlasmap-component.adoc b/components/camel-atlasmap/src/main/docs/atlasmap-component.adoc
index f44ce2b..29ddf9b 100644
--- a/components/camel-atlasmap/src/main/docs/atlasmap-component.adoc
+++ b/components/camel-atlasmap/src/main/docs/atlasmap-component.adoc
@@ -66,6 +66,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Examples
 
diff --git a/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapConstants.java b/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapConstants.java
index c948fb6..5537cdb 100644
--- a/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapConstants.java
+++ b/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapConstants.java
@@ -16,15 +16,23 @@
  */
 package org.apache.camel.component.atlasmap;
 
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.Metadata;
+
 /**
  * AtlasMap Constants.
  */
 public final class AtlasMapConstants {
 
+    @Metadata(description = "The new resource URI to use.", javaType = "java.lang.String")
     public static final String ATLAS_RESOURCE_URI = "CamelAtlasResourceUri";
+    @Metadata(description = "The Atlas mapping to use.", javaType = "java.lang.String")
     public static final String ATLAS_MAPPING = "CamelAtlasMapping";
     public static final String ATLAS_SOURCE_MAP = "CamelAtlasSourceMap";
     public static final String ATLAS_TARGET_MAP = "CamelAtlasTargetMap";
+    @Metadata(description = "The content type that is set according to the datasource (json or xml).",
+              javaType = "java.lang.String")
+    public static final String CONTENT_TYPE = Exchange.CONTENT_TYPE;
 
     private AtlasMapConstants() {
     }
diff --git a/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapEndpoint.java b/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapEndpoint.java
index 92be69d..bbc84a9 100644
--- a/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapEndpoint.java
+++ b/components/camel-atlasmap/src/main/java/org/apache/camel/component/atlasmap/AtlasMapEndpoint.java
@@ -49,7 +49,7 @@ import static io.atlasmap.api.AtlasContextFactory.Format.JSON;
  * Transforms the message using an AtlasMap transformation.
  */
 @UriEndpoint(firstVersion = "3.7.0", scheme = "atlasmap", title = "AtlasMap", syntax = "atlasmap:resourceUri",
-             producerOnly = true, category = { Category.TRANSFORMATION })
+             producerOnly = true, category = { Category.TRANSFORMATION }, headersClass = AtlasMapConstants.class)
 public class AtlasMapEndpoint extends ResourceEndpoint {
 
     public static final String CONTENT_TYPE_JSON = "application/json";