Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Pre-requisites

The webscript provided with MCF 8.1 seems to be working with Alfresco community 5.2 even though it is said to support only Alfresco until version 5.0. So it is possible that errors occurs when using versions of Alfresco greater than 5.0.

Check https://github.com/maoo/alfresco-indexer and https://github.com/Alfresco/alfresco-indexer for potential updates (else you’ll need to tune it yourself).

The rest of this document suppose that alfresco is installed in /opt/alfresco, please adapt paths whenever needed to suite your own installation.

Preparation

First, you need to install the Alfresco Module Package (AMP) alfresco-indexer-webscripts-0.8.1.amp provided in the ManifoldCF distribution plugin folder.

Copy the amp file into the alfresco installation amps directory (/opt/alfresco/amps).

Stop alfresco:

/opt/alfresco/alfresco.sh stop 


Install the amp

The amp file may need to override some of the libraries contained in the alfresco war to complete the installation process. It is not allowed by default by the installer script, so we will need to force the installation. Although the installation scripts make backups of the libraries overridden in the war itself, I would recommend backing up the war before doing the installation anyway.

cp /opt/alfresco/tomcat/webapps/alfresco.war /backup_location/alfresco.war.bak 

 

Then you can install the amp file into the war

/opt/alfresco/java/bin/java -jar /opt/afresco/bin/alfresco-mmt.jar install /opt/alfresco/amps/alfresco-indexer-webscripts-0.8.1.amp /opt/alfresco/tomcat/webapps/alfresco.war -force

 

It is recommended to clear out temporary files from tomcat before restarting alfresco. So, remove the files in the work and temp directory of tomcat (the script /opt/alfresco/bin/clean_tomcat.sh can give you hints about the file to remove, although all the files mentioned there were not existing on the system when I did the test. The script must be run from /opt/alfresco to work).

You can check that the newly added amp has been correctly added to the war by running

/opt/alfresco/java/bin/java -jar /opt/alfresco/bin/alfresco-mmt.jar list /opt/alfresco/tomcat/webapps/alfresco.war  

 

Be aware that this does not guarantee that it will be working.

 

As tomcat un-compresses the war archive at the first startup only and uses the un-compressed version directly for subsequent startups, you must remove the un-compressed version of alfresco from the tomcat directory so that the new war is un-compressed and used at the next startup


rm - R / opt / alfresco / tomcat / webapp / alfresco  

 

Finally, you can start alfresco again

/opt/alfresco/alfresco.sh start  

 

Check https://docs.alfresco.com/5.2/tasks/amp-install.html for the alfresco documentation on amp installation.

Checking if the extension works and troubleshooting

If  you go to http://<server_address>:<port>/alfresco/service/index/uri/ (the forward slash at the end is mandatory, you’ll get a 404 if you don’t put it) you should be able to find an entry /auth/resolve/{username} in the list (it is an alphabetical list).

If you don’t, the webscript plugin is not working properly. I did not find any errors in the logs when I was investigating this issue on an alfresco community 5.2. Everything looked ok in the alfresco.log except that the same number of webscripts were registered as before I added the extension (which got my attention) but there were no fails or any error. So carefully check the alfresco version. It is written at the top of the http://<server_address>:<port>/alfresco/service/index/uri/ page if you need it. (In my case it was because I didn’t remove the un-compressed alfresco webapp, so the version without the webscript installed was started)

If you happen to try to configure an MCF authentication connector with the webscript no running properly, you will likely end up with an error as shown below:

This is because the connector expects a json response and the alfresco is giving a 404 html page as the response to the query. This is not handled properly in the connector, leading to an exception. You need to debug why the webscript doesn’t work.

  • No labels