You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/06/25 09:42:53 UTC
[PR] CAMEL-23456: camel-docling - extract document title and type metadata in EXTRACT_METADATA [camel]
oscerd opened a new pull request, #24245:
URL: https://github.com/apache/camel/pull/24245
## What
Fixes the `EXTRACT_METADATA` operation in `camel-docling` so it reliably populates the document **title** and **documentType** on the returned `DocumentMetadata`.
JIRA: https://issues.apache.org/jira/browse/CAMEL-23456
## Root cause
`DocumentMetadata` had **no** `title` or `documentType` fields at all, so the assertions in `MetadataExtractionIT` (lines 74-75) could not even compile and were left as `// TODO` comments. `DoclingProducer` never read these values from Docling's output. The component documentation already advertised `metadata.getTitle()` and the `CamelDoclingMetadataTitle` header, so this also closes a docs-vs-code gap.
## Changes
- **`DocumentMetadata`** — add `title` and `documentType` fields with getters/setters; include them in `toString()`.
- **`DoclingProducer`**:
- `extractTitle(...)` — uses the first text item that Docling labels as `DocItemLabel.TITLE` (the canonical document-title representation in `DoclingDocument`).
- `deriveDocumentType(...)` — derives a short type (e.g. `PDF`) from the origin's file extension, falling back to the MIME subtype.
- Both are wired into the docling-serve API path (`extractMetadataUsingApi`) and the CLI path (`parseMetadataFromJson`), and exposed as the `CamelDoclingMetadataTitle` / `CamelDoclingMetadataDocumentType` headers.
- **`DoclingHeaders`** — add `METADATA_TITLE` (`METADATA_DOCUMENT_TYPE` already existed but was never populated).
- **`MetadataExtractionIT`** — enable the previously-disabled `title` / `documentType` assertions.
- **Docs** — fix the metadata example (it referenced non-existent `getAuthor()`/`getCreationDate()`) to show the now-working `documentType`; add a `camel-docling` note to the 4.21 upgrade guide.
- Regenerated `docling.json` (component + catalog copy).
The scope is intentionally limited to `title` and `documentType` per the issue — `author`/`creationDate`/`language` are out of scope.
## Testing
- `camel-docling` module unit tests pass (49 run, 0 failures).
- `MetadataExtractionIT` is a container-based integration test (`@DisabledIfSystemProperty ci.env.name`), so it does not run on GitHub Actions and must be run locally against a `docling-serve` instance. The test PDF (`multi_page.pdf`) begins with "The Evolution of the Word Processor", which Docling surfaces as the `TITLE`-labelled item, and its `.pdf` extension yields `PDF`.
---
_Claude Code on behalf of Andrea Cosentino._
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23456: camel-docling - extract document title and type metadata in EXTRACT_METADATA [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24245:
URL: https://github.com/apache/camel/pull/24245#issuecomment-4799028954
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `catalog/camel-catalog`
- `components/camel-ai/camel-docling`
- `docs`
- `dsl/camel-endpointdsl`
:warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
- `components/camel-ai/camel-docling`: 6 test(s) disabled on GitHub Actions
<details><summary>All tested modules (10 modules)</summary>
- Camel :: AI :: Docling
- Camel :: Catalog :: Camel Catalog
- Camel :: Endpoint DSL
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: Launcher :: Container
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/28167968100)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23456: camel-docling - extract document title and type metadata in EXTRACT_METADATA [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #24245:
URL: https://github.com/apache/camel/pull/24245
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23456: camel-docling - extract document title and type metadata in EXTRACT_METADATA [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #24245:
URL: https://github.com/apache/camel/pull/24245#issuecomment-4798109298
There are uncommitted changes
HEAD detached at pull/24245/merge
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DoclingEndpointBuilderFactory.java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23456: camel-docling - extract document title and type metadata in EXTRACT_METADATA [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24245:
URL: https://github.com/apache/camel/pull/24245#issuecomment-4797885732
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org