Integration with alfresco 4.x and Liferay 6.1

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

Blogs
[...] 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
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
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
[...] 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
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.