U4-700 - Rewritten and migrated IMacroEngine

Created by Shannon Deminick 28 Aug 2012, 01:04:01 Updated by Shannon Deminick 03 Oct 2013, 04:34:08

Relates to: U4-2910

Is required for: U4-701

Is required for: U4-795

Is required for: U4-834

Subtask of: U4-806

The IMacroEngine currently exists in the umbraco.cms project and in the far far future this will be discontinued and legacy. It needs to exist in the Umbraco.Core project. It also only supports macro types that are file based and we need to support Child Action macros with the upcoming MVC support. We should take the IMacroEngine defined in the v5 codebase as it is very flexible and allows for any type of macro.... However the one thing that should be changed from the v5 macro engine (which i think is called AbstractMacroEngine) would be to have the result returned as string NOT ActionResult.

Once this is completed we should do:

  • Make the Xslt macros actually use this engine, currently xslt macros are hard coded and do not use IMacroEngine!
  • Create the Child Action macro engine
  • Change the UI to use the new interface and proxy the old one to maintain backwards compatibility


Shannon Deminick 06 Nov 2012, 03:01:17

Other macro engines that are hard coded:

  • UserControl macros
  • Control library macros

The other huge issue is that the current IMacroEngine isn't even plug-able meaning that you can't even create another IMacroEngine and register it because there's actually an enum: MacroTypes that has all the the IMacroEngines explicitly declared! So there's really no point in having the current IMacroEngine in the first place.

In any case, having a new IMacroEngine that is actually plugable and having all of the macro types use their new IMacroEngine implementation will be a much needed change and pave the way for potentially new macro types. The entire macro rendering process currently is very much spaghetti code, moving this rendering into each engine will start making this code make a lot more sense.

Priority: Normal

Type: Task

State: Open

Assignee: Shannon Deminick

Difficulty: Normal

Category: Architecture

Backwards Compatible: False

Fix Submitted:

Affected versions:

Due in version:


Story Points: