Running Alfresco web scripts as Liferay Portlets
I've seen a lot of Liferay and Alfresco forum posts from people having trouble getting Alfresco running within a Liferay portal.
Once that's done, people usually want to invoke Alfresco web scripts as portlets without requiring a separate single sign-on (SSO) infrastructure.
1. Download the Liferay Portal 5.x war.
2. Unpack the Liferay distribution and fire it up. Make sure you can log in as the test@liferay.com (password: test) user to validate that all is well with the Liferay install.
2a. Create a test user. ("Create Account" on the Liferay login screen). Remember the email address.
- For this discussion I'll assume Sample User with a screen name of sample and an email address of sample@sample.com. Make sure you create a home directory.
- In this example, we'll call it "sample".
2b. Verify that you can log in as your test user.
3. Shut down the server.
4. Download Alfresco 2.1.2 Enterprise , 3.2r2 CE WAR only.
Note: Alfresco 2.1.1 , 3.2 CE has a known issue (AWC-1686) with the way authentication is handled for web scripts in the context of Liferay so make sure you are using 2.1.2.
5. Expand the Alfresco WAR into the Tomcat webapps/alfresco directory (which you'll have to create the first time). If you are tweaking the install (such as pointing to a specific MySQL database, using something other than MySQL, pointing to a different data directory, etc.) make sure you have copied your good set of extensions into Tomcat's shared/classes/alfresco/extension directory.
6. Copy the MySQL connector into Tomcat's common/lib directory.
7. Start Tomcat. When it comes up, you'll have Liferay running and you'll have Alfresco running, but Liferay doesn't yet know about Alfresco. Verify that you can log in to Alfresco as admin.
7a. While you are here, create a test user account. You need to create a user account that has an email address that matches the test user account you created in Liferay. In this example you created Sample User with a screen name of fuser and an email address of sample@sample.com so you need to create an Alfresco user with the same settings. You'll log in to Alfresco as sample. You'll log in to Liferay as sample@sample.com.
7b. Verify that you can log in to Alfresco as sample.
8. Shut down Tomcat.
9. Now you need to configure Alfresco as a Liferay plug-in. This involves adding four files to Alfresco's WEB-INF directory: liferay-display.xml, liferay-plugin-package.xml, liferay-portlet.xml, and portlet.xml. Why aren't these available in the Alfresco source or on the wiki? Apparently someone tried to address this at some point because there is a link on the wiki but it is broken. Until that's addressed, I've put them (Email me)
10. Remove the portlet-api-lib.jar file from Alfresco's WEB-INF/lib directory.
11. Re-package alfresco.war. It is now ready to hand over to Liferay.
12. Start Tomcat.
13. Find your Liferay deploy directory. If you are running out-of-the-box on Linux, Liferay's "deploy" directory is called liferay/deploy and it resides in the home directory of the user who started Tomcat. I'm running it as root so my Liferay deploy directory is /root/liferay/deploy.
14. Copy the alfresco.war you just created into the deploy directory. Watch the log. You should see Liferay working on the WAR. He's finding the plug-in config files and essentially deploying the Alfresco portlets.
15. Now log in to Liferay using the Liferay admin account (test@liferay.com). Go to a page, then use the global navigation dropdown to select "Add Content". The list of portlets should appear and you should see the "Alfresco" category. If you don't, look at the log because something is amiss. Add the My Spaces portlet to the page. You may see an error at this point but ignore it. The problem is you probably don't have a user in Alfresco that has an email address of "test@liferay.com", which is the currently-logged in user.
16. Log out.
17. Log in as your test user that exists in both Alfresco and Liferay (sample@sample.com).
18. Go to the page. You should see the "My Spaces" portlet. You should be able to upload content, create spaces, etc.
Regards,Tapan Avasthi
2 comments:
Why you are copying contents of post of someone and represent it as your own creativity ??????
Hey!!! I already tried on my system and then after i post here.No one can point that it's his/her creativity.It's open source any one can do it through reference book or wiki of alfresco.
If you feel it's yours then please share your name here or mail me at avasthitapan@gmail.com, i will definitely give your name afterwards on any alfresco post of mine.Because i think you are the inventor of alfesco....
Post a Comment