PDA

View Full Version : ExtDirect for Delphi



r.federiconi
16 Jun 2009, 3:05 AM
Hi,
I start the open source project to invoke Delphi Object with Ext.Direct remote procedure call.

http://code.google.com/p/extdirectdelphi/

aconran
16 Jun 2009, 5:40 AM
Thanks for your contribution; I've added the Delphi Router to the master list.

r.federiconi
16 Jun 2009, 6:45 AM
What's the "master list"?

Condor
16 Jun 2009, 7:27 AM
Here is the master list (http://extjs.com/forum/showthread.php?t=67992).

pbotelho
17 Nov 2009, 4:01 AM
Hi Federiconi
I've dowloaded and successifully compiled the Demo isapi. It looks very interesting for Delphi developers using ExtJs, congratulations !!
Do you have the html/client side files containing the the ExtJs (ExtDirect) calls to the server ?
Tks
Paulo Botelho

r.federiconi
17 Nov 2009, 7:35 AM
Sure...
http://extdirectdelphi.googlecode.com/files/Demo_0.4.zip

pbotelho
17 Nov 2009, 10:53 AM
Sure...
http://extdirectdelphi.googlecode.com/files/Demo_0.4.zip

Thanks for the Demo. It's working here as expected !!
I will continue with the tests.
Paulo Botelho

pbotelho
29 Nov 2009, 1:14 PM
Hi Federiconi,

Now i'm trying to reproduce the example at :
http://www.extjs.com/deploy/dev/examples/grid/array-grid.html

But the difference is that the data (js array) will be generated at server-side (delphi), on a function returning the string. The problem occours because the returnig text is Html encoded ex : S%E3o%20Paulo

Here an exemple of my function :

function TServerObject1.Teste4(pfoo: string): string;
var
Dados:TStringList;
begin
Dados:=TStringList.create;
try
Dados.LoadFromFile('Dados_Teste4.txt');
result:=AnsiToUtf8(Trim(Dados.Text));
finally
Dados.free;
end;
end;

My question is : How can i generate the result on plain text, without being Html encoded ?

r.federiconi
21 Dec 2009, 2:00 AM
In the last commit on SVN source I added Encoded property in TExtDirect component.. the default it's true.. You have to set false..

hugquocip
26 Dec 2009, 3:08 PM
I accept with information:The extended cut of Dreamscape is due to go off to US distributors in early September.

pbotelho
27 Dec 2009, 6:35 AM
Hi Federiconi,

Thanks for yr last response. It worked !

Now I need to provide some responses in Json format but it's a complex generation so I cannot use the TJsonFast type. I've tried to use as String, but the json is being enclosed on " (double quotes), generating an invalid content.
I guess I shoud use TContentFile type, could you provide an example using TContentFile ?

Tks Again.

Paulo Botelho

pbotelho
28 Dec 2009, 2:15 AM
Hi Federiconi,

Thanks for yr last response. It worked !

Now I need to provide some responses in Json format but it's a complex generation so I cannot use the TJsonFast type. I've tried to use as String, but the json is being enclosed on " (double quotes), generating an invalid content.
I guess I shoud use TContentFile type, could you provide an example using TContentFile ?

Tks Again.

Paulo Botelho

Hi Federiconi,

I'm not sure I was clear enough on last post, I'll try better ...
I mean that my server side application already generates some jSon (as string output), so I would like to use it as an string, without having to re-generate it as TJsonFast type. I've tried to output the existing jSon with an function returning string, but on the response, my json comes enclosed inside dobule quotes, generating an error at client side


For example :

Let's say the jSon returned by method Teste3 is {"airport":"JFK"}

Here is how it is being returned (checked using firebug) :

{"type":"rpc","tid":3,"action": "IServerObject1","method":"Teste3","result":"{"airport":"JFK"}"}


Here is how it should be returned :

{"type":"rpc","tid":3,"action": "IServerObject1","method":"Teste3","result":{"airport":"JFK"}}

r.federiconi
3 Jan 2010, 6:34 AM
In the last commit source I implemented the TExtDirectObject base class that expose the overrideable method ToString() .. in the demo example now the JsonString new method use the TStringObject..

lgomes
1 Feb 2010, 10:01 AM
Hi,

I'd like to know how can I submit a form, using a Direct method, setting the submit handler as a "formHandler" like this link: http://www.extjs.com/deploy/dev/examples/direct/direct-form.php

By the way, I was trying to test it in unit "ExtDirectDispatcher.pas" and, in line 101 I think that the field "AData[high(AData)].Name" should recieve "ARequest.ContentFields.Names[i];" in order to "Request.QueryFields.Names[i];".

Thanks,
Leo

lgomes
8 Feb 2010, 8:29 AM
Hi,

Is possible get cookie data in implementation of the server method ?

Thanks,
Leo

r.federiconi
21 Feb 2010, 10:20 AM
Hi,
I committed the version 0.6 with direct-form implementation in the demo.

r.federiconi
21 Feb 2010, 10:45 AM
Yes,
I added the Request:TWebRequest property in the TExtDirectRemotable object.

lgomes
22 Feb 2010, 6:50 AM
Hi Federiconi,

I've already tested the Form Integration and it worked fine. Thank you!

In demo of Form Integration, I could see that you've created the class TProfile. I'd like to know how can I get cookie fields in method "TProfile.getBasicInfo", for example. Is it possible ?

Thank you again,
Leo

r.federiconi
22 Feb 2010, 10:09 AM
In every remote object like TProfile you can access to new property Request (TWebRequest) that contains all http request informations also Request.CookieFields.Values property.

lgomes
22 Feb 2010, 10:39 AM
Hi Federiconi,

I could not find the Request property in the class TExtDirectRemotable. The last version, that I've had downloaded (ExtDirectDelphi 0.6), didn't have this property.

Could you check it please?

Tks,
Leo



unit ExtDirectRemotable;

interface

uses InvokeRegistry;

type
TExtDirectRemotable = class(TInvokableClass)
end;
implementation
end.

r.federiconi
22 Feb 2010, 1:11 PM
Sure, because this features it's in the current source repository trunk it will be included in the next version 0.7 but if you want you can download it with tortoiseSVN from here (http://tortoisesvn.net/downloads)