mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +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.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Recipes.Models;
|
||||
using Orchard.Recipes.Services;
|
||||
using VersionOptions = Orchard.ContentManagement.VersionOptions;
|
||||
|
||||
@@ -50,7 +49,6 @@ namespace Orchard.ImportExport.Services {
|
||||
|
||||
public void Import(string recipeText) {
|
||||
var recipe = _recipeParser.ParseRecipe(recipeText);
|
||||
CheckRecipeSteps(recipe);
|
||||
_recipeManager.Execute(recipe);
|
||||
UpdateShell();
|
||||
}
|
||||
@@ -180,19 +178,6 @@ namespace Orchard.ImportExport.Services {
|
||||
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() {
|
||||
var descriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
_shellDescriptorManager.UpdateShellDescriptor(descriptor.SerialNumber, descriptor.Features, descriptor.Parameters);
|
||||
|
Reference in New Issue
Block a user