• 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: Overriding ERRest output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding ERRest output


  • Subject: Re: Overriding ERRest output
  • From: Mike Schrag <email@hidden>
  • Date: Wed, 1 Sep 2010 13:05:48 -0400

you want to make a custom ERXRestFormat with a custom ERXRestWriter and ERXRestParser if you want to change the actual format of the wire protocol

On Sep 1, 2010, at 11:54 AM, David Avendasora wrote:

Well, I'm assuming that's what it's currently using to generate the XML it is, it's just that as wonderfully correct that XML is, I need to break it. I suppose I can create a DABustificatedXmlResponseWriter subclass, but I'm starting to question the wisdom of using the ERRest hammer on this particular bolt.

Dave

On Sep 1, 2010, at 10:50 AM, Martin Samm wrote:

Dave,

haven't tried it (yet) but i think ERXAbstractRestResponseWriter (or the subclass ERXXmlRestResponseWriter) might be what you're looking for.


On 1 September 2010 15:40, David Avendasora <email@hidden> wrote:
Hi all,

I know this is a Wonder question, but for some reason the source forge mail servers tend to refuse my mail.

I'm trying to use ERRest to replace some existing XML service calls, the problem is that the current formatting of the XML files produced is somewhat arbitrary, as in it doesn't match the data model.

For example, we have two entities: Identity and Account. Each identity can have multiple accounts, but in the XML, they are flattened into a "person" node so we currently have:

<person>
       <id>1928374</id>
       <username>StrudelCutie4427</username>
       <firstname>Heinz</firstname>
       <lastname>Doofenshmirtz</lastname>
</person>

ERRest is producing:

<Accounts type="Account" id="10201040013">
       <userName>StrudelCutie4427</userName>
       <identity type="Identity" id="1040013">
               <id>1928374</id>
               <firstname>Heinz</firstname>
               <lastname>Doofenshmirtz</lastname>
       </identity>
</Accounts>

So I want to override not just what the entities are called (just for this one request - not for all requests against Account and Identity) but I also want to flatten some of the relationships and rename attributes.

I can't see any built-in way to do this kind of toying with the object graph, unless I'm missing something.

So, if ERRest can't do it, what would be some suggestions on how to do it? Create a non-EO class that manually flattens the information and have ERRest vend that?

Dave _______________________________________________
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



--
Martin Samm
Aetopia Ltd
+44 (0) 28 9099 8767
____________________________________________________________________________
Aetopia Ltd is a limited company registered in Belfast, Northern Ireland,
with registration number NI053321, having its principal place of business
(and postal address) at ECIT Institute, Queens Road, BELFAST BT3 9DT
and registered office at 1, Lanyon Quay, BELFAST BT1 3LG

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:
    • Apache2.2 on Windows within Eclipse
      • From: Michael Hast <email@hidden>
References: 
 >Overriding ERRest output (From: David Avendasora <email@hidden>)
 >Re: Overriding ERRest output (From: Martin Samm <email@hidden>)
 >Re: Overriding ERRest output (From: David Avendasora <email@hidden>)

  • Prev by Date: Re: ERAttachment help
  • Next by Date: Re: ERAttachment help
  • Previous by thread: Re: Overriding ERRest output
  • Next by thread: Apache2.2 on Windows within Eclipse
  • Index(es):
    • Date
    • Thread