ERRest: rename entity node
Edward Merry <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
WO geniuses,
I am developing an ERRest application to accept orders from one of our clients. The challenge is their data model is much simpler that ours so I have to bridge that gap. I took care of the structure differences by writing a decorator class around the root entity and then using the entity rest delegate to handle primary keys, etc. Works great.
Where I am stuck now is changing the name of a node (which is an actual entity). In the sample below, I'd like to change
<OrderItem id="6594930" type="OrderItem">
to
<item id="6594930" type="OrderItem">
(plus, the closing tag as well)
<?xml version="1.0" encoding="UTF-8"?>
<SimpleOrder id="2339461" type="SimpleOrder">
<attention>John Doe</attention>
-- snip --
<items type="OrderItem">
<OrderItem id="6594930" type="OrderItem">
<itemDescription>PEBCCDV8US</itemDescription>
<itemTitle>BOS (8) Combo</itemTitle>
<quantity type = "integer">1</quantity>
</OrderItem>
</items>
<creationTime type = "datetime">2012-10-22T22:52:11Z</creationTime>
<lastModified type = "datetime">2012-10-23T06:58:02Z</lastModified>
</SimpleOrder>
I looked around and didn't see a simple solution. setExternalNameForInternalName just changes "type," not the node name.
Is the solution to write my own format class(es)?
Edward Merry
P.S. The ERRest framework is fantastic. Thanks to Pascal, Mike and everyone who has contributed to it.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712