You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2026/05/28 15:00:53 UTC

(camel) branch camel-4.14.x updated: CAMEL-23579: camel-pdf - align Exchange header constant names with Camel naming convention (#23437) (#23561)

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

oscerd pushed a commit to branch camel-4.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.14.x by this push:
     new db18d90d0941 CAMEL-23579: camel-pdf - align Exchange header constant names with Camel naming convention (#23437) (#23561)
db18d90d0941 is described below

commit db18d90d094141e9f0a575286e323947b629e2e2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu May 28 17:00:45 2026 +0200

    CAMEL-23579: camel-pdf - align Exchange header constant names with Camel naming convention (#23437) (#23561)
    
    Renames the Exchange header string values in PdfHeaderConstants from non-Camel
    prefixed values (protection-policy, pdf-document, decryption-material,
    files-to-merge) to CamelPdf<Name>, following the convention used across the
    rest of the Camel component catalog and matching the pattern established in
    CAMEL-23526 (camel-cxf), CAMEL-23522 (camel-mail), CAMEL-23461
    (camel-aws-bedrock), CAMEL-23532 (camel-vertx-websocket /
    camel-atmosphere-websocket / camel-iggy), and CAMEL-23576 (camel-jira).
    
    The Java field names (PROTECTION_POLICY_HEADER_NAME, PDF_DOCUMENT_HEADER_NAME,
    DECRYPTION_MATERIAL_HEADER_NAME, FILES_TO_MERGE_HEADER_NAME) are unchanged
    so routes referencing the constants symbolically continue to work; routes
    using the literal string values must be updated (documented in the 4.21
    upgrade guide).
    
    The generated Endpoint DSL header accessors on PdfHeaderNameBuilder have
    been renamed accordingly:
    - protectionPolicy() -> pdfProtectionPolicy()
    - decryptionMaterial() -> pdfDecryptionMaterial()
    - filesToMerge() -> pdfFilesToMerge()
    - pdfDocument() unchanged in name but returns "CamelPdfDocument"
    
    All existing tests use symbolic constant references and continue to pass
    without changes.
    
    Tracker: CAMEL-23577
    
    Reported by Claude Code on behalf of Andrea Cosentino
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../org/apache/camel/catalog/components/pdf.json   |  8 +++---
 .../org/apache/camel/component/pdf/pdf.json        |  8 +++---
 .../camel/component/pdf/PdfHeaderConstants.java    |  8 +++---
 .../ROOT/pages/camel-4x-upgrade-guide-4_14.adoc    | 30 ++++++++++++++++++++++
 .../endpoint/dsl/PdfEndpointBuilderFactory.java    | 22 ++++++++--------
 5 files changed, 53 insertions(+), 23 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pdf.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pdf.json
index a59060ea06ef..6a29ab139fd9 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pdf.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pdf.json
@@ -28,10 +28,10 @@
     "autowiredEnabled": { "index": 1, "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 t [...]
   },
   "headers": {
-    "protection-policy": { "index": 0, "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 encrypt [...]
-    "pdf-document": { "index": 1, "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 docume [...]
-    "decryption-material": { "index": 2, "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 en [...]
-    "files-to-merge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.io.File>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Mandatory header for merge operation and ignored in all other operations. The array of pdf files that will be merged.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
+    "CamelPdfProtectionPolicy": { "index": 0, "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  [...]
+    "CamelPdfDocument": { "index": 1, "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 do [...]
+    "CamelPdfDecryptionMaterial": { "index": 2, "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 documen [...]
+    "CamelPdfFilesToMerge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.io.File>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Mandatory header for merge operation and ignored in all other operations. The array of pdf files that will be merged.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
   },
   "properties": {
     "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pdf.PdfOperation", "enum": [ "create", "append", "extractText", "merge" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pdf.PdfConfiguration", "configurationField": "pdfConfiguration", "description": "Operation type" },
diff --git a/components/camel-pdf/src/generated/resources/META-INF/org/apache/camel/component/pdf/pdf.json b/components/camel-pdf/src/generated/resources/META-INF/org/apache/camel/component/pdf/pdf.json
index a59060ea06ef..6a29ab139fd9 100644
--- a/components/camel-pdf/src/generated/resources/META-INF/org/apache/camel/component/pdf/pdf.json
+++ b/components/camel-pdf/src/generated/resources/META-INF/org/apache/camel/component/pdf/pdf.json
@@ -28,10 +28,10 @@
     "autowiredEnabled": { "index": 1, "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 t [...]
   },
   "headers": {
-    "protection-policy": { "index": 0, "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 encrypt [...]
-    "pdf-document": { "index": 1, "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 docume [...]
-    "decryption-material": { "index": 2, "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 en [...]
-    "files-to-merge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.io.File>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Mandatory header for merge operation and ignored in all other operations. The array of pdf files that will be merged.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
+    "CamelPdfProtectionPolicy": { "index": 0, "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  [...]
+    "CamelPdfDocument": { "index": 1, "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 do [...]
+    "CamelPdfDecryptionMaterial": { "index": 2, "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 documen [...]
+    "CamelPdfFilesToMerge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.io.File>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Mandatory header for merge operation and ignored in all other operations. The array of pdf files that will be merged.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
   },
   "properties": {
     "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.pdf.PdfOperation", "enum": [ "create", "append", "extractText", "merge" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pdf.PdfConfiguration", "configurationField": "pdfConfiguration", "description": "Operation type" },
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 037644939fae..500c7f42a0fb 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
@@ -24,20 +24,20 @@ public final class PdfHeaderConstants {
                             +
                             "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";
+    public static final String PROTECTION_POLICY_HEADER_NAME = "CamelPdfProtectionPolicy";
     @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";
+    public static final String PDF_DOCUMENT_HEADER_NAME = "CamelPdfDocument";
     @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";
+    public static final String DECRYPTION_MATERIAL_HEADER_NAME = "CamelPdfDecryptionMaterial";
 
     @Metadata(description = """
             *Mandatory* header for `merge` operation and ignored in all other
@@ -45,7 +45,7 @@ public final class PdfHeaderConstants {
             The array of pdf files that will be merged.
             """,
               javaType = "java.util.List<java.io.File>")
-    public static final String FILES_TO_MERGE_HEADER_NAME = "files-to-merge";
+    public static final String FILES_TO_MERGE_HEADER_NAME = "CamelPdfFilesToMerge";
 
     private PdfHeaderConstants() {
     }
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_14.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_14.adoc
index b3e3c195b2b3..9338092661f0 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_14.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_14.adoc
@@ -306,6 +306,36 @@ jmsComponent.setHeaderFilterStrategy(new ShiroFriendlyJmsHeaderFilterStrategy())
 
 A worked example is in `ShiroOverJmsTest` in the `camel-itest` module.
 
+=== camel-pdf - potential breaking change
+
+The Exchange header constants in `PdfHeaderConstants` have been renamed to
+follow the Camel naming convention used across the rest of the component
+catalog. The Java field names are unchanged; only the header string values
+have changed:
+
+[options="header"]
+|===
+| Constant | Previous value | New value
+| `PdfHeaderConstants.PROTECTION_POLICY_HEADER_NAME` | `protection-policy` | `CamelPdfProtectionPolicy`
+| `PdfHeaderConstants.PDF_DOCUMENT_HEADER_NAME` | `pdf-document` | `CamelPdfDocument`
+| `PdfHeaderConstants.DECRYPTION_MATERIAL_HEADER_NAME` | `decryption-material` | `CamelPdfDecryptionMaterial`
+| `PdfHeaderConstants.FILES_TO_MERGE_HEADER_NAME` | `files-to-merge` | `CamelPdfFilesToMerge`
+|===
+
+Routes that reference the constants symbolically (for example
+`setHeader(PdfHeaderConstants.PDF_DOCUMENT_HEADER_NAME, ...)`) continue to
+work without changes. Routes that set the header by its literal string value
+(for example `setHeader("pdf-document", ...)`) must be updated to use the
+new value (`setHeader("CamelPdfDocument", ...)`).
+
+As a consequence, the generated Endpoint DSL header accessors on
+`PdfHeaderNameBuilder` have been renamed accordingly:
+
+* `protectionPolicy()` -> `pdfProtectionPolicy()`
+* `pdfDocument()` -> `pdfDocument()` (unchanged in name, returns the new value)
+* `decryptionMaterial()` -> `pdfDecryptionMaterial()`
+* `filesToMerge()` -> `pdfFilesToMerge()`
+
 == Upgrading from 4.14.5 to 4.14.6
 
 === camel-platform-http-main
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PdfEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PdfEndpointBuilderFactory.java
index b65fa5b46fcd..bf9842483ba1 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PdfEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PdfEndpointBuilderFactory.java
@@ -409,10 +409,10 @@ public interface PdfEndpointBuilderFactory {
          * 
          * Group: producer
          * 
-         * @return the name of the header {@code protection-policy}.
+         * @return the name of the header {@code PdfProtectionPolicy}.
          */
-        public String protectionPolicy() {
-            return "protection-policy";
+        public String pdfProtectionPolicy() {
+            return "CamelPdfProtectionPolicy";
         }
         /**
          * Mandatory header for append operation and ignored in all other
@@ -423,10 +423,10 @@ public interface PdfEndpointBuilderFactory {
          * 
          * Group: producer
          * 
-         * @return the name of the header {@code pdf-document}.
+         * @return the name of the header {@code PdfDocument}.
          */
         public String pdfDocument() {
-            return "pdf-document";
+            return "CamelPdfDocument";
         }
         /**
          * Expected type is
@@ -437,10 +437,10 @@ public interface PdfEndpointBuilderFactory {
          * 
          * Group: producer
          * 
-         * @return the name of the header {@code decryption-material}.
+         * @return the name of the header {@code PdfDecryptionMaterial}.
          */
-        public String decryptionMaterial() {
-            return "decryption-material";
+        public String pdfDecryptionMaterial() {
+            return "CamelPdfDecryptionMaterial";
         }
         /**
          * Mandatory header for merge operation and ignored in all other
@@ -450,10 +450,10 @@ public interface PdfEndpointBuilderFactory {
          * 
          * Group: producer
          * 
-         * @return the name of the header {@code files-to-merge}.
+         * @return the name of the header {@code PdfFilesToMerge}.
          */
-        public String filesToMerge() {
-            return "files-to-merge";
+        public String pdfFilesToMerge() {
+            return "CamelPdfFilesToMerge";
         }
     }
     static PdfEndpointBuilder endpointBuilder(String componentName, String path) {