[Building Sakai] Wicket and entity broker

Adrian Fish a.fish at lancaster.ac.uk
Tue Jan 11 08:43:01 PST 2011


The only way I've done that is to just get the HTTP return code and 
message via the XmlHttpRequest object in JS. I would then render 
different html based on the response. If you wanted to do it that way in 
java you'd have to use HttpConnection or something.

Alternatively you could do a filthy hack like pulling the entity 
provider from the component manager and look up the custom action method 
using reflection. Call it, trap the appropriate exception and redirect. 
Ughhh.

Most of my coding is done in JS on the client nowadays, so I'm out of 
touch with the Wicket stuff.

Cheers,

Adrian.

On 11/01/2011 16:26, Tania Tritean wrote:
>
> Thanks for the answer.
>
> The thing is that the action can throw different exception and I have 
> to redirect to different pages depending on the exception.
>
> How can I do this?
>
> Thanks,
>
> Tania
>
> ------------------------------------------------------------------------
>
> *From:*sakai-dev-bounces at collab.sakaiproject.org 
> [mailto:sakai-dev-bounces at collab.sakaiproject.org] *On Behalf Of 
> *Adrian Fish
> *Sent:* Tuesday, January 11, 2011 1:38 PM
> *To:* sakai-dev at collab.sakaiproject.org
> *Subject:* Re: [Building Sakai] Wicket and entity broker
>
> Correction, the EB url would be more like 
> /direct/my-service/my-entity/my-action. Here's a real one from the 
> floating chat:
>
> /direct/sfc-message/803ec9d8-6798-402d-9702-13b201627e54/online.json
>
> Just to avoid confusion ...
>
> On 11/01/2011 12:29, Adrian Fish wrote:
>
> Hi Tania,
>
> If you set the action attribute of the form to the EB url (eg: 
> /direct/my-service/my-action) it should send the parameters through to 
> the Map<String,Object> params argument in the custom action method. In 
> other words Wicket's form handling isn't involved at all.
>
> Does the custom action return anything other than a success code?
>
> Cheers,
> Adrian.
>
> On 11/01/2011 11:57, Tania Tritean wrote:
>
> Hello,
>
> I need to call a EntityCustomAction from a wicket tool. Can anybody 
> please tell me how can I do that?
>
> In the tool I have a page, on the submit button of the form from that 
> page I want to call the method annotated with EntityCustomAction.
>
> The method can throw different exceptions that I need to handle in UI.
>
>  Is there a 'rest client' in sakai that I can use for this with wicket?
>
> Thanks in advance,
>
> Tania
>
>   
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org  <mailto:sakai-dev at collab.sakaiproject.org>
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>   
> TO UNSUBSCRIBE: send email tosakai-dev-unsubscribe at collab.sakaiproject.org  <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org>  with a subject of "unsubscribe"
>
>
>
> -- 
> ==================================
> Adrian Fish
> Software Engineer
> Centre for e-Science
> Bowland  Tower  South C Floor
> Lancaster  University
> Lancaster
> LA1 4YW
> email:a.fish at lancaster.ac.uk  <mailto:a.fish at lancaster.ac.uk>
>   
> http://confluence.sakaiproject.org/display/YAFT/Yaft
> http://confluence.sakaiproject.org/display/CLOG/Home
> http://confluence.sakaiproject.org/display/BBB/Home
>   
>
>   
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org  <mailto:sakai-dev at collab.sakaiproject.org>
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>   
> TO UNSUBSCRIBE: send email tosakai-dev-unsubscribe at collab.sakaiproject.org  <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org>  with a subject of "unsubscribe"
>
>
>
> -- 
> ==================================
> Adrian Fish
> Software Engineer
> Centre for e-Science
> Bowland  Tower  South C Floor
> Lancaster  University
> Lancaster
> LA1 4YW
> email:a.fish at lancaster.ac.uk  <mailto:a.fish at lancaster.ac.uk>
>   
> http://confluence.sakaiproject.org/display/YAFT/Yaft
> http://confluence.sakaiproject.org/display/CLOG/Home
> http://confluence.sakaiproject.org/display/BBB/Home
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-- 
==================================
Adrian Fish
Software Engineer
Centre for e-Science
Bowland Tower South C Floor
Lancaster University
Lancaster
LA1 4YW
email: a.fish at lancaster.ac.uk

http://confluence.sakaiproject.org/display/YAFT/Yaft
http://confluence.sakaiproject.org/display/CLOG/Home
http://confluence.sakaiproject.org/display/BBB/Home

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110111/0bc73a47/attachment.html 


More information about the sakai-dev mailing list