cancel
Showing results for 
Search instead for 
Did you mean: 

Serving binary content with webscripts in Alfresco 2.2

unmeshjoshi
Champ in-the-making
Champ in-the-making
Hi,

We are using alfresco as web content management system. Content editors create HTML content in alfresco. But we are not using alfresco to serve the web content to the user. We have a J2EE app in front of alfresco which forwards user requests  to alfresco to get the content using REST API (implemeted using webscripts in Alfresco) and then serve it to the user.
We are facing issues with binary content like images. HTML content in alfresco has relative paths for images. Because browser requests are served by a J2EE app and not by alfresco, we need package all the images from alfresco in WAR file. Is there any way to get binary content from alfresco? We see support for content streaming in alfresco version 3.0 onwards. Is there a way it can be achieved in version 2.2?

We are thinking of having a servlet to handle all the image requests from browser. Then fetch the image from alfresco ( by using something like content streaming web script in alfresco), and serve it to the browser.
Have anyone used alfresco in this way?

Thanks,
Unmesh
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
Or another approach is to use WCM to deploy the images onto your web server.

unmeshjoshi
Champ in-the-making
Champ in-the-making
Or another approach is to use WCM to deploy the images onto your web server.
So do you think our approach of fetching images from alfresco is feasible? How to achieve this with alfresco 2.2, which doesnt have content streaming web scripts?

Where can I find documentation about configuring WCM to deploy images to web server?

Thanks,
Unmesh

kmehta31
Champ in-the-making
Champ in-the-making
Hi Unmesh,

The approach Roger is describing here is to manage the images in the folder and deploy to web server using FSR.
http://wiki.alfresco.com/wiki/FSR - this might help

I dont think there is any direct approach. Other way to do that is embed the url within xml tag, call the webscript that would return you xml file. You might use Jaxb for XML to Java Object transformation and use the links within your image tag.
This would require all your images have proper mapping (Associations) in the web forms for different pages.

mrogers
Star Contributor
Star Contributor
Yes you can stream content out of earlier versions of Alfresco.    Admittedly you can't use CMIS, but there's several streaming interfaces that have been there for a long time.

However for static content like images where you don't need any of the alfresco functionaility like access control or full text searching you are paying an overhead for little benefit.   That's why I suggested deploying your images out of Alfresco.