It was on my planning already for a long time but this weekend I took a couple of hours to create an ASP.NET MVC sample application. The application itself is for the moment very, very basic, but the idea is to add features to add that demonstrate how you can use ASP.NET MVC in combination with Rhino Tools, NHibernate, Nhibernate Search, Migrator.NET, Windsor, Binsor, ExtJS grid, and probably even some others.
I did not have that much inspiration, so the idea is to create an ASP.NET MVC version of the WineCellarManager, which is built with Castle Monorail.
This first version contains the following:
- Integration with Windsor: the Controllers are created via Windsor and the configuration of Windsor is done using Binsor.
- Integration with Rhino.Security:
- I have a base "WineCellarController" that has an "AuthorizationAttribute". That means that every controller that derives from WineCellarController will pass the authorization module. This attribute was created by a colleague on my project. It uses the IAuthorizationService from Rhino.Security to verify whether the logged in user is allowed to perform the requested action.
- There is also a PermissionController with a Generate action that you can use to generate permissions for all actions of all controllers. On our project we have the intention to use an attribute on Controller Actions to allow you to group actions in one security operation or to not add a Controller action as an operation, but that is not entirely finished yet.
- Use of Migrator.NET to create the database schema: there is a project in the solution: WineCellar.Migrator that is used to add database migrations. You execute the migrations using the Migrator.Console.exe which is included in the libs. In the first migration is a comment that tells you which parameters to add to the console application.
- Integration with Rhino.Commons by using the UnitOfWorkApplication of Rhino.Commons.
- Console application for Rhino.Security setup: there is also a small console application included that I used to create the database schema for Rhino.Security. I added that afterwards to the migrations, but you can still have a look to see how it's done.
- Demonstate how you can use an extension method on HtmlHelper to add security on field level.
- Integration of NHibernate.Search
- Integration of ExtJs grid using HtmlHelpers.
I almost forgot to tell you where to get the source. It is here: https://winecellarmanager.googlecode.com/svn/trunk/WineCellarManagerOnASPNETMVC
UPDATE: I noticed you need a password to check out the code on the link above. You should be able to get it without password in the following way:
svn checkout http://winecellarmanager.googlecode.com/svn/trunk/ winecellarmanager-read-only