This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new bdcfe49609e5 CAMEL-23579: camel-pdf - align Exchange header constant
names with Camel naming convention (#23437)
bdcfe49609e5 is described below
commit bdcfe49609e532ca9e1730579b846f8a349851ad
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri May 22 18:33:06 2026 +0200
CAMEL-23579: camel-pdf - align Exchange header constant names with Camel
naming convention (#23437)
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 <[email protected]>
---
.../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_21.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 a42d6fc389a1..19225769cd7c 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 a42d6fc389a1..19225769cd7c 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 a4258f3605f0..a74241c7ac86 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 {
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.""",
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
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.""",
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
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].
*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_21.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
index 22f8f222fd45..04c5d7ec96b1 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
@@ -1060,6 +1060,36 @@ The generated Endpoint DSL header accessors on each
component's
`openstackOperation()`, `password()` -> `openstackKeystonePassword()`,
`adminPassword()` -> `openstackNovaAdminPassword()`, etc.).
+=== camel-pdf
+
+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()`
+
=== Jackson dataformat documentation pages renamed
The Jackson 2.x and Jackson 3.x lines ship the same dataformat names
(`jackson`, `jacksonXml`,
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) {