« Back

Integration with alfresco 4.x and Liferay 6.1

General Blogs May 22, 2013 By Navin Agarwal

We will be seeing here the proper way of intregrating Alfresco 4.x with Liferay 6.1 version. So, here I have given details process, How you can achive the integration.

Let’s do some few steps for integrating Alfresco 4.x with Liferay 6.1.

As we can have assumption that you might have installed the Alfresco and Liferay Tomcat bundles into separate directories. Let’s say as <ALFRESCO_HOME> and<LIFERAY_HOME>.

NOTE: If you are not using any SSO for both servers, Make sure you create a same user admin/admin in Liferay. Doing this you will have common user in both environment.

1. You need to have different ports number for Alfresco and Liferay running on to resolve port conflicts, Say Alfresco is running on 8080 and Liferay on 5050. So, you can configure the Liferay port in Tomcat server by editing <LIFERAY_HOME>/<tomcat>/conf/server.xml

...
<Server port="5005" shutdown="SHUTDOWN">
...
<Connector port="5050" protocol="HTTP/1.1"
        connectionTimeout="20000"
         redirectPort="5443" URIEncoding="UTF-8" />
...
<Connector port="5009" protocol="AJP/1.3" redirectPort="5443" URIEncoding="UTF-8" />
...

2.  Now, You need to change the Share Loader by editing   <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

These will load the alfresco custom and extension configuration with respect to the XML and other properties files. And also if you have the custom jar files.

3. You have to enable the external authenticate services of alfresco, we can do that by editing <ALFRESCO_HOME>/tomcat/shared/classes/alfresco-global.properties and add to file.

Add the following line at the end of the file

authentication.chain=alfrescoNtlm1:alfrescoNtlm,external1:external

external.authentication.proxyUserName=

Note: Leave the value of proxyUserName blank

 

4.  You can deploy the share.war file in Liferay deploy folder.

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

5.  As you set the share loader in catalina.properties inside Liferay tomcat. You need to copy the Share Loader from Alfresco to Liferay. Let copy the entire folder

<ALFRESCO_HOME>/tomcat/shared  directory to  <LIFERAY_HOME>/<tomcat>/

Note: Alfresco requirement is to copy the shared/classes/alfresco/web-extension/ directory where all the custom xml configuration files are placed, to have a common bridge between Liferay and Alfresco.

So, it’s convenient task to copy entire folder.

 

6. Finally you need to configure SSO, what we called as Bridge.

Create a file <LIFERAY_HOME>/<tomcat>hared/classes/alfresco/web-extension/share-config-custom.xml, and copy the below code to enable remote authenticator. shared/classes/alfresco/web-extension/share-config-custom.xml

<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.AlfrescoConnector</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.

7.  Last but not the least, you can startup both the servers Liferay and Alfresco

8.  Now you can able to see the 3 portlets under Alfresco category in Dock bar menu | Add portlet in Liferay. Try to add the Share Document library portlet in Liferay Page.

Reference Site : http://wiki.alfresco.com/wiki/Portlets

Other related link : Integrating Alfresco Repository to Liferay Documents and Media Portlet

Threaded Replies Author Date
[...] NOTE: If you are not using any SSO for... Anonymous May 22, 2013 10:12 AM
Very Useful Post. DarshanKumar N Bhatia May 23, 2013 9:24 AM
What about performance whit thousand of... Denis Signoretto July 13, 2013 12:56 AM
Navin, This was very useful. I had to create... Keval Mehta July 30, 2013 11:09 AM
Navin, This was very useful. I had to create... Keval Mehta July 30, 2013 11:09 AM
Keval did you do this with Alfersco CE version... Anantha Kancherla November 22, 2014 7:29 AM
Anantha, Did you get it working with... Charles Devin Riley May 6, 2015 9:01 AM
This is one works for LR 6.2 as well ! Thank you Hardik Pathak January 3, 2014 2:07 AM
[...] Dans cet article, nous proposons... Anonymous January 8, 2014 8:44 AM
Hi i have integrated alfresco into liferay for... jhansi annamaneni July 11, 2014 2:40 AM
Anybody pls help me out to solve this issue. jhansi annamaneni July 16, 2014 7:23 AM
Nice blog Naveen. This was very helpful for me.... Nazakat Ali August 17, 2014 11:21 AM
[...] Integration with alfresco 4.x and Liferay... Anonymous February 13, 2015 1:52 AM

[...] NOTE: If you are not using any SSO for both servers, Make sure you create a same user admin/admin in Liferay. Doing this you will have common user in both environment. 1. Login with the admin user,... [...] Read More
Posted on 5/22/13 10:12 AM.
Posted on 5/23/13 9:24 AM.
What about performance whit thousand of documents and a lot of users?
Posted on 7/13/13 12:56 AM.
Navin,
This was very useful. I had to create the alfresco database manually since alfresco wouldn't start up. Once I did that, it worked like a charm emoticon . I followed the same steps for integrating with alfresco 3.4b since 4.x needs Java 7.

Thanks again
Keval
Posted on 7/30/13 11:09 AM.
Navin,
This was very useful. I had to create the alfresco database manually since alfresco wouldn't start up. Once I did that, it worked like a charm emoticon . I followed the same steps for integrating with alfresco 3.4b since 4.x needs Java 7.

Thanks again
Keval
Posted on 7/30/13 11:09 AM.
This is one works for LR 6.2 as well !

Thank you
Posted on 1/3/14 2:07 AM.
[...] Dans cet article, nous proposons d’étudier les moyens existants pour l’intégration de Liferay et Alfreco. Le but est de permettre l’utilisation de documents stockés dans Alfresco dans les fonctions... [...] Read More
Posted on 1/8/14 8:44 AM.
Hi i have integrated alfresco into liferay for firsttime it has worked fine.But after sometime when i am trying to access the same alfresco portlet in liferay it is saying please login via your portal.If anybody knows the solution please let me know.
Posted on 7/11/14 2:40 AM in reply to .
Anybody pls help me out to solve this issue.
Posted on 7/16/14 7:23 AM.
Nice blog Naveen.
This was very helpful for me.

Thanks.
Posted on 8/17/14 11:21 AM.
Keval did you do this with Alfersco CE version or EE ?
Posted on 11/22/14 7:29 AM in reply to Keval Mehta.
[...] Integration with alfresco 4.x and Liferay 6.1 – Blog | Liferay. [...] Read More
Posted on 2/13/15 1:52 AM.
Anantha, Did you get it working with AlfrescoCE? I assume thats why you asked
Posted on 5/6/15 9:01 AM in reply to Anantha Kancherla.