Content manager assigning values to definition properties

DefaultContentManager now takes a dependency on IContentDefinitionManager
ContentItem.TypeDefinition assigned to ContentTypeDefinition instance when creating
ContentPart.TypePartDefinition assigned to ContentTypeDefinition.Part instance as added
Empty definition instances are created as code-only types and parts are created

--HG--
branch : dev
This commit is contained in:
Louis DeJardin
2010-06-08 12:05:29 -07:00
parent 1b39eb3bc0
commit 57e830f19e
19 changed files with 137 additions and 41 deletions

View File

@@ -1,12 +1,14 @@
using System.Collections.Generic;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Security;
namespace Orchard.Roles.Models {
public static class UserSimulation {
public static IUser Create(string role) {
var simulation = new ContentItemBuilder("user")
var simulationType = new ContentTypeDefinitionBuilder().Named("user").Build();
var simulation = new ContentItemBuilder(simulationType)
.Weld<SimulatedUser>()
.Weld<SimulatedUserRoles>()
.Build();

View File

@@ -7,6 +7,7 @@ using Orchard.Commands;
using Orchard.Commands.Builtin;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Data.Builders;
using Orchard.Environment.Extensions;
using Orchard.Localization;
@@ -90,7 +91,8 @@ namespace Orchard.Setup {
class SafeModeSiteService : ISiteService {
public ISite GetSiteSettings() {
var site = new ContentItemBuilder("site")
var siteType = new ContentTypeDefinitionBuilder().Named("site").Build();
var site = new ContentItemBuilder(siteType)
.Weld<SafeModeSite>()
.Build();