Hello friends, first time poster here. I am running into an issue that I hope can be resolved through this form because I have been at it for several days to no avail.
I recently started working for a company that does some of its clients CMSs using Umbraco. The problem is that I am a .NET developer that was given the task of maintaing the code that a previous developer left when she worked on the Umbraco CMS. So I can't just ask her what she was doing, otherwise I wouldn't be here.
Enough blaberring, here is my problem:
She was getting some data from a stored procedure in a SQL Server database, simple enough. However, after that she was using that data and loading it into a macro's properties, then she executed the macro. Again, I am not too familiar with Umbraco, I have tried to replicate this behavior but I can't find, or don't understand, what she is doing. Here is the code that she was using to load and execute the macros:
The class that I can't find is the RazorMacroEngine, is this an umbraco class? Or is it something custom she made?
This all happens in a .NET class library, this is why the people at my company placed me on this project. We access the class library's methods through jquery ajax in our templates.
Please forgive me if this is something trivial, again I am fairly new to umbraco.
Please feel free to ask for more information if it is needed.
Macro Engine Problem
Hello friends, first time poster here. I am running into an issue that I hope can be resolved through this form because I have been at it for several days to no avail.
I recently started working for a company that does some of its clients CMSs using Umbraco. The problem is that I am a .NET developer that was given the task of maintaing the code that a previous developer left when she worked on the Umbraco CMS. So I can't just ask her what she was doing, otherwise I wouldn't be here.
Enough blaberring, here is my problem:
She was getting some data from a stored procedure in a SQL Server database, simple enough. However, after that she was using that data and loading it into a macro's properties, then she executed the macro. Again, I am not too familiar with Umbraco, I have tried to replicate this behavior but I can't find, or don't understand, what she is doing. Here is the code that she was using to load and execute the macros:
private static string loadRazorMacro(int pageId, string name, List<MacroPropertyModel> properties){
try
{
INode currentPage = new Node(pageId);
RazorMacroEngine engine = new RazorMacroEngine();
MacroModel macro = new MacroModel
{
ScriptCode = "",
ScriptLanguage = "cshtml",
ScriptName = name + ".cshtml",
Properties = properties
};
return engine.Execute(macro, currentPage);
}
catch (Exception exception)
{
return (exception.Message + exception.StackTrace.ToString());
}
}
The class that I can't find is the RazorMacroEngine, is this an umbraco class? Or is it something custom she made?
This all happens in a .NET class library, this is why the people at my company placed me on this project. We access the class library's methods through jquery ajax in our templates.
Please forgive me if this is something trivial, again I am fairly new to umbraco.
Please feel free to ask for more information if it is needed.
Thank you in advance.
Hi Ed,
Welcome to Our!
Yes, RazorMacroEngine is an Umbraco class and it can be found in the umbraco.MacroEngines namespace.
Hope that helps you?
Jeavon
is working on a reply...