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 b375be693508b2d11a1e1e7b6f229b12f2221d67 Author: Nicolas Filotto <[email protected]> AuthorDate: Mon Apr 4 12:48:10 2022 +0200 CAMEL-17792: Add doc about the message headers of camel-pdf --- .../org/apache/camel/component/pdf/pdf.json | 5 +++++ .../camel-pdf/src/main/docs/pdf-component.adoc | 23 +++------------------- .../apache/camel/component/pdf/PdfEndpoint.java | 3 ++- .../camel/component/pdf/PdfHeaderConstants.java | 18 +++++++++++++++++ 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/components/camel-pdf/src/generated/resources/org/apache/camel/component/pdf/pdf.json b/components/camel-pdf/src/generated/resources/org/apache/camel/component/pdf/pdf.json index e0d85d8b0a2..2bed8c0cf41 100644 --- a/components/camel-pdf/src/generated/resources/org/apache/camel/component/pdf/pdf.json +++ b/components/camel-pdf/src/generated/resources/org/apache/camel/component/pdf/pdf.json @@ -25,6 +25,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": { + "protection-policy": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/ProtectionPolicy.htmlProtectionPolicy. If specified then PDF document will be encrypted with it." }, + "pdf-document": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.PDDocument", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Mandatory header for append operation and ignored in all other operations. Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/PDDocument.htmlPDDocument. Stores PDF document which wil [...] + "decryption-material": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/DecryptionMaterial.htmlDecryptionMaterial. Mandatory header if PDF document is encrypted." } + }, "properties": { "operation": { "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.pdf.PdfOperation", "enum": [ "create", "append", "extractText" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pdf.PdfConfiguration", "configurationField": "pdfConfiguration", "description": "Operation type" }, "font": { "kind": "parameter", "displayName": "Font", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol", "ZapfDingbats" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Helveti [...] diff --git a/components/camel-pdf/src/main/docs/pdf-component.adoc b/components/camel-pdf/src/main/docs/pdf-component.adoc index c1821c8652c..14129dfa63a 100644 --- a/components/camel-pdf/src/main/docs/pdf-component.adoc +++ b/components/camel-pdf/src/main/docs/pdf-component.adoc @@ -54,26 +54,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: END - -== Headers -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Header |Description - -|`pdf-document` |*Mandatory* header for `append` operation and ignored in all other -operations. Expected type is -https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/PDDocument.html[PDDocument]. -Stores PDF document which will be used for append operation. - -|`protection-policy` |Expected type is -https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/ProtectionPolicy.html[ProtectionPolicy]. -If specified then PDF document will be encrypted with it. - -|`decryption-material` |Expected type is -https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial]. -*Mandatory* header if PDF document is encrypted. -|======================================================================= - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END include::spring-boot:partial$starter.adoc[] diff --git a/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfEndpoint.java b/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfEndpoint.java index a46b39d14fd..b9c727e96f3 100644 --- a/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfEndpoint.java +++ b/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfEndpoint.java @@ -29,7 +29,8 @@ import org.apache.camel.support.DefaultEndpoint; * Create, modify or extract content from PDF documents. */ @UriEndpoint(firstVersion = "2.16.0", scheme = "pdf", title = "PDF", syntax = "pdf:operation", producerOnly = true, - category = { Category.DOCUMENT, Category.TRANSFORMATION, Category.PRINTING }) + category = { Category.DOCUMENT, Category.TRANSFORMATION, Category.PRINTING }, + headersClass = PdfHeaderConstants.class) public class PdfEndpoint extends DefaultEndpoint { @UriParam diff --git a/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfHeaderConstants.java b/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfHeaderConstants.java index e4bf7361f90..25dfc3dbb53 100644 --- a/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfHeaderConstants.java +++ b/components/camel-pdf/src/main/java/org/apache/camel/component/pdf/PdfHeaderConstants.java @@ -16,9 +16,27 @@ */ package org.apache.camel.component.pdf; +import org.apache.camel.spi.Metadata; + public final class PdfHeaderConstants { + @Metadata(description = "Expected type is\n" + + "https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/ProtectionPolicy.html[ProtectionPolicy].\n" + + + "If specified then PDF document will be encrypted with it.", + javaType = "org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy") public static final String PROTECTION_POLICY_HEADER_NAME = "protection-policy"; + @Metadata(description = "*Mandatory* header for `append` operation and ignored in all other\n" + + "operations. Expected type is\n" + + "https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/PDDocument.html[PDDocument].\n" + + + "Stores PDF document which will be used for append operation.", + javaType = "org.apache.pdfbox.pdmodel.PDDocument") public static final String PDF_DOCUMENT_HEADER_NAME = "pdf-document"; + @Metadata(description = "Expected type is\n" + + "https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].\n" + + + "*Mandatory* header if PDF document is encrypted.", + javaType = "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial") public static final String DECRYPTION_MATERIAL_HEADER_NAME = "decryption-material"; private PdfHeaderConstants() {
