Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-03

Improvments to HTML Web Module

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Michael Van Canneyt
to African Wild Dog
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.

Reply by email

African Wild Dog
to Michael Van Canneyt

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

I suppose you mean TCustomHTMLModule ?

Exactly. Sorry for my typo. I mean TCustomHTMLModule.

Show quoted text 6 lines
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.

Show quoted text 5 lines
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

Reply by email

Michael Van Canneyt
to African Wild Dog
African Wild Dog wrote 29 lines
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.

Reply by email