C# Class Rebel.Cms.Web.Mvc.ViewEngines.PluginViewEngine

A ViewEngine to support non-embedded views for packaged plugins for both editors, property editors and dashboards
Views will be found in the folders: ~/App_Plugins/Packages/[PackageName]/Editors/Views/{0} ~/App_Plugins/Packages/Core/Editors/Views/{0} ~/App_Plugins/Packages/[PackageName]/PropertyEditors/Views/{0} ~/App_Plugins/Packages/Core/PropertyEditors/Views/{0} ~/App_Plugins/Packages/[PackageName]/Dashboards/{0} ~/App_Plugins/Packages/Core/Dashboards/{0} Front-end partial views & child action views can be found in these folders: ~/App_Plugins/Packages/[PackageName]/Views/Partial/{0}
Inheritance: System.Web.Mvc.RazorViewEngine
Mostra file Open project: RebelCMS/rebelcmsxu5

Public Methods

Method Description
FindPartialView ( ControllerContext controllerContext, string partialViewName, bool useCache ) : System.Web.Mvc.ViewEngineResult

If we're not rendering in an rebel context this will exit

NOTE: If someone has a lot of packages installed, the number of folders being searched will be fairly insane it would be good if VirtualPathProviderViewEngine exposed its members for path finding but they are all marked as private, so we could either copy all of its code in here or find another nice way to avoid having to lookup so many folders. We could aid in this performance by injecting different data tokens for different types of views (i.e. Dashboards, etc...) then we can actually have a differerent ViewEngines for those specific ones by checking for the correct token.

FindView ( ControllerContext controllerContext, string viewName, string masterName, bool useCache ) : System.Web.Mvc.ViewEngineResult

If we're not rendering in an rebel context, this will exit, otherwise will find the view based on the base class implementation.

PluginViewEngine ( RebelSettings settings, IPackageContext packageContext ) : System

Constructor

Private Methods

Method Description
SetViewLocations ( ) : void
ShouldFindView ( ControllerContext controllerContext, bool isPartial ) : bool

Determines if a view should be found, this is to improve performance of view lookups but also to decrease the amount of overlap with other view engines.

Method Details

FindPartialView() public method

If we're not rendering in an rebel context this will exit
NOTE: If someone has a lot of packages installed, the number of folders being searched will be fairly insane it would be good if VirtualPathProviderViewEngine exposed its members for path finding but they are all marked as private, so we could either copy all of its code in here or find another nice way to avoid having to lookup so many folders. We could aid in this performance by injecting different data tokens for different types of views (i.e. Dashboards, etc...) then we can actually have a differerent ViewEngines for those specific ones by checking for the correct token.
public FindPartialView ( ControllerContext controllerContext, string partialViewName, bool useCache ) : System.Web.Mvc.ViewEngineResult
controllerContext ControllerContext
partialViewName string
useCache bool
return System.Web.Mvc.ViewEngineResult

FindView() public method

If we're not rendering in an rebel context, this will exit, otherwise will find the view based on the base class implementation.
public FindView ( ControllerContext controllerContext, string viewName, string masterName, bool useCache ) : System.Web.Mvc.ViewEngineResult
controllerContext ControllerContext
viewName string
masterName string
useCache bool
return System.Web.Mvc.ViewEngineResult

PluginViewEngine() public method

Constructor
public PluginViewEngine ( RebelSettings settings, IPackageContext packageContext ) : System
settings RebelSettings
packageContext IPackageContext
return System