Quote from: rthrash at Apr 24, 2010, 05:43 AM
Or maybe having a "Processor" resource type which can be used for Ajax calls, etc. (What we currently do now by just including a snippet on a blank template for Ajax calls, etc.) Hmmm.... Thoughts?
You can make a static resource pointing at your connector that would actually become a "Processor resource type" as you suggested.
You can also not make any resource and just ajax call your processors (via a connector) directly.
This means you’re losing changeable friendly-url
(would you really need it on a connector?) and ACL control via manager. but normally you’d anyway check permissions in your connector/processor (
hasPermission).
jquery example (a processor that sends an activation to a user)
(the important things here are:
a. connector.php -or- static resource url
b. action path
c. ,json
all the rest is up to your processor
$.post('/assets/components/forces/connector.php'
,{ action: 'web/services/sendActivation'
,memberId: memberId
,ctx: 'web'
}
,function(r){
if (r.success == false) { alert(r.message); }
else { alert("ok"); }
}
,'json'
);