How can i send alfresco web script output to liferay?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2010 06:22 AM
Hi,
I want to know how can i call my webscript from liferay & send webscript output back.
What formats i can have?
I want to know how can i call my webscript from liferay & send webscript output back.
What formats i can have?
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2010 06:28 AM
Hi,
You can look at this post of mine @
http://forums.alfresco.com/en/viewtopic.php?f=36&t=26649
It can help you out.
You can look at this post of mine @
http://forums.alfresco.com/en/viewtopic.php?f=36&t=26649
It can help you out.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2010 06:56 AM
Which webscript you want to use ?
I mean what action you want to perform on alfresco side by using webscript ?
I mean what action you want to perform on alfresco side by using webscript ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2010 12:32 AM
Hi Sanket,
Thanks for your reply.
I want to expose a webscript to liferay so that on a portlet from liferay, a link is clicked resulting in invoking that web script.Once successfully invoked, the output which is an HTML content, should be displayed on the portlet.
Will appreciate for any suggestion on this?
Thanks for your reply.
I want to expose a webscript to liferay so that on a portlet from liferay, a link is clicked resulting in invoking that web script.Once successfully invoked, the output which is an HTML content, should be displayed on the portlet.
Will appreciate for any suggestion on this?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2010 08:03 AM
So I guess you want to read some content (or file) from alfresco and display it in your liferay portlet.
For that, u need to pass the node-id of the file you want to read - when u make a call to alfresco.
Web script will accept that node-id, process the request, prepare the response and send the html content back - in the form of response.
This java code will help u reading content from alfresco file.
Note: "project_node_id" is the node-id of the file you want to read.
You can store cr.getContentInputStream() in byte array and send to response.Something like this.
byte b[] = cr.getContentInputStream().toString().getBytes();
BufferedInputStream bis = new BufferedInputStream(cr.getContentInputStream());
StringBuffer sb = new StringBuffer();
while (bis.available() > 0)
{
//System.out.print((char)bis.read());
sb.append((char)bis.read());
}
At last - response.getWriter().write("<ReadContent>"+sb+"</ReadContent>");
Hope this helps,
Thanks.
For that, u need to pass the node-id of the file you want to read - when u make a call to alfresco.
Web script will accept that node-id, process the request, prepare the response and send the html content back - in the form of response.
This java code will help u reading content from alfresco file.
Note: "project_node_id" is the node-id of the file you want to read.
String lStrParentUuid = request.getParameter("project_node_id")!=null ? request.getParameter("project_node_id") : ""; ContentReader cr = getContentService().getReader(lStrParentUuid , ContentModel.PROP_CONTENT); content = cr.getContentInputStream(); response.getWriter().write("<ReadContent>"+content+"</ReadContent>");
You can store cr.getContentInputStream() in byte array and send to response.Something like this.
byte b[] = cr.getContentInputStream().toString().getBytes();
BufferedInputStream bis = new BufferedInputStream(cr.getContentInputStream());
StringBuffer sb = new StringBuffer();
while (bis.available() > 0)
{
//System.out.print((char)bis.read());
sb.append((char)bis.read());
}
At last - response.getWriter().write("<ReadContent>"+sb+"</ReadContent>");
Hope this helps,
Thanks.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 09:28 AM
Hi,
Please have look at : http://wiki.rivetlogic.com/display/AWPr/Home
You will need the awpr war for liferay and the star 1.2 amp for alfresco.
Please note i only got it running on alfresco 3.2r2 community.
EDIT:
Star also works on alfresco 3.3.
However i needed to recompile it in eclipse.
Please have look at : http://wiki.rivetlogic.com/display/AWPr/Home
You will need the awpr war for liferay and the star 1.2 amp for alfresco.
Please note i only got it running on alfresco 3.2r2 community.
EDIT:
Star also works on alfresco 3.3.
However i needed to recompile it in eclipse.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 09:07 AM
Hi all!
I have the same problem. I want to know how the webscripts integration works, and I want to invoke from a Liferay Portlet a webscript from Alfresco.
I created an example portlet (just Hello world) in liferay, and i would like to call the webscript from that portlet.
The webscript is alfresco/service/cmis/checkedout , and it works perfectly.
So, how can i connect them?
I've read a lot of information about Alfresco and Liferay, but I can't found any steps to achieve this functionallity, and at this point I am really lost.
Any information would be very appreciated!
Kind regards,
Ana
I have the same problem. I want to know how the webscripts integration works, and I want to invoke from a Liferay Portlet a webscript from Alfresco.
I created an example portlet (just Hello world) in liferay, and i would like to call the webscript from that portlet.
The webscript is alfresco/service/cmis/checkedout , and it works perfectly.
So, how can i connect them?
I've read a lot of information about Alfresco and Liferay, but I can't found any steps to achieve this functionallity, and at this point I am really lost.
Any information would be very appreciated!
Kind regards,
Ana

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2010 10:36 AM
