[stringtemplate-interest] ANN: StringTemplate View and Transform Library for Maverick.NET now available

Kunle Odutola Kunle_Odutola at hotmail.com
Thu Feb 23 22:02:04 PST 2006


Maverick.View.StringTemplate v0.1.0 has been released. This library adds a
StringTemplate.NET View and Transform to the Maverick.NET MVC framework. It
basically allows Maverick.NET views to be developed as StringTemplate.NET
template files. Maverick.View.StringTemplate is developed in C#, it can be
used with projects developed in other .NET languages such as VB.NET,
C++.NET, JScript.NET and J#.

Maverick.NET (or MavNet) is a lightweight, Model-View-Controller (MVC)
framework for web applications on the .NET and Mono platforms. It is a
minimalist MVC framework that concentrates on the management of MVC workflow
in web applications. It's basic usage can be learned
in only a few hours. Maverick.NET is highly configurable and is entirely
agnostic of view templating technologies.

StringTemplate.NET (or ST#) is an MVC templating library for structured text
output. It is designed help designers and development with the task of
creating dynamically-generated text output such as web pages. Use of ST# in
web applications ensures the application's business logic is separated from
it's presentation because ST# strictly enforces Model-View separation. This
helps to promote modularity, reuse of system components and results in
systems that are more flexible and easy to change.

Maverick.View.StringTemplate, Maverick.NET and StringTemplate.NET all run on
the C#/CLI platform (i.e Microsoft .NET, Novell Mono, and dotGNU). Although
Maverick.View.StringTemplate has only been tested on the Microsoft .NET
platform, it should work with little or no change on the others.
Maverick.View.StringTemplate is feature-complete.

Maverick.View.StringTemplate is available from this page on the
StringTemplate website:

 http://www.stringtemplate.org/share/list


Maverick.NET is at:   http://mavnet.sourceforge.net/
StringTemplate.NET is at:  http://www.stringtemplate.org/


Enjoy!

Kunle


-- 
"The world responds to action, and not much else."

    -Scott Adams
-------------- next part --------------
Maverick.View.StringTemplate - ST# View and Transform for Maverick.NET

20 February, 2006

Kunle Odutola		: kunle UNDERSCORE odutola AT hotmail DOT com
Anthony Oguntimehin


1. INTRODUCTION 

Maverick.NET (or MavNet) is a lightweight, Model-View-Controller (MVC)
framework for web applications on the .NET and Mono platforms. It is
a minimalist MVC framework because it concentrates on the management 
of MVC workflown in web applications. Consequently, it's basic usage 
can be learned in only a few hours. Paradoxically, Maverick.NET is 
highly configurable and - most relevant to us here - is entirely 
agnostic of view tmplating technologies.

StringTemplate.NET (or ST#) is an MVC templating library for structured 
text output. It is designed help designers and development with the task 
of creating dynamically-generated text output such as web pages. Use of 
ST# in web applications ensures the application's business logic is 
separated from it's presentation. Model-View separation as this is known 
promotes modularity and reuse of system components and, results in systems 
that are more flexible and easy to change.

We hope you find Maverick.Views.StringTemplate delightful and useful even 
but, as per the license under which you may use it, this software is not 
guaranteed to work. See LICENSE.TXT for the full text of the license.


2. WHAT'S IN THE PACK?

This distribution contains two projects and the project files needed to 
build them with Microsoft Visual Studio 2003. The projects are:

	1. Maverick.View.StringTemplate
	
	   This project adds one ST# view and one ST# transform to 
	   Maverick.NET. The transform allows one view to wrap another.

	2. FriendBook-ST
	
	   This project is a version of the FriendBook sample application 
	   included in Maverick.NET that uses the ST# view and transform 
	   from the above project.
	
In addition the Lib sub-directory contains copies of the assemblies that 
these projects depend on:
	- ANTLR v2.7.6 runtime 
	- StringTemplate v2.3b5
	- Maverick.NET v1.2.0.1
	- Log4net v1.2.9.0
If you already have the same (or later) versions of these assemblies, you 
should probably alter the project to use your version once you've verified 
that everything works fine in your environment.


3. RUNNING FriendBook-ST

The following instructions are only directly applicable if you plan to run 
under IIS on either Windows 2000, XP or 2003. Needless to say, you need to 
have the .NET framework installed on the computer too.

a.	EXTRACT FILES
	Since you are reading this, it is perhaps reasonable to assume you've 
	already extract that contents of the archive to a location on your 
	computer. If not, please do so now. We will refer to this location 
	(the root directory of the extracted files) later as "MAV_ST_HOME".
b.	CREATE VIRTUAL DIRECTORY
	Use the IIS Manager application to create a new virtual directory named
	"FriendBook-ST" that points to the "Maverick.Examples.FriendBook-ST" dir
	under MAV_ST_HOME (the directory in which you extracted the files).
	i.e.  "FriendBook-ST" -> "MAV_ST_HOME/Maverick.Examples.FriendBook-ST"
c.	CONFIGURE VIRTUAL DIRECTORY
	Right-click on the folder of your newly created virtual directory and
	open it's properties dialog. On the directories (or virtual directory) 
	tab, click the button marked "Create" to create the application if it 
	hasn't been created.
d.  REDIRECT *.m REQUESTS TO ASPNET_ISAPI.DLL
	Still on the properties dialog, click the "Configuration" button. 
	Click "Add" on the "Mappings" tab of the Configuration dialog. 
	Choose "aspnet_isapi.dll" as the executable to map to.
	Enter .m as the extension and make sure that the "Check file exists" 
	checkbox is unchecked.
	Click OK.

You should now be able to open the project files in MS Visual Studio 2003 
and build the projects. Once you've done that, you can run the FriendBook-ST 
application by pointing your web browser to:

	http://localhost/FriendBook-ST/


4. USING Maverick.View.StringTemplate

You can use Maverick.View.StringTemplate in your own projects, as both View 
and Transform if you so wish. You need to configure Maverick.NET to use them 
on a per-project basis. Add either or both of the following entries to the 
<modules> section of you Maverick.NET configuration file (usually named 
maverick.config):

	<view-factory 
		type="st" 
		provider="Maverick.Opt.View.StringTemplateViewFactory,Maverick.View.StringTemplate">
	</view-factory>
	
	<transform-factory 
		type="stwrap" 
		provider="Maverick.Opt.Transform.StringTemplateWrapTransformFactory,Maverick.View.StringTemplate">
	</transform-factory>

To make Maverick.View.StringTemplate the default type for views or transforms, 
modify the "default-view-type" and/or "default-transform-type" attributes in 
the top-level <maverick> element as shown below:
	
	<maverick version="2.0" default-view-type="st" default-transform-type="stwrap">
		......
	</maverick>


You can define a view and transform as follows (note that paths do NOT include 
the extension ".st"):

	<view path="Views/welcome" type="st">
		<transform path="Transforms/trimOutside" type="stwrap" />
	</view>


Don't forget to add the relevant references to your project. See FriendBook-ST 
for an example.


5. Maverick.View.StringTemplate STATUS

This release of Maverick.View.StringTemplate is a beta release albeit 
a robust and fairly well-tested beta release. Nevertheless, you should 
keep in mind that:
a) StringTemplate.NET is unforgiving of syntax errors and such-like.
b) StringTemplate.NET (and Maverick.View.StringTemplate by extension) 
   is **strict** in enforcing Model-View separation. Now, this is a 
   ReallyGoodThing(tm) in our opinion.
   As a matter of fact, all other versions of the FriendBook sample 
   application either do not properly enforce Model-View separation 
   (the ASP.NET WebForms and NVelocity vm & dvsl versions) or, do not 
   fully implement all the functionality in the original (xsl version).
   We suspect this was simply because the underlying view templating
   technology did not prevent attempts to breach that separation. 
   Comparing these other versions to FriendBook-ST might be an interesting 
   exercise.
c) Maverick.View.StringTemplate (and StringTemplate.NET) is in beta.

Don't forget to visit www.stringtemplate.org and mavnet.sourceforge.net
for further info. The mailing lists of both projects is (currently) low 
volume with a high Signal-to-Noise ratio. We'd like to hear about how 
you're using Maverick.NET with StringTemplate.NET.


6. CONTRIBUTORS

Kunle Odutola			-- developer/tester
Anthony Oguntimehin		-- developer/tester



Enjoy!

Kunle Odutola
Anthony Oguntimehin


More information about the stringtemplate-interest mailing list