Hey David,

Ok splendid - another alternative it is.

FYI - I added a few more HTTP code representations to HttpResponse.scala
last night... Nothing crazy, but just some other ones I needed. I also need
to add some extra parameters to some of them so they directly represent the
RFC spec, but they are OK for the moment :-)

Cheers

Tim

On 31/01/2009 15:48, "David Pollak" <feeder.of.the.be...@gmail.com> wrote:

> Tim,
> 
> Please don't change the existing XMLApiHelpers, but feel free to create an
> alternative.  I expect different people are going to have different styles and
> providing them with lots of alternatives will be important.
> 
> I'm planning another alternative that will returns failures as different HTTP
> codes to make things more RESTful.
> 
> Thanks,
> 
> David
> 
> On Sat, Jan 31, 2009 at 3:07 AM, Tim Perrett <he...@timperrett.com> wrote:
>> 
>> Guys,
>> 
>> Just doing some work with the XMLApiHelper and im finding some things
>> that can be improved. For instance, the trait provides createTag which
>> you then have to override like so:
>> 
>> def createTag(in: NodeSeq) = <api>{in}</api>
>> 
>> IMO, it seems that this isnt ideal as if you were returning a list of
>> users, your xml would be:
>> 
>> <api>
>>   <user>....</user>
>>   <user>....</user>
>> </api>
>> 
>> It would be better to have a configurable root node, so its a more
>> logical semantic:
>> 
>> <users>
>>   <user>....</user>
>>   <user>....</user>
>> </users>
>> 
>> I've been playing around with the best way to do it and by changing
>> the implicits and the xml build methods I now have it so that you can
>> do:
>> 
>> def listAllUsers = {
>>   ...
>>   ("users", listOfUsers)
>> }
>> 
>> This appears to be the best way to do it, otherwise things start
>> getting messy?
>> 
>> Whilst I can make these changes code wise, im very aware that ESME
>> uses this helper a lot and this would mean some significant breaking
>> changes in the api construction, both for ESME, and no doubt other
>> projects. IMHO, the change is worth the hassle as it will make
>> services up of more logically formed xml.
>> 
>> What are people's thoughts?
>> 
>> Cheers
>> 
>> Tim
>> 
> 
> 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to