cancel
Showing results for 
Search instead for 
Did you mean: 

making a web service call which returns an html document

cdn_alfresco_de
Champ in-the-making
Champ in-the-making
Good Day,

We have a system with a number of components. Alfresco is our back end content management system.

What we need to do is in Alfresco run a script against an xml file. The script would make a web service call to another application passing the xml file and the response would contain an html formatted file which we would then display to the client (the html file will not be saved, just streamed to the console). We don't want to save the html in Alfresco as it could become unsynched with the xml..

We are running an older version of alfresco (2.9 community)

What would be the best way to do this? action executer or webscript or javascript? or something else?

Thank you,
Bruce
4 REPLIES 4

kaynezhang
World-Class Innovator
World-Class Innovator
When will the script be called ?
Where(alfresco explorer or your own UI?) and when the html file will be displayed ?

The script will be called by a link or button that the user will click. It is from the alfresco ui (explorer).  We were thinking an action executer tied to a link on the ui.

My team was discussion the possiblities further this morning and refined our requirements.

We have another system (a java web application) It's purpose is to process a change to a natrual health product application. Basically the output from that tool is a zip file. The zip contains an xml file with the changes as well as a number of attachments and supporting documents.

This zip gets loaded into Alfresco. We want to be able to display the xml in a readable format that is consistent with how our other system displays it. The other system uses custom stylesheets and scripts (WET Toolkit) that we don't want to have to host in the Alfresco codebase also.

What we'd like is:
1. An action executer which makes a service call to our other Java web application passing the xml file.
2. The other web application while take the xml, load it into the domain model, and generate a readable html file.
3. The other web application will pass back a url to the html file hosted in the other web app.
4. The action executer will take the url, and then open up the url in a new webpage (the url is hosted in the other web application)

We think all this is possible, but are not sure if/how the Action Executer can open up a new webpage with the url link. Thinking it should be fairly easy to do. We've done some searching but haven't found anything yet.

Do you think this is feasable? Do you know how to easily to step 4?

As I mentioned, the script will be called by a button or link the user will click. We are running an older version of alfresco (2.9 community)

Thank you,
Bruce  

kaynezhang
World-Class Innovator
World-Class Innovator
Yes ,you can redirect a request to the specified URL  in the JSF backing bean,like follwoing

ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
context.redirect(url);

kara
Confirmed Champ
Confirmed Champ

Good morning, I have the same problem, we have our java aplication in the same tomcat that Alfresco and we want to call it trough one button that a person will click. I don't know if that is possible with action executer or wit web scrip, we are working with alfresco 3.4.d  and our java application should be to call when the person will click.

Thank you.