SPRNET-843 - second attempt at solution templates, now conforming to project layout expected by Solution Factory add-in!

This commit is contained in:
markpollack
2009-07-31 18:31:22 +00:00
parent acaab749d6
commit 0ba232a918
64 changed files with 2868 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<!-- Refer to the SpringAir example application for guidance should you decide to enable these settings -->
<!-- Base page definition. It is common for other pages inherit these settings -->
<!--
<object id="standardPage" abstract="true">
<property name="MasterPageFile" value="~/Web/StandardTemplate.master"/>
<property name="CultureResolver" ref="cultureResolver"/>
<property name="Localizer" ref="localizer"/>
<property name="ScriptsRoot" value="~/Scripts" />
<property name="CssRoot" value="~/Web/CSS"/>
<property name="ImagesRoot" value="~/Web/Images"/>
</object>
-->
<!-- If using Spring validation framework, configure the validation error renderer -->
<!--
<object id="Spring.Web.UI.Controls.ValidationError" abstract="true">
<property name="Renderer">
<object type="Spring.Web.UI.Validation.IconValidationErrorsRenderer, Spring.Web">
<property name="IconSrc" value="validation-error.gif"/>
</object>
</property>
</object>
<object id="Spring.Web.UI.Controls.ValidationSummary" abstract="true">
<property name="Renderer">
<object type="Spring.Web.UI.Validation.DivValidationErrorsRenderer, Spring.Web">
<property name="CssClass" value="validationError"/>
</object>
</property>
</object>
-->
<!-- If using a Mesage Source -->
<!--
<object id="messageSource" type="Spring.Context.Support.ResourceSetMessageSource, Spring.Core">
<property name="ResourceManagers">
<list>
<value>Resources.Strings, App_GlobalResources</value>
</list>
</property>
<property name="UseCodeAsDefaultMessage" value="true" />
</object>
-->
<!--
If using localization features
-->
<!--
<object id="cultureResolver" type="Spring.Globalization.Resolvers.SessionCultureResolver, Spring.Web" />
<object id="localizer" type="Spring.Globalization.Localizers.ResourceSetLocalizer, Spring.Core" />
-->
</objects>

View File

@@ -0,0 +1,26 @@
<%@ Page Language="C#" EnableViewState="false" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="DI_HelloWorld_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title><%=Title%></title>
</head>
<body>
<h2><a href="../../Default.aspx">Welcome to Spring.NET Web Framework Quick Start Application Template</a></h2>
<h2><a href="../Default.aspx">Dependency Injection</a></h2>
<div>
<h2>Hello World example</h2>
<form id="form1" runat="server">
<p>
This very simple web form demonstrates dependency injection on pages and controls.
</p>
<p>
The message you can see below has been injected by &lt;object type="Default.aspx"&gt; object definition:
</p>
<p>
'<%=Message%>'
</p>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,30 @@
using System;
using System.Web.UI;
/// <summary>
/// Notice that you don't need to extend Spring.Web.UI.Page for DI features!
/// </summary>
public partial class DI_HelloWorld_Default : System.Web.UI.Page
{
private string message;
public string Message
{
get { return this.message; }
set { this.message = value; }
}
/// <summary>
/// Values are injected right before OnInit() is called.
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
if(this.Message == null)
{
throw new ArgumentNullException("Message");
}
base.OnInit(e);
}
}

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<configuration>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<!-- use the filename of your Page for the 'type' attribute to configure DI for a Page -->
<object type="Default.aspx">
<property name="Title" value="Dependency Injection - Hello World Sample"/>
<property name="Message">
<value>This message you are reading was set using dependencies injection.</value>
</property>
</object>
</objects>
</spring>
<system.web>
</system.web>
</configuration>

View File

@@ -0,0 +1,26 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Spring.NET Web Application</title>
</head>
<body>
<h2>Welcome to a Spring.NET Web Application</h2>
<div>
<p>
Spring.NET Web Framework is an extension to ASP.NET that adds many
powerful features, such as Dependency Injection for web pages and
controls, bi-directional data binding, localization support, etc.
</p>
<p>
This solution template has configured an ASP.NET web site to use Spring.NET Web Framework.
</p>
<p>
The following page is configured using dependency injection.
</p>
<h3><a href="DI/Default.aspx">Dependency Injection</a></h3>
</div>
</body>
</html>

View File

@@ -0,0 +1,17 @@
using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" requirePermission="false"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" requirePermission="false"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" requirePermission="false"/>
</sectionGroup>
</configSections>
<!-- to see logging output in the attached debugger -->
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
<arg key="Level" value="ALL"/>
</factoryAdapter>
</logging>
</common>
<spring>
<context>
<!-- Application services and data access that has been previously developed and tested-->
<resource uri="assembly://App.DataAccess/App.DataAccess/data-access-config.xml"/>
<resource uri="assembly://App.Service/App.Service/service-config.xml"/>
<!-- Configuration of general -->
<resource uri="~/Config/Web.xml"/>
</context>
</spring>
<!-- Standard Web Configuration Section - Add Spring specific modules and handlers-->
<system.web>
<!--
The following needs to be configured in order to enable Spring.NET Web Framework features
-->
<httpModules>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
<!-- if using NHibernate
<add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate21"/>
-->
</httpModules>
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
<add verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
<add verb="*" path="ContextMonitor.ashx" type="Spring.Web.Support.ContextMonitor, Spring.Web"/>
</httpHandlers>
<pages>
<controls>
<add tagPrefix="spring" namespace="Spring.Web.UI.Controls" assembly="Spring.Web"/>
</controls>
</pages>
<globalization culture="en-US" uiCulture="en-US"/>
<customErrors mode="Off"/>
<compilation debug="true">
</compilation>
</system.web>
</configuration>