cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco web script portlet

nmcminn
Champ in-the-making
Champ in-the-making
I am currently working on a handful of projects which call for integrating content from Alfresco into Liferay Portal.  Web scripts are a fantastic fit, but I had a need for authentication using the user's Liferay credentials, and I wanted the ability to use jQuery to fiddle with the data returned from the script.  So, to solve both of those problems, I wrote up a quick Alfresco Portlet for Liferay.  It's built for Liferay 5.2.3, but it may work with earlier versions, not sure.

If anybody might find it useful, you can grab the .war and the source here:

http://www.unorganizedmachines.com/site/index.php?option=com_content&view=article&id=84:alfresco-web...

Enjoy!
6 REPLIES 6

openpj
Elite Collaborator
Elite Collaborator
You have to use the WebScriptPortlet class provided by Alfresco.
In this way you can implement your own WebScript and then, only if you have deployed Alfresco in the same application server of your portlet container, you can declare a WebScript as a portlet. You only need to add a portlet declaration in the portlet.xml in alfresco.war:
http://wiki.alfresco.com/wiki/Web_Script_Runtimes#JSR-168_Runtime_.28Portlet_Access.29
The WebScriptPortlet will get the user session from the portal and it will execute the WebScript with the same user credentials taken from the portal session.

Hope this helps.

nmcminn
Champ in-the-making
Champ in-the-making
My Liferay and Alfresco instances are (and will remain) on separate servers, so your method wouldn't work.  That's why I wrote the portlet that is linked to in my original post.

liferay01
Champ in-the-making
Champ in-the-making
I am currently working on a handful of projects which call for integrating content from Alfresco into Liferay Portal.  Web scripts are a fantastic fit, but I had a need for authentication using the user's Liferay credentials, and I wanted the ability to use jQuery to fiddle with the data returned from the script.  So, to solve both of those problems, I wrote up a quick Alfresco Portlet for Liferay.  It's built for Liferay 5.2.3, but it may work with earlier versions, not sure.

If anybody might find it useful, you can grab the .war and the source here:

http://www.unorganizedmachines.com/site/index.php?option=com_content&view=article&id=84:alfresco-web...

Enjoy!
Hye Nathan,

I tried your Alfresco portlet for Liferay. It works well. You really did a great job, thanx.
I'va succesfully achieve the following step with your component :
- Authenticate as the Alfresco admin
- Authenticate as an Alfresco "classic" user (I've manually created a test user in both Alfresco and Liferay)
- Use the Folder webscript to display the user folder in Liferay
- Use the Upload Document webscript to upload documents in the Alfresco user folder
- Use the Search Webscript to retrieve a specific list of documents and display it in Liferay
- Use the People Webscript to retrieve Alfresco user informations and display them in Liferay

Although, i have a problem creating user in Alfresco from Liferay with you portlet.
For this, I'm using the People Webscript (once more), but this time, it's a POST request (what is necessary to create users in Alfresco).
Have you already done such things ? How are you creating users in Alfreso ?

Once again, thx for your great job Smiley Happy

liferay01
Champ in-the-making
Champ in-the-making
OK, done !
Now, I am also able to create users in alfresco Smiley Happy

nmcminn
Champ in-the-making
Champ in-the-making
Glad you found it useful!  I posted a couple of bug fixes, you might want to grab the latest version, same location.

nmcminn
Champ in-the-making
Champ in-the-making
I have moved this project to AlfrescoForge in the hopes that it might be easier to discover that way.

http://forge.alfresco.com/projects/liferaywsp/