mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18695: Allow import to accept any type of step
Work Item: 18695 --HG-- branch : 1.x
This commit is contained in:
@@ -10,7 +10,6 @@ using Orchard.FileSystems.AppData;
|
|||||||
using Orchard.ImportExport.Models;
|
using Orchard.ImportExport.Models;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
using Orchard.Recipes.Models;
|
|
||||||
using Orchard.Recipes.Services;
|
using Orchard.Recipes.Services;
|
||||||
using VersionOptions = Orchard.ContentManagement.VersionOptions;
|
using VersionOptions = Orchard.ContentManagement.VersionOptions;
|
||||||
|
|
||||||
@@ -50,7 +49,6 @@ namespace Orchard.ImportExport.Services {
|
|||||||
|
|
||||||
public void Import(string recipeText) {
|
public void Import(string recipeText) {
|
||||||
var recipe = _recipeParser.ParseRecipe(recipeText);
|
var recipe = _recipeParser.ParseRecipe(recipeText);
|
||||||
CheckRecipeSteps(recipe);
|
|
||||||
_recipeManager.Execute(recipe);
|
_recipeManager.Execute(recipe);
|
||||||
UpdateShell();
|
UpdateShell();
|
||||||
}
|
}
|
||||||
@@ -180,19 +178,6 @@ namespace Orchard.ImportExport.Services {
|
|||||||
return _appDataFolder.MapPath(path);
|
return _appDataFolder.MapPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckRecipeSteps(Recipe recipe) {
|
|
||||||
foreach (var step in recipe.RecipeSteps) {
|
|
||||||
switch (step.Name) {
|
|
||||||
case "Metadata":
|
|
||||||
case "Settings":
|
|
||||||
case "Data":
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new InvalidOperationException(T("Step {0} is not a supported import step.", step.Name).Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateShell() {
|
private void UpdateShell() {
|
||||||
var descriptor = _shellDescriptorManager.GetShellDescriptor();
|
var descriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||||
_shellDescriptorManager.UpdateShellDescriptor(descriptor.SerialNumber, descriptor.Features, descriptor.Parameters);
|
_shellDescriptorManager.UpdateShellDescriptor(descriptor.SerialNumber, descriptor.Features, descriptor.Parameters);
|
||||||
|
Reference in New Issue
Block a user