AnsweredAssumed Answered

Retrieving remote content

Question asked by rjohnson on Apr 12, 2014
Latest reply on Apr 12, 2014 by romschn
I have a migration from an old system that has millions of images, very few of which will ever be viewed but it is impossible to know which will and wont be viewed.

Now, I could inport 5TB of images "just in case" but it seems to make more sense to leave these behind their own private web server and retrieve them when required. However, I do not want that web server to be public so I want to access the images behind it via Alfresco webscripts executed from Share.

I want to display them inside share so what I need to be able to do is create a web script that will stream content but that first retrieves that content from a remote http server.

I can easily write the webscript to stream the content if the content was a node in Alfresco, but there does not seem to be the properties on model to directly return content. I can set contentNode but not, so far as I can see, "content" or at least I cannot find any example of anyone directly setting the content stream; only ever passing a node from which the content must be streamed.

This tends to suggest my only solution is to retrieve the content using java and create a node (temporary) inside Alfresco and then return that content node.

Does anyone have any suggestions as to how I can basically do

model.content = remoteURL.contentsStream

in a webscript of kind=""