Posted on 11/12/2007 22:32:45
I've addressed the issue about having different sets of custommodules in one solution by making af custom ParagraphProvider following the ASP.NET Provider Model specifications.
Our situation is somehow different because we have many modules that we sell and some customers have custommodules already and just wants an extra one, so instead of adding a souce-code-copy into the custommodule solution and recompile and upload, we are able to have multiple dll-files containing each module completely isolated from others.
The main idea is to load different dlls and call different modules inside these all done from the web.config file instead of new code.
So what I did is I modifed the "Provider Toolkit" available from http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx and made a ParagraphProvider which has it's own configSection in the web.config file e.g.
type="CustomModules.ParagraphConfiguration, CustomModules"
allowDefinition="MachineToApplication" />
type="kevin.myModule.myClass, kevins_modules" />
type="kevin.myOtherModule.myClass, kevins_2nd_modules" />
Now inside the default.aspx.cs file I call the instantiation of my ProviderManager with DoWork(strModulename, e.DataRow, e.Pageview) the ProviderManager then pases the parameters to the DoWork method of the Provider from the web.config file which has the same name as the strModulename parameter ex:
private void Content_CMEventHandler(object sender, Dynamicweb.Frontend.CustomModuleEventArgs e)
{
string strModuleName = System.Convert.ToString(e.Name).ToLower();
e.Output = CustomModules.ParagraphManager.DoWork(strModuleName, e.ParagraphRow, e.Pageview);
}
The problem for you could be that all providers must inherit ParagraphProvider and implement the DoWork method, and company a, b or c didn't know of my way of dealing with this issue so you'd have to make them add this small change to their modules.
But what Nicolai is talking about seems to be something along this way of dealing with this major problem, and I'm looking forward to how this issue is solved in the january release.