Deploying Alfresco Share portlets in Liferay
In Web Scripts as Portlets tutorials, how to deploy Alfresco Web Scripts as Liferay Portlets have been discussed. In this tutorial we will see how to deploy Alfresco Share 3.4 portlets in Liferay.
In the latest community release 3.4b, Alfresco has come up with three new portlets as part of the Share distribution.
- Repository Browser
- Site Document Library
- My Document Library
These are more popularly called as Share DocLib portlets.
Some of the important capabilities of these portlets are -
- Create Content, Create Folder, Upload
- Navigate Breadcrumbs, RSS Feed, Hide/Show Folders
- Simple/Detailed View
- Filters – All Documents/I’m Editing/Others are Editing/Recently Modified, Recently Added, My Favorites
- Hierarchical folder browsing
- Tag browsing
- Simple Document Details Page
- Document Details Page including all existing standard Document Actions, Version history, Commenting
- Edit Document Metadata
- Simple Folder Details Page (Popup)
- Folder Details Page – All existing standard folder actions
- Edit Folder Metadata
In this tutorial, we will explore the steps to deploy these portlets in Liferay.
This is what it would look like.
Environment
- Liferay 5.2.3
- Alfresco 3.4b
- Tomcat 6.0.18
- MySQL 5
- Windows 7
- JDK 6
Download
Assuming you have Tomcat bundle of Liferay up and running (you can download from here), download Alfresco 3.4 packages.
Deployment
- Unzip the downloaded alfresco 3.4 bundle, three folders will be there – bin, licenses and web-server.
- Copy the contents of bin folder in \tomcat-6.0.18\bin folder.
- Copy the contents of licenses folder in the license folder .
- Copy the files of web-server\endorsed folder in \tomcat-6.0.18\endorsed folder. You can create the folder in case it does not exist.
- Copy of the files of web-server\lib folder in \tomcat-6.0.18\lib folder.
- Copy the contents of web-server\shared folder in \tomcat-6.0.18\shared folder. Create the shared folder if it does not exist.
- Create a database in your local MySQL server named alfresco. Create a user named alfresco with same password; and give the user all permissions to the new database.
- Open the catalina.properties file from \tomcat-6.0.18\conf folder in your text editor; and put the value of shared.loader as ${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
The line should look like
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar - Copy the web-server\webapps\alfresco.war file in tomcat’s webapps folder – \tomcat-6.0.18\webapps folder.
- Now start your tomcat server (we haven’t deployed share yet) . The server might take a few minutes to start up. Both liferay and alfresco should be deployed. The bootstrap should create tables required for alfresco to run in your MySQL database. Once the server is up and running, you can access Liferay portal as well as Alfresco Web Client application in your browser.
- Now copy the web-server\webapps\alfresco.war file in your liferay’s deploy folder. This should ideally be located in parallel to your tomcat-6.0.18 folder.
- In the tomcat server log, you will be able to see that the share application is being deployed in the server.
Notice the following log information properly appeared. This means your share portlets have been recognized and deployed by liferay.
INFO [PortletHotDeployListener:227] Registering portlets for share
INFO [PortletHotDeployListener:351] 3 portlets for share are available for use - Once the deployment is done, we are just a few steps away. We need to configure the permission model of the alfresco and share application – so that the portlets can properly run in liferay. Stop the tomcat server.
- Rename the alfresco-global.properties.sample file as alfresco-global.properties (in folder \tomcat-6.0.18\shared\classes); and open the file. Append the following two lines at the end of the file.
authentication.chain=alfrescoNtlm1:alfrescoNtlm,external1:external
external.authentication.proxyUserName= - Then open the share-config-custom.xml file from\tomcat-6.0.18\shared\classes\alfresco\web-extension folder, and append the following lines
<!– 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> - Restart your tomcat server, once the server is up, open Liferay portal, log in as Administrator, try to add new portlet.
In the available portlet list, you will be able to see a new group named Alfresco and three portlets available there. - You can add any of the portlets from here and test the functionalities. You have got the full alfresco share document library features in your portal!







Hi Snig,
thanks for the detailed info. However, as you may know from the forums the portlets don’t seem to work with LifeRay 6x
Do you have any workarounds / suggestions on how to make it work?
Ed
Hi Ed
Liferay 6x requires all portlets to developed and deployed as plug-ins. Thus this procedure of deploying Alfresco portlets in liferay 6x fails.
However, shortly we will be posting the solution for the same. Follow this thread!!!
Thanks
Snig.
Hi Snig,
I thank you for the smart tutorial,I am just wondering if i can use the same procedure for alfresco 3.3 CE and liferay portal 5.2? I hope itsnt a matter of versions?
thanks in advance,
Abouelkheir.
Hi Abouelkheir
Yes, you can use the same process for deploying portlets in 3.3 CE alfresco and 5.2 liferay.
Alfresco really has not changed the portlet creating and deploying mechanism since 2.9. However, this method will fail in case of liferay 6, where you need to deploy portlets as plug-ins.
Thanks
Snig.
Hello,
Have you figured out a way to deploy alfresco in liferay 6?
Thanks
[...] for making you wait, this is the tuto, i hope it will work for you, or else, give your feedbacktutothis too [...]
hi santana,
Have you figured out the liferay 6 and alfresco integration?
If not please let me know i will help you…
Regards
Chandra
I followed the above stuff on liefray and alfresco.As you mentioned that we need to work on liferays’ tomcat folder by copying the bin of alfresco bundle.I have been able to run alfresco in browsewr but I am unabel to see liferay portal page.
Let me know what I need to do to see liefrays page as well.
Hi Rajesh
Supposing your are running your server in localhost with 8080 port, you can see alfresco at http://localhost:8080/alfresco.
Where as Share will run at http://localhost:8080/share.
For liferay, you should use only http://localhost:8080/
Let me know if you are facing any issues.
Thanks
Snig.
How can I do this integration using external SSO?
What configurations I need to make?
Thanks,
Patil
@Patil,
Exactly which external SSO are we talking about here.
Since Liferay and Alfresco both supports CAS integration easily.
If anyone is willing to assist with, or provide information about, integrating Alfresco 3.4 with Liferay 6 I would greatly appreciate it. If possible Alfresco 4.0 as well.
Thanks,
Robert
hi Snig,
thank you for the tutorial,
I am wondering if you have any idea how to deploy Alfresco Share portlets in Liferay jboss bundle instead of tomcat.
Thanks
Adel.
Hi Adel
Is there any specific issues you are facing in deploying the share portlets in liferay?
Can you please share your steps and any log file produced?
Thanks
Snig.
Thnks for this doc.
I did this in liferay6.0.6 It works perfectly for me.
Sincerely
Abhinav Ladani.
Thanks @abhinav.
Glad to know it was helpful for you.
The Webpage http://localhost:8080/share is not opening
http://localhost:8080 and http://localhost:8080/alfresco is opening properly and is connecting to the mysql database also
@Robin, I think your alfresco and share web applications haven’t properly started up in tomcat.
Can you share your catalina log?
Hi Snig & Others,
Working on Liferay 6.0.6 with JBoss App Server and want to integrate Alfresco for DMS. Would the above steps works for me? Please guide … what are the steps?
Thanks.
Yes Saikat, the above steps should work.
Do let me know in case you face any issues…
Dear Mr.Snig Bhaumik:
Hello,My name is David Chao and I am from Taiwan, I am very
interesting in the essay of “Integration of Alfresco with Liferay
Deploy Alfresco Share” in your blog. I did it step by step just like your essay and it works. But when I tried to add any of Alfresco porlet to Lifreray Portal it just cannot be added and it
show error message “Portlet is temporarily unavailable”. Can you tell what’s wrong? Thanks!
Best Regard
David Chao
Winsonic Electronics Co., Ltd.
http://www.ewinsonic.com
david.chao@ewinsonic.com
Dear David
Can you forward me your liferay and alfresco log here?
Thanks
Snig.
Hi..
Thanks for sharing Alfresco Web Scripts information, using this information, i have solved my problem n also working well,
Thanks a lot.
Glad it was helpful to you…