C# Класс Sage.Controllers.SageController

Provides a base class for all controllers within the application.
Наследование: Controller, IModuleFactory
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DiscoverViewXmlFilters void
InitializeForTesting void
OnAssembliesUpdated void
SageController System

Открытые методы

Метод Описание
CreateModule ( XmlElement moduleElement ) : IModule
GetLastModificationDate ( string viewName ) : DateTime?

Gets the last modification date for the specified viewName.

Each action can and should be cached by the browsers. When subsequent requests come in, browsers will send the last modification date that they received the last time they got that file, in order for the server to figure out whether to send a new version. With sage controllers views, the last modification date is actually the latest modification date of possibly a whole series of files. Those files could be the XSLT style-sheet itself or any one of its includes, or the XML configuration file or any one of its includes. Therefore it is necessary to have this extra piece of logic to effectively determine what that latest modification date is.

GetViewInfo ( string viewName ) : ViewInfo

Gets the view info corresponding to this controller and the specified viewName.

GetViewModel ( ViewInfo viewInfo ) : ViewModel

Processes the view configuration associated with the specified viewInfo, and returns a ViewModel instance that contains the result.

GetViewModel ( string viewName ) : ViewModel

Processes the view configuration associated with the specified viewName, and returns a ViewModel instance that contains the result.

PageNotFound ( string action = null ) : System.Web.Mvc.ActionResult

Sets the HTTP status to not found (404) and returns an EmptyResult.

PrepareViewXml ( System.Web.Mvc.ViewContext viewContext ) : XmlDocument

Wraps the previously processed view configuration input XML with the standard XML envelope that contains information about the current request, and the resources referenced by the modules and libraries in use by the the view.

SageView ( ViewInfo viewInfo ) : System.Web.Mvc.ActionResult

Processes the view descibed with the specified viewInfo, and returns an ActionResult.

SageView ( string viewName ) : System.Web.Mvc.ActionResult

Processes the view configuration associated with the specified viewName, and returns an ActionResult.

Защищенные методы

Метод Описание
AddMessage ( MessageType type, string messageText ) : void

Adds a message to this controller's message collection

AddMessagePhrase ( MessageType type, string phraseId ) : void

Adds a message to this controller's message collection, using the specified phraseId to get the message text.

FilterViewXml ( System.Web.Mvc.ViewContext viewContext, XmlDocument viewXml ) : XmlDocument

Filters the specified viewXml by invoking all FilterViewXml delegates that are accessible by the project at the time of initialization.

Initialize ( System.Web.Routing.RequestContext requestContext ) : void

Initializes the controller with a new SageContext instance.

Приватные методы

Метод Описание
DiscoverViewXmlFilters ( ) : void
InitializeForTesting ( System.Web.Routing.RequestContext requestContext ) : void

Provides a hook to initialize the controller from a unit test

OnAssembliesUpdated ( object sender, EventArgs arg ) : void
SageController ( ) : System

Описание методов

AddMessage() защищенный Метод

Adds a message to this controller's message collection
protected AddMessage ( MessageType type, string messageText ) : void
type MessageType The type of the message to add.
messageText string The message to display.
Результат void

AddMessagePhrase() защищенный Метод

Adds a message to this controller's message collection, using the specified phraseId to get the message text.
protected AddMessagePhrase ( MessageType type, string phraseId ) : void
type MessageType The type of the message to add.
phraseId string The id of the phrase that contains the text associated with this message.
Результат void

CreateModule() публичный Метод

public CreateModule ( XmlElement moduleElement ) : IModule
moduleElement System.Xml.XmlElement
Результат IModule

FilterViewXml() защищенный Метод

Filters the specified viewXml by invoking all FilterViewXml delegates that are accessible by the project at the time of initialization.
protected FilterViewXml ( System.Web.Mvc.ViewContext viewContext, XmlDocument viewXml ) : XmlDocument
viewContext System.Web.Mvc.ViewContext The view context under which this code is executed.
viewXml System.Xml.XmlDocument The XML document to filter.
Результат System.Xml.XmlDocument

GetLastModificationDate() публичный Метод

Gets the last modification date for the specified viewName.
Each action can and should be cached by the browsers. When subsequent requests come in, browsers will send the last modification date that they received the last time they got that file, in order for the server to figure out whether to send a new version. With sage controllers views, the last modification date is actually the latest modification date of possibly a whole series of files. Those files could be the XSLT style-sheet itself or any one of its includes, or the XML configuration file or any one of its includes. Therefore it is necessary to have this extra piece of logic to effectively determine what that latest modification date is.
public GetLastModificationDate ( string viewName ) : DateTime?
viewName string The name of the action for which to retrieve the last modification date.
Результат DateTime?

GetViewInfo() публичный Метод

Gets the view info corresponding to this controller and the specified viewName.
public GetViewInfo ( string viewName ) : ViewInfo
viewName string The name of the view for which to get the info.
Результат Sage.Views.ViewInfo

GetViewModel() публичный Метод

Processes the view configuration associated with the specified viewInfo, and returns a ViewModel instance that contains the result.
public GetViewModel ( ViewInfo viewInfo ) : ViewModel
viewInfo Sage.Views.ViewInfo The object that contains information about the view.
Результат Sage.Views.ViewModel

GetViewModel() публичный Метод

Processes the view configuration associated with the specified viewName, and returns a ViewModel instance that contains the result.
public GetViewModel ( string viewName ) : ViewModel
viewName string The name of the view to process.
Результат Sage.Views.ViewModel

Initialize() защищенный Метод

Initializes the controller with a new SageContext instance.
protected Initialize ( System.Web.Routing.RequestContext requestContext ) : void
requestContext System.Web.Routing.RequestContext The request context.
Результат void

PageNotFound() публичный Метод

Sets the HTTP status to not found (404) and returns an EmptyResult.
public PageNotFound ( string action = null ) : System.Web.Mvc.ActionResult
action string Optional name of the action that could not be found.
Результат System.Web.Mvc.ActionResult

PrepareViewXml() публичный Метод

Wraps the previously processed view configuration input XML with the standard XML envelope that contains information about the current request, and the resources referenced by the modules and libraries in use by the the view.
public PrepareViewXml ( System.Web.Mvc.ViewContext viewContext ) : XmlDocument
viewContext System.Web.Mvc.ViewContext The view context that contains the that resulted from /// previously processing the view configuration.
Результат System.Xml.XmlDocument

SageView() публичный Метод

Processes the view descibed with the specified viewInfo, and returns an ActionResult.
public SageView ( ViewInfo viewInfo ) : System.Web.Mvc.ActionResult
viewInfo Sage.Views.ViewInfo The object that contains information about the view.
Результат System.Web.Mvc.ActionResult

SageView() публичный Метод

Processes the view configuration associated with the specified viewName, and returns an ActionResult.
public SageView ( string viewName ) : System.Web.Mvc.ActionResult
viewName string The name of the view that should be rendered to response.
Результат System.Web.Mvc.ActionResult