C# Class EnterpriseWebLibrary.EnterpriseWebFramework.EwfApp

The HttpApplication class for a web site using EWF. Provides access to the authenticated user, handles errors, and performs other useful functions.
Inheritance: System.Web.HttpApplication
Datei anzeigen Open project: enduracode/enterprise-web-library Class Usage Examples

Public Properties

Property Type Description
BaseUrlOverrideGetter Func

Private Properties

Property Type Description
ExecuteWithBasicExceptionHandling void
GetDefaultBaseUrl string
GetRequestAppRelativeUrl string
Init void
getErrorPage System.PageInfo
getQueryParameters IEnumerable
getRequestBaseUrl string
getTransferPath string
handleAuthenticateRequest void
handleBeginRequest void
handleEndRequest void
handleError void
handleErrorIfOnErrorPage bool
handleErrorIfOnHandledErrorPage bool
handleErrorIfOnUnhandledExceptionPage bool
handlePostAuthenticateRequest void
rewritePathIfShortcutUrl void
set500StatusCode void
setStatusCode void
transferRequest void

Public Methods

Method Description
GetPageViewDataModificationMethod ( ) : System.Action

Returns a method that executes data modifications that happen simply because of a request and require no other action by the user. Returns null if there are no modifications, which can improve page performance since the data-access cache does not need to be reset. WARNING: Don't ever use this to correct for missing loadData preconditions. For example, do not create a page that requires a user preferences row to exist and then use a page-view data modification to create the row if it is missing. Page-view data modifications will not execute before the first loadData call on post-back requests, and we provide no mechanism to do this because it would allow developers to accidentally cause false user concurrency errors by modifying data that affects the rendering of the page.

SendHealthCheck ( ) : void

Standard library use only.

Protected Methods

Method Description
EwfApp ( ) : System

Registers event handlers for certain application events.

GetJavaScriptFiles ( ) : List

Creates and returns a list of JavaScript files that should be included on all EWF pages, including those not using the EWF user interface.

GetMediaTypeOverrides ( ) : IEnumerable

Gets the Internet media type overrides for the application, which are used when serving static files. Do not return null.

GetShortcutUrlResolvers ( ) : IEnumerable

Gets the shortcut URL resolvers for the application.

GetStyleSheets ( ) : List

Creates and returns a list of custom style sheets that should be used on all EWF pages, including those not using the EWF user interface.

RequestIsSecure ( HttpRequest request ) : bool

Returns true if the specified request is secure. Override this to be more than just HttpRequest.IsSecureConnection if you are using a reverse proxy to perform SSL termination. Remember that your implementation should support not just live installations, but also development and intermediate installations.

getRequestBasePath ( HttpRequest request ) : string

Returns the base path for the specified request. Override this if you are using a reverse proxy and are changing the base path. Never return null. Return the empty string to represent the root path. Remember that your implementation should support not just live installations, but also development and intermediate installations.

getRequestHost ( HttpRequest request ) : string

Returns the host name for the specified request. Override this if you are using a reverse proxy that is changing the Host header. Include the port number in the return value if it is not the default port. Never return null. If the host name is unavailable (i.e. the request uses HTTP 1.0 and does not include a Host header), return the empty string, which will cause a 400 status code to be returned. Remember that your implementation should support not just live installations, but also development and intermediate installations.

Private Methods

Method Description
ExecuteWithBasicExceptionHandling ( System.Action handler, bool setErrorInRequestState, bool set500StatusCode ) : void
GetDefaultBaseUrl ( bool secure ) : string
GetRequestAppRelativeUrl ( HttpRequest request, bool disableLeadingSlashRemoval = false ) : string
Init ( Type globalType, AppMetaLogicFactory metaLogicFactory ) : void
getErrorPage ( System.PageInfo ewfErrorPage ) : System.PageInfo
getQueryParameters ( string url ) : IEnumerable
getRequestBaseUrl ( HttpRequest request ) : string
getTransferPath ( EnterpriseWebLibrary.EnterpriseWebFramework.ResourceInfo resource ) : string
handleAuthenticateRequest ( object sender, EventArgs e ) : void
handleBeginRequest ( object sender, EventArgs e ) : void
handleEndRequest ( object sender, EventArgs e ) : void
handleError ( object sender, EventArgs e ) : void

This method will not work properly unless the application is initialized, RequestState is not null, and the authenticated user is available.

handleErrorIfOnErrorPage ( string errorEvent, Exception exception ) : bool
handleErrorIfOnHandledErrorPage ( string errorEvent, Exception exception ) : bool
handleErrorIfOnUnhandledExceptionPage ( string errorEvent, Exception exception ) : bool
handlePostAuthenticateRequest ( object sender, EventArgs e ) : void
rewritePathIfShortcutUrl ( ) : void
set500StatusCode ( string description ) : void
setStatusCode ( int code ) : void
transferRequest ( System.PageInfo page, bool completeRequest ) : void

Method Details

EwfApp() protected method

Registers event handlers for certain application events.
protected EwfApp ( ) : System
return System

GetJavaScriptFiles() protected method

Creates and returns a list of JavaScript files that should be included on all EWF pages, including those not using the EWF user interface.
protected GetJavaScriptFiles ( ) : List
return List

GetMediaTypeOverrides() protected method

Gets the Internet media type overrides for the application, which are used when serving static files. Do not return null.
protected GetMediaTypeOverrides ( ) : IEnumerable
return IEnumerable

GetPageViewDataModificationMethod() public method

Returns a method that executes data modifications that happen simply because of a request and require no other action by the user. Returns null if there are no modifications, which can improve page performance since the data-access cache does not need to be reset. WARNING: Don't ever use this to correct for missing loadData preconditions. For example, do not create a page that requires a user preferences row to exist and then use a page-view data modification to create the row if it is missing. Page-view data modifications will not execute before the first loadData call on post-back requests, and we provide no mechanism to do this because it would allow developers to accidentally cause false user concurrency errors by modifying data that affects the rendering of the page.
public GetPageViewDataModificationMethod ( ) : System.Action
return System.Action

GetShortcutUrlResolvers() protected abstract method

Gets the shortcut URL resolvers for the application.
protected abstract GetShortcutUrlResolvers ( ) : IEnumerable
return IEnumerable

GetStyleSheets() protected method

Creates and returns a list of custom style sheets that should be used on all EWF pages, including those not using the EWF user interface.
protected GetStyleSheets ( ) : List
return List

RequestIsSecure() protected method

Returns true if the specified request is secure. Override this to be more than just HttpRequest.IsSecureConnection if you are using a reverse proxy to perform SSL termination. Remember that your implementation should support not just live installations, but also development and intermediate installations.
protected RequestIsSecure ( HttpRequest request ) : bool
request System.Web.HttpRequest
return bool

SendHealthCheck() public method

Standard library use only.
public SendHealthCheck ( ) : void
return void

getRequestBasePath() protected method

Returns the base path for the specified request. Override this if you are using a reverse proxy and are changing the base path. Never return null. Return the empty string to represent the root path. Remember that your implementation should support not just live installations, but also development and intermediate installations.
protected getRequestBasePath ( HttpRequest request ) : string
request System.Web.HttpRequest
return string

getRequestHost() protected method

Returns the host name for the specified request. Override this if you are using a reverse proxy that is changing the Host header. Include the port number in the return value if it is not the default port. Never return null. If the host name is unavailable (i.e. the request uses HTTP 1.0 and does not include a Host header), return the empty string, which will cause a 400 status code to be returned. Remember that your implementation should support not just live installations, but also development and intermediate installations.
protected getRequestHost ( HttpRequest request ) : string
request System.Web.HttpRequest
return string

Property Details

BaseUrlOverrideGetter public_oe static_oe property

public static Func BaseUrlOverrideGetter
return Func