A common requirement in Alfresco Transform is to change the mapping of out-of-the-box properties, such as mapping the created property to a custom property (e.g., cm:removeAfter) instead of the default cm:created (which is auditable and therefore not updatable) for a PDF file. This can be achieved by modifying the metadata extractor configuration files. These configuration files are found in the following locations:
To map the created property to the content model property cm:removeAfter for PDF files, redefine the PdfBoxMetadataExtractor_metadata_extract.properties configuration as follows:
# Namespaces
namespace.prefix.cm=http://www.alfresco.org/model/content/1.0
# Mappings
author=cm:author
title=cm:title
created=cm:removeAfter
modified=cm:modified- Namespace Specification: All namespaces that the content model properties belong to must be specified, just like the sample from the documentation, using the ACME model (
namespace.prefix.acme=http://www.acme.org/model/content/1.0) - Case Sensitivity: Property names are case-sensitive.
Additional instructions can be found in the Metadata Extractors Documentation.
This project includes a sample Dockerfile that applies the above configuration to the Docker Image alfresco-transform-core-aio. The Docker image can be built locally and used in a Docker Compose deployment.
-
Build the Docker Image:
docker build -t custom-transform-core-aio . -
Run the Docker Image:
docker run -p 8090:8090 custom-transform-core-aio
You can also include this custom image in a Docker Compose file for a complete deployment.
Below is an example compose.yaml file:
services:
transform-core-aio:
build:
context: ./transform
ports:
- "8090:8090"Include this Dockerfile in a folder transform on the same folder the compose.yaml file is living.
Deploy the stack using Docker Compose:
docker compose upThis setup ensures that your custom metadata mappings are applied correctly within the Alfresco Transform service.