C# 클래스 Sage.Controllers.SageController

Provides a base class for all controllers within the application.
상속: Controller, IModuleFactory
파일 보기 프로젝트 열기: igorfrance/sage 1 사용 예제들

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