This program is a Go-based tool for processing and packaging Alfresco XML model files extracted from an existing Alfresco Addon into a JAR format. It extracts valid Alfresco content models from a ZIP archive, generates required module configuration files, and creates a JAR package with the desired structure.
Use this tool when upgrading an Alfresco installation that no longer supports a specific Alfresco Addon but still requires its Custom Content Model. Since existing content depends on this model, the Alfresco Model Extractor enables you to extract only the necessary Custom Content Model files from the original Addon and package them into a new Addon (JAR file) compatible with the upgraded Alfresco installation.
- Extracts Alfresco Models: Scans a JAR/AMP file containing an Alfresco Addon for Alfresco XML content models.
- Modular Packaging: Packages models into a JAR file for easy deployment in Alfresco.
- Auto-Configuration: Generates
module.properties
andmodule-context.xml
files.
Download the appropriate binary for your OS and architecture from Releases:
- macOS with Intel:
alfresco-model-extractor_darwin_amd64
- macOS with Silicon:
alfresco-model-extractor_darwin_arm64
- Linux:
alfresco-model-extractor_linux_amd64
- Windows:
alfresco-model-extractor_windows_amd64.exe
Each version is precompiled for the latest supported Go version.
On macOS and Linux, you may need to make the binary executable:
chmod +x alfresco-model-extractor
-zip
(required): Path to the input Alfresco Addon file containing Alfresco models.-output
(optional): Name of the output JAR file. Default ismodels.jar
.
Open a terminal (or Command Prompt on Windows) and navigate to the binary's folder. Run the program with the necessary arguments:
./alfresco-model-extractor -zip path/to/your-models.amp -output my-models.jar
Replace path/to/your-models.amp
with the path to your Alfresco Addon file (AMP and JAR formats accepted) and specify your desired output JAR file name.
For instance, on macOS:
./alfresco-model-extractor_darwin_amd64 -zip original-addon.jar -output original-addon-models.jar
This will create original-addon-models
containing only the Custom Content Model files needed for your updated Alfresco installation.
A namespace prefix is not registered - Simple OCR describes the scenario this program is designed for.
-
Download the original repository addon that is not being deployed on the updated Alfresco installation from the original GitHub project: https://github.com/keensoft/alfresco-simple-ocr/releases/tag/2.3.1
-
Download the the appropriate Alfresco Model Extractor binary for your OS
-
Use the program to create the new Alfresco Addon as JAR
./alfresco-model-extractor -zip simple-ocr-repo-2.3.1.jar -output simple-ocr-repo-models-2.3.1.jar
- Apply
simple-ocr-repo-models-2.3.1.jar
to the upgraded Alfresco deployment
- Go 1.17+ installed on your system.
To use the program, run the following command:
go run main.go -zip path/to/your-models.zip -output my-models.jar
This will generate a JAR file with the following structure:
my-models.jar
└── alfresco/
└── module/
└── <module_name>/
├── module.properties
├── module-context.xml
└── model/
└── <your-model-files>.xml
Clone the repository and install dependencies:
git clone https://github.com/yourusername/alfresco-model-extractor.git
cd alfresco-model-extractor
go mod download
To compile the program, run:
go build -o alfresco-model-extractor main.go
This will create an executable named alfresco-model-extractor
in your directory.