Re: [fpc-devel] Improvments to HTML Web Module

2018-03-03 Thread Michael Van Canneyt



On Sat, 3 Mar 2018, African Wild Dog wrote:


2018-03-03 6:31 GMT-03:00 Michael Van Canneyt :



I suppose you mean TCustomHTMLModule ?



Exactly. Sorry for my typo. I mean TCustomHTMLModule.




I have fixed 1 by descending TCustomHTMLModule from TSessionHTTPModule. It
originally had support for sessions. That it lost this support was the
result of a refactoring of session support... This is now fixed.
See revision 38397.



Perfect.



As for 2, what do you mean by this ? TCustomHTMLModule already supports
HTML Content actions.
If you planned to actually add it to TCustomHTMLModule: No, that is not OK.



HTML content actions are not used by the TCustomHTMLModule. If you have a
module called "mymodule" and an action called "myaction", when you access
the address "/mymodule/myaction", the event OnGetContent of the WebModule
is always executed but, the OnGetContent event of the action is never
executed. This is by design. I would like to fix it.



OK, this is clearly a bug :(
I committed a potential fix in rev 38401. Please check if it works for you,
feel free to make/suggest improvements.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Improvments to HTML Web Module

2018-03-03 Thread African Wild Dog
2018-03-03 6:31 GMT-03:00 Michael Van Canneyt :

>
> I suppose you mean TCustomHTMLModule ?
>
>
Exactly. Sorry for my typo. I mean TCustomHTMLModule.


>
> I have fixed 1 by descending TCustomHTMLModule from TSessionHTTPModule. It
> originally had support for sessions. That it lost this support was the
> result of a refactoring of session support... This is now fixed.
> See revision 38397.
>

Perfect.


> As for 2, what do you mean by this ? TCustomHTMLModule already supports
> HTML Content actions.
> If you planned to actually add it to TCustomHTMLModule: No, that is not OK.
>
>
HTML content actions are not used by the TCustomHTMLModule. If you have a
module called "mymodule" and an action called "myaction", when you access
the address "/mymodule/myaction", the event OnGetContent of the WebModule
is always executed but, the OnGetContent event of the action is never
executed. This is by design. I would like to fix it.


Regards
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Improvments to HTML Web Module

2018-03-03 Thread Michael Van Canneyt



On Fri, 2 Mar 2018, African Wild Dog wrote:


I would like to propose (and develop, if authorized) the following
improvements to the web module specialized in generating HTML content
(TCustomHTTPModule):


I suppose you mean TCustomHTMLModule ?

Because TCustomHTTPModule is a base class.

It should not know anything of actions, HTML, sessions, whatnot.
It just needs to know how to handle a request: The HandleRequest abstract
method.



1 - Add support for sessions;
2 - Add support for the use of actions (THTMLContentAction)


I have fixed 1 by descending TCustomHTMLModule from TSessionHTTPModule. 
It originally had support for sessions. That it lost this support was 
the result of a refactoring of session support... This is now fixed.

See revision 38397.

As for 2, what do you mean by this ? 
TCustomHTMLModule already supports HTML Content actions.
If you planned to actually add it to TCustomHTMLModule: 
No, that is not OK.


If there is something which prevents you from working with TCustomHTMLModule
other than session support (which is now fixed) we can discuss possible 
solutions.

For starters, it's an option to let it descend from TCustomFPWebModule
instead of TSessionHTTPModule. 
I have refactored TCustomFPWebModule so actions, template and template vars

can now be overridden by descendents, to make this possible. See rev. 38398.

Let me know if you have any other issues.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] Improvments to HTML Web Module

2018-03-02 Thread African Wild Dog
I would like to propose (and develop, if authorized) the following
improvements to the web module specialized in generating HTML content
(TCustomHTTPModule):

1 - Add support for sessions;
2 - Add support for the use of actions (THTMLContentAction)

Regards
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel