Permalink
Browse files

Importing the non-functional parts of ServiceStack here

  • Loading branch information...
0 parents commit a3b4766ea99b719943c6471f6dcc28422342f794 @mythz mythz committed Nov 28, 2010
Showing 400 changed files with 25,989 additions and 0 deletions.
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ../env-vars.sh
+
+echo uploading ServiceStack/html...
+
+rsync --verbose --progress --stats --compress \
+ -e "ssh -i $SERVER_KEY" \
+ --recursive --times --perms --links \
+ $BASE_PATH/html/ $HOST_LOGIN:html/servicestack.net/
+
+rsync --verbose --progress --stats --compress \
+ -e "ssh -i $SERVER_KEY" \
+ --recursive --times --perms --links --delete \
+ --exclude ".svn" \
+ $BASE_PATH/MonoTouch.Examples/html/ $HOST_LOGIN:html/servicestack.net/monotouch
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. ../env-vars.sh
+
+rsync --verbose --progress --stats --compress \
+ -e "ssh -i $SERVER_KEY" \
+ --recursive --times --perms --links \
+ $BASE_PATH/html/ $HOST_LOGIN:html/servicestack.net/
+
+
+rsync --verbose --progress --stats --compress \
+ -e "ssh -i $SERVER_KEY" \
+ --recursive --times --perms --links \
+ --exclude ".svn" \
+ --exclude "App_Data" \
+ --exclude "obj" \
+ --exclude "Properties" \
+ --exclude "*.cs" \
+ --exclude "*.csproj*" \
+ --exclude "*.config" \
+ $BASE_PATH/ServiceStack.Examples/ServiceStack.Examples.Clients $HOST_LOGIN:mono/servicestack.net/
+
+
+rsync --verbose --progress --stats --compress \
+ -e "ssh -i $SERVER_KEY" \
+ --recursive --times --perms --links \
+ --exclude ".svn" \
+ --exclude "App_Data" \
+ --exclude "obj" \
+ --exclude "Properties" \
+ --exclude "*.cs" \
+ --exclude "*.csproj*" \
+ --exclude "*.config" \
+ $BASE_PATH/ServiceStack.Examples/ServiceStack.Examples.Host.Web $HOST_LOGIN:mono/servicestack.net/
+
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. ../env-vars.sh
+
+echo $SERVER_KEY
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
+COPY ..\..\Lib\* .
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
+/*
+// $Id$
+//
+// Revision : $Revision$
+// Modified Date : $LastChangedDate$
+// Modified By : $LastChangedBy$
+//
+// (c) Copyright 2008 Digital Distribution Networks Ltd
+*/
+
+namespace @DomainModelNamespace@
+{
+ public abstract class Entity : ModelBase
+ {
+ //Make it a long so we can store the unique db4o internal id for fast access
+ public long Id { get; set; }
+ }
+}
@@ -0,0 +1,51 @@
+/*
+// $Id$
+//
+// Revision : $Revision$
+// Modified Date : $LastChangedDate$
+// Modified By : $LastChangedBy$
+//
+// (c) Copyright 2008 Digital Distribution Networks Ltd
+*/
+
+namespace @DomainModelNamespace@
+{
+ /// <summary>
+ /// This is called MessageCodes to be consistent with ErrorCodes
+ /// </summary>
+ public enum MessageCodes
+ {
+ NewUserCreated,
+ LoginWasSuccessful,
+ CouldNotRegisterNewUser,
+ CreditCardDetailsAreInvalid,
+ }
+
+ /// <summary>
+ /// This enum is called ErrorCodes rather that ErrorCode to avoid naming conficts with
+ /// the ValidationAttributeBase.ErrorCode field. If you can think of better names refactor!
+ /// </summary>
+ public enum ErrorCodes
+ {
+ Error, //General unspecified error
+ InvalidUserOrPassword,
+ UserAlreadyExists,
+ InvalidOrExpiredSession,
+
+ //Valdiation errors:
+ FieldIsRequired,
+ FieldsAreNotEqual,
+ PasswordsAreNotEqual,
+ EmailAddressIsNotValid,
+
+ //Credit card validation errors:
+ CreditCardNumberIsInvalid,
+ CreditCardTypeIsInvalid,
+ CreditCardHasExpired,
+ CreditCardCvvIsInvalid,
+ CreditCardHolderNameIsInvalid,
+
+ //Business rules:
+ CreditInfoIsRequiredIfStoreCreditCard,
+ }
+}
@@ -0,0 +1,12 @@
+using ServiceStack.Validation;
+
+namespace @DomainModelNamespace@
+{
+ public abstract class ModelBase
+ {
+ public virtual ValidationResult Validate()
+ {
+ return ModelValidator.ValidateObject(this);
+ }
+ }
+}
@@ -0,0 +1,6 @@
+namespace @DomainModelNamespace@
+{
+ public class @ModelName@ : Entity
+ {
+ }
+}
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("UserCatalogue.DomainModel")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UserCatalogue.DomainModel")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ec64bd9c-7db5-420a-a590-cf6b1a40a503")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <@ModelName@Version>9.0.30729</@ModelName@Version>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E6170756-E72D-4A0B-AF2F-9DFBE83F5C48}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>@DomainModelNamespace@</RootNamespace>
+ <AssemblyName>@DomainModelNamespace@</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ServiceStack, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Lib\ServiceStack.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="@ModelName@.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Entity.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ErrorCodes.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ModelBase.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,79 @@
+using Db4objects.Db4o;
+using ServiceStack.CacheAccess.Providers;
+using ServiceStack.Configuration;
+using ServiceStack.DataAccess.Db4oProvider;
+using ServiceStack.Logging;
+using ServiceStack.Logging.Log4Net;
+using ServiceStack.LogicFacade;
+using @ServiceNamespace@.ServiceInterface;
+using ServiceStack.ServiceInterface;
+using ServiceStack.WebHost.Endpoints;
+using @ServiceModelNamespace@;
+
+namespace @ServiceNamespace@.Host.WebService
+{
+ public class AppHost : EndpointHostBase
+ {
+ public static AppHost Instance = new AppHost();
+
+ private AppHost()
+ {
+ LogManager.LogFactory = new Log4NetFactory(true);
+
+ var factory = new FactoryProvider(FactoryUtils.ObjectFactory, LogManager.LogFactory);
+ var providerManager = new Db4oFileProviderManager(Config.ConnectionString);
+
+ var configDb4o = Db4oFactory.Configure();
+ configDb4o.ActivationDepth(5);
+ configDb4o.UpdateDepth(5);
+ configDb4o.OptimizeNativeQueries(true);
+
+ factory.Register(providerManager); //Keep the manager from disposing providers it created
+ factory.Register(providerManager.GetProvider());
+
+ // Create the ApplicationContext injected with the static service implementations
+ ApplicationContext.SetInstanceContext(new ApplicationContext {
+ Factory = factory,
+ Cache = new MemoryCacheClient(),
+ Resources = new ConfigurationResourceManager(),
+ });
+
+ SetConfig(new EndpointHostConfig {
+ ServiceName = Config.ServiceName,
+ OperationsNamespace = Config.OperationNamespace,
+ ServiceModelFinder = ServiceModelFinder.Instance,
+ ServiceController = new ServiceController(new ServiceResolver()),
+ });
+ }
+
+ protected override IOperationContext CreateOperationContext(object requestDto)
+ {
+ var requestContext = new RequestContext(requestDto, new FactoryProvider(FactoryUtils.ObjectFactory));
+ return new @DatabaseName@OperationContext(ApplicationContext.Instance, requestContext);
+ }
+
+ //Access application configuration statically
+ public static class Config
+ {
+ public static string ConnectionString
+ {
+ get { return ConfigUtils.GetAppSetting("ConnectionString"); }
+ }
+
+ public static string ServiceName
+ {
+ get { return ConfigUtils.GetAppSetting("ServiceName"); }
+ }
+
+ public static string OperationNamespace
+ {
+ get { return ConfigUtils.GetAppSetting("OperationNamespace"); }
+ }
+
+ public static string ServerPrivateKey
+ {
+ get { return ConfigUtils.GetAppSetting("ServerPrivateKey"); }
+ }
+ }
+ }
+}
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="@ServiceNamespace@.Host.WebService.Global" Language="C#" %>
@@ -0,0 +1,44 @@
+using System;
+
+namespace @ServiceNamespace@.Host.WebService
+{
+ public class Global : System.Web.HttpApplication
+ {
+
+ protected void Application_Start(object sender, EventArgs e)
+ {
+ // Touch singletons to force static initializations
+ var touchApp = AppHost.Instance;
+ }
+
+ protected void Session_Start(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_BeginRequest(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_AuthenticateRequest(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_Error(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Session_End(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Application_End(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit a3b4766

Please sign in to comment.