梁某人

发展才是硬道理

导航

由插件独特的处理器产生页面

/// <summary>
        
/// 由插件独特的处理器产生页面
        
/// </summary>
        
/// <param name="catalogId">做发布动作的栏目ID</param>
        
/// <param name="pluginId">栏目上的插件ID</param>
        
/// <param name="result">异常散播</param>
        
/// <param name="tmpltToPublish">要发布的模板</param>
        private void GeneratePageByPluginProcessor(int catalogId, int pluginId, List<Exception> result,
                                                   List
<WebTemplateInCatalog> tmpltToPublish)
        {
            IDBPluginManager pluginMgr 
= PluginSupportFacade.GetFacade().GetIDBPluginManager();
            
string pluginEname = pluginMgr.GetPluginEnameByPluginId(pluginId, true);
            
//取得处理器
            IExtensionRegistry registry = Platform.GetExtensionRegistry();
            IExtensionPoint point 
= registry.getExtensionPoint("AppCatalogSupport.AppCatalogTemplatePagesGenerator");
            IExtension[] exts 
= point.getExtensions();
            
foreach (IExtension e in exts)
            {
                
if (e.Namespace == pluginEname)
                {
                    IConfigurationElement[] impClassElem 
= e.ConfigurationElements[0].getChildren("implement");
                    
if (impClassElem != null && impClassElem.Length > 0)
                    {
                        IAppCatalogTemplatePagesGenerator processor 
=
                            (IAppCatalogTemplatePagesGenerator) impClassElem[
0].CreateExecutableExtension("class");
                        Exception processEx;
                        
if (! processor.GeneratePagesFromNonMPTemplate(catalogId, tmpltToPublish, out processEx))
                        {
                            result.Add(processEx);                            
                        }                        
                    }
                    
break;
                }
            }
        }

posted on 2006-12-06 05:31  涛仔28  阅读(238)  评论(0编辑  收藏  举报