Added module Orchard.Azure. Added Azure Cache providers to it.

Deleted old module Orchard.AzureBlobStorage.
Moved all Azure code into Orchard.Azure module, deleting the old Orchard.Azure project.
Cleaned up Web.config and Config\* files in Orchard.Web and Orchard.Azure.Web.
This commit is contained in:
Daniel Stolt
2013-08-24 20:16:32 +02:00
committed by Sebastien Ros
parent d4154fa1fe
commit 92f8d0df80
35 changed files with 1576 additions and 1307 deletions

View File

@@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.ServiceRuntime;
using Orchard.Environment.Configuration;
using Orchard.Azure.FileSystems;
using Microsoft.WindowsAzure.Storage;
using Orchard.FileSystems.Media;
namespace Orchard.Azure.Environment.Configuration {
public class AzureShellSettingsManager : IShellSettingsManager {
public const string ContainerName = "sites"; // container names must be lower cased
public const string SettingsFilename = "Settings.txt";
public const char Separator = ':';
public const string EmptyValue = "null";
private readonly IShellSettingsManagerEventHandler _events;
private readonly AzureFileSystem _fileSystem;
public AzureShellSettingsManager(IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider)
: this(CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("DataConnectionString")), events, mimeTypeProvider) {}
public AzureShellSettingsManager(CloudStorageAccount storageAccount, IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider)
{
_events = events;
_fileSystem = new AzureFileSystem(ContainerName, String.Empty, true, mimeTypeProvider);
}
IEnumerable<ShellSettings> IShellSettingsManager.LoadSettings() {
var settings = LoadSettings().ToArray();
return settings;
}
void IShellSettingsManager.SaveSettings(ShellSettings settings) {
var content = ShellSettingsSerializer.ComposeSettings(settings);
var filePath = _fileSystem.Combine(settings.Name, SettingsFilename);
var file = _fileSystem.FileExists(filePath)
? _fileSystem.GetFile(filePath)
: _fileSystem.CreateFile(filePath);
using (var stream = file.OpenWrite()) {
using (var writer = new StreamWriter(stream)) {
writer.Write(content);
}
}
_events.Saved(settings);
}
IEnumerable<ShellSettings> LoadSettings() {
foreach (var folder in _fileSystem.ListFolders(null))
foreach (var file in _fileSystem.ListFiles(folder.GetPath())) {
if (!String.Equals(file.GetName(), SettingsFilename))
continue;
using (var stream = file.OpenRead())
using (var reader = new StreamReader(stream))
yield return ShellSettingsSerializer.ParseSettings(reader.ReadToEnd());
}
}
}
}

View File

@@ -1,33 +0,0 @@
using System;
using Microsoft.WindowsAzure.Diagnostics;
using log4net.Appender;
using log4net.Core;
namespace Orchard.Azure.Logging {
/// <summary>
/// Azure specific implementation of a log4net appender.
/// Uses DataConnectionString to define the location of the log.
/// </summary>
public class AzureAppender : AppenderSkeleton {
private const string WadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
public AzureAppender() {
var defaultDiagnostics = DiagnosticMonitor.GetDefaultInitialConfiguration();
var period = TimeSpan.FromMinutes(1d);
defaultDiagnostics.Directories.ScheduledTransferPeriod = period;
defaultDiagnostics.Logs.ScheduledTransferPeriod = period;
defaultDiagnostics.WindowsEventLog.ScheduledTransferPeriod = period;
DiagnosticMonitor.Start(WadConnectionString, defaultDiagnostics);
}
protected override void Append(LoggingEvent loggingEvent) {
var formattedLog = RenderLoggingEvent(loggingEvent);
// this is the way to logging into Azure
System.Diagnostics.Trace.WriteLine(formattedLog);
}
}
}

View File

@@ -3,7 +3,7 @@
<Role name="Orchard.Azure.Web">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Orchard.StorageConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>

View File

@@ -12,7 +12,7 @@
<Import moduleName="Diagnostics" />
</Imports>
<ConfigurationSettings>
<Setting name="DataConnectionString" />
<Setting name="Orchard.StorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />

View File

@@ -1,19 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration"/>
</configSections>
<autofac defaultAssembly="Orchard.Framework">
<components>
<component instance-scope="single-instance"
type="Orchard.Azure.Environment.Configuration.AzureShellSettingsManager, Orchard.Azure"
service="Orchard.Environment.Configuration.IShellSettingsManager">
</component>
</components>
</autofac>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration"/>
</configSections>
<autofac defaultAssembly="Orchard.Framework">
<components>
<!-- Configure Orchard to read shell settings (Settings.txt) from Azure Blob Storage. -->
<component instance-scope="single-instance" type="Orchard.Azure.Services.Environment.Configuration.AzureBlobShellSettingsManager, Orchard.Azure" service="Orchard.Environment.Configuration.IShellSettingsManager"></component>
</components>
</autofac>
</configuration>

View File

@@ -1,85 +1,85 @@
<?xml version="1.0" encoding="utf-8" ?>
<HostComponents>
<Components>
<Component Type="Orchard.Environment.Extensions.ExtensionMonitoringCoordinator">
<Properties>
<!-- Set Value="true" to disable new extensions monitoring -->
<Property Name="Disabled" Value="true"/>
</Properties>
</Component>
<Components>
<Component Type="Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy.PlacementFileParser">
<Properties>
<!-- Set Value="true" to disable Placement files monitoring (Placement.info) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.ExtensionMonitoringCoordinator">
<Properties>
<!-- Set Value="true" to disable new extensions monitoring -->
<Property Name="Disabled" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy">
<Properties>
<!-- Set Value="true" to disable template views monitoring (Views\*.cshtml) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy.PlacementFileParser">
<Properties>
<!-- Set Value="true" to disable Placement files monitoring (Placement.info) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Folders.ExtensionHarvester">
<Properties>
<!-- Set Value="true" to disable extension folders monitoring (new files in modules and themes) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy">
<Properties>
<!-- Set Value="true" to disable template views monitoring (Views\*.cshtml) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Compilers.DefaultProjectFileParser">
<Properties>
<!-- Set Value="true" to disable project files monitoring (/Modules/**/*.csproj) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Folders.ExtensionHarvester">
<Properties>
<!-- Set Value="true" to disable extension folders monitoring (new files in modules and themes) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader">
<Properties>
<!-- Set Value="true" to disable source files monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
<!-- Set Value="true" to completely disable the Dynamic Extension Loader -->
<Property Name="Disabled" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Compilers.DefaultProjectFileParser">
<Properties>
<!-- Set Value="true" to disable project files monitoring (/Modules/**/*.csproj) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader">
<Properties>
<!-- Set Value="true" to disable pre-compiled files monitoring (~/Modules/**/bin/*.dll) -->
<Property Name="DisableMonitoring" Value="false"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader">
<Properties>
<!-- Set Value="true" to disable source files monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
<!-- Set Value="true" to completely disable the Dynamic Extension Loader -->
<Property Name="Disabled" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.FileSystems.Dependencies.DefaultDependenciesFolder">
<Properties>
<!-- Set Value="true" to disable the dependencies folder monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader">
<Properties>
<!-- Set Value="true" to disable pre-compiled files monitoring (~/Modules/**/bin/*.dll) -->
<Property Name="DisableMonitoring" Value="false"/>
</Properties>
</Component>
<Component Type="Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager">
<Properties>
<!-- Set Value="true" to disable compiled dependencides files monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.FileSystems.Dependencies.DefaultDependenciesFolder">
<Properties>
<!-- Set Value="true" to disable the dependencies folder monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Localization.Services.DefaultLocalizedStringManager">
<Properties>
<!-- Set Value="true" to disable localization files monitoring (*.po) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager">
<Properties>
<!-- Set Value="true" to disable compiled dependencides files monitoring -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
<Component Type="Orchard.Caching.DefaultParallelCacheContext">
<Properties>
<!-- Set Value="true" to disable parallel cache resolution -->
<Property Name="Disabled" Value="false"/>
</Properties>
</Component>
<Component Type="Orchard.Localization.Services.DefaultLocalizedStringManager">
<Properties>
<!-- Set Value="true" to disable localization files monitoring (*.po) -->
<Property Name="DisableMonitoring" Value="true"/>
</Properties>
</Component>
</Components>
<Component Type="Orchard.Caching.DefaultParallelCacheContext">
<Properties>
<!-- Set Value="true" to disable parallel cache resolution -->
<Property Name="Disabled" Value="false"/>
</Properties>
</Component>
</Components>
</HostComponents>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration"/>
</configSections>
<autofac defaultAssembly="Orchard.Framework">
<components>
<component instance-scope="per-lifetime-scope"
type="Orchard.Azure.FileSystems.Media.AzureBlobStorageProvider, Orchard.Azure"
service="Orchard.FileSystems.Media.IStorageProvider">
</component>
</components>
</autofac>
</configuration>

View File

@@ -7,7 +7,7 @@
<appender-ref ref="AzureAppender" />
</root>
<appender name="AzureAppender" type="Orchard.Azure.Logging.AzureAppender, Orchard.Azure">
<appender name="AzureAppender" type="Orchard.Azure.Services.Logging.AzureDiagnosticsAppender, Orchard.Azure">
<filter type="log4net.Filter.LevelRangeFilter">
<!-- Only error and fatal messages end up in this target, even if child loggers accept lower priority. -->
<levelMin value="ERROR" />

File diff suppressed because it is too large Load Diff

View File

@@ -1,192 +1,207 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host" />
<remove name="pages" />
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" />
</configSections>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host" />
<remove name="pages" />
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
</configSections>
<appSettings>
<add key="webpages:Enabled" value="false" />
<add key="log4net.Config" value="Config\log4net.config" />
</appSettings>
<appSettings>
<add key="webpages:Enabled" value="false" />
<add key="log4net.Config" value="Config\log4net.config" />
</appSettings>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="Orchard.Mvc.Html" />
</namespaces>
</pages>
</system.web.webPages.razor>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="Orchard.Mvc.Html" />
</namespaces>
</pages>
</system.web.webPages.razor>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<!--
Set default transaction timeout to 30 minutes so that interactive debugging
is easier (default timeout is less than one minute)
-->
<system.transactions>
<defaultSettings timeout="00:30:00" />
</system.transactions>
<system.web>
<!-- ///TODO: Need to add machine key here -->
<!-- <machineKey validationKey="" decryptionKey="" validation="SHA1" decryption="AES" /> -->
<httpRuntime requestValidationMode="2.0" />
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.0" batch="true" numRecompilesBeforeAppRestart="250">
<buildProviders>
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim" />
</buildProviders>
<assemblies>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<remove assembly="mscorlib" />
<remove assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="~/Users/Account/AccessDenied" timeout="2880" />
</authentication>
<!--
Uncomment below to store session state in Windows Azure Cache.
To use the in-role flavor of Windows Azure Caching, set {CacheHostIdentifier} to be the cache cluster role name.
To use the Windows Azure Caching Service, set {CacheHostIdentifier} to be the endpoint of the cache cluster.
-->
<!--<dataCacheClients>
<dataCacheClient name="DefaultCacheClient" useLegacyProtocol="false" connectionPool="true" maxConnectionsToServer="20">
<autoDiscover isEnabled="true" identifier="{CacheHostIdentifier}" />
</dataCacheClient>
</dataCacheClients>-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="Orchard.Mvc.Html" />
</namespaces>
</pages>
<httpHandlers>
<!-- see below -->
<clear />
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
</httpHandlers>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers accessPolicy="Script">
<!-- clear all handlers, prevents executing code file extensions, prevents returning any file contents -->
<clear />
<!-- Return 404 for all requests via managed handler. The url routing handler will substitute the mvc request handler when routes match. -->
<add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="App_Data/Dependencies" />
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
<!--
Set default transaction timeout to 30 minutes so that interactive debugging
is easier (default timeout is less than one minute).
-->
<system.transactions>
<defaultSettings timeout="00:30:00" />
</system.transactions>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<system.web>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<!-- Accept file uploads up to 64 MB. -->
<httpRuntime requestValidationMode="2.0" maxRequestLength="65536" />
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<compilation debug="true" targetFramework="4.0" batch="true" numRecompilesBeforeAppRestart="250">
<buildProviders>
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim" />
</buildProviders>
<assemblies>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<remove assembly="mscorlib" />
<remove assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove assembly="System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<remove assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<remove assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<authentication mode="Forms">
<forms loginUrl="~/Users/Account/AccessDenied" timeout="2880" />
</authentication>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<!-- Uncomment below to store session state in Windows Azure Cache (replace {CacheName} with name of your configured cache). -->
<!--<sessionState mode="Custom" timeout="60" customProvider="CacheSessionStateProvider">
<providers>
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="{CacheName}" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
</providers>
</sessionState>-->
<customErrors mode="RemoteOnly" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="Orchard.Mvc.Html" />
</namespaces>
</pages>
<httpHandlers>
<clear/>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<httpModules>
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.7, Culture=neutral"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="false">
<remove name="WarmupHttpModule"/>
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.7, Culture=neutral"/>
</modules>
<handlers accessPolicy="Script">
<!-- Clear all handlers, prevents executing code file extensions or returning any file contents. -->
<clear/>
<!-- Return 404 for all requests via a managed handler. The URL routing handler will substitute the MVC request handler when routes match. -->
<add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script"/>
<!-- WebApi -->
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
<!-- Prevent IIS 7.0 from returning a custom 404/500 error page of its own. -->
<httpErrors existingResponse="PassThrough"/>
<security>
<requestFiltering>
<!-- Accept file uploads up to 64 MB. -->
<requestLimits maxAllowedContentLength="67108864" />
</requestFiltering>
</security>
</system.webServer>
<runtime>
<gcServer enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="App_Data/Dependencies"/>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="2.2.0.0-2.6.3.862" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2505AA84-65A6-43D0-9C27-4F44FD576284}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Azure</RootNamespace>
<AssemblyName>Orchard.Azure</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</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>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</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>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\lib\log4net\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<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="FileSystems\CloudBlobContainerExtensions.cs" />
<Compile Include="Environment\Configuration\AzureShellSettingsManager.cs" />
<Compile Include="FileSystems\Media\AzureBlobStorageProvider.cs">
<SubType>
</SubType>
</Compile>
<Compile Include="Logging\AzureAppender.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="FileSystems\AzureFileSystem.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</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>

View File

@@ -11,8 +11,6 @@ Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "Orchard.Azure.CloudService"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Web", "Orchard.Azure.Web\Orchard.Azure.Web.csproj", "{0DF8F426-9F30-4918-8F64-A5B40BA12D10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "Orchard.Azure.csproj", "{2505AA84-65A6-43D0-9C27-4F44FD576284}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "..\Orchard.Web\Core\Orchard.Core.csproj", "{9916839C-39FC-4CEB-A5AF-89CA7E87119F}"
@@ -133,10 +131,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting.CSharp",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Taxonomies", "..\Orchard.Web\Modules\Orchard.Taxonomies\Orchard.Taxonomies.csproj", "{E649EA64-D213-461B-87F7-D67035801443}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AzureBlobStorage", "..\Orchard.Web\Modules\Orchard.AzureBlobStorage\Orchard.AzureBlobStorage.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "..\Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules.Deprecated", "Modules.Deprecated", "{B6092A92-1071-4C30-AD55-8E8D46BC2F14}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orchard", "Orchard", "{F2AB7512-139A-420F-AE3A-9ED22CA52CE1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -151,10 +151,6 @@ Global
{0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.Build.0 = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Release|Any CPU.Build.0 = Release|Any CPU
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -460,8 +456,10 @@ Global
{33B1BC8D-E292-4972-A363-22056B207156} = {75E7476C-C05B-4C41-8E38-081D3EB55659}
{CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {84650275-884D-4CBB-9CC0-67553996E211}
{137906EA-15FE-4AD8-A6A0-27528F0477D6} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14}
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14}
{43D0EC0B-1955-4566-8D31-7B9102DA1703} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14}
{966EC390-3C7F-4D98-92A6-F0F30D02E9B1} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14}
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14}
{9916839C-39FC-4CEB-A5AF-89CA7E87119F} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1}
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1}
EndGlobalSection
EndGlobal

View File

@@ -1,36 +0,0 @@
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("Orchard.Azure")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Orchard.Azure")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2009")]
[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("02bb8033-01ce-4c2d-a3f7-2a03641f4640")]
// 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.2.41")]
[assembly: AssemblyFileVersion("1.2.41")]

View File

@@ -1,27 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration"/>
</configSections>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration"/>
</configSections>
<autofac defaultAssembly="Orchard.Framework">
<components>
<!--
<component instance-scope="single-instance"
type="Orchard.Environment.Configuration.AzureBlobTenantManager"
service="Orchard.Environment.Configuration.IShellSettingsManager">
<parameters>
<parameter name="account" value="devstoreaccount1"/>
<parameter name="key" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="/>
<parameter name="container" value="mycontainer"/>
</parameters>
</component>
-->
</components>
</autofac>
</configuration>
<autofac defaultAssembly="Orchard.Framework">
<!-- Uncomment below to have Orchard store shell settings (Settings.txt) in Azure Blob Storage (useful when running multiple instances on Azure Web sites). -->
<!--<components>
<component instance-scope="single-instance" type="Orchard.Azure.Services.Environment.Configuration.AzureBlobShellSettingsManager, Orchard.Azure" service="Orchard.Environment.Configuration.IShellSettingsManager"></component>
</components>-->
</autofac>
</configuration>

View File

@@ -0,0 +1,21 @@
Name: Orchard.Azure
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.0
OrchardVersion: 1.7
Description: Provides a set of Orchard service implementations targeting Windows Azure services.
Features:
Orchard.Azure.OutputCache:
Name: Windows Azure Output Cache
Description: Activates an Orchard output cache provider that targets Windows Azure Cache.
Dependencies: Orchard.OutputCache
Category: Hosting
Orchard.Azure.DatabaseCache:
Name: Windows Azure Database Cache
Description: Activates an NHibernate second-level cache provider that targets Windows Azure Cache.
Category: Hosting
Orchard.Azure.MediaStorage:
Name: Windows Azure Media Storage
Description: Activates an Orchard media storage provider that targets Windows Azure Blob Storage.
Category: Hosting

View File

@@ -10,8 +10,8 @@
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.AzureBlobStorage</RootNamespace>
<AssemblyName>Orchard.AzureBlobStorage</AssemblyName>
<RootNamespace>Orchard.Azure</RootNamespace>
<AssemblyName>Orchard.Azure</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
@@ -45,14 +45,20 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
<HintPath>..\..\..\..\lib\log4net\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -77,10 +83,6 @@
<Content Include="Module.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard.Azure\Orchard.Azure.csproj">
<Project>{2505aa84-65a6-43d0-9c27-4f44fd576284}</Project>
<Name>Orchard.Azure</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
@@ -89,9 +91,22 @@
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.OutputCache\Orchard.OutputCache.csproj">
<Project>{6e444ff1-a47c-4cf6-bb3f-507c8ebd776d}</Project>
<Name>Orchard.OutputCache</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Services\AzureBlobStorageProviderDependency.cs" />
<Compile Include="Services\Caching\Database\AzureCacheClient.cs" />
<Compile Include="Services\Caching\Database\AzureCacheConfiguration.cs" />
<Compile Include="Services\Caching\Database\AzureCacheProvider.cs" />
<Compile Include="Services\Caching\Output\AzureOutputCacheStorageProvider.cs" />
<Compile Include="Services\Environment\Configuration\AzureConfigShellSettingsManager.cs" />
<Compile Include="Services\Environment\Configuration\AzureBlobShellSettingsManager.cs" />
<Compile Include="Services\FileSystems\AzureFileSystem.cs" />
<Compile Include="Services\FileSystems\CloudBlobContainerExtensions.cs" />
<Compile Include="Services\FileSystems\Media\AzureBlobStorageProvider.cs" />
<Compile Include="Services\Logging\AzureDiagnosticsAppender.cs" />
</ItemGroup>
<ItemGroup />
<PropertyGroup>

View File

@@ -1,36 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// 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("Orchard.AzureBlobStorage")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2013")]
[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("bcd6a602-4041-4a40-af4f-82f3dc0ab136")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
// 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("Orchard.AzureBlobStorage")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2013")]
[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("bcd6a602-4041-4a40-af4f-82f3dc0ab136")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]

View File

@@ -0,0 +1,180 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Microsoft.ApplicationServer.Caching;
using NHibernate;
using NHibernate.Cache;
namespace Orchard.Azure.Services.Caching.Database {
public class AzureCacheClient : ICache {
public AzureCacheClient(string cacheHostIdentifier, string cacheName, string region) {
var dataCacheFactoryConfiguration = new DataCacheFactoryConfiguration() {
AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, cacheHostIdentifier),
MaxConnectionsToServer = 32,
UseLegacyProtocol = false
};
var dataCacheFactory = new DataCacheFactory(dataCacheFactoryConfiguration);
_logger = LoggerProvider.LoggerFor(typeof(AzureCacheClient));
_region = region ?? _defaultRegion;
// Azure Cache supports only alphanumeric strings for regions and
// Orchard can get a lot more creative than that. Remove all non
// alphanumering characters from the region, and append the hash code
// of the original string to mitigate the risk of two distinct original
// region strings yielding the same transformed region string.
_regionAlphaNumeric = new String(Array.FindAll(_region.ToCharArray(), c => Char.IsLetterOrDigit(c))) + _region.GetHashCode().ToString();
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Creating instance with CacheName='{0}' and Region='{1}' (original Region='{2}').", cacheName, _regionAlphaNumeric, _region);
if (!String.IsNullOrEmpty(cacheName))
_cache = dataCacheFactory.GetCache(cacheName);
else
_cache = dataCacheFactory.GetDefaultCache();
_cache.CreateRegion(_regionAlphaNumeric);
_lockHandleDictionary = new ConcurrentDictionary<object, DataCacheLockHandle>();
_lockTimeout = TimeSpan.FromSeconds(30);
}
private const string _defaultRegion = "NHibernate";
private readonly IInternalLogger _logger;
private readonly string _region;
private readonly string _regionAlphaNumeric;
private readonly DataCache _cache;
private readonly ConcurrentDictionary<object, DataCacheLockHandle> _lockHandleDictionary;
private readonly TimeSpan _lockTimeout;
#region ICache Members
public object Get(object key) {
if (key == null)
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Get() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
return _cache.Get(key.ToString(), _regionAlphaNumeric);
}
public void Put(object key, object value) {
if (key == null)
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
if (value == null)
throw new ArgumentNullException("value", "The parameter 'value' must not be null.");
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Put() invoked with key='{0}' and value='{1}' in region '{2}'.", key, value, _regionAlphaNumeric);
_cache.Put(key.ToString(), value, _regionAlphaNumeric);
}
public void Remove(object key) {
if (key == null)
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Remove() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
_cache.Remove(key.ToString(), _regionAlphaNumeric);
}
public void Clear() {
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Clear() invoked in region '{0}'.", _regionAlphaNumeric);
_cache.ClearRegion(_regionAlphaNumeric);
}
public void Destroy() {
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Destroy() invoked in region '{0}'.", _regionAlphaNumeric);
Clear();
}
// The NHibernate locking mechanism and the Azure Cache pessimistic concurrency
// model are not a perfect fit. For example, Azure Cache has atomic "get-and-lock"
// and "put-and-unlock" semantics but there is no corresponding atomic operations
// defined on the ICache interface of NHibernate. Also, Azure Cache does not
// strictly enforce the pessimistic concurrency model - clients are responsible
// for following the locking protocol and therefore the implementation assumes that
// NHibernate will always call ICache.Lock() before calling ICache.Put() for data
// with concurrency management requirements. The implementations of ICache.Lock()
// and ICache.Unlock() below are therefore not as elegant as they would otherwise
// be (if not downright hackish).
// TODO: Try to understand how it's used, and make locking more robust.
public void Lock(object key) {
if (key == null)
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Lock() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
try {
DataCacheLockHandle lockHandle = null;
_cache.GetAndLock(key.ToString(), _lockTimeout, out lockHandle, _regionAlphaNumeric);
_lockHandleDictionary.TryAdd(key, lockHandle);
}
catch (Exception ex) {
if (_logger.IsErrorEnabled)
_logger.Error("Exception thrown while trying to lock object in cache.", ex);
throw;
}
}
// TODO: Try to understand how it's used, and make locking more robust.
public void Unlock(object key) {
if (key == null)
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Unlock() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
try {
DataCacheLockHandle lockHandle = null;
if (_lockHandleDictionary.TryRemove(key, out lockHandle))
_cache.Unlock(key.ToString(), lockHandle, _regionAlphaNumeric);
}
catch (Exception ex) {
if (_logger.IsErrorEnabled)
_logger.Error("Exception thrown while trying to unlock object in cache.", ex);
throw;
}
}
// TODO: Try to understand what this is for and how it's used.
public long NextTimestamp() {
if (_logger.IsDebugEnabled)
_logger.DebugFormat("NextTimestamp() invoked in region '{0}'.", _regionAlphaNumeric);
return Timestamper.Next();
}
// TODO: Try to understand what this is for and how it's used.
public int Timeout {
get {
return Timestamper.OneMs * (int)_lockTimeout.TotalMilliseconds;
}
}
public string RegionName {
get {
// Return original region here (which may be non-alphanumeric) so NHibernate
// will recognize it as the same region supplied to the constructor.
return _region;
}
}
#endregion
}
}

View File

@@ -0,0 +1,36 @@
using NHibernate.Cfg.Loquacious;
using Orchard;
using Orchard.Data;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
using Orchard.Logging;
namespace Orchard.Azure.Services.Caching.Database {
[OrchardFeature("Orchard.Azure.DatabaseCache")]
[OrchardSuppressDependency("Orchard.Data.DefaultDatabaseCacheConfiguration")]
public class AzureCacheConfiguration : Component, IDatabaseCacheConfiguration {
public static string CacheHostIdentifier;
public static string CacheName;
public AzureCacheConfiguration(ShellSettings shellSettings)
: base() {
_shellSettings = shellSettings;
CacheHostIdentifier = shellSettings["Azure.DatabaseCache.HostIdentifier"];
CacheName = shellSettings["Azure.DatabaseCache.CacheName"];
}
private readonly ShellSettings _shellSettings;
public void Configure(ICacheConfigurationProperties cache) {
cache.Provider<AzureCacheProvider>();
cache.UseQueryCache = true;
cache.RegionsPrefix = _shellSettings.Name;
//cache.RegionsPrefix = "Orchard";
Logger.Information("Configured NHibernate cache provider '{0}' with regions prefix '{1}'.", typeof(AzureCacheProvider).Name, _shellSettings.Name);
}
}
}

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
using Microsoft.WindowsAzure.ServiceRuntime;
using NHibernate.Cache;
namespace Orchard.Azure.Services.Caching.Database {
public class AzureCacheProvider : ICacheProvider {
#region ICacheProvider Members
public ICache BuildCache(string regionName, IDictionary<string, string> properties) {
return new AzureCacheClient(AzureCacheConfiguration.CacheHostIdentifier, AzureCacheConfiguration.CacheName, regionName);
}
public long NextTimestamp() {
return Timestamper.Next();
}
public void Start(IDictionary<string, string> properties) {
}
public void Stop() {
}
#endregion
}
}

View File

@@ -0,0 +1,102 @@
using Microsoft.ApplicationServer.Caching;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
using Orchard.OutputCache.Models;
using Orchard.OutputCache.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Orchard.Azure.Services.Caching.Output {
[OrchardFeature("Orchard.Azure.OutputCache")]
[OrchardSuppressDependency("Orchard.OutputCache.Services.DefaultCacheStorageProvider")]
public class AzureOutputCacheStorageProvider : Component, IOutputCacheStorageProvider {
public AzureOutputCacheStorageProvider(ShellSettings shellSettings)
: base() {
var cacheHostIdentifier = shellSettings["Azure.OutputCache.HostIdentifier"];
var cacheName = shellSettings["Azure.OutputCache.CacheName"];
var dataCacheFactoryConfiguration = new DataCacheFactoryConfiguration() {
AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, cacheHostIdentifier),
MaxConnectionsToServer = 32,
UseLegacyProtocol = false
};
var dataCacheFactory = new DataCacheFactory(dataCacheFactoryConfiguration);
if (!String.IsNullOrEmpty(cacheName))
_cache = dataCacheFactory.GetCache(cacheName);
else
_cache = dataCacheFactory.GetDefaultCache();
_usingSharedCaching = Boolean.Parse(shellSettings["Azure.OutputCache.IsSharedCaching"]);
if (!_usingSharedCaching)
{
// If not using Windows Azure Shared Caching we can enable additional features by
// storing all cache items in a region. This enables enumerating and counting all
// items currently in the cache.
_region = shellSettings.Name;
_cache.CreateRegion(_region);
}
}
private readonly DataCache _cache;
private readonly bool _usingSharedCaching; // True if using Windows Azure Shared Caching rather than role-based caching.
private readonly string _region;
public void Set(string key, CacheItem cacheItem) {
if (_usingSharedCaching)
_cache.Put(key, cacheItem);
else
_cache.Put(key, cacheItem, _region);
}
public void Remove(string key) {
if (_usingSharedCaching)
_cache.Remove(key);
else
_cache.Remove(key, _region);
}
public void RemoveAll() {
if (_usingSharedCaching)
_cache.Clear();
else
_cache.ClearRegion(_region);
}
public CacheItem GetCacheItem(string key) {
if (_usingSharedCaching)
return _cache.Get(key) as CacheItem;
else
return _cache.Get(key, _region) as CacheItem;
}
public IEnumerable<CacheItem> GetCacheItems(int skip, int count) {
if (_usingSharedCaching)
throw new NotSupportedException("The GetCacheItems() method is not supported with Windows Azure Shared Caching.");
return _cache.GetObjectsInRegion(_region).AsParallel()
.Select(x => x.Value)
.OfType<CacheItem>()
.Skip(skip)
.Take(count)
.ToArray();
}
public int GetCacheItemsCount() {
if (_usingSharedCaching)
throw new NotSupportedException("The GetCacheItemsCount() method is not supported with Windows Azure Shared Caching.");
return _cache.GetObjectsInRegion(_region).AsParallel()
.Select(x => x.Value)
.OfType<CacheItem>()
.Count();
}
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Orchard.Azure.Services.FileSystems;
using Orchard.Environment.Configuration;
using Orchard.FileSystems.Media;
namespace Orchard.Azure.Services.Environment.Configuration {
public class AzureBlobShellSettingsManager : Component, IShellSettingsManager {
public const string ConnectionStringSettingName = "Orchard.StorageConnectionString";
public const string ContainerName = "sites"; // Container names must be lower cased.
public const string SettingsFilename = "Settings.txt";
public const char Separator = ':';
public const string EmptyValue = "null";
protected readonly IShellSettingsManagerEventHandler Events;
protected readonly AzureFileSystem FileSystem;
public AzureBlobShellSettingsManager(IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider)
: this(CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting(ConnectionStringSettingName)), events, mimeTypeProvider) {
}
public AzureBlobShellSettingsManager(CloudStorageAccount storageAccount, IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider) {
Events = events;
FileSystem = new AzureFileSystem(ContainerName, String.Empty, true, mimeTypeProvider);
}
public virtual IEnumerable<ShellSettings> LoadSettings() {
var settings = LoadSettingsInternal().ToArray();
return settings;
}
public virtual void SaveSettings(ShellSettings settings) {
var content = ShellSettingsSerializer.ComposeSettings(settings);
var filePath = FileSystem.Combine(settings.Name, SettingsFilename);
var file = FileSystem.FileExists(filePath)
? FileSystem.GetFile(filePath)
: FileSystem.CreateFile(filePath);
using (var stream = file.OpenWrite()) {
using (var writer = new StreamWriter(stream)) {
writer.Write(content);
}
}
Events.Saved(settings);
}
private IEnumerable<ShellSettings> LoadSettingsInternal() {
foreach (var folder in FileSystem.ListFolders(null)) {
foreach (var file in FileSystem.ListFiles(folder.GetPath())) {
if (!String.Equals(file.GetName(), SettingsFilename))
continue;
using (var stream = file.OpenRead()) {
using (var reader = new StreamReader(stream))
yield return ShellSettingsSerializer.ParseSettings(reader.ReadToEnd());
}
}
}
}
}
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using Orchard.Environment.Configuration;
using Orchard.FileSystems.Media;
using Orchard.Logging;
namespace Orchard.Azure.Services.Environment.Configuration {
/// <summary>
/// Provides a ShellSettingsManager implementation that reads each value first
/// from platform configuration and second from the Settings.txt file stored in
/// Azure Blob Storage (using AzureBlobShellSettingsManager).
/// </summary>
/// <remarks>
/// This provider can be activated by configuration in Orchard.Web or Orchard.Azure.Web.
///
/// For each setting {SettingName} found in the Settings.txt file, this provider also looks
/// for a corresponding platform setting Orchard.{TenantName}.{SettingName}. The
/// <see cref="Microsoft.WindowsAzure.CloudConfigurationManager"/> class is used to search
/// for platform configuration settings in Azure Cloud Service configuration settings, Azure
/// Web Sites configuration settings and finally the Web.config appSettings element.
///
/// If a settings value is found, that value takes precedence over the Settings.txt
/// file when settings are read. When settings are written, they are always only written
/// to the backing Settings.txt file since cloud configuration settings are read-only.
///
/// This can be very useful in scenarios when you deploy your site to a number of different
/// environments and want to use cloud configuration profiles to maintain separate
/// settings for each of them that are automatically used when publishing. The fallback
/// mechanism enables you to keep environment-specific read-only settings (such as
/// SqlServerConnectionString) in cloud configuration profiles while leaving the
/// remaining and writeable settings (such as State) in the Settings.txt file.
///
/// When distributing your settings across cloud configuration and Settings.txt, you
/// must ensure that any settings that Orchard considers writeable (such as State) are
/// not placed in cloud configuration.
///
/// This provider also handles role configuration change events when running in an
/// Azure Cloud Service to ensure all Orchard tenents are notified whenever a role configuration
/// settings is changed though the management portal or API.
/// </remarks>
public class AzureConfigShellSettingsManager : AzureBlobShellSettingsManager {
private const string _prefix = "Orchard";
public AzureConfigShellSettingsManager(IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider)
: this(CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting(ConnectionStringSettingName)), events, mimeTypeProvider) {
}
public AzureConfigShellSettingsManager(CloudStorageAccount storageAccount, IShellSettingsManagerEventHandler events, IMimeTypeProvider mimeTypeProvider)
: base(storageAccount, events, mimeTypeProvider) {
if (RoleEnvironment.IsAvailable) {
RoleEnvironment.Changing += RoleEnvironment_Changing;
RoleEnvironment.Changed += RoleEnvironment_Changed;
}
}
public override IEnumerable<ShellSettings> LoadSettings() {
var settingsList = base.LoadSettings();
foreach (var settings in settingsList) {
foreach (var key in settings.Keys) {
var cloudConfigurationKey = String.Format("{0}.{1}.{2}", _prefix, settings.Name, key);
var cloudConfigurationValue = ParseValue(CloudConfigurationManager.GetSetting(cloudConfigurationKey));
if (cloudConfigurationValue != null)
settings[key] = cloudConfigurationValue;
}
}
return settingsList;
}
void RoleEnvironment_Changing(object sender, RoleEnvironmentChangingEventArgs e) {
// Indicate to the fabric controller that we can handle any changes.
e.Cancel = false;
}
private void RoleEnvironment_Changed(object sender, RoleEnvironmentChangedEventArgs e) {
Logger.Debug("Handling RoleEnvironmentChanged event.");
var configurationChangeQuery =
from c in e.Changes
where c is RoleEnvironmentConfigurationSettingChange
select c;
// If there's a configuration settings change, inform all Orchard tenants.
if (configurationChangeQuery.Any()) {
Logger.Information("Role configuration settings changed; refreshing Orchard shell settings.");
var settingsList = LoadSettings();
foreach (var settings in settingsList)
Events.Saved(settings);
}
}
private string ParseValue(string value) {
if (value == EmptyValue || String.IsNullOrWhiteSpace(value))
return null;
return value;
}
}
}

View File

@@ -7,13 +7,15 @@ using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Orchard.FileSystems.Media;
namespace Orchard.Azure.FileSystems {
namespace Orchard.Azure.Services.FileSystems {
public class AzureFileSystem {
public const string FolderEntry = "$$$ORCHARD$$$.$$$";
private readonly bool _isPrivate;
private readonly IMimeTypeProvider _mimeTypeProvider;
protected string _root;
protected string _absoluteRoot;
@@ -21,7 +23,10 @@ namespace Orchard.Azure.FileSystems {
private CloudBlobClient _blobClient;
private CloudBlobContainer _container;
public string ContainerName { get; protected set; }
public string ContainerName {
get;
protected set;
}
public CloudBlobClient BlobClient {
get {
@@ -32,7 +37,7 @@ namespace Orchard.Azure.FileSystems {
public CloudBlobContainer Container {
get {
EnsureInitialized();
EnsureInitialized();
return _container;
}
}
@@ -49,8 +54,7 @@ namespace Orchard.Azure.FileSystems {
return;
}
_storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
_storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("Orchard.StorageConnectionString"));
_absoluteRoot = Combine(Combine(_storageAccount.BlobEndpoint.AbsoluteUri, ContainerName), _root);
_blobClient = _storageAccount.CreateCloudBlobClient();
@@ -61,9 +65,12 @@ namespace Orchard.Azure.FileSystems {
_container.CreateIfNotExists();
_container.SetPermissions(_isPrivate
? new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Off }
: new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Container });
? new BlobContainerPermissions {
PublicAccess = BlobContainerPublicAccessType.Off
}
: new BlobContainerPermissions {
PublicAccess = BlobContainerPublicAccessType.Container
});
}
private static string ConvertToRelativeUriPath(string path) {
@@ -109,16 +116,16 @@ namespace Orchard.Azure.FileSystems {
path = ConvertToRelativeUriPath(path);
Container.EnsureBlobExists(String.Concat(_root, path));
return new AzureBlobFileStorage(Container.GetBlockBlobReference(String.Concat(_root, path)), _absoluteRoot);
Container.EnsureBlobExists(String.Concat(_root, path));
return new AzureBlobFileStorage(Container.GetBlockBlobReference(String.Concat(_root, path)), _absoluteRoot);
}
public bool FileExists(string path) {
return Container.BlobExists(String.Concat(_root, path));
return Container.BlobExists(String.Concat(_root, path));
}
public bool FolderExists(string path) {
return Container.DirectoryExists(String.Concat(_root, path));
return Container.DirectoryExists(String.Concat(_root, path));
}
public IEnumerable<IStorageFile> ListFiles(string path) {
@@ -252,7 +259,7 @@ namespace Orchard.Azure.FileSystems {
Container.EnsureBlobExists(String.Concat(_root, path));
Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath));
var blob = Container.GetBlockBlobReference(String.Concat(_root, path));
var newBlob = Container.GetBlockBlobReference(String.Concat(_root, newPath));
newBlob.StartCopyFromBlob(blob);
@@ -287,8 +294,8 @@ namespace Orchard.Azure.FileSystems {
public string GetPublicUrl(string path) {
path = ConvertToRelativeUriPath(path);
Container.EnsureBlobExists(String.Concat(_root, path));
return Container.GetBlockBlobReference(String.Concat(_root, path)).Uri.ToString();
Container.EnsureBlobExists(String.Concat(_root, path));
return Container.GetBlockBlobReference(String.Concat(_root, path)).Uri.ToString();
}
private class AzureBlobFileStorage : IStorageFile {
@@ -369,7 +376,7 @@ namespace Orchard.Azure.FileSystems {
if (_blob.Parent != null) {
return new AzureBlobFolderStorage(_blob.Parent, _rootPath);
}
throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory");
throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory");
}
private static long GetDirectorySize(CloudBlobDirectory directoryBlob) {
@@ -386,6 +393,5 @@ namespace Orchard.Azure.FileSystems {
return size;
}
}
}
}

View File

@@ -3,7 +3,8 @@ using System.Linq;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
namespace Orchard.Azure.FileSystems {
namespace Orchard.Azure.Services.FileSystems {
public static class CloudBlobContainerExtensions {
public static bool BlobExists(this CloudBlobContainer container, string path) {

View File

@@ -1,13 +1,16 @@
using System.IO;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
using Orchard.FileSystems.Media;
using Orchard.Environment.Extensions;
namespace Orchard.Azure.FileSystems.Media {
namespace Orchard.Azure.Services.FileSystems.Media {
[OrchardFeature("Orchard.Azure.MediaStorage")]
[OrchardSuppressDependency("Orchard.FileSystems.Media.FileSystemStorageProvider")]
public class AzureBlobStorageProvider : AzureFileSystem, IStorageProvider {
public AzureBlobStorageProvider(ShellSettings shellSettings, IMimeTypeProvider mimeTypeProvider) : base("media", shellSettings.Name, false, mimeTypeProvider) { }
public AzureBlobStorageProvider(ShellSettings shellSettings, IMimeTypeProvider mimeTypeProvider) : base("media", shellSettings.Name, false, mimeTypeProvider)
{ }
public bool TrySaveStream(string path, Stream inputStream) {
try {
@@ -21,13 +24,12 @@ namespace Orchard.Azure.FileSystems.Media {
}
public void SaveStream(string path, Stream inputStream) {
// Create the file.
// The CreateFile method will map the still relative path
// Create the file. The CreateFile() method will map the still relative path.
var file = CreateFile(path);
using(var outputStream = file.OpenWrite()) {
using (var outputStream = file.OpenWrite()) {
var buffer = new byte[8192];
for (;;) {
while (true) {
var length = inputStream.Read(buffer, 0, buffer.Length);
if (length <= 0)
break;
@@ -37,10 +39,10 @@ namespace Orchard.Azure.FileSystems.Media {
}
/// <summary>
/// Retrieves the local path for a given url within the storage provider.
/// Retrieves the local path for a given URL within the storage provider.
/// </summary>
/// <param name="url">The public url of the media.</param>
/// <returns>The local path.</returns>
/// <param name="url">The public URL of the media.</param>
/// <returns>The corresponding local path.</returns>
public string GetStoragePath(string url) {
if (url.StartsWith(_absoluteRoot)) {
return url.Substring(Combine(_absoluteRoot, "/").Length);
@@ -52,6 +54,5 @@ namespace Orchard.Azure.FileSystems.Media {
public string GetRelativePath(string path) {
return GetPublicUrl(path);
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using Microsoft.WindowsAzure.Diagnostics;
using log4net.Appender;
using log4net.Core;
namespace Orchard.Azure.Services.Logging {
/// <summary>
/// Provides a Log4net appender implementation that sends log messages to Windows Azure Diagnostics.
/// </summary>
public class AzureDiagnosticsAppender : AppenderSkeleton {
private const string _wadStorageAccountConnectionStringSettingName = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
public AzureDiagnosticsAppender() {
var defaultDiagnostics = DiagnosticMonitor.GetDefaultInitialConfiguration();
var period = TimeSpan.FromMinutes(1d);
defaultDiagnostics.Directories.ScheduledTransferPeriod = period;
defaultDiagnostics.Logs.ScheduledTransferPeriod = period;
defaultDiagnostics.WindowsEventLog.ScheduledTransferPeriod = period;
DiagnosticMonitor.Start(_wadStorageAccountConnectionStringSettingName, defaultDiagnostics);
}
protected override void Append(LoggingEvent loggingEvent) {
var formattedMessage = RenderLoggingEvent(loggingEvent);
System.Diagnostics.Trace.WriteLine(formattedMessage);
}
}
}

View File

@@ -1,41 +1,41 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host" />
<remove name="pages" />
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web.webPages.razor>
<system.web>
<compilation targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
</system.web>
</configuration>
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host" />
<remove name="pages" />
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web.webPages.razor>
<system.web>
<compilation targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
</system.web>
</configuration>

View File

@@ -1,12 +0,0 @@
Name: Orchard.AzureBlobStorage
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.0
OrchardVersion: 1.7
Description: Description for the module
Features:
Orchard.AzureBlobStorage:
Description: Configures Windows Azure Blob Storage to be used as the underlying storage for Orchard
Name: Azure Blob Storage
Category: Hosting

View File

@@ -1,12 +0,0 @@
using System.IO;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
using Orchard.FileSystems.Media;
using Orchard.Azure.FileSystems.Media;
namespace Orchard.AzureBlobStorage.Services {
[OrchardSuppressDependency("Orchard.FileSystems.Media.FileSystemStorageProvider")]
public class AzureBlobStorageProviderDependency : AzureBlobStorageProvider {
public AzureBlobStorageProviderDependency(ShellSettings shellSettings, IMimeTypeProvider mimeTypeProvider) : base(shellSettings, mimeTypeProvider) { }
}
}

View File

@@ -88,7 +88,7 @@
</ProjectReference>
<ProjectReference Include="..\..\..\Tools\Orchard\Orchard.csproj">
<Project>{33B1BC8D-E292-4972-A363-22056B207156}</Project>
<Name>Orchard</Name>
<Name>Orchard %28Tools\Orchard%29</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Packaging\Orchard.Packaging.csproj">
<Project>{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}</Project>

View File

@@ -150,6 +150,10 @@
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
<ProjectReference Include="Modules\Orchard.Azure\Orchard.Azure.csproj">
<Project>{cbc7993c-57d8-4a6c-992c-19e849dfe71d}</Project>
<Name>Orchard.Azure</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Config\Host.config" />

View File

@@ -1,13 +1,6 @@
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host"/>
@@ -15,12 +8,14 @@
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
</configSections>
<appSettings>
<add key="webpages:Enabled" value="false"/>
<add key="log4net.Config" value="Config\log4net.config"/>
</appSettings>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
@@ -36,22 +31,31 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
Uncomment below to store session state in Windows Azure Cache.
To use the in-role flavor of Windows Azure Caching, set {CacheHostIdentifier} to be the cache cluster role name.
To use the Windows Azure Caching Service, set {CacheHostIdentifier} to be the endpoint of the cache cluster.
-->
<!--<dataCacheClients>
<dataCacheClient name="DefaultCacheClient" useLegacyProtocol="false" connectionPool="true" maxConnectionsToServer="20">
<autoDiscover isEnabled="true" identifier="{CacheHostIdentifier}" />
</dataCacheClient>
</dataCacheClients>-->
<!--
Set default transaction timeout to 30 minutes so that interactive debugging
is easier (default timeout is less than one minute)
-->
Set default transaction timeout to 30 minutes so that interactive debugging
is easier (default timeout is less than one minute).
-->
<system.transactions>
<defaultSettings timeout="00:30:00"/>
</system.transactions>
<system.web>
<!-- Accept file uploads up to 64 Mb -->
<!-- Accept file uploads up to 64 MB. -->
<httpRuntime requestValidationMode="2.0" maxRequestLength="65536" />
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.0" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
<buildProviders>
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim"/>
@@ -83,22 +87,20 @@
<remove assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="~/Users/Account/AccessDenied" timeout="2880"/>
</authentication>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<!-- Uncomment below to store session state in Windows Azure Cache (replace {CacheName} with name of your configured cache). -->
<!--<sessionState mode="Custom" timeout="60" customProvider="CacheSessionStateProvider">
<providers>
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="{CacheName}" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
</providers>
</sessionState>-->
<customErrors mode="RemoteOnly"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -110,19 +112,17 @@
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
<httpHandlers>
<!-- see below -->
<clear/>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<httpModules>
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.7, Culture=neutral"/>
</httpModules>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="false">
@@ -130,9 +130,9 @@
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.7, Culture=neutral"/>
</modules>
<handlers accessPolicy="Script">
<!-- clear all handlers, prevents executing code file extensions, prevents returning any file contents -->
<!-- Clear all handlers, prevents executing code file extensions or returning any file contents. -->
<clear/>
<!-- Return 404 for all requests via managed handler. The url routing handler will substitute the mvc request handler when routes match. -->
<!-- Return 404 for all requests via a managed handler. The URL routing handler will substitute the MVC request handler when routes match. -->
<add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script"/>
<!-- WebApi -->
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
@@ -142,15 +142,16 @@
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
<!-- Prevent IIS 7.0 from returning a custom 404/500 error page of its own -->
<!-- Prevent IIS 7.0 from returning a custom 404/500 error page of its own. -->
<httpErrors existingResponse="PassThrough"/>
<security>
<requestFiltering>
<!-- Accept file uploads up to 64 Mb -->
<!-- Accept file uploads up to 64 MB. -->
<requestLimits maxAllowedContentLength="67108864" />
</requestFiltering>
</security>
</system.webServer>
<runtime>
<gcServer enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@@ -193,4 +194,5 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -160,9 +160,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Upgrade", "Orchard.Web\Modu
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules.Deprecated", "Modules.Deprecated", "{902528F6-1444-42A3-8B75-A54B775B539C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AzureBlobStorage", "Orchard.Web\Modules\Orchard.AzureBlobStorage\Orchard.AzureBlobStorage.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "Orchard.Azure\Orchard.Azure.csproj", "{2505AA84-65A6-43D0-9C27-4F44FD576284}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -902,16 +900,6 @@ Global
{CBC7993C-57D8-4A6C-992C-19E849DFE71D}.FxCop|Any CPU.Build.0 = Release|Any CPU
{CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.Build.0 = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Coverage|Any CPU.Build.0 = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.FxCop|Any CPU.Build.0 = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2505AA84-65A6-43D0-9C27-4F44FD576284}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -25,7 +25,6 @@ namespace Orchard.FileSystems.Media {
/// <returns>The storage path or <value>null</value> if the media is not in a correct format.</returns>
string GetStoragePath(string url);
/// <summary>
/// Retrieves a file within the storage provider.
/// </summary>