• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ERRest tutorial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERRest tutorial


  • Subject: Re: ERRest tutorial
  • From: Pascal Robert <email@hidden>
  • Date: Mon, 02 Jan 2012 14:04:12 -0500

Le 2012-01-02 à 13:09, Alexis Tual a écrit :

> Hi Pascal and the list, best wishes for 2K12 !
>
> Thanks for this tutorial, but I have some questions :
> - Where is the "new Wonder REST Application" wizard ? I can't see it in my current WOLips (v 3.7.1002088)

It's in my fork of WOLips. I have a problem with it, I can create a project from the template by doing File -> New -> Other -> WO Project from Template, but I get an exception when doing it from File -> New.

> - "Last step in the controller: implementing the showAction method. Again, the code is simple:" it's rather the indexAction
> - A more general concern about html routing, other rest frameworks (rails, grails) use actions also when there's html routing. With ERRest as I understand, the isAutomaticHtmlRoutingEnabled bypasses the actions to directly render the views.

It only bypass actions when you use the convention <EntityName><Action>Page, if the view component have a different name, it falls back to the action. If you fall back to the action, you check if the format is HTML (like you did in your example :-)).

> Instead too use the same actions for json,xml or html formats, I would do :
>
> 	@Override
> 	public WOActionResults indexAction() throws Throwable {
> 		NSArray<BlogEntry> entries = BlogEntry.fetchAllBlogEntries(editingContext());
> 		WOActionResults response;
> 		if (format().equals(ERXRestFormat.html())) {
> 			BlogEntryIndexPage index = pageWithName(BlogEntryIndexPage.class);
> 			index.setEntries(entries);
> 			response = index;
> 		} else {
> 			response = response(entries, filter());
> 		}
> 		return response;
> 	}
> This, to avoid duplicating some logic (the fetchAll stuff).
>
> Thansk again !
>
> Alex
>
> Le 29 déc. 2011 à 14:32, Pascal Robert a écrit :
>
>> Hello everyone,
>>
>> I wrote a mini ERRest tutorial that will be part of a larger "Getting Started with Project Wonder" tutorial. It's in the wiki:
>>
>>  http://wiki.wocommunity.org/display/WONDER/Your+First+Rest+Project
>>
>> The only thing missing is screen shots, I will add them after I get to resolve the problem with adding a REST template in WOLips…
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERRest tutorial
      • From: Pascal Robert <email@hidden>
    • Re: ERRest tutorial
      • From: Alexis Tual <email@hidden>
References: 
 >Re: ERRest tutorial (From: Alexis Tual <email@hidden>)

  • Prev by Date: thanks
  • Next by Date: Re: thanks
  • Previous by thread: Re: ERRest tutorial
  • Next by thread: Re: ERRest tutorial
  • Index(es):
    • Date
    • Thread