Merge 1.x => default

This commit is contained in:
Renaud Paquay
2011-01-17 15:15:21 -08:00
326 changed files with 4675 additions and 2395 deletions

View File

@@ -156,7 +156,13 @@ namespace Orchard.Azure {
public void TryCreateFolder(string path) {
EnsurePathIsRelative(path);
CreateFile(Combine(path, FolderEntry));
using (new HttpContextWeaver()) {
if (Container.DirectoryExists(String.Concat(_root, path))) {
return;
}
CreateFile(Combine(path, FolderEntry));
}
}
public void CreateFolder(string path) {

View File

@@ -5,19 +5,18 @@ using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.ServiceRuntime;
using Orchard.Environment.Configuration;
using Orchard.Localization;
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;
Localizer T { get; set; }
public AzureShellSettingsManager(IShellSettingsManagerEventHandler events)
: this(CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("DataConnectionString")), events) {}
@@ -33,7 +32,7 @@ namespace Orchard.Azure.Environment.Configuration {
void IShellSettingsManager.SaveSettings(ShellSettings settings) {
var content = ComposeSettings(settings);
var filePath = String.Concat(settings.Name, "/", SettingsFilename);
var filePath = _fileSystem.Combine(settings.Name, SettingsFilename);
var file = _fileSystem.CreateFile(filePath);
using (var stream = file.OpenWrite()) {
@@ -62,50 +61,54 @@ namespace Orchard.Azure.Environment.Configuration {
if (String.IsNullOrEmpty(text))
return shellSettings;
string[] settings = text.Split(new[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries);
var settings = text.Split(new[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries);
foreach (var setting in settings) {
string[] settingFields = setting.Split(new[] {":"}, StringSplitOptions.RemoveEmptyEntries);
int fieldsLength = settingFields.Length;
if (fieldsLength != 2)
var separatorIndex = setting.IndexOf(Separator);
if(separatorIndex == -1) {
continue;
for (int i = 0; i < fieldsLength; i++) {
settingFields[i] = settingFields[i].Trim();
}
if (settingFields[1] != "null") {
switch (settingFields[0]) {
string key = setting.Substring(0, separatorIndex).Trim();
string value = setting.Substring(separatorIndex + 1).Trim();
if (value != EmptyValue) {
switch (key) {
case "Name":
shellSettings.Name = settingFields[1];
shellSettings.Name = value;
break;
case "DataProvider":
shellSettings.DataProvider = settingFields[1];
shellSettings.DataProvider = value;
break;
case "State":
shellSettings.State = new TenantState(settingFields[1]);
shellSettings.State = new TenantState(value);
break;
case "DataConnectionString":
shellSettings.DataConnectionString = settingFields[1];
shellSettings.DataConnectionString = value;
break;
case "DataPrefix":
shellSettings.DataTablePrefix = settingFields[1];
shellSettings.DataTablePrefix = value;
break;
case "RequestUrlHost":
shellSettings.RequestUrlHost = settingFields[1];
shellSettings.RequestUrlHost = value;
break;
case "RequestUrlPrefix":
shellSettings.RequestUrlPrefix = settingFields[1];
shellSettings.RequestUrlPrefix = value;
break;
case "EncryptionAlgorithm":
shellSettings.EncryptionAlgorithm = settingFields[1];
shellSettings.EncryptionAlgorithm = value;
break;
case "EncryptionKey":
shellSettings.EncryptionKey = settingFields[1];
shellSettings.EncryptionKey = value;
break;
case "EncryptionIV":
shellSettings.EncryptionIV = settingFields[1];
case "HashAlgorithm":
shellSettings.HashAlgorithm = value;
break;
case "HashKey":
shellSettings.HashKey = value;
break;
}
}
}
return shellSettings;
}
@@ -113,17 +116,18 @@ namespace Orchard.Azure.Environment.Configuration {
if (settings == null)
return "";
return string.Format("Name: {0}\r\nDataProvider: {1}\r\nDataConnectionString: {2}\r\nDataPrefix: {3}\r\nRequestUrlHost: {4}\r\nRequestUrlPrefix: {5}\r\nState: {6}\r\nEncryptionAlgorithm: {7}\r\nEncryptionKey: {8}\r\nEncryptionIV: {9}\r\n",
return string.Format("Name: {0}\r\nDataProvider: {1}\r\nDataConnectionString: {2}\r\nDataPrefix: {3}\r\nRequestUrlHost: {4}\r\nRequestUrlPrefix: {5}\r\nState: {6}\r\nEncryptionAlgorithm: {7}\r\nEncryptionKey: {8}\r\nHashAlgorithm: {9}\r\nHashKey: {10}\r\n",
settings.Name,
settings.DataProvider,
settings.DataConnectionString ?? "null",
settings.DataTablePrefix ?? "null",
settings.RequestUrlHost ?? "null",
settings.RequestUrlPrefix ?? "null",
settings.DataConnectionString ?? EmptyValue,
settings.DataTablePrefix ?? EmptyValue,
settings.RequestUrlHost ?? EmptyValue,
settings.RequestUrlPrefix ?? EmptyValue,
settings.State != null ? settings.State.ToString() : String.Empty,
settings.EncryptionAlgorithm ?? "null",
settings.EncryptionKey ?? "null",
settings.EncryptionIV ?? "null"
settings.EncryptionAlgorithm ?? EmptyValue,
settings.EncryptionKey ?? EmptyValue,
settings.HashAlgorithm ?? EmptyValue,
settings.HashKey ?? EmptyValue
);
}
}

View File

@@ -118,6 +118,10 @@
<Reference Include="System.Web.WebPages">
<HintPath>..\..\..\lib\aspnetmvc\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\aspnetmvc\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor">
<HintPath>..\..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll</HintPath>
</Reference>

View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.9.0")]
[assembly: AssemblyFileVersion("0.9.0")]
[assembly: AssemblyVersion("1.0.20")]
[assembly: AssemblyFileVersion("1.0.20")]

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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("0.9.0")]
[assembly: AssemblyFileVersion("0.9.0")]
[assembly: AssemblyVersion("1.0.20")]
[assembly: AssemblyFileVersion("1.0.20")]