Sign inSign up

pleosoft/cmd-transformer

By pleosoft

Updated over 1 year ago

Command-Line transformation engine - no Java implementation required. Alfresco ready!

Image
0

205

pleosoft/cmd-transformer repository overview

Command-Line T-Engine

Overview

The Command-Line T-Engine is a flexible transformation engine designed to execute command-line tools for document, image, or media transformations. It follows the Alfresco T-Engines specification, enabling seamless integration with Alfresco or the Pleodox rendition & transformation server.

This docker image is distributed as a native application.

If you need a Windows native image please reach at [email protected].

Key Features

Generic Execution Framework
  • Allows defining transformation commands dynamically via configuration.
  • Supports any CLI-based transformation tool (e.g., LibreOffice, ImageMagick, FFmpeg, ExifTool).
Configurable Execution
  • Users provide a JSON-based engine configuration (similar to Alfresco T-Engines).
  • Each transformation is mapped to a command with error handling and custom options.
Docker-Based Modularity
  • A base Docker image (docker.pleosoft.com/pleosoft/cmd-transformer:version) provides the core functionality.

  • Users can extend the base image by:

    • Installing additional CLI tools via apt-get.
    • Copying custom configuration files into the image.
Alfresco & Rendition Server Integration
  • Provides a Swagger API for external access exposed at /swagger-ui/index.html (POST /transform, GET /transform/config, GET /version)
  • Can be used as a transformation engine in Alfresco or with the Pleodox rendition server.
Multi-Step Transformations (User-Defined pipelines)
  • While the engine does not natively handle inter-format transformations, users can define multi-step pipelines using command chaining or scripts.
  • Example: Convert a .docx to .pdf and then extract text.

Usage

Extend the Base Image github example

Create a Dockerfile:

FROM docker.pleosoft.com/pleosoft/cmd-transformer:XXX

COPY engine_config.json /workspace/engine_config.json
COPY exiftool-cmd.spel /workspace/exiftool-cmd.spel
COPY exiftool-options.spel /workspace/exiftool-options.spel
COPY application.yaml /workspace/application.yaml

ENV SPRING_CONFIG_ADDITIONAL_LOCATION=/workspace/

USER root

RUN apt-get update && \
    apt-get install -y libimage-exiftool-perl && \
    apt-get clean

EXPOSE 8181

Build and run the container.

docker build -t cmd-transformer:XXX-exiftool .
application properties

it is possible to run the application with multiple command line tools in a single instance

application.yaml:

transformserver:
  providers: 
    exif: /workspace/exif
    ghostscript: /workspace/ghostscript
    ...

each folder should contain at least

  • engine_config.json
  • TRANSFORMERNAME-cmd.spel
  • TRANSFORMER-options.spel

you are free to include in your container image anything else that fits your use case.

Define the Engine Configuration

engine_config.json:

{
  "transformers": [
    {
      "transformerName": "exiftool",
      "supportedSourceAndTargetList": [
        {"sourceMediaType": "application/pdf",  "targetMediaType": "alfresco-metadata-extract" }
      ]
    }
  ]
}
Define the command

command and options are implemented as SPEL

exiftool-cmd.spel:

{
	commandsAndArguments = {'*': {'exiftool', '${source}', 'SPLIT:${options}', '-args', '-G1', '-S', '-struct', '-j', '-W+!', '${target}'}},
	errorCodes = '1,2,3'
}
Define request options

exiftool-options.spel:

{
}

a more advanced example checking request options (only if the engine is configured with those transform options)

{
  #options['exifWidth'] != null ? '--width='+#options['exifWidth'] : null,
  #options['exifHeight'] != null ? '--width2='+#options['exifHeight'] : null
}

License

This software is provided free of charge for use, but without any warranty. It is built as a native image on top of Spring Framework libraries and Spring Boot. The software includes no third-party software except for Spring Framework libraries, OpenTelemetry/Micrometer, and proprietary code developed by Pleo Soft d.o.o.

The source code for the Docker image (non-native images) and Windows executables is available to customers upon request. The binaries are distributed under an unlockable source code license, allowing free usage with limitations on access to the source code.

Tag summary

Content type

Image

Digest

sha256:ea28cb509

Size

134.6 MB

Last updated

over 1 year ago

docker pull pleosoft/cmd-transformer:1.0.0