Guys !!! Checkout my new application. Just upload your error/log file and trace all the exceptions along with detailed output in various formats (like xml, text, json).

Want To Search Something Else? Just Google It !

Tuesday, April 10, 2012

Integrating Alfresco with Liferay 6.1



Hello Friends.  It's been a long I am posting to my blog. In my previous post Liferay Alfresco Integration , I explained how to integrate Liferay 6 (CE or EE) with Alfresco 3.3(or higher).  Both the integration methods explained in the post have their own advantages and limitations (which also I have mentioned in the post). The CMISHook was being used as a means to store Liferay's document library's low-level data.  This had two limitations: (1) It was showing up all these low lever information numbers in the CMIS Repository system which are not of any use from the user perspective and (2) If we change anything in that repository, it would screw up Liferay because things were not synchronized.


With the latest version (Liferay 6.1), Liferay has come up with some really cool features which makes it very easy to integrate Liferay with alfresco and many other CMS systems (like sharepoint, documentum etc). It eliminates all the limitations of CMIS Hook as well as it let's us mount multiple repositories to one document. 


Following are the steps to configure Liferay 6.1 (with tomcat bundle) with Alfresco 3.4d. 



1. Download Alfresco(Community or Enterprise edition) and follow the installation instructions. You can download it from following URLs:

Community Edition: http://wiki.alfresco.com/wiki/Download_Community_Edition
Enterprise Edition: http://www.alfresco.com/try/    (30-Days trial version)

You can install it with an inbuilt tomcat and mysql bundle or you can install it on any existing application server and connect it to existing mysql database. I have done it with inbuilt tomcat bundle and connected to my existing mysql database. The installation wizard let's you configure all these stuff.

2. Download and install Liferay 6.1 (EE or CE). You can download it from http://www.liferay.com/downloads/liferay-portal/available-releases

3. Start Alfresco. 

4.  Liferay passes user credentials through CMIS to the alfresco in order to connect. To enable liferay to do so, we need to enter following property in portal-ext.properties which will allow liferay to store password in session. 

session.store.password=true 


4. Also one more thing we need to take into consideration is that: Liferay passes logged in user's credentials to CMIS Repository (alfresco here) as described in step 4. What this means is that userid/password in liferay must match userid/password in Alfresco. Alfresco by default uses a loginid (which is similar to screen-name in liferay) to authenticate user. So we need to make liferay also authenticate using screen name by making following entry into portal-ext.properties.

company.security.auth.type=screenName

5. Now we are good to move ahead. Let's start Liferay. 

6. Login as administrator and go to control panel. 

7. Click on Document and Media which will bring up a screen similar to following:

Liferay 6.1 Document Library
7. Click on Add -> New Repository as shown in following image. 

8. This will bring up following screen where you basically provide connection details to connect to Alfresco. 




9. Specify following details:

Name: Give any name you want to give to your repository view in liferay. For example, I will give Alfresco

Description: A brief description about it. 

Repository Type: You can connect either using AtomPub or using web services. For this example, I will use AtomPub. 

AtomPub URL: This will be the CMIS repository URL where you alfresco is running. In my case, it's http://localhost:8080/alfresco/service/api/cmis (Note: In case of Alfresco 4.0, it will be http://host:port/alfresco/cmisatom) 

Repository ID: It is not required field.  It is basically used to connect to a specific repository incase we have multiple repositories available. If we do not enter a repositoryId, then it will just look for the first repository using the given parameters and set it to that.

10. Click on Save button. Liferay will try connecting to Alfresco using information we just provided in step 9 and will show success or failure message.  If it's failure, just make sure that the connectivity information we have provided in step 9 is correct. 

11. On successful connection, you will be able to see a folder view of your Alfresco in your Liferay's document and media as following. 



Now, you will be able to upload your documents from Liferay to Alfresco by simply uploading to this folder. This is synchronized completely. It means that if you upload any document from Liferay, you will be able to see the same from Alfresco's web portal. If you delete any document from alfresco's using it's web portal, it will reflect the changes in liferay's document and media section.  Isn't it cool ?

That's it for this post. Next, I'll try to connect alfresco using web services or may be share point with liferay. 


Feel free to provide any comments/suggestions/enhancements. 

9 comments:

  1. Thanks a lot. This post proved very helpful to me. I tried to integrate Liferay 6.1 with Alfresco CE 4.0d and this post guided me through most of the process. However I would like to point out that in Alfresco 4 the AtomPub url has changed to the following: http://host:port/alfresco/cmisatom

    ReplyDelete
  2. Thank you Vango Stravo for the sharing the info. related to Alfresco 4.

    I have incorporated this info. as Note in my post :)

    Appreciate your feedback and I'm glad my post was very helpful to you.

    ReplyDelete
  3. error... config en liferay 6.1.1, repository field reposytory with atom-pub...

    changes?

    ReplyDelete
    Replies
    1. Sorry Javier, I really didn't get you. Could you please be more specific what exact error you are getting?

      Delete
  4. Hallo I need help integrating my liferay to Alfresco:

    Ia have the following versions running:
    Liferay := 6.1 and Alfresco community 4.2
    I have changed the properties as described above. When I try and configure the repository in liferay I get and error " Please verify your repository configuration parameters"
    When I take the same URL and add it to my browser, it asks for username and password, then it tries to save a xml file.

    How can I verify that my CMIS interface is working on ALFRESCO before I connect via liferay?

    ReplyDelete
  5. Can we integrate Alfresco 4.2 version with Liferay 6.1?

    ReplyDelete
  6. I recently came across your blog and have been following it. I'm very impressed. You're truly well informed and very intelligent. You've been able to write in a way people can understand easily. I'm saving this for future use.
    liferay training in hyderabad

    ReplyDelete
  7. Try this:
    https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&cad=rja&uact=8&ved=0ahUKEwi7no-o9rTLAhXB6CYKHU6zDlcQtwIISTAF&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5NsQkbZzfpI&usg=AFQjCNHEPtWKUMsNCNiV5NYeNWHjPoYL9A

    ReplyDelete
  8. This post is truly inspiring. I like your post and everything you share with us is current and very informative,that you have done a fantastic job. Alfresco ACSCE-5X Practice Test Questions Answers

    ReplyDelete