This project is read-only.

How about open module Import Export for custom steps?

Topics: Core, Customizing Orchard, Writing modules
May 17, 2012 at 4:24 PM

Hi guys, I have implemented my own IRecipeHandler to allow my recipes also import predefined roles with permissions. But Orchard.ImportExport have one nasty (hard-coded, no way to extend) limitation:

private void CheckRecipeSteps(Recipe recipe) {
            foreach (var step in recipe.RecipeSteps) {
                switch (step.Name) {
                    case "Metadata":
                    case "Settings":
                    case "Data":
                        throw new InvalidOperationException(T("Step {0} is not a supported import step.", step.Name).Text);


Why is this present? Of course, i resolved this by adding case: "Roles":, but I dont understand this limitation - why should I not be able to write my own recipe steps and handlers for them?  Is there any chance you remove this check in future versions so I wont have to hack Import Export module? Thanx.

May 17, 2012 at 6:13 PM

I know little about the Import/Export module but wouldn't it be possible what you're trying to do by naming your steps e.g. Settings then add your own step handler? Don't all steps get executed? So yours would also run.

May 17, 2012 at 9:14 PM
Edited May 17, 2012 at 9:15 PM

How is that hard-coded? Can't you just implement IImportExportService? (I don't like that default though. That looks wrong. Please file a bug).