Contrib.PasteImport - Help with module

Topics: Customizing Orchard, Writing modules
Apr 2, 2013 at 8:41 PM
Edited Apr 2, 2013 at 8:50 PM
I don't know how many developers get by with Orchard.
But I depend heavily on importing and exporting recipe components.

I often export, modify a quick piece of something, but then I'd be forced to forge a new file and save it to upload. I would do this more often, if it were easier. So I slapped this together, and I need some help to make it a bit better.


Orchard Gallery - Contrib.PasteImport
Github - Contrib.PasteImport

I noticed that recipes are submitted to a scheduler.
If your input is valid all works well, but if the recipe is invalid I cant tell.
Is there a way to wait for the result of the import so I can display a failure message if the import did in fact fail.

Apr 18, 2013 at 2:31 PM
I don't know how many people have had a chance to check this out. We use this module internally a lot.

I'm bringing it up again cause I'd like to extend it to be able to capture the error (if any) that occurs during recipe execution.
Apr 20, 2013 at 3:55 AM

Maybe you can inject a dependency to Orchard.Recipes.Services.IRecipeParser in your controller code, try parsing the recipe and catch structural errors in the pasted xml.

As far as I understand from Orchard.Setup.Services.SetupService code, the setup creates a standalone shell and executes the recipe during it's lifetime. In effect the home page is not shown until the recipe is "cooked". You might want to try that in your controller if you want to catch more than xml parse exceptions.

BTW, I'm quite new to Orchard and still trying to figure out basics, so all these might be nonsense. Just my 2 cents...
Apr 22, 2013 at 2:33 PM
If your input is valid all works well, but if the recipe is invalid I cant tell.

I've had a number of issues with invalid data going to the scheduler on recipe import. Have managed to pick up most of them by looking at the log file (orchard-error-yyyy-mm-dd.log) created within App_Data\Logs.

I'll have a look at your paste import as rely heavily on the output/import mechanism at the moment.
Apr 22, 2013 at 3:39 PM
@kassobasi: The false positives of success haven't started to bother me yet, so I haven't pushed that much farther into figuring out the problem. I'll take note of the interface and take a look at it a little later today.

@alanevery: My PasteImport module is just stubbing into the same Recipe Upload functionality. So thankfully the logs appear there.

I'm very happy with the little functionality this module has, it proves to be really clutch.