SuperObject Notification

40 views
Skip to first unread message

mrbar2000

unread,
May 8, 2010, 4:00:05 PM5/8/10
to Delphi on Rails
Hi friend,

There are some way to use DOR server with a desktop client
application? How we can do this?

Henri Gourvest

unread,
May 8, 2010, 6:07:18 PM5/8/10
to Delphi on Rails
you mean a client GUI application ?
in wich programming language ?

Marcos Barreto

unread,
May 9, 2010, 7:00:15 PM5/9/10
to delphi...@googlegroups.com
Yeah, a GUI VCL desktop application! How do This?
I want too see with you if there is way to integrate Flex and DOR!
My goal is create the same server application and use the same exchange message protocol with differents client applications.

Henri Gourvest

unread,
May 10, 2010, 8:26:15 AM5/10/10
to Delphi on Rails
I have never used Flex before, but it was easy to create a sample
program that interprets JSON data from a DOR server.
I used this additional library: http://code.google.com/p/as3corelib/
and take a look here:
http://ntt.cc/2008/10/06/as3corelib-tutorial-how-to-use-json-class-in-flex.html

With Flex, data controls can automatically render xml, so you could
automatically create an xml view from superobject in the Dor Server.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">

<fx:Script>
<![CDATA[
import com.adobe.serialization.json.JSON;

import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
import mx.utils.ObjectUtil;

private var srv:HTTPService

protected function button1_clickHandler(event:MouseEvent):void
{
srv = new HTTPService();
srv.url = "http://server/controller/action.json";
srv.method = "GET";
srv.resultFormat = "text";
srv.addEventListener("result", httpResult);
srv.addEventListener("fault", httpResult);
srv.send();

}
public function httpResult(event:ResultEvent):void {
var result:Object = JSON.decode(event.result.toString());
memo.text = JSON.encode(result);
}

public function httpFault(event:FaultEvent):void {
var faultstring:String = event.fault.faultString;
Alert.show(faultstring);
}

]]>
</fx:Script>
<s:Button x="55" y="58" label="Button"
click="button1_clickHandler(event)"/>
<s:TextArea id="memo" x="44" y="116" width="374" height="221"/>
</s:WindowedApplication>

Marcos Barreto

unread,
May 10, 2010, 9:44:39 AM5/10/10
to delphi...@googlegroups.com
Ok. But what about VCL desktop applications? To update GUI I need receive notification of changes on superobject properties and lists!

Henri Gourvest

unread,
May 10, 2010, 11:25:21 AM5/10/10
to delphi...@googlegroups.com
I do not understand what you expect of me.
the client sends a request to the server and the server responds.
the server does not send notification to the client asynchronously.


2010/5/10 Marcos Barreto <mrba...@gmail.com>

Marcos Barreto

unread,
May 10, 2010, 12:55:22 PM5/10/10
to delphi...@googlegroups.com
Maybe this is a wrong forum to this. i think that i have post on superobject forum.
I want know how use the superobject returned from server in my desktop application.
How use it as a common object?
Person.Name instead Person.S['Name']
And how I can be notified when changing the superobject data? Person.Name := 'Marcos'
Reply all
Reply to author
Forward
0 new messages