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/04/01 16:46:42 UTC

[camel] 07/11: CAMEL-17792: Add doc about the message headers of camel-oaipmh

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 38f408e755877fd30bb90ebefb05ff67d7f9e7b7
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Fri Apr 1 15:36:07 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-oaipmh
---
 .../resources/org/apache/camel/oaipmh/component/oaipmh.json  |  3 +++
 components/camel-oaipmh/src/main/docs/oaipmh-component.adoc  | 12 +++---------
 .../org/apache/camel/oaipmh/component/OAIPMHEndpoint.java    |  3 ++-
 .../apache/camel/oaipmh/component/model/OAIPMHConstants.java |  5 +++++
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/components/camel-oaipmh/src/generated/resources/org/apache/camel/oaipmh/component/oaipmh.json b/components/camel-oaipmh/src/generated/resources/org/apache/camel/oaipmh/component/oaipmh.json
index c97eac5..dfbabaa 100644
--- a/components/camel-oaipmh/src/generated/resources/org/apache/camel/oaipmh/component/oaipmh.json
+++ b/components/camel-oaipmh/src/generated/resources/org/apache/camel/oaipmh/component/oaipmh.json
@@ -26,6 +26,9 @@
     "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": {
+    "CamelOaimphResumptionToken": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "This header is obtained when onlyFirst option is enable. Return resumption token of the request when data is still available." }
+  },
   "properties": {
     "baseUrl": { "kind": "path", "displayName": "Base Url", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Base URL of the repository to which the request is made through the OAI-PMH protocol" },
     "from": { "kind": "parameter", "displayName": "From", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Specifies a lower bound for datestamp-based selective harvesting. UTC DateTime value" },
diff --git a/components/camel-oaipmh/src/main/docs/oaipmh-component.adoc b/components/camel-oaipmh/src/main/docs/oaipmh-component.adoc
index f551dd9..cf194cd 100644
--- a/components/camel-oaipmh/src/main/docs/oaipmh-component.adoc
+++ b/components/camel-oaipmh/src/main/docs/oaipmh-component.adoc
@@ -48,17 +48,11 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 
-
-== Message Headers
-
-[width="100%",cols="20%,80%",options="header",]
-|=======================================================================
-|Name |Description
-|`CamelOaimphResumptionToken` | This header is obtained when onlyFirst option is enable. Return resumptiontoken of the request when data is still available.
-|=======================================================================
-
 == Usage
 
 The OAIPMH component supports both consumer and producer endpoints.
diff --git a/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/OAIPMHEndpoint.java b/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/OAIPMHEndpoint.java
index a11fbe1..0381e62 100644
--- a/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/OAIPMHEndpoint.java
+++ b/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/OAIPMHEndpoint.java
@@ -23,6 +23,7 @@ import org.apache.camel.Category;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.oaipmh.component.model.OAIPMHConstants;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
@@ -35,7 +36,7 @@ import org.joda.time.format.ISODateTimeFormat;
  * Harvest metadata using OAI-PMH protocol
  */
 @UriEndpoint(firstVersion = "3.5.0", scheme = "oaipmh", title = "OAI-PMH", syntax = "oaipmh:baseUrl", lenientProperties = true,
-             category = { Category.ENDPOINT, Category.WEBSERVICE, Category.BATCH })
+             category = { Category.ENDPOINT, Category.WEBSERVICE, Category.BATCH }, headersClass = OAIPMHConstants.class)
 public class OAIPMHEndpoint extends ScheduledPollEndpoint {
 
     private transient URI url;
diff --git a/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/model/OAIPMHConstants.java b/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/model/OAIPMHConstants.java
index 4a18307..6aac8ff 100644
--- a/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/model/OAIPMHConstants.java
+++ b/components/camel-oaipmh/src/main/java/org/apache/camel/oaipmh/component/model/OAIPMHConstants.java
@@ -16,7 +16,12 @@
  */
 package org.apache.camel.oaipmh.component.model;
 
+import org.apache.camel.spi.Metadata;
+
 public final class OAIPMHConstants {
+    @Metadata(label = "producer", description = "This header is obtained when onlyFirst option is enable. " +
+                                                "Return resumption token of the request when data is still available.",
+              javaType = "String")
     public static final String RESUMPTION_TOKEN = "CamelOaimphResumptionToken";
     public static final String URL = "CamelOaimphUrl";
     public static final String ENDPOINT_URL = "CamelOaimphEndpointUrl";