/// <summary> /// GetModuleList gets a collection of SearchContentModuleInfo Items for the Portal /// </summary> /// <remarks> /// Parses the Modules of the Portal, determining whetehr they are searchable. /// </remarks> /// <param name="PortalID">The Id of the Portal</param> /// <history> /// [cnurse] 11/15/2004 documented /// </history> protected SearchContentModuleInfoCollection GetModuleList(int PortalID) { SearchContentModuleInfoCollection Results = new SearchContentModuleInfoCollection(); ModuleController objModules = new ModuleController(); ArrayList arrModules = objModules.GetSearchModules(PortalID); Hashtable businessControllers = new Hashtable(); Hashtable htModules = new Hashtable(); ModuleInfo objModule; foreach (ModuleInfo tempLoopVar_objModule in arrModules) { objModule = tempLoopVar_objModule; if (!htModules.ContainsKey(objModule.ModuleID)) { try { //Check if the business controller is in the Hashtable object objController = businessControllers[objModule.BusinessControllerClass]; //If nothing create a new instance if (objController == null) { objController = Framework.Reflection.CreateObject(objModule.BusinessControllerClass, objModule.BusinessControllerClass); //Add to hashtable businessControllers.Add(objModule.BusinessControllerClass, objController); } //Double-Check that module supports ISearchable if (objController is ISearchable) { SearchContentModuleInfo ContentInfo = new SearchContentModuleInfo(); ContentInfo.ModControllerType = (ISearchable)objController; ContentInfo.ModInfo = objModule; Results.Add(ContentInfo); } } catch (Exception ex) { DotNetNuke.Services.Exceptions.Exceptions.LogException(ex); } finally { htModules.Add(objModule.ModuleID, objModule.ModuleID); } } } return(Results); }
protected SearchContentModuleInfoCollection GetModuleList(int portalId) { var results = new SearchContentModuleInfoCollection(); var objModules = new ModuleController(); var arrModules = objModules.GetSearchModules(portalId); var businessControllers = new Hashtable(); var htModules = new Hashtable(); foreach (var module in arrModules.Cast <ModuleInfo>().Where(module => !htModules.ContainsKey(module.ModuleID))) { try { //Check if the business controller is in the Hashtable var controller = businessControllers[module.DesktopModule.BusinessControllerClass]; if (!String.IsNullOrEmpty(module.DesktopModule.BusinessControllerClass)) { //If nothing create a new instance if (controller == null) { //Add to hashtable controller = Reflection.CreateObject(module.DesktopModule.BusinessControllerClass, module.DesktopModule.BusinessControllerClass); businessControllers.Add(module.DesktopModule.BusinessControllerClass, controller); } //Double-Check that module supports ISearchable //Check if module inherits from ModuleSearchBase if (controller is ISearchable && !(controller is ModuleSearchBase)) { var contentInfo = new SearchContentModuleInfo { ModControllerType = (ISearchable)controller, ModInfo = module }; results.Add(contentInfo); } } } catch (Exception ex) { Logger.Error(ex); ThrowLogError(module, ex); } finally { htModules.Add(module.ModuleID, module.ModuleID); } } return(results); }
protected SearchContentModuleInfoCollection GetModuleList(int portalId) { var results = new SearchContentModuleInfoCollection(); var objModules = new ModuleController(); var arrModules = objModules.GetSearchModules(portalId); var businessControllers = new Hashtable(); var htModules = new Hashtable(); foreach (var module in arrModules.Cast<ModuleInfo>().Where(module => !htModules.ContainsKey(module.ModuleID))) { try { //Check if the business controller is in the Hashtable var controller = businessControllers[module.DesktopModule.BusinessControllerClass]; if (!String.IsNullOrEmpty(module.DesktopModule.BusinessControllerClass)) { //If nothing create a new instance if (controller == null) { //Add to hashtable controller = Reflection.CreateObject(module.DesktopModule.BusinessControllerClass, module.DesktopModule.BusinessControllerClass); businessControllers.Add(module.DesktopModule.BusinessControllerClass, controller); } //Double-Check that module supports ISearchable //Check if module inherits from ModuleSearchBase if (controller is ISearchable && !(controller is ModuleSearchBase)) { var contentInfo = new SearchContentModuleInfo {ModControllerType = (ISearchable) controller, ModInfo = module}; results.Add(contentInfo); } } } catch (Exception ex) { Logger.Error(ex); ThrowLogError(module, ex); } finally { htModules.Add(module.ModuleID, module.ModuleID); } } return results; }
/// <summary> /// GetModuleList gets a collection of SearchContentModuleInfo Items for the Portal /// </summary> /// <remarks> /// Parses the Modules of the Portal, determining whetehr they are searchable. /// </remarks> /// <param name="PortalID">The Id of the Portal</param> /// <history> /// [cnurse] 11/15/2004 documented /// </history> protected SearchContentModuleInfoCollection GetModuleList( int PortalID ) { SearchContentModuleInfoCollection Results = new SearchContentModuleInfoCollection(); ModuleController objModules = new ModuleController(); ArrayList arrModules = objModules.GetSearchModules( PortalID ); Hashtable businessControllers = new Hashtable(); Hashtable htModules = new Hashtable(); ModuleInfo objModule; foreach( ModuleInfo tempLoopVar_objModule in arrModules ) { objModule = tempLoopVar_objModule; if( ! htModules.ContainsKey( objModule.ModuleID ) ) { try { //Check if the business controller is in the Hashtable object objController = businessControllers[objModule.BusinessControllerClass]; //If nothing create a new instance if( objController == null ) { objController = Framework.Reflection.CreateObject( objModule.BusinessControllerClass, objModule.BusinessControllerClass ); //Add to hashtable businessControllers.Add( objModule.BusinessControllerClass, objController ); } //Double-Check that module supports ISearchable if( objController is ISearchable ) { SearchContentModuleInfo ContentInfo = new SearchContentModuleInfo(); ContentInfo.ModControllerType = (ISearchable)objController; ContentInfo.ModInfo = objModule; Results.Add( ContentInfo ); } } catch( Exception ex ) { DotNetNuke.Services.Exceptions.Exceptions.LogException(ex); } finally { htModules.Add( objModule.ModuleID, objModule.ModuleID ); } } } return Results; }
/// ----------------------------------------------------------------------------- /// <summary> /// GetModuleList gets a collection of SearchContentModuleInfo Items for the Portal /// </summary> /// <remarks> /// Parses the Modules of the Portal, determining whetehr they are searchable. /// </remarks> /// <param name="PortalID">The Id of the Portal</param> /// <history> /// [cnurse] 11/15/2004 documented /// </history> /// ----------------------------------------------------------------------------- protected SearchContentModuleInfoCollection GetModuleList(int PortalID) { var Results = new SearchContentModuleInfoCollection(); var objModules = new ModuleController(); ArrayList arrModules = objModules.GetSearchModules(PortalID); var businessControllers = new Hashtable(); var htModules = new Hashtable(); foreach (ModuleInfo objModule in arrModules) { if (!htModules.ContainsKey(objModule.ModuleID)) { try { //Check if the business controller is in the Hashtable object objController = businessControllers[objModule.DesktopModule.BusinessControllerClass]; if (!String.IsNullOrEmpty(objModule.DesktopModule.BusinessControllerClass)) { //If nothing create a new instance if (objController == null) { objController = Reflection.CreateObject(objModule.DesktopModule.BusinessControllerClass, objModule.DesktopModule.BusinessControllerClass); //Add to hashtable businessControllers.Add(objModule.DesktopModule.BusinessControllerClass, objController); } //Double-Check that module supports ISearchable if (objController is ISearchable) { var ContentInfo = new SearchContentModuleInfo(); ContentInfo.ModControllerType = (ISearchable)objController; ContentInfo.ModInfo = objModule; Results.Add(ContentInfo); } } } catch (Exception ex) { Instrumentation.DnnLog.Error(ex); try { string strMessage = string.Format("Error Creating BusinessControllerClass '{0}' of module({1}) id=({2}) in tab({3}) and portal({4}) ", objModule.DesktopModule.BusinessControllerClass, objModule.DesktopModule.ModuleName, objModule.ModuleID, objModule.TabID, objModule.PortalID); throw new Exception(strMessage, ex); } catch (Exception ex1) { Exceptions.Exceptions.LogException(ex1); } } finally { htModules.Add(objModule.ModuleID, objModule.ModuleID); } } } return(Results); }
/// ----------------------------------------------------------------------------- /// <summary> /// GetModuleList gets a collection of SearchContentModuleInfo Items for the Portal /// </summary> /// <remarks> /// Parses the Modules of the Portal, determining whetehr they are searchable. /// </remarks> /// <param name="PortalID">The Id of the Portal</param> /// <history> /// [cnurse] 11/15/2004 documented /// </history> /// ----------------------------------------------------------------------------- protected SearchContentModuleInfoCollection GetModuleList(int PortalID) { var Results = new SearchContentModuleInfoCollection(); var objModules = new ModuleController(); ArrayList arrModules = objModules.GetSearchModules(PortalID); var businessControllers = new Hashtable(); var htModules = new Hashtable(); foreach (ModuleInfo objModule in arrModules) { if (!htModules.ContainsKey(objModule.ModuleID)) { try { //Check if the business controller is in the Hashtable object objController = businessControllers[objModule.DesktopModule.BusinessControllerClass]; if (!String.IsNullOrEmpty(objModule.DesktopModule.BusinessControllerClass)) { //If nothing create a new instance if (objController == null) { objController = Reflection.CreateObject(objModule.DesktopModule.BusinessControllerClass, objModule.DesktopModule.BusinessControllerClass); //Add to hashtable businessControllers.Add(objModule.DesktopModule.BusinessControllerClass, objController); } //Double-Check that module supports ISearchable if (objController is ISearchable) { var ContentInfo = new SearchContentModuleInfo(); ContentInfo.ModControllerType = (ISearchable) objController; ContentInfo.ModInfo = objModule; Results.Add(ContentInfo); } } } catch (Exception ex) { Instrumentation.DnnLog.Error(ex); try { string strMessage = string.Format("Error Creating BusinessControllerClass '{0}' of module({1}) id=({2}) in tab({3}) and portal({4}) ", objModule.DesktopModule.BusinessControllerClass, objModule.DesktopModule.ModuleName, objModule.ModuleID, objModule.TabID, objModule.PortalID); throw new Exception(strMessage, ex); } catch (Exception ex1) { Exceptions.Exceptions.LogException(ex1); } } finally { htModules.Add(objModule.ModuleID, objModule.ModuleID); } } } return Results; }