KEMBAR78
Liferay-Alfresco Setup Guide | PDF | World Wide Web | Computer Architecture
0% found this document useful (0 votes)
176 views4 pages

Liferay-Alfresco Setup Guide

This document provides instructions for integrating Alfresco with Liferay by configuring Liferay's Tomcat server, editing configuration files, copying files between the Alfresco and Liferay installations, and modifying XML configuration files. This allows Liferay to authenticate users against the Alfresco repository and adds an example CMIS portlet for browsing the Alfresco repository from within Liferay. It also provides guidance for developing custom portlets that integrate Alfresco and Liferay.

Uploaded by

Pratip Dutta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views4 pages

Liferay-Alfresco Setup Guide

This document provides instructions for integrating Alfresco with Liferay by configuring Liferay's Tomcat server, editing configuration files, copying files between the Alfresco and Liferay installations, and modifying XML configuration files. This allows Liferay to authenticate users against the Alfresco repository and adds an example CMIS portlet for browsing the Alfresco repository from within Liferay. It also provides guidance for developing custom portlets that integrate Alfresco and Liferay.

Uploaded by

Pratip Dutta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Installation and Configuration (Liferay)

Prerequisites

 Liferay v5.2.3 installed & working. We have not tested and therefore do not support Liferay 6
at this time.
 Admin user knows where Liferay's "deploy" folder is.
 If using Tomcat6, the modifications described in our wiki have been
deployed: http://wiki.alfresco.com/wiki/Install_Tomcat6
 share.war is the one taken from the DocLIb Portlet branch of 3.3.1E, or is 3.4 Community or
newer.
 Repository is v3.3.1E or newer
Single-server Installation Steps

We assume you’ve installed the Alfresco and Liferay Tomcat bundles into separate directories. We’ll
refer to these as<ALFRESCO_HOME> and <LIFERAY_HOME>

Step 1. Configuring Liferay’s Tomcat Server to resolve port conflicts by


editing <LIFERAY_HOME>/<tomcat>/conf/server.xml:

Change all the port numbers to avoid conflicts with the Alfresco’s Tomcat server, here are the
changes I made:

...
<Server port="8105" shutdown="SHUTDOWN">
...
<Connector port="9090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="9443" URIEncoding="UTF-8" />
...
<Connector port="8109" protocol="AJP/1.3" redirectPort="8443"
URIEncoding="UTF-8" />
...

Step 2. Next, edit <LIFERAY_HOME>/<tomcat>/conf/catalina.properties and locate the


“shared.loader” entry and replace it with this:

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar Step
3. Edit<ALFRESCO_HOME>/tomcat/shared/classes/alfresco-global.properties and add the
following lines to the end of the file:

 shared/classes/alfresco/alfresco-global.properties

authentication.chain=alfrescoNtlm1:alfrescoNtlm,external1:external
external.authentication.proxyUserName=

NOTE: Yes, the value for proxyUserName needs to be blank.

Step 4. Copy <ALFRESCO_HOME>/tomcat/webapps/share.war to <LIFERAY_HOME>/deploy

Step 5. Copy the entire <ALFRESCO_HOME>/tomcat/shared directory


to <LIFERAY_HOME>/<tomcat>/

NOTE: Technically, we only need the shared/classes/alfresco/web-extension/ directory, but


copying the whole shared directory is a convenient alternative.

Step 6. Open <LIFERAY_HOME>/<tomcat>hared/classes/alfresco/web-extension/share-config-
custom.xml.sample toshare-config-custom.xml and edit the file to uncomment the second config
block to enable remote authenticator. The comments are on lines 44 and 73. The result should look
like this:

 shared/classes/alfresco/web-extension/share-config-custom.xml

Note: Modify endpoint-url parameters to match actual Repository deployment.

<alfresco-config>

<!-- Overriding endpoints to reference a remote Alfresco server -->


<config evaluator="string-compare" condition="Remote">
<remote>

<endpoint>
<id>alfresco-noauth</id>
<name>Alfresco - unauthenticated access</name>
<description>Access to Alfresco Repository WebScripts that do
not require authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>

<endpoint>
<id>alfresco-feed</id>
<name>Alfresco Feed</name>
<description>Alfresco Feed - supports basic HTTP
authentication</description>
<connector-id>http</connector-id>
<endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
<basic-auth>true</basic-auth>
<identity>user</identity>
</endpoint>

<connector>
<id>alfrescoCookie</id>
<name>Alfresco Connector</name>
<description>Connects to an Alfresco instance using cookie-
based authentication</description>

<class>org.springframework.extensions.webscripts.connector.AlfrescoConnecto
r</class>
</connector>

<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that
require user authentication</description>
<connector-id>alfrescoCookie</connector-id>
<endpoint-url>http://localhost:8080/alfresco/wcs</endpoint-url>
<identity>user</identity>
<external-auth>true</external-auth>
</endpoint>

</remote>
</config>

</alfresco-config>

NOTE: If you’re running Alfresco’s Tomcat server on a different host or port, please change the
corresponding endpoint.

Step 7. Startup Alfresco, then follow up with starting Liferay.

Step 8. Once Alfresco and Liferay are started, add and try out the basic CMIS Repo Browser portlet.
It should appear under the “Alfresco” category.

This integration makes use of an external authenticator that will automatically create an Alfresco user
account whenever a new Liferay user accesses an Alfresco portlet.

Developing New Portlets


To create your own custom portlet, I recommend you look at the CMIS Repo code under in the
share.war file under WEB-
INF/classes/alfresco/webscripts/org/alfresco/test/cmisrepo.* and cmisfolder.*.

In short, you’ll need to create a Web Script which can be placed inside the share.war file under WEB-
INF/classes/alfresco/webscripts or
in <LIFERAY_HOME>/<tomcat>/shared/classes/alfresco/web-extension/webscripts(create the
directory if it doesn’t already exist.

You’ll also need to edit the portlet.xml file in the share.war/WEB-INF directory to add a new entry for
your portlet using the Alfresco “ProxyPortlet” as the portlet class.

<portlet>

<description>CMIS Folder Browser</description>


<portlet-name>CMISFolder</portlet-name>
<portlet-
class>org.alfresco.web.portlet.ProxyPortlet</portlet-class>
<init-param>
<name>scriptUrl</name>
<value>/share/service/sample/cmis/repo</value>
</init-param>

<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>

<portlet-info>
<title>CMIS Folder Browser</title>
<short-title>CMIS Folder</short-title>
</portlet-info>

</portlet>

Finally add your portlet to the liferay-display.xml and liferay-portlet.xml files.

To make sure that your URLs are correctly generated, please use the “scripturl()” function in your
Freemarker templates to wrap them:

<a href="${scripturl(url.serviceContext + "/sample/cmis/repo",


false)}">CMIS Repository</a>

You might also like