Moving default patterns to migrations. Custom patterns can still be defined

in recipes.

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-02-15 11:04:02 -08:00
parent 721f9515fa
commit dee42e5d69
7 changed files with 14 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
74eb74be6abec40d498a24a767c48181bf4487cf src/Orchard.Web/Modules/Orchard.Autoroute
63605157ddfcc24043bf97245f109a56cf81e2a9 src/Orchard.Web/Modules/Orchard.Autoroute
c54cb640d6bc14c51b9fb9bd78231bb0facec067 src/Orchard.Web/Modules/Orchard.Forms
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease

View File

@@ -11,11 +11,11 @@ namespace Orchard.Pages {
.WithSetting("DateEditorSettings.ShowDateEditor", "true"))
.WithPart("PublishLaterPart")
.WithPart("TitlePart")
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-page'}]")
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-page'}]")
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
.WithPart("BodyPart")
.Creatable());

View File

@@ -147,7 +147,7 @@ namespace Orchard.Roles.Services {
public IEnumerable<string> GetPermissionsForRoleByName(string name) {
return _cacheManager.Get(name, ctx => {
MonitorSignal(ctx);
return GetPermissionsForRoleByNameInner(name);
return GetPermissionsForRoleByNameInner(name).ToList();
});
}

View File

@@ -7,6 +7,7 @@ using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
using Orchard.Logging;
using Orchard.Utility;
using Orchard.Utility.Extensions;
namespace Orchard.DisplayManagement.Descriptors {
@@ -41,7 +42,7 @@ namespace Orchard.DisplayManagement.Descriptors {
var builder = new ShapeTableBuilder(strategyDefaultFeature);
bindingStrategy.Value.Discover(builder);
return builder.BuildAlterations().ToList();
return builder.BuildAlterations().ToReadOnlyCollection();
});
var alterations = alterationSets

View File

@@ -13,6 +13,7 @@ using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
using Orchard.FileSystems.VirtualPath;
using Orchard.Logging;
using Orchard.Utility.Extensions;
namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy {
public class ShapeTemplateBindingStrategy : IShapeTableProvider {
@@ -70,7 +71,7 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy {
var virtualPath = Path.Combine(basePath, subPath).Replace(Path.DirectorySeparatorChar, '/');
var fileNames = _cacheManager.Get(virtualPath, ctx => {
ctx.Monitor(_virtualPathMonitor.WhenPathChanges(virtualPath));
return _virtualPathProvider.ListFiles(virtualPath).Select(Path.GetFileName);
return _virtualPathProvider.ListFiles(virtualPath).Select(Path.GetFileName).ToReadOnlyCollection();
});
return new { harvesterInfo.harvester, basePath, subPath, virtualPath, fileNames };
})).ToList();

View File

@@ -55,7 +55,7 @@ namespace Orchard.Environment.Extensions.Folders {
return _cacheManager.Get(key, ctx => {
ctx.Monitor(_webSiteFolder.WhenPathChanges(path));
return AvailableExtensionsInFolder(path, extensionType, manifestName, manifestIsOptional);
return AvailableExtensionsInFolder(path, extensionType, manifestName, manifestIsOptional).ToReadOnlyCollection();
});
}

View File

@@ -5,6 +5,7 @@ using System.Xml.Linq;
using Orchard.Caching;
using Orchard.FileSystems.AppData;
using Orchard.Localization;
using Orchard.Utility.Extensions;
namespace Orchard.FileSystems.Dependencies {
public class DefaultDependenciesFolder : IDependenciesFolder {
@@ -40,7 +41,7 @@ namespace Orchard.FileSystems.Dependencies {
_writeThroughToken.IsCurrent = true;
ctx.Monitor(_writeThroughToken);
return ReadDependencies(ctx.Key).ToList();
return ReadDependencies(ctx.Key).ToReadOnlyCollection();
});
}