Daraja HTTP Framework 3.0
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjWebComponentContextHandler Class Reference

Context Handler for Web Components. More...

+ Inheritance diagram for TdjWebComponentContextHandler:

Public Member Functions

 TdjWebComponentContextHandler (const string ContextPath, Boolean Sessions=False)
 Constructor.
 
 ~TdjWebComponentContextHandler ()
 Destructor.
 
TdjWebComponentHolder AddWebComponent (TdjWebComponentClass ComponentClass, const string UrlPattern)
 Add a Web Component.
 
TdjWebComponentHolder Add (TdjWebComponentClass ComponentClass, const string UrlPattern)
 Add a Web Component.
 
 AddWebComponent (TdjWebComponentHolder Holder, const string UrlPattern)
 Add a Web Component.
 
 AddWebFilter (TdjWebFilterHolder Holder, const string UrlPattern)
 Add a Web Filter Holder.
 
TdjWebFilterHolder AddWebFilter (TdjWebFilterClass FilterClass, const string UrlPattern)
 Add a Web Filter, specifying a WebFilter class and the mapped WebComponent name.
 
TdjWebFilterHolder Add (TdjWebFilterClass FilterClass, const string UrlPattern)
 Add a Web Filter, specifying a WebFilter class and the mapped WebComponent name.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjContextHandler
 TdjContextHandler (const string ContextPath)
 Create a ContextHandler.
 
 ~TdjContextHandler ()
 Destructor.
 
IContext GetCurrentContext ()
 The internal IContext field.
 
 SetInitParameter (const string Key, const string Value)
 Set initialization parameter.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Stop the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjHandlerWrapper
 AddHandler (const IHandler Handler)
 Add a handler to the container.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler from the container.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Stop the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjAbstractHandler
 TdjAbstractHandler ()
 Constructor.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Start the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjLifeCycle
 Start ()
 Start the handler.
 
 Stop ()
 Stop the handler.
 
Boolean IsStarted ()
 
Boolean IsStopped ()
 

Protected Member Functions

 DoHandle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 
- Protected Member Functions inherited from TdjContextHandler
Boolean ContextMatches (const string ConnectorName, const string Target)
 Check if the Document matches this context.
 
string ToConnectorName (TdjServerContext Context)
 Creates connector name in the form 'host:port'.
 
- Protected Member Functions inherited from TdjHandlerWrapper
TIdHTTPSession GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create)
 Get a HTTP session.
 
- Protected Member Functions inherited from TdjAbstractHandlerContainer
 AddHandler (const IHandler Handler)
 Add a handler.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler.
 
- Protected Member Functions inherited from TdjLifeCycle
 DoStart ()
 Execute the custom start code.
 
 DoStop ()
 Execute the custom stop code.
 
 CheckStarted ()
 Raises an exception if the lifecycle is in "started" state.
 
 CheckStopped ()
 Raises an exception if the lifecycle is in "stopped" state.
 

Additional Inherited Members

- Public Attributes inherited from TdjContextHandler
TStrings ConnectorNames
 
string ContextPath
 
IHandler ErrorHandler
 
- Public Attributes inherited from TdjHandlerWrapper
IHandler Handler
 
- Public Attributes inherited from TdjLifeCycle
Boolean Started
 True if the state is "started".
 
Boolean Stopped
 True if the state is "stopped".
 

Detailed Description

Context Handler for Web Components.

Constructor & Destructor Documentation

◆ TdjWebComponentContextHandler()

TdjWebComponentContextHandler::TdjWebComponentContextHandler ( const string ContextPath,
Boolean Sessions = False )

Constructor.

Parameters
ContextPaththe context path
Sessionsenable HTTP sessions

References TdjHandlerWrapper::AddHandler(), and TdjContextHandler::ContextPath.

Member Function Documentation

◆ Add() [1/2]

TdjWebComponentHolder TdjWebComponentContextHandler::Add ( TdjWebComponentClass ComponentClass,
const string UrlPattern )

Add a Web Component.

Parameters
ComponentClassWebComponent class
UrlPatternpath specification
Returns
the Web Component holder, which can be used for further configuration.
Exceptions
EWebComponentExceptionif the Web Component can not be added

References AddWebComponent().

◆ Add() [2/2]

TdjWebFilterHolder TdjWebComponentContextHandler::Add ( TdjWebFilterClass FilterClass,
const string UrlPattern )

Add a Web Filter, specifying a WebFilter class and the mapped WebComponent name.

Parameters
FilterClassWebFilter class
UrlPatternpath specification
Returns
the Web Filter holder, which can be used for further configuration.
Exceptions
Exceptionif the WebFilter can not be added

References AddWebFilter().

◆ AddWebComponent() [1/2]

TdjWebComponentHolder TdjWebComponentContextHandler::AddWebComponent ( TdjWebComponentClass ComponentClass,
const string UrlPattern )

Add a Web Component.

Parameters
ComponentClassWebComponent class
UrlPatternpath specification
Returns
the Web Component holder, which can be used for further configuration.
Exceptions
EWebComponentExceptionif the Web Component can not be added

References TdjWebComponentHandler::AddWebComponent(), TdjWebComponentHandler::AddWithMapping(), TdjWebComponentHandler::FindHolder(), TdjContextHandler::GetCurrentContext(), and TdjWebComponentHolder::SetContext().

Referenced by Add().

◆ AddWebComponent() [2/2]

TdjWebComponentContextHandler::AddWebComponent ( TdjWebComponentHolder Holder,
const string UrlPattern )

Add a Web Component.

Parameters
Holderholds information about the Web Component
UrlPatternpath specification
Exceptions
EWebComponentExceptionif the Web Component can not be added

References TdjWebComponentHandler::AddWithMapping(), TdjWebComponentHolder::GetContext(), TdjWebComponentHolder::SetContext(), and TdjWebComponentHolder::WebComponentClass.

◆ AddWebFilter() [1/2]

TdjWebFilterHolder TdjWebComponentContextHandler::AddWebFilter ( TdjWebFilterClass FilterClass,
const string UrlPattern )

Add a Web Filter, specifying a WebFilter class and the mapped WebComponent name.

Parameters
FilterClassWebFilter class
UrlPatternpath specification
Returns
the Web Filter holder, which can be used for further configuration.
Exceptions
Exceptionif the WebFilter can not be added

References TdjWebComponentHandler::AddWebFilter().

◆ AddWebFilter() [2/2]

TdjWebComponentContextHandler::AddWebFilter ( TdjWebFilterHolder Holder,
const string UrlPattern )

Add a Web Filter Holder.

Parameters
Holderholds information about the Web Filter
UrlPatternpath specification
Exceptions
Exceptionif the Web Filter can not be added

References TdjWebComponentHandler::AddWebFilter(), and TdjWebFilterHolder::SetContext().

Referenced by Add().

◆ DoHandle()

TdjWebComponentContextHandler::DoHandle ( const string Target,
TdjServerContext Context,
TdjRequest Request,
TdjResponse Response )
protected
Parameters
TargetRequest target
ContextHTTP server context
RequestHTTP request
ResponseHTTP response

References TdjContextHandler::ContextPath, and TdjWebComponentHandler::Handle().

Referenced by Handle().

◆ Handle()

TdjWebComponentContextHandler::Handle ( const string Target,
TdjServerContext Context,
TdjRequest Request,
TdjResponse Response )

Handle a HTTP request.

Parameters
TargetRequest target
ContextHTTP server context
RequestHTTP request
ResponseHTTP response
Exceptions
EWebComponentExceptionif an exception occurs that interferes with the component's normal operation
See also
IHandler

References TdjContextHandler::ContextMatches(), DoHandle(), TdjHandlerWrapper::GetSession(), and TdjContextHandler::ToConnectorName().