Another refinement of the content api.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041636
This commit is contained in:
loudej
2009-11-21 09:17:22 +00:00
parent 4ada0e0996
commit 953c83fe78
67 changed files with 266 additions and 192 deletions

View File

@@ -1,7 +1,7 @@
using Orchard.Models;
namespace Orchard.Core.Common.Models {
public class ContentPart : ContentItemPart {
public class BodyPart : Orchard.Models.ContentPart {
public string Body { get; set; }
public string Format { get; set; }
}

View File

@@ -1,7 +1,7 @@
using Orchard.Models.Driver;
namespace Orchard.Core.Common.Models {
public class ContentPartHandler : ContentHandler {
public class BodyPartProvider : ContentProvider {
}
}

View File

@@ -6,14 +6,14 @@ using Orchard.Security;
namespace Orchard.Core.Common.Models {
public class CommonPart : ContentPartForRecord<CommonRecord> {
private readonly Lazy<IUser> _owner = new Lazy<IUser>();
private readonly Lazy<ContentItem> _container = new Lazy<ContentItem>();
private readonly Lazy<IContent> _container = new Lazy<IContent>();
public IUser Owner {
get { return _owner.Value; }
set { _owner.Value = value; }
}
public ContentItem Container {
public IContent Container {
get { return _container.Value; }
set { _container.Value = value; }
}
@@ -21,7 +21,7 @@ namespace Orchard.Core.Common.Models {
public void LoadOwner(Func<IUser> loader) {
_owner.Loader(loader);
}
public void LoadContainer(Func<ContentItem> loader) {
public void LoadContainer(Func<IContent> loader) {
_container.Loader(loader);
}
}

View File

@@ -6,12 +6,12 @@ using Orchard.Security;
using Orchard.Services;
namespace Orchard.Core.Common.Models {
public class CommonPartHandler : ContentHandler {
public class CommonPartProvider : ContentProvider {
private readonly IClock _clock;
private readonly IAuthenticationService _authenticationService;
private readonly IContentManager _contentManager;
public CommonPartHandler(
public CommonPartProvider(
IRepository<CommonRecord> repository,
IClock clock,
IAuthenticationService authenticationService,

View File

@@ -3,8 +3,8 @@ using Orchard.Data;
using Orchard.Models.Driver;
namespace Orchard.Core.Common.Models {
public class RoutablePartHandler : Orchard.Models.Driver.ContentHandler {
public RoutablePartHandler(IRepository<RoutableRecord> repository) {
public class RoutablePartProvider : ContentProvider {
public RoutablePartProvider(IRepository<RoutableRecord> repository) {
Filters.Add(new StorageFilterForRecord<RoutableRecord>(repository));
}
}

View File

@@ -61,18 +61,18 @@
<Reference Include="System.Web.Mobile" />
</ItemGroup>
<ItemGroup>
<Compile Include="Common\Models\CommonPartHandler.cs" />
<Compile Include="Common\Models\CommonPartProvider.cs" />
<Compile Include="Common\Models\CommonPart.cs" />
<Compile Include="Common\Models\ContentPartHandler.cs" />
<Compile Include="Common\Models\ContentPart.cs" />
<Compile Include="Common\Models\BodyPartProvider.cs" />
<Compile Include="Common\Models\BodyPart.cs" />
<Compile Include="Common\Models\RoutablePart.cs" />
<Compile Include="Common\Models\RoutablePartHandler.cs" />
<Compile Include="Common\Models\RoutablePartProvider.cs" />
<Compile Include="Common\Records\CommonRecord.cs" />
<Compile Include="Common\Records\RoutableRecord.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings\AdminMenu.cs" />
<Compile Include="Settings\Controllers\AdminController.cs" />
<Compile Include="Settings\Models\SiteSettingsHandler.cs" />
<Compile Include="Settings\Models\SiteSettingsProvider.cs" />
<Compile Include="Settings\Models\SiteSettings.cs" />
<Compile Include="Settings\Records\SiteSettingsRecord.cs" />
<Compile Include="Settings\Services\SiteService.cs" />

View File

@@ -3,8 +3,8 @@ using Orchard.Data;
using Orchard.Models.Driver;
namespace Orchard.Core.Settings.Models {
public class SiteSettingsHandler : ContentHandler {
public SiteSettingsHandler(IRepository<SiteSettingsRecord> repository){
public class SiteSettingsProvider : ContentProvider {
public SiteSettingsProvider(IRepository<SiteSettingsRecord> repository){
Filters.Add(new ActivatingFilter<SiteSettings>("site"));
Filters.Add(new StorageFilterForRecord<SiteSettingsRecord>(repository));
}