Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

OAT Deployment & Configuration Guide

Katie Brill edited this page Oct 12, 2022 · 10 revisions

Enabling OAT

Configure OpenContent to Pass the contentPath

OAT is enabled by setting up a property in OpenContent that tells OC to pass back the contentPath of the file on the getDocumentInfo call that Alfresco Enterprise Viewer, formerly OpenAnnotate, makes. The property in OpenContent to enable is annotation.useContentFilepathForTransformations=true. Once that property is enabled, the AEV frontend has access to the contentPath since it will be returned in the getDocumentInfo call (ex: /mnt/nas/alf_data/contentstore/2019/05/15/8/3/26/d38b7e22-816e-4bbd-b7ff-f9b164edcfee.bin).

Proxy calls to go to OAT

Once useContentFilepathForTransformations is enabled, the next step is to tell Apache that you are going to proxy calls that would be going to /OpenContent/openannotate/transform? before, but should now send the calls to OAT instead.

Below is the example of the Apache ProxyPass/forwarding rule. IT IS IMPORTANT that this proxy pass occur BEFORE any other rules that reference the same host (since a rule with /alfresco will match and overrule any rules under it that are more specific).

#Proxy all requests for OAT
ProxyPass /alfresco/OpenContent/openannotate/transform http://oat-servername:8080/oat/optimus/transform
ProxyPassReverse /alfresco/OpenContent/openannotate/transform http://oat-servername:8080/oat/optimus/transform
ProxyPass /alfresco/OpenContent/openannotate/getThumbnails http://oat-servername:8080/oat/optimus/getThumbnails
ProxyPassReverse /alfresco/OpenContent/openannotate/getThumbnails http://oat-servername:8080/oat/optimus/getThumbnails

Request from AEV:

/OpenContent/openannotate/transform?id=workspace://SpacesStore/82b15c11-b09a-4ab5-8b3a-058029296969&pageNum=3&resolution=64&lastModified=1560972048092&imageWidth=843&docWidth=612&docHeight=792&contentPath=/mnt/nas/alf_data/contentstore/2019/05/15/8/3/26/d38b7e22-816e-4bbd-b7ff-f9b164edcfee.bin

Is proxied to:

/oat/optimus/transform?id=workspace://SpacesStore/82b15c11-b09a-4ab5-8b3a-058029296969&pageNum=3&resolution=64&lastModified=1560972048092&imageWidth=843&docWidth=612&docHeight=792&contentPath=/mnt/nas/alf_data/contentstore/2019/05/15/8/3/26/d38b7e22-816e-4bbd-b7ff-f9b164edcfee.bin

Map calls between OpenContent and OAT

Sometimes in may be benefitial to map the calls between OpenContent and OAT, so the same calls can be made to the OpenContent and OAT server. This can be accomplished on Tomcat 8+ through extra configuration, without having to install an additional proxy.

On the OAT tomcat, add the following line to your conf/server.xml file:

...
<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
...
    <!-- The following will alow native tomcat url rewriting -->
    <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
...
</Host>

Then create a new rewrite.config file in your conf/Catalina/localhost directory. Create this directory if it does not yet exist. The file should contain:

RewriteRule ^/alfresco/OpenContent/openannotate/(.*)$ /oat/optimus/$1 [L]

This will cause all incoming to calls from /alfresco/OpenContent/openannotate to get mapped to /oat/optimus. Thus both the OpenContent and OAT servers can accept calls to /alfresco/OpenContent/openannotate. URL rewriting is no longer neccesary at the Proxy/Load Balancer level.

If you are not on Tomcat 8+, setting up the Tuckey UrlRewriteFilter may be an option (https://tuckey.org/urlrewrite). Or you can setup an additional proxy on the OAT server.

Configuration

Your deployment must include an application.properties. See the included application.properties.sample included in the code a the path oat.war\WEB-INF\classes\ for more information.

Typically we will place this file in the /tomcat/shared directory to allow for the file to be environment specific. If there is no /tomcat/shared classpath configured that is 'outside' of the war, an application.properties file can also be included inside of the war in WEB-INF/classes

It is recommended you start with the sample application.properties already packaged in the deployment, or the application.properties.sample mentioned above. The two properties that will need configuration as they typically change between environments are 👍

mu-configs.muPath= - Which points to the installation of MuPDF in a given environment.

mu-configs.tempDirForFilesCachedFromNas - The filesystem location used for temp files.

Clone this wiki locally