Easily installing new Oxygen publishing engines in linux
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
			- 
				chrispitude
 - Posts: 922
 - Joined: Thu May 02, 2019 2:32 pm
 
Easily installing new Oxygen publishing engines in linux
Post by chrispitude »
Hi everyone,
We use the Oxygen publishing engine in a linux environment to create our final production-ready PDFs. I thought I'd share the linux script that I use to download and configure the publishing engine:
This script does the following:
Here's what the working directory looks like before the script is run:
Here's what it looks like the script is run:
You can use this script to install multiple build versions, then manually adjust the no-build-number filesystem link to point to whichever version you like.
			
			
									
									
						We use the Oxygen publishing engine in a linux environment to create our final production-ready PDFs. I thought I'd share the linux script that I use to download and configure the publishing engine:
Code: Select all
#!/bin/bash
rm -rf oxygen-publishing-engine-3.x
OXY=`realpath oxygen-publishing-engine-3.x`
REPO=/u/doc/git/dita-git-repo
# external named URLs do not resolve in our internal network environment
wget http://89.36.26.124/InstData/PublishingEngine/oxygen-publishing-engine-3.x.zip
# uncompress the publishing engine
unzip -q ./oxygen-publishing-engine-*.zip
rm ./oxygen-publishing-engine-*.zip
# install the license key
cp ./licensekey.txt ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry
# install our company plugins
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN1 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN2 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN3 ${OXY}/plugins/
${OXY}/bin/dita --install
# install the Windows fonts
rm -rf ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/fonts
ln -s `realpath ./fonts` ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/fonts
# rename by build number, then make a filesystem link
BUILD=`grep -P -o '(?<=build )(\d+)' oxygen-publishing-engine-3.x/DITA-OT.README_OXYGEN.txt`
rm -rf ./oxygen-publishing-engine-3.x-${BUILD}
mv ./oxygen-publishing-engine-3.x ./oxygen-publishing-engine-3.x-${BUILD}
ln -s ./oxygen-publishing-engine-3.x-${BUILD} ./oxygen-publishing-engine-3.x- Downloads and decompresses the current version of the publishing engine.
 - Installs the "licensekey.txt" file located in the current directory.
 - Creates filesystem links to DITA-OT plugins stored in a Git repo directory.
 - Creates a filesystem link to an additional fonts directory.
 - Renames publishing engine directory by its build number, then creates a filesystem link to it without the build number.
 
Here's what the working directory looks like before the script is run:
Code: Select all
% ls -l
total 161516
     4 drwxrwxrwx 2 doc src      4096 Jan  5 04:37 fonts/
     4 -rw-rw-rw- 1 doc src       295 Jan  5 04:37 licensekey.txt
     4 -rwxrwxrwx 1 doc src      2263 Jan  5 05:10 update.sh*Code: Select all
% ls -l
total 161516
     4 drwxrwxrwx 2 doc src      4096 Jan  5 04:37 fonts/
     4 -rw-rw-rw- 1 doc src       295 Jan  5 04:37 licensekey.txt
     0 lrwxrwxrwx 1 doc src        41 Jan  5 05:11 oxygen-publishing-engine-3.x -> ./oxygen-publishing-engine-3.x-2020121802/
     4 drwxr-xr-x 7 doc src      4096 Dec 18 04:25 oxygen-publishing-engine-3.x-2020121802/
     4 -rwxrwxrwx 1 doc src      2263 Jan  5 05:10 update.sh*- 
				chrispitude
 - Posts: 922
 - Joined: Thu May 02, 2019 2:32 pm
 
Re: Easily installing new Oxygen publishing engines in linux
Post by chrispitude »
Here is an updated script that uses the current archive file naming convention (no more "-3.x" in the file name). It also fixes a bug with how the fonts/ filesystem link was created.
			
			
									
									
						Code: Select all
#!/bin/bash
# get the absolute on-disk path to where the archive will place the publishing engine
rm -rf ./oxygen-publishing-engine  # must remove before evaluating realpath
OXYPUB=$(realpath ./oxygen-publishing-engine)
# remove any leftover archives
rm -f ./oxygen-publishing-engine.zip*
# download the archive (current production release)
wget https://www.oxygenxml.com/InstData/PublishingEngine/oxygen-publishing-engine.zip --no-check-certificate
# make sure archive exists
if [ ! -f 'oxygen-publishing-engine.zip' ]; then
  echo "Could not download 'oxygen-publishing-engine.zip'."
  exit 1
fi
# uncompress the archive
unzip -q ./oxygen-publishing-engine.zip
rm -f ./oxygen-publishing-engine.zip*
# make sure uncompressed directory exists
if [ ! -d "${OXYPUB}" ]; then
  echo "Could not find '${OXYPUB}' directory."
  exit 1
fi
# install the license key
ln -s $(realpath ./licenses/licensekey_publishing_engine.txt) ${OXYPUB}/licensekey.txt
# install our company plugins
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN1 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN2 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN3 ${OXY}/plugins/
# install the Windows fonts
rm -rf ${OXYPUB}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/fonts
ln -s $(realpath ./fonts) ${OXYPUB}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/
# rename by build number, then make a filesystem link
BUILD=$(perl -ne 'm{Oxygen \d\d\.\d, build (\d+)} && print $1;' ${OXYPUB}/DITA-OT.README_OXYGEN.txt)
VERSION=$(perl -ne 'm{Oxygen (\d\d\.\d), build \d+} && print $1;' ${OXYPUB}/DITA-OT.README_OXYGEN.txt)
OXYPUB_FULL=${OXYPUB}-${VERSION}-${BUILD}
rm -rf ${OXYPUB_FULL}
mv ${OXYPUB} ${OXYPUB_FULL}
ln -s ${OXYPUB_FULL} ${OXYPUB}
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
 - ↳ Feature Request
 - ↳ Common Problems
 - ↳ DITA (Editing and Publishing DITA Content)
 - ↳ Artificial Intelligence (AI Positron Assistant add-on)
 - ↳ SDK-API, Frameworks - Document Types
 - ↳ DocBook
 - ↳ TEI
 - ↳ XHTML
 - ↳ Other Issues
 - Oxygen XML Web Author
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Content Fusion
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen JSON Editor
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen PDF Chemistry
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Feedback
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen XML WebHelp
 - ↳ Feature Request
 - ↳ Common Problems
 - XML
 - ↳ General XML Questions
 - ↳ XSLT and FOP
 - ↳ XML Schemas
 - ↳ XQuery
 - NVDL
 - ↳ General NVDL Issues
 - ↳ oNVDL Related Issues
 - XML Services Market
 - ↳ Offer a Service