Class EmbeddedSiteHandler
Implements handler that serves content from assembly-embedded resources and class actions.
Inherit from this class to implement actual handler that serves from particular assembly/namespace root
Inheritance
System.Object
EmbeddedSiteHandler
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.Wave.dll
Syntax
public abstract class EmbeddedSiteHandler : WorkHandler, IDisposable, IApplicationComponent, INamed, IOrdered
Constructors
EmbeddedSiteHandler(WorkDispatcher, IConfigSectionNode)
Declaration
protected EmbeddedSiteHandler(WorkDispatcher dispatcher, IConfigSectionNode confNode)
Parameters
EmbeddedSiteHandler(WorkDispatcher, String, Int32, WorkMatch)
Declaration
protected EmbeddedSiteHandler(WorkDispatcher dispatcher, string name, int order, WorkMatch match)
Parameters
Fields
CONFIG_CACHE_CONTROL_SECTION
Declaration
public const string CONFIG_CACHE_CONTROL_SECTION = "cache-control"
Field Value
Type |
Description |
System.String |
|
DEFAULT_SITE_PATH
Declaration
public const string DEFAULT_SITE_PATH = "Home.htm"
Field Value
Type |
Description |
System.String |
|
SITE_ACTION
Declaration
public const string SITE_ACTION = "site"
Field Value
Type |
Description |
System.String |
|
VAR_PATH
Declaration
public const string VAR_PATH = "path"
Field Value
Type |
Description |
System.String |
|
Properties
Actions
Returns actions that this site can perform
Declaration
public IRegistry<EmbeddedSiteHandler.IAction> Actions { get; }
Property Value
CacheControl
Declaration
public CacheControl CacheControl { get; set; }
Property Value
DefaultSitePath
Returns default site path that serves site root
Declaration
public virtual string DefaultSitePath { get; }
Property Value
Type |
Description |
System.String |
|
RootResourcePath
Returns resource path root, i.e. namespace prefixes where resources reside
Declaration
public abstract string RootResourcePath { get; }
Property Value
Type |
Description |
System.String |
|
SiteAction
Returns name for action that serves embedded site
Declaration
public virtual string SiteAction { get; }
Property Value
Type |
Description |
System.String |
|
SupportsEnvironmentBranching
Override in sites that do not support named environment sub-folders in resource structure.
True by default
Declaration
public virtual bool SupportsEnvironmentBranching { get; }
Property Value
Type |
Description |
System.Boolean |
|
VersionSegmentPrefix
When set indicates the case-insensitive prefix of a path segment that should be ignored by the handler path resolver.
Version prefixes are used for attaching a surrogate path "folder" that makes resource differ based on their content.
For example when prefix is "@", path '/embedded/img/@767868768768/picture.png' resolves to actual '/embedded/img/picture.png'
Declaration
public string VersionSegmentPrefix { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
DispatchAction(WorkContext, String, String)
Dispatched appropriate action
Declaration
protected virtual void DispatchAction(WorkContext work, string action, string path)
Parameters
Type |
Name |
Description |
WorkContext |
work |
|
System.String |
action |
|
System.String |
path |
|
DispatchNonSiteAction(WorkContext, String)
Dispatches an action which is not a site-serving one
Declaration
protected virtual void DispatchNonSiteAction(WorkContext context, string action)
Parameters
Type |
Name |
Description |
WorkContext |
context |
|
System.String |
action |
|
DoHandleWork(WorkContext)
Declaration
protected override void DoHandleWork(WorkContext work)
Parameters
Overrides
GetActions()
Override to declare what actions this site can perform
Declaration
protected abstract IEnumerable<EmbeddedSiteHandler.IAction> GetActions()
Returns
ParseWork(WorkContext, out String)
Override to extract action and path form request
Declaration
protected virtual string ParseWork(WorkContext work, out string path)
Parameters
Type |
Name |
Description |
WorkContext |
work |
|
System.String |
path |
|
Returns
Type |
Description |
System.String |
|
SetResourceCacheHeader(WorkContext, String, String)
Override to set specific cache header set per resource name
Declaration
protected virtual void SetResourceCacheHeader(WorkContext work, string sitePath, string resName)
Parameters
Type |
Name |
Description |
WorkContext |
work |
|
System.String |
sitePath |
|
System.String |
resName |
|
Implements
System.IDisposable
Extension Methods