开发者

Submitting a form to a different server in Alfresco

I am very ne开发者_开发技巧w to Alfresco and was trying to ascertain if it's possible to create a web form that submits to a different server. The form would exist in Alfresco but we need a different server to process the submitted form, which in this case would be a file upload.


The following assumes you are trying to post to a second Alfresco server from the first one. Yes it is possible to do this. You would need to do the following

  1. Get a valid authentication to the remote Alfresco server (eg. grab a ticket using the login webscript)
  2. Wrap you form data into a JSON object
  3. Post the JSON object to the remote Alfresco server and handle the response appropriately.

On the remote Alfresco server you will need a WebScript or servlet to handle the POST and send the appropriate JSON response.


If you're using alfresco share, here's an idea of how I solved a similar problem:

First, we have 1 dashlet with the original form. This forms action is another alfresco dashlet. The user puts the desired data here and submits the form. Now, the form, upon submit calls another of our dashlets.

The other dashlet executes a server side script first. It goes something like this:

var url = 'http://something.net/which_isnt_alfresco?parameters
var connector = remote.connect("http");
var result = connector.call(url);

Then the other dashlet gets rendered - you can either inject the response html in the original dashlet, open this new dashlet as a "You're fine" popup window or whatever you need, I suppose.


(late answer)

Depending a little on how your form is called in Share, page definition, Javascript or Share-Config; you can set the submission URL for the form

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜