예제 #1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// GetSearchIndexItems gets the SearchInfo Items for the Portal
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="PortalID">The Id of the Portal</param>
        /// <history>
        ///		[cnurse]	11/15/2004	documented
        ///     [vnguyen]   09/07/2010  Modified: Included logic to add TabId to searchItems
        /// </history>
        /// -----------------------------------------------------------------------------
        public override SearchItemInfoCollection GetSearchIndexItems(int PortalID)
        {
            var SearchItems = new SearchItemInfoCollection();
            SearchContentModuleInfoCollection SearchCollection = GetModuleList(PortalID);

            foreach (SearchContentModuleInfo ScModInfo in SearchCollection)
            {
                try
                {
                    SearchItemInfoCollection myCollection;
                    myCollection = ScModInfo.ModControllerType.GetSearchItems(ScModInfo.ModInfo);
                    if (myCollection != null)
                    {
                        foreach (SearchItemInfo searchItem in myCollection)
                        {
                            searchItem.TabId = ScModInfo.ModInfo.TabID;
                        }

                        SearchItems.AddRange(myCollection);
                    }
                }
                catch (Exception ex)
                {
                    Exceptions.Exceptions.LogException(ex);
                }
            }
            return(SearchItems);
        }
예제 #2
0
 /// <summary>
 /// Adds the contents of another <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> containing the objects to add to the collection. </param>
 public void AddRange(SearchContentModuleInfoCollection value)
 {
     for (int i = 0; i <= value.Count - 1; i++)
     {
         Add((SearchContentModuleInfo)value.List[i]);
     }
 }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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;
        }
예제 #5
0
        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);
        }
예제 #6
0
        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;
        }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> with which to initialize the collection.</param>
 public SearchContentModuleInfoCollection(SearchContentModuleInfoCollection value)
 {
     AddRange(value);
 }
예제 #8
0
        /// -----------------------------------------------------------------------------
        /// <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>
 /// Initializes a new instance of the <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> with which to initialize the collection.</param>
 public SearchContentModuleInfoCollection( SearchContentModuleInfoCollection value )
 {
     AddRange( value );
 }
 /// <summary>
 /// Adds the contents of another <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref="SearchContentModuleInfoCollection">SearchContentModuleInfoCollection</see> containing the objects to add to the collection. </param>
 public void AddRange( SearchContentModuleInfoCollection value )
 {
     for( int i = 0; i <= value.Count - 1; i++ )
     {
         Add( (SearchContentModuleInfo)value.List[ i ] );
     }
 }
예제 #11
0
        /// -----------------------------------------------------------------------------
        /// <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;
        }