OMG! I made it work somehow! Here's what I did:
Outbound show filter:
filter.include( Card.BACK_SIDE_RESOURCE.dot( TextCardResource.CONTENT )
);
SmartGWT RestDataSource field:
DataSourceTextField field = new DataSourceTextField(
"backSideResource.content", "Back" /*Title*/ );
field.setValueXPath( "backSideResource/content" ); /*or path in JSON*/
Inbound update filter:
filter.include( Card.BACK_SIDE_RESOURCE ).include(
TextCardResource.CONTENT );
filter.addMap( new ERXKey<String>( "backSideResource.content" ),
Card.BACK_SIDE_RESOURCE.dot( TextCardResource.CONTENT ) );
I'm not sure if is a documented or undocumented feature, but I can have a JSON
attribute key contain a dot and still
Now I have a new problem, NULL-ing. In my JSON I have:
"backSideResource.content":null
I thought it would automatically work. Is there any trick to NULL-ing
attributes?
= Robert =
On Oct 14, 2012, at 5:42 PM, Pascal Robert <[email protected]> wrote:
> I never wrote a new format, but check the existing formats (ERXJSONRestParser
> / ERXJSONRestWriter would be a good start). I think ERXSproutCoreRestWriter
> was for a case like yours, e.g. SproutCore needs to add elements to a
> response.
>
>> Could u kindly point me to an example of implementing a new erxformat?
>>
>> On Oct 14, 2012, at 3:58 PM, [email protected] wrote:
>>
>>> Maybe it should be done as a new ErxFormat.
>>>
>>> Envoyé de mon iPhone
>>>
>>> Le 2012-10-14 à 16:51, "Robert Hanviriyapunt" <[email protected]> a écrit :
>>>
>>>> SmartGWT is a strange animal.
>>>>
>>>> I like it's idea of various DataSource classes, specifically
>>>> RestDataSource. And I love WebObjects and am looking to employ ERRest. I
>>>> have GET and PUT being called for indexAction and updateAction. I have
>>>> indexAction returning my EOs in an container Dictionary to provide other
>>>> data required by SmartGWT. But now I'm trying to handle the PUT request
>>>> by SmartGWT to my Controller.updateAction method and have the following
>>>> JSON structure to deal with:
>>>>
>>>> {
>>>> transaction: {
>>>> operations: [{
>>>> dataSource:"countryDS",
>>>> operationType:"update",
>>>> data: {
>>>> pk: 1
>>>> countryName: "Edited Value",
>>>> capital: "Edited Value",
>>>> continent: "Edited Value"
>>>> }
>>>> }, {
>>>> dataSource:"countryDS",
>>>> operationType:"update",
>>>> data: {
>>>> pk: 2,
>>>> capital: "Edited Value",
>>>> popuilation: 123456
>>>> }
>>>> }]
>>>> }
>>>> }
>>>>
>>>>
>>>> My updated fields are in the values for the keys named "data". Is there
>>>> an example of handling this data in the REST update request? Or anyone
>>>> done this before that hasn't posted about it that can offer any advice?
>>>>
>>>> = Robert =
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
>>>>
>>>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]