mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-20 02:37:55 +08:00
Updated code to reflect new DataServicesProvider changes
--HG-- branch : dev
This commit is contained in:
@@ -19,6 +19,8 @@ using Orchard.Security;
|
|||||||
using Orchard.Settings;
|
using Orchard.Settings;
|
||||||
using Orchard.Themes;
|
using Orchard.Themes;
|
||||||
using Orchard.UI.Notify;
|
using Orchard.UI.Notify;
|
||||||
|
using Orchard.Environment.State;
|
||||||
|
using Orchard.DataMigration;
|
||||||
|
|
||||||
namespace Orchard.Setup.Services {
|
namespace Orchard.Setup.Services {
|
||||||
public class SetupService : ISetupService {
|
public class SetupService : ISetupService {
|
||||||
@@ -27,6 +29,8 @@ namespace Orchard.Setup.Services {
|
|||||||
private readonly IShellSettingsManager _shellSettingsManager;
|
private readonly IShellSettingsManager _shellSettingsManager;
|
||||||
private readonly IShellContainerFactory _shellContainerFactory;
|
private readonly IShellContainerFactory _shellContainerFactory;
|
||||||
private readonly ICompositionStrategy _compositionStrategy;
|
private readonly ICompositionStrategy _compositionStrategy;
|
||||||
|
private readonly IProcessingEngine _processingEngine;
|
||||||
|
private readonly IDataMigrationManager _dataMigrationManager;
|
||||||
|
|
||||||
public SetupService(
|
public SetupService(
|
||||||
ShellSettings shellSettings,
|
ShellSettings shellSettings,
|
||||||
@@ -34,12 +38,16 @@ namespace Orchard.Setup.Services {
|
|||||||
IOrchardHost orchardHost,
|
IOrchardHost orchardHost,
|
||||||
IShellSettingsManager shellSettingsManager,
|
IShellSettingsManager shellSettingsManager,
|
||||||
IShellContainerFactory shellContainerFactory,
|
IShellContainerFactory shellContainerFactory,
|
||||||
ICompositionStrategy compositionStrategy) {
|
ICompositionStrategy compositionStrategy,
|
||||||
|
IProcessingEngine processingEngine,
|
||||||
|
IDataMigrationManager dataMigrationManager) {
|
||||||
_shellSettings = shellSettings;
|
_shellSettings = shellSettings;
|
||||||
_orchardHost = orchardHost;
|
_orchardHost = orchardHost;
|
||||||
_shellSettingsManager = shellSettingsManager;
|
_shellSettingsManager = shellSettingsManager;
|
||||||
_shellContainerFactory = shellContainerFactory;
|
_shellContainerFactory = shellContainerFactory;
|
||||||
_compositionStrategy = compositionStrategy;
|
_compositionStrategy = compositionStrategy;
|
||||||
|
_processingEngine = processingEngine;
|
||||||
|
_dataMigrationManager = dataMigrationManager;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +105,7 @@ namespace Orchard.Setup.Services {
|
|||||||
// initialize database explicitly, and store shell descriptor
|
// initialize database explicitly, and store shell descriptor
|
||||||
var bootstrapLifetimeScope = _shellContainerFactory.CreateContainer(shellSettings, shellToplogy);
|
var bootstrapLifetimeScope = _shellContainerFactory.CreateContainer(shellSettings, shellToplogy);
|
||||||
using (var environment = new StandaloneEnvironment(bootstrapLifetimeScope)) {
|
using (var environment = new StandaloneEnvironment(bootstrapLifetimeScope)) {
|
||||||
environment.Resolve<ISessionFactoryHolder>().CreateDatabase();
|
_dataMigrationManager.Update(new [] { "Orchard.Framework", "Settings" });
|
||||||
|
|
||||||
environment.Resolve<IShellDescriptorManager>().UpdateShellDescriptor(
|
environment.Resolve<IShellDescriptorManager>().UpdateShellDescriptor(
|
||||||
0,
|
0,
|
||||||
@@ -105,6 +113,10 @@ namespace Orchard.Setup.Services {
|
|||||||
shellDescriptor.Parameters);
|
shellDescriptor.Parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// in effect "pump messages" see PostMessage circa 1980
|
||||||
|
while ( _processingEngine.AreTasksPending() )
|
||||||
|
_processingEngine.ExecuteNextTask();
|
||||||
|
|
||||||
|
|
||||||
// creating a standalone environment.
|
// creating a standalone environment.
|
||||||
// in theory this environment can be used to resolve any normal components by interface, and those
|
// in theory this environment can be used to resolve any normal components by interface, and those
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentNHibernate.Cfg;
|
using FluentNHibernate.Cfg;
|
||||||
using Orchard.Data.Builders;
|
using Orchard.Data.Providers;
|
||||||
using Orchard.DataMigration.Schema;
|
using Orchard.DataMigration.Schema;
|
||||||
using Orchard.Environment.ShellBuilders.Models;
|
using Orchard.Environment.ShellBuilders.Models;
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ namespace Orchard.DataMigration {
|
|||||||
public IEnumerable<ISchemaBuilderCommand> CreateCommands(IEnumerable<RecordBlueprint> records) {
|
public IEnumerable<ISchemaBuilderCommand> CreateCommands(IEnumerable<RecordBlueprint> records) {
|
||||||
|
|
||||||
// use FluentNhibernate generation for this module
|
// use FluentNhibernate generation for this module
|
||||||
var persistenceModel = AbstractBuilder.CreatePersistenceModel(records);
|
var persistenceModel = AbstractDataServicesProvider.CreatePersistenceModel(records);
|
||||||
var configuration = Fluently.Configure().Mappings(m => m.AutoMappings.Add(persistenceModel));
|
var configuration = Fluently.Configure().Mappings(m => m.AutoMappings.Add(persistenceModel));
|
||||||
|
|
||||||
return Enumerable.Empty<ISchemaBuilderCommand>();
|
return Enumerable.Empty<ISchemaBuilderCommand>();
|
||||||
|
@@ -356,6 +356,7 @@
|
|||||||
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs">
|
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="DataMigration\AutomaticDataMigration.cs" />
|
||||||
<Compile Include="DataMigration\Interpreters\ICommandInterpreter.cs" />
|
<Compile Include="DataMigration\Interpreters\ICommandInterpreter.cs" />
|
||||||
<Compile Include="DataMigration\Interpreters\DefaultDataMigrationInterpreter.cs" />
|
<Compile Include="DataMigration\Interpreters\DefaultDataMigrationInterpreter.cs" />
|
||||||
<Compile Include="DataMigration\Interpreters\IDataMigrationInterpreter.cs" />
|
<Compile Include="DataMigration\Interpreters\IDataMigrationInterpreter.cs" />
|
||||||
|
Reference in New Issue
Block a user