--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-11-04 15:34:24 -07:00
129 changed files with 1307 additions and 361 deletions

View File

@@ -48,7 +48,8 @@
<MSBuild <MSBuild
Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln" Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln"
Targets="Build" Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64" /> Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64;DefineConstants=AZURE"
/>
<MSBuild <MSBuild
Projects="$(SrcFolder)\Orchard.Azure.sln" Projects="$(SrcFolder)\Orchard.Azure.sln"

View File

@@ -50,7 +50,7 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
Assert.AreEqual(".txt", storageFile.GetFileType()); Assert.AreEqual(".txt", storageFile.GetFileType());
Assert.AreEqual("foo.txt", storageFile.GetName()); Assert.AreEqual("foo.txt", storageFile.GetName());
Assert.That(storageFile.GetPath().EndsWith("/default/foo.txt"), Is.True); Assert.AreEqual("foo.txt", storageFile.GetPath());
Assert.AreEqual(0, storageFile.GetSize()); Assert.AreEqual(0, storageFile.GetSize());
} }
@@ -71,7 +71,8 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
var files = _azureBlobStorageProvider.ListFiles(""); var files = _azureBlobStorageProvider.ListFiles("");
Assert.AreEqual(1, files.Count()); Assert.AreEqual(1, files.Count());
Assert.That(files.First().GetPath().EndsWith("foo2.txt"), Is.True); Assert.That(files.First().GetPath().Equals("foo2.txt"), Is.True);
Assert.That(files.First().GetName().Equals("foo2.txt"), Is.True);
} }
[Test] [Test]
@@ -82,17 +83,28 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("").Count()); Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("").Count());
Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder").Count()); Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder").Count());
Assert.AreEqual("folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetPath());
Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetName());
Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder/folder").Count());
Assert.AreEqual("folder/folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetPath());
Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetName());
} }
[Test] [Test]
[ExpectedException(typeof(ArgumentException))] [ExpectedException(typeof(ArgumentException))]
public void CreateFolderThatExistsShouldThrow() { public void CreateFolderThatExistsShouldThrow() {
// sebros: In Azure, the folder concept is just about checking files prefix. So until a file exists, a folder is nothing
_azureBlobStorageProvider.CreateFile("folder/foo.txt"); _azureBlobStorageProvider.CreateFile("folder/foo.txt");
_azureBlobStorageProvider.CreateFolder("folder"); _azureBlobStorageProvider.CreateFolder("folder");
} }
[Test]
public void ListFolderShouldAcceptNullPath() {
_azureBlobStorageProvider.CreateFolder("folder");
Assert.AreEqual(1, _azureBlobStorageProvider.ListFolders(null).Count());
Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetName());
Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetPath());
}
[Test] [Test]
public void DeleteFolderShouldDeleteFilesAlso() { public void DeleteFolderShouldDeleteFilesAlso() {
_azureBlobStorageProvider.CreateFile("folder/foo1.txt"); _azureBlobStorageProvider.CreateFile("folder/foo1.txt");

View File

@@ -8,11 +8,15 @@ using Microsoft.WindowsAzure.StorageClient;
using Orchard.FileSystems.Media; using Orchard.FileSystems.Media;
namespace Orchard.Azure { namespace Orchard.Azure {
public class AzureFileSystem { public class AzureFileSystem
{
private const string FolderEntry = "$$$ORCHARD$$$.$$$";
public string ContainerName { get; protected set; } public string ContainerName { get; protected set; }
private readonly CloudStorageAccount _storageAccount; private readonly CloudStorageAccount _storageAccount;
private readonly string _root; private readonly string _root;
private readonly string _absoluteRoot;
public CloudBlobClient BlobClient { get; private set; } public CloudBlobClient BlobClient { get; private set; }
public CloudBlobContainer Container { get; private set; } public CloudBlobContainer Container { get; private set; }
@@ -25,6 +29,7 @@ namespace Orchard.Azure {
_storageAccount = storageAccount; _storageAccount = storageAccount;
ContainerName = containerName; ContainerName = containerName;
_root = String.IsNullOrEmpty(root) || root == "/" ? String.Empty : root + "/"; _root = String.IsNullOrEmpty(root) || root == "/" ? String.Empty : root + "/";
_absoluteRoot = _storageAccount.BlobEndpoint.AbsoluteUri + containerName + "/" + root + "/";
using ( new HttpContextWeaver() ) { using ( new HttpContextWeaver() ) {
@@ -46,66 +51,65 @@ namespace Orchard.Azure {
} }
private static void EnsurePathIsRelative(string path) { private static void EnsurePathIsRelative(string path) {
if ( path.StartsWith("/") || path.StartsWith("http://")) if (path.StartsWith("/") || path.StartsWith("http://"))
throw new ArgumentException("Path must be relative"); throw new ArgumentException("Path must be relative");
} }
public IStorageFile GetFile(string path) { public IStorageFile GetFile(string path) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{ Container.EnsureBlobExists(String.Concat(_root, path));
Container.EnsureBlobExists(path); return new AzureBlobFileStorage(Container.GetBlockBlobReference(path), _absoluteRoot);
return new AzureBlobFileStorage(Container.GetBlockBlobReference(path));
} }
} }
public bool FileExists(string path) { public bool FileExists(string path) {
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{ return Container.BlobExists(String.Concat(_root, path));
path = String.Concat(_root, path);
return Container.BlobExists(path);
} }
} }
public IEnumerable<IStorageFile> ListFiles(string path) { public IEnumerable<IStorageFile> ListFiles(string path) {
path = path ?? String.Empty;
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
string prefix = String.Concat(Container.Name, "/", _root, path); string prefix = String.Concat(Container.Name, "/", _root, path);
if ( !prefix.EndsWith("/") ) if ( !prefix.EndsWith("/") )
prefix += "/"; prefix += "/";
using ( new HttpContextWeaver() )
{ using ( new HttpContextWeaver() ) {
foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType<CloudBlockBlob>()) foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType<CloudBlockBlob>()) {
{ // ignore directory entries
yield return new AzureBlobFileStorage(blobItem); if(blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry))
continue;
yield return new AzureBlobFileStorage(blobItem, _absoluteRoot);
} }
} }
} }
public IEnumerable<IStorageFolder> ListFolders(string path) { public IEnumerable<IStorageFolder> ListFolders(string path) {
path = path ?? String.Empty;
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path); using ( new HttpContextWeaver() ) {
using ( new HttpContextWeaver() ) if ( !Container.DirectoryExists(String.Concat(_root, path)) ) {
{ try {
if (!Container.DirectoryExists(path)) CreateFolder(String.Concat(_root, path));
{
try
{
CreateFolder(path);
} }
catch (Exception ex) catch ( Exception ex ) {
{
throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}", throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}",
path, ex)); path, ex));
} }
} }
return Container.GetDirectoryReference(path) return Container.GetDirectoryReference(String.Concat(_root, path))
.ListBlobs() .ListBlobs()
.OfType<CloudBlobDirectory>() .OfType<CloudBlobDirectory>()
.Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d)) .Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d, _absoluteRoot))
.ToList(); .ToList();
} }
} }
@@ -113,23 +117,20 @@ namespace Orchard.Azure {
public void CreateFolder(string path) public void CreateFolder(string path)
{ {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path); using (new HttpContextWeaver()) {
using (new HttpContextWeaver()) Container.EnsureDirectoryDoesNotExist(String.Concat(_root, path));
{
Container.EnsureDirectoryDoesNotExist(path); // Creating a virtually hidden file to make the directory an existing concept
Container.GetDirectoryReference(path); CreateFile(path + "/" + FolderEntry);
} }
} }
public void DeleteFolder(string path) { public void DeleteFolder(string path) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{ Container.EnsureDirectoryExists(String.Concat(_root, path));
Container.EnsureDirectoryExists(path); foreach ( var blob in Container.GetDirectoryReference(String.Concat(_root, path)).ListBlobs() ) {
foreach (var blob in Container.GetDirectoryReference(path).ListBlobs())
{
if (blob is CloudBlob) if (blob is CloudBlob)
((CloudBlob) blob).Delete(); ((CloudBlob) blob).Delete();
@@ -141,7 +142,6 @@ namespace Orchard.Azure {
public void RenameFolder(string path, string newPath) { public void RenameFolder(string path, string newPath) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
EnsurePathIsRelative(newPath); EnsurePathIsRelative(newPath);
if ( !path.EndsWith("/") ) if ( !path.EndsWith("/") )
@@ -149,20 +149,16 @@ namespace Orchard.Azure {
if ( !newPath.EndsWith("/") ) if ( !newPath.EndsWith("/") )
newPath += "/"; newPath += "/";
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{ foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) {
foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) if (blob is CloudBlob) {
{
if (blob is CloudBlob)
{
string filename = Path.GetFileName(blob.Uri.ToString()); string filename = Path.GetFileName(blob.Uri.ToString());
string source = String.Concat(path, filename); string source = String.Concat(path, filename);
string destination = String.Concat(newPath, filename); string destination = String.Concat(newPath, filename);
RenameFile(source, destination); RenameFile(source, destination);
} }
if (blob is CloudBlobDirectory) if (blob is CloudBlobDirectory) {
{
string foldername = blob.Uri.Segments.Last(); string foldername = blob.Uri.Segments.Last();
string source = String.Concat(path, foldername); string source = String.Concat(path, foldername);
string destination = String.Concat(newPath, foldername); string destination = String.Concat(newPath, foldername);
@@ -174,29 +170,24 @@ namespace Orchard.Azure {
public void DeleteFile(string path) { public void DeleteFile(string path) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{
Container.EnsureBlobExists(path); Container.EnsureBlobExists(path);
var blob = Container.GetBlockBlobReference(path); var blob = Container.GetBlockBlobReference(String.Concat(_root, path));
blob.Delete(); blob.Delete();
} }
} }
public void RenameFile(string path, string newPath) { public void RenameFile(string path, string newPath) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
EnsurePathIsRelative(newPath); EnsurePathIsRelative(newPath);
newPath = String.Concat(_root, newPath);
using ( new HttpContextWeaver() )
{
Container.EnsureBlobExists(path);
Container.EnsureBlobDoesNotExist(newPath);
var blob = Container.GetBlockBlobReference(path); using ( new HttpContextWeaver() ) {
var newBlob = Container.GetBlockBlobReference(newPath); 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.CopyFromBlob(blob); newBlob.CopyFromBlob(blob);
blob.Delete(); blob.Delete();
} }
@@ -204,36 +195,36 @@ namespace Orchard.Azure {
public IStorageFile CreateFile(string path) { public IStorageFile CreateFile(string path) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
if ( Container.BlobExists(path) ) { if ( Container.BlobExists(String.Concat(_root, path)) ) {
throw new ArgumentException("File " + path + " already exists"); throw new ArgumentException("File " + path + " already exists");
} }
var blob = Container.GetBlockBlobReference(path); var blob = Container.GetBlockBlobReference(String.Concat(_root, path));
blob.OpenWrite().Dispose(); // force file creation blob.OpenWrite().Dispose(); // force file creation
return new AzureBlobFileStorage(blob); return new AzureBlobFileStorage(blob, _absoluteRoot);
} }
public string GetPublicUrl(string path) { public string GetPublicUrl(string path) {
EnsurePathIsRelative(path); EnsurePathIsRelative(path);
path = String.Concat(_root, path);
using ( new HttpContextWeaver() ) using ( new HttpContextWeaver() ) {
{ Container.EnsureBlobExists(String.Concat(_root, path));
Container.EnsureBlobExists(path); return Container.GetBlockBlobReference(String.Concat(_root, path)).Uri.ToString();
return Container.GetBlockBlobReference(path).Uri.ToString();
} }
} }
private class AzureBlobFileStorage : IStorageFile { private class AzureBlobFileStorage : IStorageFile {
private readonly CloudBlockBlob _blob; private readonly CloudBlockBlob _blob;
private readonly string _rootPath;
public AzureBlobFileStorage(CloudBlockBlob blob) { public AzureBlobFileStorage(CloudBlockBlob blob, string rootPath) {
_blob = blob; _blob = blob;
_rootPath = rootPath;
} }
public string GetPath() { public string GetPath() {
return _blob.Uri.ToString(); return _blob.Uri.ToString().Substring(_rootPath.Length+1);
} }
public string GetName() { public string GetName() {
@@ -264,17 +255,19 @@ namespace Orchard.Azure {
private class AzureBlobFolderStorage : IStorageFolder { private class AzureBlobFolderStorage : IStorageFolder {
private readonly CloudBlobDirectory _blob; private readonly CloudBlobDirectory _blob;
private readonly string _rootPath;
public AzureBlobFolderStorage(CloudBlobDirectory blob) { public AzureBlobFolderStorage(CloudBlobDirectory blob, string rootPath) {
_blob = blob; _blob = blob;
_rootPath = rootPath;
} }
public string GetName() { public string GetName() {
return Path.GetDirectoryName(_blob.Uri.ToString()); return Path.GetDirectoryName(GetPath() + "/");
} }
public string GetPath() { public string GetPath() {
return _blob.Uri.ToString(); return _blob.Uri.ToString().Substring(_rootPath.Length + 1).TrimEnd('/');
} }
public long GetSize() { public long GetSize() {
@@ -287,7 +280,7 @@ namespace Orchard.Azure {
public IStorageFolder GetParent() { public IStorageFolder GetParent() {
if ( _blob.Parent != null ) { if ( _blob.Parent != null ) {
return new AzureBlobFolderStorage(_blob.Parent); 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");
} }

View File

@@ -8,6 +8,11 @@ namespace Orchard.Azure.Web {
public override bool OnStart() { public override bool OnStart() {
DiagnosticMonitor.Start("DiagnosticsConnectionString"); DiagnosticMonitor.Start("DiagnosticsConnectionString");
CloudStorageAccount.SetConfigurationSettingPublisher(
(configName, configSetter) =>
configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))
);
// For information on handling configuration changes // For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
RoleEnvironment.Changing += RoleEnvironmentChanging; RoleEnvironment.Changing += RoleEnvironmentChanging;

View File

@@ -2,9 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*.aspx" verb="*" type="System.Web.HttpNotFoundHandler"/>
<add path="*.ascx" verb="*" type="System.Web.HttpNotFoundHandler"/>
<add path="*.master" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -28,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*.aspx,*.ascx,*.master" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -26,6 +26,7 @@ namespace Orchard.Tests.DataMigration {
private string _tempFolder; private string _tempFolder;
private SchemaBuilder _schemaBuilder; private SchemaBuilder _schemaBuilder;
private DefaultDataMigrationInterpreter _interpreter; private DefaultDataMigrationInterpreter _interpreter;
private ISession _session;
[SetUp] [SetUp]
public void Setup() { public void Setup() {
@@ -38,7 +39,7 @@ namespace Orchard.Tests.DataMigration {
var builder = new ContainerBuilder(); var builder = new ContainerBuilder();
var session = _sessionFactory.OpenSession(); _session = _sessionFactory.OpenSession();
builder.RegisterInstance(appDataFolder).As<IAppDataFolder>(); builder.RegisterInstance(appDataFolder).As<IAppDataFolder>();
builder.RegisterType<SqlCeDataServicesProvider>().As<IDataServicesProvider>(); builder.RegisterType<SqlCeDataServicesProvider>().As<IDataServicesProvider>();
builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>(); builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>();
@@ -46,7 +47,7 @@ namespace Orchard.Tests.DataMigration {
builder.RegisterType<DefaultDataMigrationInterpreter>().As<IDataMigrationInterpreter>(); builder.RegisterType<DefaultDataMigrationInterpreter>().As<IDataMigrationInterpreter>();
builder.RegisterType<SessionConfigurationCache>().As<ISessionConfigurationCache>(); builder.RegisterType<SessionConfigurationCache>().As<ISessionConfigurationCache>();
builder.RegisterType<SessionFactoryHolder>().As<ISessionFactoryHolder>(); builder.RegisterType<SessionFactoryHolder>().As<ISessionFactoryHolder>();
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(session)).As<ISessionLocator>(); builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>(); builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>();
builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As<ShellSettings>(); builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As<ShellSettings>();
builder.RegisterModule(new DataModule()); builder.RegisterModule(new DataModule());
@@ -133,10 +134,24 @@ namespace Orchard.Tests.DataMigration {
.AlterTable("User", table => table .AlterTable("User", table => table
.AddColumn("Age", DbType.Int32)) .AddColumn("Age", DbType.Int32))
.AlterTable("User", table => table .AlterTable("User", table => table
.AlterColumn("Lastname", column => column.WithDefault("John"))) .AlterColumn("Lastname", column => column.WithDefault("Doe")))
.AlterTable("User", table => table .AlterTable("User", table => table
.DropColumn("Firstname") .DropColumn("Firstname")
); );
// creating a new row should assign a default value to Firstname and Age
_schemaBuilder
.ExecuteSql("insert into TEST_User VALUES (DEFAULT, DEFAULT)");
// ensure wehave one record woth the default value
var command = _session.Connection.CreateCommand();
command.CommandText = "SELECT count(*) FROM TEST_User WHERE Lastname = 'Doe'";
Assert.That(command.ExecuteScalar(), Is.EqualTo(1));
// ensure this is not a false positive
command = _session.Connection.CreateCommand();
command.CommandText = "SELECT count(*) FROM TEST_User WHERE Lastname = 'Foo'";
Assert.That(command.ExecuteScalar(), Is.EqualTo(0));
} }
[Test] [Test]

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -8,6 +8,7 @@ using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects; using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Models; using Orchard.ContentManagement.MetaData.Models;
using Orchard.ContentManagement.Records;
using Orchard.Core.Common.Models; using Orchard.Core.Common.Models;
using Orchard.Core.Contents.Settings; using Orchard.Core.Contents.Settings;
using Orchard.Core.Contents.ViewModels; using Orchard.Core.Contents.ViewModels;
@@ -67,12 +68,14 @@ namespace Orchard.Core.Contents.Controllers {
switch (model.Options.OrderBy) { switch (model.Options.OrderBy) {
case ContentsOrder.Modified: case ContentsOrder.Modified:
//query = query.OrderByDescending<ContentPartRecord, int>(ci => ci.ContentItemRecord.Versions.Single(civr => civr.Latest).Id);
query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.ModifiedUtc); query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.ModifiedUtc);
break; break;
case ContentsOrder.Published: case ContentsOrder.Published:
query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.PublishedUtc); query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.PublishedUtc);
break; break;
case ContentsOrder.Created: case ContentsOrder.Created:
//query = query.OrderByDescending<ContentPartRecord, int>(ci => ci.Id);
query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.CreatedUtc); query = query.OrderByDescending<CommonPartRecord, DateTime?>(cr => cr.CreatedUtc);
break; break;
} }
@@ -189,24 +192,39 @@ namespace Orchard.Core.Contents.Controllers {
return View(model); return View(model);
} }
[HttpPost, ActionName("Create")]
[FormValueRequired("submit.Save")]
public ActionResult CreatePOST(string id) {
return CreatePOST(id, contentItem => {
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
_contentManager.Publish(contentItem);
});
}
[HttpPost, ActionName("Create")] [HttpPost, ActionName("Create")]
public ActionResult CreatePOST(string id) { [FormValueRequired("submit.Publish")]
public ActionResult CreateAndPublishPOST(string id) {
return CreatePOST(id, contentItem => _contentManager.Publish(contentItem));
}
private ActionResult CreatePOST(string id, Action<ContentItem> conditionallyPublish) {
var contentItem = _contentManager.New(id); var contentItem = _contentManager.New(id);
if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't create content"))) if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't create content")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_contentManager.Create(contentItem, VersionOptions.Draft); var isDraftable = contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable;
var model = _contentManager.UpdateEditor(contentItem, this); _contentManager.Create(
contentItem,
isDraftable ? VersionOptions.Draft : VersionOptions.Published);
var model = _contentManager.UpdateEditor(contentItem, this);
if (!ModelState.IsValid) { if (!ModelState.IsValid) {
_transactionManager.Cancel(); _transactionManager.Cancel();
return View(model); return View(model);
} }
if (!contentItem.Has<IPublishingControlAspect>()) conditionallyPublish(contentItem);
_contentManager.Publish(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("Your content has been created.") ? T("Your content has been created.")
@@ -229,7 +247,21 @@ namespace Orchard.Core.Contents.Controllers {
} }
[HttpPost, ActionName("Edit")] [HttpPost, ActionName("Edit")]
[FormValueRequired("submit.Save")]
public ActionResult EditPOST(int id, string returnUrl) { public ActionResult EditPOST(int id, string returnUrl) {
return EditPOST(id, returnUrl, contentItem => {
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
_contentManager.Publish(contentItem);
});
}
[HttpPost, ActionName("Edit")]
[FormValueRequired("submit.Publish")]
public ActionResult EditAndPublishPOST(int id, string returnUrl) {
return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem));
}
private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired); var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);
if (contentItem == null) if (contentItem == null)
@@ -244,9 +276,7 @@ namespace Orchard.Core.Contents.Controllers {
return View("Edit", model); return View("Edit", model);
} }
//need to go about this differently - to know when to publish (IPlublishableAspect ?) conditionallyPublish(contentItem);
if (!contentItem.Has<IPublishingControlAspect>())
_contentManager.Publish(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("Your content has been saved.") ? T("Your content has been saved.")

View File

@@ -1,5 +1,7 @@
using Orchard.ContentManagement; using System.Collections.Generic;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Drivers;
using Orchard.Core.Contents.Settings;
namespace Orchard.Core.Contents.Drivers { namespace Orchard.Core.Contents.Drivers {
public class ContentsDriver : ContentPartDriver<ContentPart> { public class ContentsDriver : ContentPartDriver<ContentPart> {
@@ -13,5 +15,18 @@ namespace Orchard.Core.Contents.Drivers {
() => shapeHelper.Parts_Contents_Publish_SummaryAdmin(ContentPart: part)) () => shapeHelper.Parts_Contents_Publish_SummaryAdmin(ContentPart: part))
); );
} }
protected override DriverResult Editor(ContentPart part, dynamic shapeHelper) {
var results = new List<DriverResult> { ContentShape("Content_SaveButton", saveButton => saveButton) };
if (part.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
results.Add(ContentShape("Content_PublishButton", publishButton => publishButton));
return Combined(results.ToArray());
}
protected override DriverResult Editor(ContentPart part, IUpdateModel updater, dynamic shapeHelper) {
return Editor(part, updater);
}
} }
} }

View File

@@ -4,6 +4,9 @@
Parts_Contents_Publish Parts_Contents_Publish
Parts_Contents_Publish_SummaryAdmin Parts_Contents_Publish_SummaryAdmin
--> -->
<!-- edit "shape" -->
<Place Content_PublishButton="Sidebar:20"/>
<Place Content_SaveButton="Sidebar:22"/>
<Match DisplayType="Detail"> <Match DisplayType="Detail">
<Place Parts_Contents_Publish="Content:5"/> <Place Parts_Contents_Publish="Content:5"/>
</Match> </Match>

View File

@@ -0,0 +1,3 @@
<fieldset class="publish-button">
<button type="submit" name="submit.Publish" value="submit.Publish">@T("Publish Now")</button>
</fieldset>

View File

@@ -0,0 +1,3 @@
<fieldset class="save-button">
<button class="primaryAction" type="submit" name="submit.Save" value="submit.Save">@T("Save")</button>
</fieldset>

View File

@@ -4,9 +4,5 @@
</div> </div>
<div class="secondary"> <div class="secondary">
@Display(Model.Sidebar) @Display(Model.Sidebar)
@* todo: (heskew) remove when the CommonPart is adding the save button *@
<fieldset>
<button class="primaryAction" type="submit" name="submit.Save" value="submit.Save">@T("Save")</button>
</fieldset>
</div> </div>
</div> </div>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -6,7 +6,7 @@
Parts_Localization_ContentTranslations_SummaryAdmin Parts_Localization_ContentTranslations_SummaryAdmin
--> -->
<!-- edit shape just gets default placement --> <!-- edit shape just gets default placement -->
<Place Parts_Localization_ContentTranslations_Edit="Content:before.1"/> <Place Parts_Localization_ContentTranslations_Edit="Content:0"/>
<Match DisplayType="Detail"> <Match DisplayType="Detail">
<Place Parts_Localization_ContentTranslations="Content:2"/> <Place Parts_Localization_ContentTranslations="Content:2"/>
</Match> </Match>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
</configuration> </configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -274,12 +274,8 @@
<Content Include="Settings\Views\Admin\Index.cshtml" /> <Content Include="Settings\Views\Admin\Index.cshtml" />
<Content Include="Settings\Views\Admin\Culture.cshtml" /> <Content Include="Settings\Views\Admin\Culture.cshtml" />
<Content Include="Contents\Views\Items\Content.Edit.cshtml" /> <Content Include="Contents\Views\Items\Content.Edit.cshtml" />
<Content Include="Routable\Placement.info"> <Content Include="Routable\Placement.info" />
<SubType>Designer</SubType> <Content Include="Settings\Placement.info" />
</Content>
<Content Include="Settings\Placement.info">
<SubType>Designer</SubType>
</Content>
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.cshtml" /> <Content Include="Settings\Views\DisplayTemplates\CurrentCulture.cshtml" />
<Content Include="Settings\Views\DisplayTemplates\RemovableCulture.cshtml" /> <Content Include="Settings\Views\DisplayTemplates\RemovableCulture.cshtml" />
<Content Include="Shapes\Module.txt" /> <Content Include="Shapes\Module.txt" />
@@ -298,7 +294,6 @@
<Content Include="Shapes\Views\HeadPreload.cshtml" /> <Content Include="Shapes\Views\HeadPreload.cshtml" />
<Content Include="Shapes\Views\Message.cshtml" /> <Content Include="Shapes\Views\Message.cshtml" />
<Content Include="Shapes\Views\NotFound.cshtml" /> <Content Include="Shapes\Views\NotFound.cshtml" />
<Content Include="Shapes\Views\UI\Switchable.cshtml" />
<Content Include="Web.config" /> <Content Include="Web.config" />
<Content Include="XmlRpc\Module.txt" /> <Content Include="XmlRpc\Module.txt" />
<Content Include="Settings\Views\EditorTemplates\Parts\Settings.SiteSettingsPart.cshtml" /> <Content Include="Settings\Views\EditorTemplates\Parts\Settings.SiteSettingsPart.cshtml" />
@@ -359,18 +354,31 @@
<Content Include="Contents\Views\Content.ControlWrapper.cshtml" /> <Content Include="Contents\Views\Content.ControlWrapper.cshtml" />
<Content Include="Contents\Views\Item\Display.cshtml" /> <Content Include="Contents\Views\Item\Display.cshtml" />
<Content Include="Localization\Placement.info" /> <Content Include="Localization\Placement.info" />
<Content Include="Messaging\Placement.info"> <Content Include="Messaging\Placement.info" />
<SubType>Designer</SubType> <Content Include="Navigation\Placement.info" />
</Content>
<Content Include="Navigation\Placement.info">
<SubType>Designer</SubType>
</Content>
<Content Include="Routable\Views\Parts\RoutableTitle.cshtml" /> <Content Include="Routable\Views\Parts\RoutableTitle.cshtml" />
<Content Include="Routable\Views\Item\Display.cshtml" /> <Content Include="Routable\Views\Item\Display.cshtml" />
<Content Include="Routable\Views\Routable.HomePage.cshtml" /> <Content Include="Routable\Views\Routable.HomePage.cshtml" />
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.SummaryAdmin.cshtml" /> <Content Include="Localization\Views\Parts\Localization.ContentTranslations.SummaryAdmin.cshtml" />
<Content Include="Contents\Views\Items\Content.Summary.cshtml" /> <Content Include="Contents\Views\Items\Content.Summary.cshtml" />
<Content Include="Shapes\Views\Pager.cshtml" /> <Content Include="Shapes\Views\Pager.cshtml" />
<Content Include="Contents\Views\Content.SaveButton.cshtml" />
<Content Include="Contents\Views\Content.PublishButton.cshtml" />
<Content Include="Shapes\Scripts\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Shapes\Styles\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Routable\Scripts\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Localization\Styles\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Settings\Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Orchard.UI.Resources; using Orchard.UI.Resources;
namespace Orchard.Core.Shapes { namespace Orchard.Core.Shapes {
@@ -11,6 +7,11 @@ namespace Orchard.Core.Shapes {
manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery"); manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery");
manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing
manifest.DefineStyle("ShapesSpecial").SetUrl("special.css"); manifest.DefineStyle("ShapesSpecial").SetUrl("special.css");
manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js")
.SetDependencies("jQuery")
.SetDependencies("ShapesBase");
manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css");
} }
} }
} }

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -1,5 +0,0 @@
@{
Style.Require("Switchable");
Script.Require("Switchable");
}
@string.Format("{0} switchable", Model)

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -106,6 +106,16 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -162,6 +162,15 @@
<Content Include="Views\Parts\Blogs.BlogPost.List.cshtml" /> <Content Include="Views\Parts\Blogs.BlogPost.List.cshtml" />
<Content Include="Views\Parts\Blogs.RecentBlogPosts.cshtml" /> <Content Include="Views\Parts\Blogs.RecentBlogPosts.cshtml" />
<Content Include="Views\Parts\Blogs.Blog.BlogPostCount.cshtml" /> <Content Include="Views\Parts\Blogs.Blog.BlogPostCount.cshtml" />
<Content Include="Scripts\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
</configuration> </configuration>

View File

@@ -23,7 +23,7 @@ namespace Orchard.CodeGeneration.Commands {
"", "Content", "Styles", "Scripts", "Views", "Zones" "", "Content", "Styles", "Scripts", "Views", "Zones"
}; };
private static readonly string[] _moduleDirectories = new [] { private static readonly string[] _moduleDirectories = new [] {
"", "Properties", "Controllers", "Views", "Models", "Scripts" "", "Properties", "Controllers", "Views", "Models", "Scripts", "Styles"
}; };
private const string ModuleName = "CodeGeneration"; private const string ModuleName = "CodeGeneration";
@@ -227,6 +227,10 @@ namespace Orchard.CodeGeneration.Commands {
File.WriteAllText(modulePath + "Views\\Web.config", File.ReadAllText(_codeGenTemplatePath + "ViewsWebConfig.txt")); File.WriteAllText(modulePath + "Views\\Web.config", File.ReadAllText(_codeGenTemplatePath + "ViewsWebConfig.txt"));
content.Add(modulePath + "Views\\Web.config"); content.Add(modulePath + "Views\\Web.config");
File.WriteAllText(modulePath + "Scripts\\Web.config", File.ReadAllText(_codeGenTemplatePath + "StaticFilesWebConfig.txt"));
content.Add(modulePath + "Scripts\\Web.config");
File.WriteAllText(modulePath + "Styles\\Web.config", File.ReadAllText(_codeGenTemplatePath + "StaticFilesWebConfig.txt"));
content.Add(modulePath + "Styles\\Web.config");
string templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleAssemblyInfo.txt"); string templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleAssemblyInfo.txt");
templateText = templateText.Replace("$$ModuleName$$", moduleName); templateText = templateText.Replace("$$ModuleName$$", moduleName);
@@ -270,6 +274,10 @@ namespace Orchard.CodeGeneration.Commands {
var webConfig = themePath + "Views\\Web.config"; var webConfig = themePath + "Views\\Web.config";
File.WriteAllText(webConfig, File.ReadAllText(_codeGenTemplatePath + "\\ViewsWebConfig.txt")); File.WriteAllText(webConfig, File.ReadAllText(_codeGenTemplatePath + "\\ViewsWebConfig.txt"));
createdFiles.Add(webConfig); createdFiles.Add(webConfig);
File.WriteAllText(themePath + "Scripts\\Web.config", File.ReadAllText(_codeGenTemplatePath + "StaticFilesWebConfig.txt"));
createdFiles.Add(themePath + "Scripts\\Web.config");
File.WriteAllText(themePath + "Styles\\Web.config", File.ReadAllText(_codeGenTemplatePath + "StaticFilesWebConfig.txt"));
createdFiles.Add(themePath + "Styles\\Web.config");
var templateText = File.ReadAllText(_codeGenTemplatePath + "\\ThemeManifest.txt").Replace("$$ThemeName$$", themeName); var templateText = File.ReadAllText(_codeGenTemplatePath + "\\ThemeManifest.txt").Replace("$$ThemeName$$", themeName);
if (string.IsNullOrEmpty(baseTheme)) { if (string.IsNullOrEmpty(baseTheme)) {

View File

@@ -76,6 +76,7 @@
<Compile Include="Services\CodeGenerationCommandInterpreter.cs" /> <Compile Include="Services\CodeGenerationCommandInterpreter.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="CodeGenerationTemplates\StaticFilesWebConfig.txt" />
<Content Include="CodeGenerationTemplates\ThemeManifest.txt" /> <Content Include="CodeGenerationTemplates\ThemeManifest.txt" />
<Content Include="Module.txt" /> <Content Include="Module.txt" />
<Content Include="CodeGenerationTemplates\Controller.txt" /> <Content Include="CodeGenerationTemplates\Controller.txt" />

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -119,7 +119,11 @@
<Content Include="Views\EditorTemplates\Settings.cshtml" /> <Content Include="Views\EditorTemplates\Settings.cshtml" />
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj"> <ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project> <Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -3,7 +3,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -28,8 +27,6 @@
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
</configuration> </configuration>

View File

@@ -3,7 +3,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -28,8 +27,6 @@
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers> </handlers>
</system.webServer> </system.webServer>
</configuration> </configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -3,10 +3,13 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Web; using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.Localization; using Orchard.Localization;
using Orchard.Media.Models; using Orchard.Media.Models;
using Orchard.Media.Services; using Orchard.Media.Services;
using Orchard.Media.ViewModels; using Orchard.Media.ViewModels;
using Orchard.Settings;
using Orchard.UI.Notify; using Orchard.UI.Notify;
using Orchard.Utility.Extensions; using Orchard.Utility.Extensions;
@@ -153,6 +156,15 @@ namespace Orchard.Media.Controllers {
if (!ModelState.IsValid) if (!ModelState.IsValid)
return View(viewModel); return View(viewModel);
// first validate them all
foreach (string fileName in Request.Files) {
HttpPostedFileBase file = Request.Files[fileName];
if (!_mediaService.FileAllowed(file)) {
ModelState.AddModelError("File", T("That file type is not allowed.").ToString());
return View(viewModel);
}
}
// then save them
foreach (string fileName in Request.Files) { foreach (string fileName in Request.Files) {
HttpPostedFileBase file = Request.Files[fileName]; HttpPostedFileBase file = Request.Files[fileName];
_mediaService.UploadMediaFile(viewModel.MediaPath, file); _mediaService.UploadMediaFile(viewModel.MediaPath, file);
@@ -195,10 +207,11 @@ namespace Orchard.Media.Controllers {
} }
} }
public ActionResult EditMedia(string name, string caption, DateTime lastUpdated, long size, string folderName, string mediaPath) { public ActionResult EditMedia(string name, DateTime lastUpdated, long size, string folderName, string mediaPath) {
var model = new MediaItemEditViewModel(); var model = new MediaItemEditViewModel();
model.Name = name; model.Name = name;
model.Caption = caption ?? String.Empty; // todo: reimplement
//model.Caption = caption ?? String.Empty;
model.LastUpdated = lastUpdated; model.LastUpdated = lastUpdated;
model.Size = size; model.Size = size;
model.FolderName = folderName; model.FolderName = folderName;

View File

@@ -0,0 +1,15 @@
using JetBrains.Annotations;
using Orchard.Data;
using Orchard.ContentManagement.Handlers;
using Orchard.Media.Models;
namespace Orchard.Media.Handlers {
[UsedImplicitly]
public class MediaSettingsPartHandler : ContentHandler {
public MediaSettingsPartHandler(IRepository<MediaSettingsPartRecord> repository) {
Filters.Add(new ActivatingFilter<MediaSettingsPart>("Site"));
Filters.Add(StorageFilter.For(repository));
Filters.Add(new TemplateFilterForRecord<MediaSettingsPartRecord>("MediaSettings", "Parts/Media.MediaSettings"));
}
}
}

View File

@@ -0,0 +1,16 @@
using Orchard.Data.Migration;
using Orchard.Media.Models;
namespace Orchard.Media {
public class MediaDataMigration : DataMigrationImpl {
public int Create() {
SchemaBuilder.CreateTable("MediaSettingsPartRecord",
table => table
.ContentPartRecord()
.Column<string>("UploadAllowedFileTypeWhitelist", c => c.WithDefault(MediaSettingsPartRecord.DefaultWhitelist).WithLength(255))
);
return 1;
}
}
}

View File

@@ -0,0 +1,11 @@
using Orchard.ContentManagement;
using System;
namespace Orchard.Media.Models {
public class MediaSettingsPart : ContentPart<MediaSettingsPartRecord> {
public string UploadAllowedFileTypeWhitelist {
get { return Record.UploadAllowedFileTypeWhitelist; }
set { Record.UploadAllowedFileTypeWhitelist = value; }
}
}
}

View File

@@ -0,0 +1,16 @@
using System.Net.Mail;
using Orchard.ContentManagement.Records;
using System.ComponentModel.DataAnnotations;
namespace Orchard.Media.Models {
public class MediaSettingsPartRecord : ContentPartRecord {
internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp";
private string _whitelist = DefaultWhitelist;
[StringLength(255)]
public virtual string UploadAllowedFileTypeWhitelist {
get { return _whitelist; }
set { _whitelist = value; }
}
}
}

View File

@@ -71,6 +71,10 @@
<ItemGroup> <ItemGroup>
<Compile Include="AdminMenu.cs" /> <Compile Include="AdminMenu.cs" />
<Compile Include="Controllers\AdminController.cs" /> <Compile Include="Controllers\AdminController.cs" />
<Compile Include="Handlers\MediaSettingsPartHandler.cs" />
<Compile Include="Migrations.cs" />
<Compile Include="Models\MediaSettingsPart.cs" />
<Compile Include="Models\MediaSettingsPartRecord.cs" />
<Compile Include="ResourceManifest.cs" /> <Compile Include="ResourceManifest.cs" />
<Compile Include="Helpers\MediaHelpers.cs" /> <Compile Include="Helpers\MediaHelpers.cs" />
<Compile Include="Permissions.cs" /> <Compile Include="Permissions.cs" />
@@ -113,6 +117,17 @@
<Content Include="Views\Admin\EditProperties.cshtml" /> <Content Include="Views\Admin\EditProperties.cshtml" />
<Content Include="Views\Admin\Index.cshtml" /> <Content Include="Views\Admin\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Views\EditorTemplates\Parts\Media.MediaSettings.cshtml" />
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -13,5 +13,6 @@ namespace Orchard.Media.Services {
void DeleteFile(string name, string folderName); void DeleteFile(string name, string folderName);
void RenameFile(string name, string newName, string folderName); void RenameFile(string name, string newName, string folderName);
string UploadMediaFile(string folderName, HttpPostedFileBase postedFile); string UploadMediaFile(string folderName, HttpPostedFileBase postedFile);
bool FileAllowed(HttpPostedFileBase postedFile);
} }
} }

View File

@@ -5,9 +5,12 @@ using System.Text;
using System.Web; using System.Web;
using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Zip;
using JetBrains.Annotations; using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.FileSystems.Media; using Orchard.FileSystems.Media;
using Orchard.Logging; using Orchard.Logging;
using Orchard.Media.Models; using Orchard.Media.Models;
using Orchard.Security;
using Orchard.Settings;
namespace Orchard.Media.Services { namespace Orchard.Media.Services {
[UsedImplicitly] [UsedImplicitly]
@@ -21,6 +24,9 @@ namespace Orchard.Media.Services {
} }
public ILogger Logger { get; set; } public ILogger Logger { get; set; }
protected virtual ISite CurrentSite { get; [UsedImplicitly] private set; }
protected virtual IUser CurrentUser { get; [UsedImplicitly] private set; }
public string GetPublicUrl(string path) { public string GetPublicUrl(string path) {
return _storageProvider.GetPublicUrl(path); return _storageProvider.GetPublicUrl(path);
@@ -82,18 +88,18 @@ namespace Orchard.Media.Services {
} }
public void RenameFile(string name, string newName, string folderName) { public void RenameFile(string name, string newName, string folderName) {
_storageProvider.RenameFile(folderName + "\\" + name, folderName + "\\" + newName); if (FileAllowed(newName, false)) {
_storageProvider.RenameFile(folderName + "\\" + name, folderName + "\\" + newName);
}
} }
public string UploadMediaFile(string folderName, HttpPostedFileBase postedFile) { public string UploadMediaFile(string folderName, HttpPostedFileBase postedFile) {
if (postedFile.FileName.EndsWith(".zip")) { if (postedFile.FileName.EndsWith(".zip")) {
UnzipMediaFileArchive(folderName, postedFile); UnzipMediaFileArchive(folderName, postedFile);
// Don't save the zip file. // Don't save the zip file.
return _storageProvider.GetPublicUrl(folderName); return _storageProvider.GetPublicUrl(folderName);
} }
if (FileAllowed(postedFile) && postedFile.ContentLength > 0) {
if (postedFile.ContentLength > 0) {
var filePath = Path.Combine(folderName, Path.GetFileName(postedFile.FileName)); var filePath = Path.Combine(folderName, Path.GetFileName(postedFile.FileName));
var inputStream = postedFile.InputStream; var inputStream = postedFile.InputStream;
@@ -104,6 +110,41 @@ namespace Orchard.Media.Services {
return null; return null;
} }
private bool FileAllowed(string name, bool allowZip) {
if (string.IsNullOrWhiteSpace(name)) {
return false;
}
var mediaSettings = CurrentSite.As<MediaSettingsPart>();
var allowedExtensions = mediaSettings.UploadAllowedFileTypeWhitelist.ToLowerInvariant().Split(' ');
var ext = (Path.GetExtension(name) ?? "").TrimStart('.').ToLowerInvariant();
if (string.IsNullOrWhiteSpace(ext)) {
return false;
}
// whitelist does not apply to the superuser
if (CurrentUser == null || !CurrentSite.SuperUser.Equals(CurrentUser.UserName, StringComparison.Ordinal)) {
// zip files at the top level are allowed since this is how you upload multiple files at once.
if (allowZip && ext.Equals("zip", StringComparison.OrdinalIgnoreCase)) {
return true;
}
// must be in the whitelist
if (Array.IndexOf(allowedExtensions, ext) == -1) {
return false;
}
}
// blacklist always applies
if (string.Equals(name.Trim(), "web.config", StringComparison.OrdinalIgnoreCase)) {
return false;
}
return true;
}
public bool FileAllowed(HttpPostedFileBase postedFile) {
if (postedFile == null) {
return false;
}
return FileAllowed(postedFile.FileName, true);
}
private void SaveStream(string filePath, Stream inputStream) { private void SaveStream(string filePath, Stream inputStream) {
var file = _storageProvider.CreateFile(filePath); var file = _storageProvider.CreateFile(filePath);
var outputStream = file.OpenWrite(); var outputStream = file.OpenWrite();
@@ -139,12 +180,17 @@ namespace Orchard.Media.Services {
var entryName = Path.Combine(targetFolder, entry.Name); var entryName = Path.Combine(targetFolder, entry.Name);
var directoryName = Path.GetDirectoryName(entryName); var directoryName = Path.GetDirectoryName(entryName);
try { _storageProvider.CreateFolder(directoryName); } // skip disallowed files
catch { if (FileAllowed(entry.Name, false)) {
// no handling needed - this is to force the folder to exist if it doesn't try {
} _storageProvider.CreateFolder(directoryName);
}
catch {
// no handling needed - this is to force the folder to exist if it doesn't
}
SaveStream(entryName, fileInflater); SaveStream(entryName, fileInflater);
}
} }
} }
} }

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -1,4 +1,6 @@
namespace Orchard.Media.ViewModels { using Orchard.Media.Models;
namespace Orchard.Media.ViewModels {
public class MediaItemAddViewModel { public class MediaItemAddViewModel {
public string FolderName { get; set; } public string FolderName { get; set; }
public string MediaPath { get; set; } public string MediaPath { get; set; }

View File

@@ -19,7 +19,7 @@
@Html.ValidationSummary() @Html.ValidationSummary()
<div class="primary"> <div class="primary">
<div> <div>
<img src="@Model.PublicUrl" class="previewImage" alt="@Model.Caption" /> <img src="@Model.PublicUrl" class="previewImage"/>
</div> </div>
<fieldset> <fieldset>
@* todo: make these real (including markup) *@ @* todo: make these real (including markup) *@
@@ -32,7 +32,7 @@
</div> </div>
<div> <div>
<label for="embedPath">@T("Embed:")</label> <label for="embedPath">@T("Embed:")</label>
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="&lt;img src=&quot;@Href("~/Media/" + Model.RelativePath + "/" + Model.Name)&quot; @* width=&quot;500&quot; height=&quot;375&quot; *@ alt=&quot;@Model.Caption&quot; /&gt;" /> <input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="&lt;img src=&quot;@Model.PublicUrl&quot; @* width=&quot;500&quot; height=&quot;375&quot; *@ /&gt;" />
<span class="hint">@T("Copy this html to add this image to your site.")</span> <span class="hint">@T("Copy this html to add this image to your site.")</span>
</div> </div>
@@ -42,9 +42,6 @@
<input id="NewName" class="textMedium" name="NewName" type="text" value="@Model.Name"/> <input id="NewName" class="textMedium" name="NewName" type="text" value="@Model.Name"/>
</div> </div>
<div> <div>
<label for="Caption">@T("Caption")</label>
<input id="Caption" class="textMedium" name="Caption" type="text" value="@Model.Caption"/>
<span class="hint">@T("This will be used for the image alt tag.")</span>
<input type="hidden" id="LastUpdated" name="LastUpdated" value="@Model.LastUpdated"/> <input type="hidden" id="LastUpdated" name="LastUpdated" value="@Model.LastUpdated"/>
<input type="hidden" id="Size" name="Size" value="@Model.Size"/> <input type="hidden" id="Size" name="Size" value="@Model.Size"/>
<input type="hidden" id="FolderName" name="FolderName" value="@Model.FolderName"/> <input type="hidden" id="FolderName" name="FolderName" value="@Model.FolderName"/>
@@ -58,7 +55,7 @@
@* @*
<div class="secondary" style="border:1px solid #ff0000;"> <div class="secondary" style="border:1px solid #ff0000;">
<h2>@T("Preview")</h2> <h2>@T("Preview")</h2>
<div><img src="@Href("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))" class="previewImage" alt="@Model.Caption" /></div> <div><img src="@Href("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))" class="previewImage" /></div>
<ul> <ul>
@// todo: make these real (including markup) @// todo: make these real (including markup)
<li><label>@T("Dimensions: <span>500 x 375 pixels</span>")</label></li> <li><label>@T("Dimensions: <span>500 x 375 pixels</span>")</label></li>
@@ -66,7 +63,7 @@
<li><label>@T("Added on: <span>{0} by Orchard User</span>", Model.LastUpdated)</label></li> <li><label>@T("Added on: <span>{0} by Orchard User</span>", Model.LastUpdated)</label></li>
<li> <li>
<label for="embedPath">@T("Embed:")</label> <label for="embedPath">@T("Embed:")</label>
<input id="embedPath" class="text" name="embedPath" type="text" readonly="readonly" value="@T("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)" /> <input id="embedPath" class="text" name="embedPath" type="text" readonly="readonly" value="@T("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375)" />
<span class="hint">@T("Copy this html to add this image to your site.")</p> <span class="hint">@T("Copy this html to add this image to your site.")</p>
</li> </li>
</ul> </ul>

View File

@@ -0,0 +1,9 @@
@model Orchard.Media.Models.MediaSettingsPartRecord
<fieldset>
<legend>@T("Media Settings")</legend>
<div>
@Html.LabelFor(m => m.UploadAllowedFileTypeWhitelist, T("Upload allowed file types (list of extensions separated by spaces)"))
@Html.TextBoxFor(m => m.UploadAllowedFileTypeWhitelist, new { @class = "textMedium" })
</div>
</fieldset>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -3,7 +3,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -28,8 +27,6 @@
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers> </handlers>
</system.webServer> </system.webServer>
</configuration> </configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -106,7 +106,16 @@
<Content Include="Views\Admin\Features.cshtml" /> <Content Include="Views\Admin\Features.cshtml" />
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -4,14 +4,15 @@
@using Orchard.Modules.ViewModels; @using Orchard.Modules.ViewModels;
@using Orchard.Utility.Extensions; @using Orchard.Utility.Extensions;
@using Orchard.Modules.Models; @using Orchard.Modules.Models;
@{ @{
Style.Require("ModulesAdmin"); Style.Require("ModulesAdmin");
Style.Require("Switchable");
Script.Require("Switchable");
} }
<h1>@Html.TitleForPage(T("Manage Features").ToString())</h1> <h1>@Html.TitleForPage(T("Manage Features").ToString())</h1>
@if (Model.Features.Count() > 0) { @if (Model.Features.Count() > 0) {
<ul class="features summary-view">@{ <ul class="features summary-view switchable">@{
var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category); var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category);
foreach (var featureGroup in featureGroups) { foreach (var featureGroup in featureGroups) {
var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized")); var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized"));

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -100,6 +100,16 @@
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -108,9 +108,7 @@
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Content\" />
<Folder Include="Models\" /> <Folder Include="Models\" />
<Folder Include="Scripts\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj"> <ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
@@ -121,6 +119,21 @@
<ItemGroup> <ItemGroup>
<Content Include="Views\Gallery\Themes.cshtml" /> <Content Include="Views\Gallery\Themes.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -3,7 +3,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -28,8 +27,6 @@
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -7,7 +7,6 @@ using Orchard.PublishLater.Services;
using Orchard.PublishLater.ViewModels; using Orchard.PublishLater.ViewModels;
using Orchard.Localization; using Orchard.Localization;
using System.Globalization; using System.Globalization;
using Orchard.Core.Localization.Services;
namespace Orchard.PublishLater.Drivers { namespace Orchard.PublishLater.Drivers {
public class PublishLaterPartDriver : ContentPartDriver<PublishLaterPart> { public class PublishLaterPartDriver : ContentPartDriver<PublishLaterPart> {
@@ -49,8 +48,8 @@ namespace Orchard.PublishLater.Drivers {
// date and time are formatted using the same patterns as DateTimePicker is, preventing other cultures issues // date and time are formatted using the same patterns as DateTimePicker is, preventing other cultures issues
var model = new PublishLaterViewModel(part) { var model = new PublishLaterViewModel(part) {
ScheduledPublishUtc = part.ScheduledPublishUtc.Value, ScheduledPublishUtc = part.ScheduledPublishUtc.Value,
ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty,
ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty
}; };
return ContentShape("Parts_PublishLater_Edit", return ContentShape("Parts_PublishLater_Edit",
@@ -60,27 +59,24 @@ namespace Orchard.PublishLater.Drivers {
var model = new PublishLaterViewModel(part); var model = new PublishLaterViewModel(part);
updater.TryUpdateModel(model, Prefix, null, null); updater.TryUpdateModel(model, Prefix, null, null);
switch (model.Command) {
case "PublishNow":
_commonService.Publish(model.ContentItem);
break;
case "PublishLater":
DateTime scheduled;
string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime);
// use an english culture as it is the one used by jQuery.datepicker by default if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) && !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) {
if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { DateTime scheduled;
model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime);
_publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value);
}
else {
updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime));
}
break; // use an english culture as it is the one used by jQuery.datepicker by default
case "SaveDraft": if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) {
break; model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime();
_publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value);
}
else {
updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime));
}
} }
else if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) || !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) {
updater.AddModelError(Prefix, T("Both the date and time need to be specified for when this is to be published. If you don't want to schedule publishing then clear both the date and time fields."));
}
return ContentShape("Parts_PublishLater_Edit", return ContentShape("Parts_PublishLater_Edit",
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
} }

View File

@@ -83,7 +83,11 @@
<Compile Include="Services\PublishLaterService.cs" /> <Compile Include="Services\PublishLaterService.cs" />
<Compile Include="ViewModels\PublishLaterViewModel.cs" /> <Compile Include="ViewModels\PublishLaterViewModel.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj"> <ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project> <Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
@@ -123,6 +127,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -7,7 +7,7 @@
--> -->
<!-- edit shape just get default placement --> <!-- edit shape just get default placement -->
<!-- edit "shape" --> <!-- edit "shape" -->
<Place Parts_PublishLater_Edit="Sidebar:1"/> <Place Parts_PublishLater_Edit="Sidebar:23"/><!-- immediately following the contents module's save button -->
<!-- default positioning --> <!-- default positioning -->
<Match DisplayType="SummaryAdmin"> <Match DisplayType="SummaryAdmin">
<Place Parts_PublishLater_Metadata_SummaryAdmin="Meta:1"/> <Place Parts_PublishLater_Metadata_SummaryAdmin="Meta:1"/>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -7,8 +7,8 @@ html.dyn input.hinted {
font-style:italic; font-style:italic;
} }
input#PublishLater_ScheduledPublishDate { input#PublishLater_ScheduledPublishDate {
width:50%; width:49%;
} }
input#PublishLater_ScheduledPublishTime { input#PublishLater_ScheduledPublishTime {
width:36%; width:43%;
} }

View File

@@ -11,7 +11,6 @@ namespace Orchard.PublishLater.ViewModels {
_publishLaterPart = publishLaterPart; _publishLaterPart = publishLaterPart;
} }
public string Command { get; set; }
public ContentItem ContentItem { get { return _publishLaterPart.ContentItem; } } public ContentItem ContentItem { get { return _publishLaterPart.ContentItem; } }
public bool IsPublished { public bool IsPublished {

View File

@@ -6,46 +6,34 @@
Style.Require("jQueryUtils_TimePicker"); Style.Require("jQueryUtils_TimePicker");
Style.Require("jQueryUI_DatePicker"); Style.Require("jQueryUI_DatePicker");
} }
<fieldset> <fieldset class="publish-later-datetime">
<legend>@T("Publish Settings")</legend> <legend>@T("Publish Settings")</legend>
<div> <label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")">@T("Date")</label>
@Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") }) @Html.EditorFor(m => m.ScheduledPublishDate)
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft")">@T("Save Draft")</label> <label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")">@T("Time")</label>
</div> @Html.EditorFor(m => m.ScheduledPublishTime)
<div>
@Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") })
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow")">@T("Publish Now")</label>
</div>
<div>
@Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") })
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")">@T("Publish Later")</label>
</div>
<div>
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")">@T("Date")</label>
@Html.EditorFor(m => m.ScheduledPublishDate)
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")">@T("Time")</label>
@Html.EditorFor(m => m.ScheduledPublishTime)
</div>
</fieldset> </fieldset>
@using(Script.Foot()) { @using(Script.Foot()) {
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
$(function () { $(function () {
var clearHint = function ($this) { if ($this.val() == $this.data("hint")) { $this.removeClass("hinted").val("") } };
var resetHint = function ($this) { setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) };
@* todo: (heskew) make a plugin *@ @* todo: (heskew) make a plugin *@
$("label.forpicker").each(function () { $("label.forpicker").each(function () {
var $this = $(this); var $this = $(this);
var pickerInput = $("#" + $this.attr("for")); var pickerInput = $("#" + $this.attr("for"));
pickerInput.data("hint", $this.text());
if (!pickerInput.val()) { if (!pickerInput.val()) {
pickerInput.data("hint", $this.text());
pickerInput.addClass("hinted") pickerInput.addClass("hinted")
.val(pickerInput.data("hint")) .val(pickerInput.data("hint"))
.focus(function () { var $this = $(this); if ($this.val() == $this.data("hint")) { $this.removeClass("hinted").val("") } }) .focus(function() {clearHint($(this));})
.blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) }); .blur(function() {resetHint($(this));});
$this.closest("form").submit(function() {clearHint(pickerInput); pickerInput = 0;});
} }
}); });
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")').datepicker({ showAnim: "" }).focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") }); $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")').datepicker({ showAnim: "" }).focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") });
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")').timepickr().focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") }); $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")').timepickr().focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") });
}) })
//]]> //]]>
</script> </script>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -111,6 +111,11 @@
<ItemGroup> <ItemGroup>
<Content Include="Placement.info" /> <Content Include="Placement.info" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -106,6 +106,11 @@
<ItemGroup> <ItemGroup>
<Content Include="Placement.info" /> <Content Include="Placement.info" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<system.web> <system.web>
<httpHandlers> <httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers> </httpHandlers>
<!-- <!--
@@ -27,8 +25,6 @@
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<handlers> <handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers> </handlers>
</system.webServer> </system.webServer>
<runtime> <runtime>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>

View File

@@ -108,6 +108,16 @@
<ItemGroup> <ItemGroup>
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Content\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Styles\Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Some files were not shown because too many files have changed in this diff Show More