The test sites are for testing. Putting the test site there would mean adding it to the build process etc. Now I can test views rendering, without having a full site in place (see AspView.Tests/RenderingTests). As for serving as a feature showcase - that's a whole other thing. I'm thinking to put it back in the contrib for that purpose. Make sense? (btw - now that Contrib is publicly open, anyone can do that ...)
04:22AM Monday, Jul 21, 2008
Igor Loginov
Said:
Ken,
Sorry, I don't know the right place to ask this my question - is AspView available as a standalone template engine, outside Castle Monorail ? I am not a big fan of MVC but would like to try AspView in some simple scenario.
@Igor: Every place is good for questions. That's the way to share knowledge.
Now, to your question: AspView is actually two separate things: 1. A compiler turning template code into a CLR classes that can render some text output given ProperyBag data
2. A runtime for making the said classes act as views on behalf of MonoRail.
Generally speaking, you should be able to take the compiled views, new() them with mocked context, and have them spit the output for your inspection. Something like this is being done in the test suite for AspView. take a look at http://svn.castleproject.org:8080/svn/castle/trunk/MonoRail/Castle.MonoRail.Views.AspView.Tests/RenderingTests/IntegrationViewTestFixture.cs
03:43PM Saturday, Aug 23, 2008
Igor Loginov
Said:
Ken,
I have made a first try - AspView claims dependencies on Castle.Core and Castle.Monorail.Framework. Does it mean that I cannot avoid referencing part of Castle? Package I used is AspView-1.0.4.400-Release.zip from aspview.com
@Igor - That's an oldie :) It'd be better for you to look up the newest version from castle's trunk.
Anyway, it is dependant on Castle, and there's nothing you can do about it as it is. However, what you are actually looking for is the compiler bit only. And the compiler is pretty straight forward thing, converting the template into a series of Output(string) methods. You can take out the compiler bits, remove the stuff that has to do with MonoRail (like dealing with view components, subviews, layouts etc.) and keep the bits that transform the <% %> directives etc. into a c# code.