Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread silvioprog
On Fri, Apr 15, 2016 at 4:37 PM, Leonardo M. Ramé 
wrote:
[...]

> Sorry, nevermind. I've found a way to configure KendoUi Grid to send
> queries as POST using JSON, so, problem solved.


Awesome. :-)

tip: you can use jQuery $.param before sent the JSON filter to
FCL-web/Brook, and decode it with HTTPDecode()+FPJson in the server. :-)

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Leonardo M . Ramé

El 15/04/16 a las 16:33, silvioprog escribió:

On Fri, Apr 15, 2016 at 4:25 PM, Leonardo M. Ramé mailto:l.r...@griensu.com>> wrote:
[...]

It works pefectly por param=value&..., but I don't know how to parse
array type values.

example: ?filters[0]['filter']=name&filters[0]['value']=john


This filter can be easily parser if you send it as:

?filters[0].filter=name&filters[0].value=john

The parser can populate a class structure like:

=== code ===

   TYourObject = class
   published
 property filter: string ...;
 property value: string ...;
   end;

   TFilters = class(TFPGMapObject)
   end;

=== /code ===




Sorry, nevermind. I've found a way to configure KendoUi Grid to send 
queries as POST using JSON, so, problem solved.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread silvioprog
On Fri, Apr 15, 2016 at 4:33 PM, silvioprog  wrote:
[...]

> This filter can be easily parser ...
>

I meant: "This filter can be easily parsed ... ".

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread silvioprog
On Fri, Apr 15, 2016 at 4:25 PM, Leonardo M. Ramé 
wrote:
[...]

> It works pefectly por param=value&..., but I don't know how to parse array
> type values.
>
> example: ?filters[0]['filter']=name&filters[0]['value']=john


This filter can be easily parser if you send it as:

?filters[0].filter=name&filters[0].value=john

The parser can populate a class structure like:

=== code ===

  TYourObject = class
  published
property filter: string ...;
property value: string ...;
  end;

  TFilters = class(TFPGMapObject)
  end;

=== /code ===

--
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Michael Van Canneyt



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:




El 15/04/16 a las 16:22, Michael Van Canneyt escribió:



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:


Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value&fields[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?


What other way would you like ? What is not good about this way ?

Michael.


It works pefectly por param=value&..., but I don't know how to parse array 
type values.


example: ?filters[0]['filter']=name&filters[0]['value']=john


What is the problem ? Everything before a = is the name ?

So:

Name:=Request.QueryFields.values['filters[0][''filter'']'];
Value:=Request.QueryFields.values['filters[0][''value'']'];

It doesn't automatically convert them to arrays, obviously.
For that you need to know how the array (in this case double array) is encoded.

Microsoft uses() in it's query names, like in:

?filters(0,'filter')=name&filters(0,'value')=john

I see no need to provide routines for this.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Leonardo M . Ramé



El 15/04/16 a las 16:22, Michael Van Canneyt escribió:



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:


Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value&fields[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?


What other way would you like ? What is not good about this way ?

Michael.


It works pefectly por param=value&..., but I don't know how to parse 
array type values.


example: ?filters[0]['filter']=name&filters[0]['value']=john

Regards,
--
Leonardo M. Ramé
Medical IT - Griensu S.A.
Av. Colón 636 - Piso 8 Of. A
X5000EPT -- Córdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Michael Van Canneyt



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:


Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value&fields[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?


What other way would you like ? What is not good about this way ?

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread silvioprog
On Fri, Apr 15, 2016 at 2:47 PM, Leonardo M. Ramé 
wrote:

> Hi, I need to extract the field values of a GET query of type:
>
> http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value&fields[2]=f2value
>
> Is there a way to handle this apart from HttpRequest.QueryFields?
>

Yes.

Supposing you have an object called "TQuery" with the published property
"Fields", you can do it easily with the "TBrookParser" object. Take a look
at this demo:

http://pastebin.com/QEh5Hnen

I've been using the "Fields" property as "TStringList", but you can use any
list type, just creating a list adapter for that.

Feel free to use the Brook community
 too! :-)

Regards,
> --
> Leonardo M. Ramé
> http://leonardorame.blogspot.com


-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-15 Thread Florian Klämpfl
Am 15.04.2016 um 15:39 schrieb Michael Schnell:
> On 04/15/2016 03:30 PM, Marco van de Voort wrote:
>> And an investment in manhours to make that happen that IMHO will never be 
>> earned back.
> I can't contradict.
> 
> But in fact "earned back" is extremely hard to define when comparing two far 
> distant edges of a
> non-profit project.

It is very very simple for a non-profit/OSS project: more man hours earned back 
than those which
were invested.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Leonardo M . Ramé

Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value&fields[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?

Regards,
--
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-15 Thread Michael Schnell

On 04/15/2016 03:30 PM, Marco van de Voort wrote:
And an investment in manhours to make that happen that IMHO will never 
be earned back.

I can't contradict.

But in fact "earned back" is extremely hard to define when comparing two 
far distant edges of a non-profit project.


-Michael


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-15 Thread Michael Schnell

On 04/15/2016 03:29 PM, Marco van de Voort wrote:

As said: I (unsuccessfully) tried.

So you can't operate a text editor?

I unsuccessfully tried to create an environment that lets me see the 
modified help text (we already did discuss this some years ago).


AFAIR, I did send (you ?) a modified help text for "CheckSynchronize()" 
(in fact a "patch" as it was the complete small chapter). (Of course 
this was not for the Lazarus help files, but RTL.)


Maybe it now is included.

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-15 Thread Marco van de Voort
On Tue, Apr 12, 2016 at 10:01:26AM +0200, Michael Schnell wrote:
> On 04/11/2016 09:28 PM, Marco van de Voort wrote:
> > It is the conjecture that the content will actually improve because of it
> > that I find highly doubtful.
> >
> Absolutely agreed ! An unmanaged Wiki would be highly dangerous. A 
> complete managing system on top of the standard Wiki software would be 
> required.

And an investment in manhours to make that happen that IMHO will never be
earned back.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-15 Thread Marco van de Voort
On Tue, Apr 12, 2016 at 10:02:56AM +0200, Michael Schnell wrote:
> On 04/11/2016 09:34 PM, Marco van de Voort wrote:
> >> Maybe you do remember that (with your help) I once tried to contribute
> >> to the fpc help.
> > Sorry, can't remember any patches, so it can't have been too serious!
> >
> As said: I (unsuccessfully) tried.

So you can't operate a text editor? 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus