当前位置: 首页>>代码示例>>C#>>正文


C# ListController.GetListEntryInfoDictionary方法代码示例

本文整理汇总了C#中DotNetNuke.Common.Lists.ListController.GetListEntryInfoDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# ListController.GetListEntryInfoDictionary方法的具体用法?C# ListController.GetListEntryInfoDictionary怎么用?C# ListController.GetListEntryInfoDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Common.Lists.ListController的用法示例。


在下文中一共展示了ListController.GetListEntryInfoDictionary方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpgradeToVersion562

        private static void UpgradeToVersion562()
        {
            //Add new Photo Profile field to Host
            var listController = new ListController();
            Dictionary<string, ListEntryInfo> dataTypes = listController.GetListEntryInfoDictionary("DataType");

            var properties = ProfileController.GetPropertyDefinitionsByPortal(Null.NullInteger);
            ProfileController.AddDefaultDefinition(Null.NullInteger, "Preferences", "Photo", "Image", 0, properties.Count * 2 + 2, UserVisibilityMode.AllUsers, dataTypes);

            HostController.Instance.Update("AutoAddPortalAlias", Globals.Status == Globals.UpgradeStatus.Install ? "Y" : "N");

            // remove the system message module from the admin tab
            // System Messages are now managed through Localization
            if (CoreModuleExists("System Messages"))
            {
                RemoveCoreModule("System Messages", "Admin", "Site Settings", false);
            }

            // remove portal alias module
            if (CoreModuleExists("PortalAliases"))
            {
                RemoveCoreModule("PortalAliases", "Admin", "Site Settings", false);
            }

            // add the log viewer module to the admin tab
            int moduleDefId;
            if (CoreModuleExists("LogViewer") == false)
            {
                moduleDefId = AddModuleDefinition("LogViewer", "Allows you to view log entries for site events.", "Log Viewer");
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/LogViewer/LogViewer.ascx", "", SecurityAccessLevel.Admin, 0);
                AddModuleControl(moduleDefId, "Edit", "Edit Log Settings", "DesktopModules/Admin/LogViewer/EditLogTypes.ascx", "", SecurityAccessLevel.Host, 0);

                //Add the Module/Page to all configured portals
                AddAdminPages("Log Viewer", "View a historical log of database events such as event schedules, exceptions, account logins, module and page changes, user account activities, security role activities, etc.", "icon_viewstats_16px.gif", "icon_viewstats_32px.gif", true, moduleDefId, "Log Viewer", "icon_viewstats_16px.gif");
            }

            // add the schedule module to the host tab
            TabInfo newPage;
            if (CoreModuleExists("Scheduler") == false)
            {
                moduleDefId = AddModuleDefinition("Scheduler", "Allows you to schedule tasks to be run at specified intervals.", "Scheduler");
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Scheduler/ViewSchedule.ascx", "", SecurityAccessLevel.Admin, 0);
                AddModuleControl(moduleDefId, "Edit", "Edit Schedule", "DesktopModules/Admin/Scheduler/EditSchedule.ascx", "", SecurityAccessLevel.Host, 0);
                AddModuleControl(moduleDefId, "History", "Schedule History", "DesktopModules/Admin/Scheduler/ViewScheduleHistory.ascx", "", SecurityAccessLevel.Host, 0);
                AddModuleControl(moduleDefId, "Status", "Schedule Status", "DesktopModules/Admin/Scheduler/ViewScheduleStatus.ascx", "", SecurityAccessLevel.Host, 0);

                //Create New Host Page (or get existing one)
                newPage = AddHostPage("Schedule", "Add, modify and delete scheduled tasks to be run at specified intervals.", "icon_scheduler_16px.gif", "icon_scheduler_32px.gif", true);

                //Add Module To Page
                AddModuleToPage(newPage, moduleDefId, "Schedule", "icon_scheduler_16px.gif");
            }

            // add the Search Admin module to the host tab
            if (CoreModuleExists("SearchAdmin") == false)
            {
                moduleDefId = AddModuleDefinition("SearchAdmin", "The Search Admininstrator provides the ability to manage search settings.", "Search Admin");
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/SearchAdmin/SearchAdmin.ascx", "", SecurityAccessLevel.Host, 0);

                //Create New Host Page (or get existing one)
                newPage = AddHostPage("Search Admin", "Manage search settings associated with DotNetNuke's search capability.", "icon_search_16px.gif", "icon_search_32px.gif", true);

                //Add Module To Page
                AddModuleToPage(newPage, moduleDefId, "Search Admin", "icon_search_16px.gif");
            }

            // add the Search Input module
            if (CoreModuleExists("SearchInput") == false)
            {
                moduleDefId = AddModuleDefinition("SearchInput", "The Search Input module provides the ability to submit a search to a given search results module.", "Search Input", false, false);
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/SearchInput/SearchInput.ascx", "", SecurityAccessLevel.Anonymous, 0);
                AddModuleControl(moduleDefId, "Settings", "Search Input Settings", "DesktopModules/Admin/SearchInput/Settings.ascx", "", SecurityAccessLevel.Edit, 0);
            }

            // add the Search Results module
            if (CoreModuleExists("SearchResults") == false)
            {
                moduleDefId = AddModuleDefinition("SearchResults", "The Search Reasults module provides the ability to display search results.", "Search Results", false, false);
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/SearchResults/SearchResults.ascx", "", SecurityAccessLevel.Anonymous, 0);
                AddModuleControl(moduleDefId, "Settings", "Search Results Settings", "DesktopModules/Admin/SearchResults/Settings.ascx", "", SecurityAccessLevel.Edit, 0);

                //Add the Search Module/Page to all configured portals
                AddSearchResults(moduleDefId);
            }

            // add the site wizard module to the admin tab
            if (CoreModuleExists("SiteWizard") == false)
            {
                moduleDefId = AddModuleDefinition("SiteWizard", "The Administrator can use this user-friendly wizard to set up the common Extensions of the Portal/Site.", "Site Wizard");
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/SiteWizard/Sitewizard.ascx", "", SecurityAccessLevel.Admin, 0);
                AddAdminPages("Site Wizard", "Configure portal settings, page design and apply a site template using a step-by-step wizard.", "icon_wizard_16px.gif", "icon_wizard_32px.gif", true, moduleDefId, "Site Wizard", "icon_wizard_16px.gif");
            }

            //add Lists module and tab
            if (HostTabExists("Lists") == false)
            {
                moduleDefId = AddModuleDefinition("Lists", "Allows you to edit common lists.", "Lists");
                AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Lists/ListEditor.ascx", "", SecurityAccessLevel.Host, 0);

                //Create New Host Page (or get existing one)
//.........这里部分代码省略.........
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:101,代码来源:Upgrade.cs

示例2: ParseProfileDefinitions

        private static void ParseProfileDefinitions(XmlNode nodeProfileDefinitions, int PortalId)
        {
            var listController = new ListController();
            Dictionary<string, ListEntryInfo> colDataTypes = listController.GetListEntryInfoDictionary("DataType");

            int orderCounter = -1;
            ProfilePropertyDefinition objProfileDefinition;
            bool preferredTimeZoneFound = false;
            foreach (XmlNode node in nodeProfileDefinitions.SelectNodes("//profiledefinition"))
            {
                orderCounter += 2;
                ListEntryInfo typeInfo;
                if (!colDataTypes.TryGetValue("DataType:" + XmlUtils.GetNodeValue(node.CreateNavigator(), "datatype"), out typeInfo))
                {
                    typeInfo = colDataTypes["DataType:Unknown"];
                }
                objProfileDefinition = new ProfilePropertyDefinition(PortalId);
                objProfileDefinition.DataType = typeInfo.EntryID;
                objProfileDefinition.DefaultValue = "";
                objProfileDefinition.ModuleDefId = Null.NullInteger;
                objProfileDefinition.PropertyCategory = XmlUtils.GetNodeValue(node.CreateNavigator(), "propertycategory");
                objProfileDefinition.PropertyName = XmlUtils.GetNodeValue(node.CreateNavigator(), "propertyname");
                objProfileDefinition.Required = false;
                objProfileDefinition.Visible = true;
                objProfileDefinition.ViewOrder = orderCounter;
                objProfileDefinition.Length = XmlUtils.GetNodeValueInt(node, "length");

                switch (XmlUtils.GetNodeValueInt(node, "defaultvisibility", 2))
                {
                    case 0:
                        objProfileDefinition.DefaultVisibility = UserVisibilityMode.AllUsers;
                        break;
                    case 1:
                        objProfileDefinition.DefaultVisibility = UserVisibilityMode.MembersOnly;
                        break;
                    case 2:
                        objProfileDefinition.DefaultVisibility = UserVisibilityMode.AdminOnly;
                        break;
                }

                if (objProfileDefinition.PropertyName == "PreferredTimeZone")
                {
                    preferredTimeZoneFound = true;
                }

                ProfileController.AddPropertyDefinition(objProfileDefinition);
            }

            //6.0 requires the old TimeZone property to be marked as Deleted
            ProfilePropertyDefinition pdf = ProfileController.GetPropertyDefinitionByName(PortalId, "TimeZone");
            if (pdf != null)
            {
                ProfileController.DeletePropertyDefinition(pdf);
            }

            // 6.0 introduced a new property called as PreferredTimeZone. If this property is not present in template
            // it should be added. Situation will mostly happen while using an older template file.
            if (!preferredTimeZoneFound)
            {
                orderCounter += 2;

                ListEntryInfo typeInfo = colDataTypes["DataType:TimeZoneInfo"];
                if (typeInfo == null)
                {
                    typeInfo = colDataTypes["DataType:Unknown"];
                }

                objProfileDefinition = new ProfilePropertyDefinition(PortalId);
                objProfileDefinition.DataType = typeInfo.EntryID;
                objProfileDefinition.DefaultValue = "";
                objProfileDefinition.ModuleDefId = Null.NullInteger;
                objProfileDefinition.PropertyCategory = "Preferences";
                objProfileDefinition.PropertyName = "PreferredTimeZone";
                objProfileDefinition.Required = false;
                objProfileDefinition.Visible = true;
                objProfileDefinition.ViewOrder = orderCounter;
                objProfileDefinition.Length = 0;
                objProfileDefinition.DefaultVisibility = UserVisibilityMode.AdminOnly;
                ProfileController.AddPropertyDefinition(objProfileDefinition);
            }
        }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:81,代码来源:PortalController.cs

示例3: UpgradeToVersion530

        private static void UpgradeToVersion530()
        {
            //update languages module
            int moduleDefId = GetModuleDefinition("Languages", "Languages");
            RemoveModuleControl(moduleDefId, "");
            AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Languages/languageEnabler.ascx", "~/images/icon_language_32px.gif", SecurityAccessLevel.View, 0, "", true);
            AddModuleControl(moduleDefId, "Editor", "", "DesktopModules/Admin/Languages/languageeditor.ascx", "~/images/icon_language_32px.gif", SecurityAccessLevel.View, 0);

            //Add new View Profile module
            moduleDefId = AddModuleDefinition("ViewProfile", "", "ViewProfile", false, false);
            AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/ViewProfile/ViewProfile.ascx", "~/images/icon_profile_32px.gif", SecurityAccessLevel.View, 0);
            AddModuleControl(moduleDefId, "Settings", "Settings", "DesktopModules/Admin/ViewProfile/Settings.ascx", "~/images/icon_profile_32px.gif", SecurityAccessLevel.Edit, 0);

            //Add new Sitemap settings module
            moduleDefId = AddModuleDefinition("Sitemap", "", "Sitemap", false, false);
            AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Sitemap/SitemapSettings.ascx", "~/images/icon_analytics_32px.gif", SecurityAccessLevel.View, 0);
            AddAdminPages("Search Engine Sitemap", "Configure the sitemap for submission to common search engines.", "~/images/icon_analytics_16px.gif", "~/images/icon_analytics_32px.gif", true, moduleDefId, "Search Engine Sitemap", "~/images/icon_analytics_32px.gif");


            //Add new Photo Profile field to Host
            var listController = new ListController();
            Dictionary<string, ListEntryInfo> dataTypes = listController.GetListEntryInfoDictionary("DataType");

            var properties = ProfileController.GetPropertyDefinitionsByPortal(Null.NullInteger);
            ProfileController.AddDefaultDefinition(Null.NullInteger, "Preferences", "Photo", "Image", 0, properties.Count * 2 + 2, UserVisibilityMode.AllUsers, dataTypes);

            string installTemplateFile = string.Format("{0}Template\\UserProfile.page.template", Globals.InstallMapPath);
            string hostTemplateFile = string.Format("{0}Templates\\UserProfile.page.template", Globals.HostMapPath);
            if (File.Exists(installTemplateFile))
            {
                if (!File.Exists(hostTemplateFile))
                {
                    File.Copy(installTemplateFile, hostTemplateFile);
                }
            }
            if (File.Exists(hostTemplateFile))
            {
                ArrayList portals = PortalController.Instance.GetPortals();
                foreach (PortalInfo portal in portals)
                {
                    properties = ProfileController.GetPropertyDefinitionsByPortal(portal.PortalID);

                    //Add new Photo Profile field to Portal
                    ProfileController.AddDefaultDefinition(portal.PortalID, "Preferences", "Photo", "Image", 0, properties.Count * 2 + 2, UserVisibilityMode.AllUsers, dataTypes);

                    //Rename old Default Page template
                    string defaultPageTemplatePath = string.Format("{0}Templates\\Default.page.template", portal.HomeDirectoryMapPath);
                    if (File.Exists(defaultPageTemplatePath))
                    {
                        File.Move(defaultPageTemplatePath, String.Format("{0}Templates\\Default_old.page.template", portal.HomeDirectoryMapPath));
                    }

                    //Update Default profile template in every portal
                    PortalController.Instance.CopyPageTemplate("Default.page.template", portal.HomeDirectoryMapPath);

                    //Add User profile template to every portal
                    PortalController.Instance.CopyPageTemplate("UserProfile.page.template", portal.HomeDirectoryMapPath);

                    //Synchronize the Templates folder to ensure the templates are accessible
                    FolderManager.Instance.Synchronize(portal.PortalID, "Templates/", false, true);

                    var xmlDoc = new XmlDocument();
                    try
                    {
                        // open the XML file
                        xmlDoc.Load(hostTemplateFile);
                    }
                    catch (Exception ex)
                    {
                        Exceptions.Exceptions.LogException(ex);
                    }

                    XmlNode userTabNode = xmlDoc.SelectSingleNode("//portal/tabs/tab");
                    if (userTabNode != null)
                    {
                        string tabName = XmlUtils.GetNodeValue(userTabNode.CreateNavigator(), "name");

                        var userTab = TabController.Instance.GetTabByName(tabName, portal.PortalID) ?? TabController.DeserializeTab(userTabNode, null, portal.PortalID, PortalTemplateModuleAction.Merge);

                        //Update SiteSettings to point to the new page
                        if (portal.UserTabId > Null.NullInteger)
                        {
                            portal.RegisterTabId = portal.UserTabId;
                        }
                        else
                        {
                            portal.UserTabId = userTab.TabID;
                        }
                    }
                    PortalController.Instance.UpdatePortalInfo(portal);

                    //Add Users folder to every portal
                    string usersFolder = string.Format("{0}Users\\", portal.HomeDirectoryMapPath);

                    if (!Directory.Exists(usersFolder))
                    {
                        //Create Users folder
                        Directory.CreateDirectory(usersFolder);

                        //Synchronize the Users folder to ensure the user folder is accessible
//.........这里部分代码省略.........
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:101,代码来源:Upgrade.cs

示例4: AddDefaultDefinitions

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Adds the default property definitions for a portal
        /// </summary>
        /// <param name="portalId">Id of the Portal</param>
        /// -----------------------------------------------------------------------------
        public static void AddDefaultDefinitions(int portalId)
        {
            portalId = GetEffectivePortalId(portalId); 
            
            _orderCounter = 1;
            var listController = new ListController();
            Dictionary<string, ListEntryInfo> dataTypes = listController.GetListEntryInfoDictionary("DataType");

            AddDefaultDefinition(portalId, "Name", "Prefix", "Text", 50, UserVisibilityMode.AllUsers, dataTypes);
            AddDefaultDefinition(portalId, "Name", "FirstName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes);
            AddDefaultDefinition(portalId, "Name", "MiddleName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes);
            AddDefaultDefinition(portalId, "Name", "LastName", "Text", 50, UserVisibilityMode.AllUsers, dataTypes);
            AddDefaultDefinition(portalId, "Name", "Suffix", "Text", 50, UserVisibilityMode.AllUsers, dataTypes);
            AddDefaultDefinition(portalId, "Address", "Unit", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Address", "Street", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Address", "City", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Address", "Region", "Region", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Address", "Country", "Country", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Address", "PostalCode", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Contact Info", "Telephone", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Contact Info", "Cell", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Contact Info", "Fax", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Contact Info", "Website", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Contact Info", "IM", "Text", 50, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Preferences", "Biography", "RichText", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Preferences", "TimeZone", "TimeZone", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Preferences", "PreferredTimeZone", "TimeZoneInfo", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Preferences", "PreferredLocale", "Locale", 0, UserVisibilityMode.AdminOnly, dataTypes);
            AddDefaultDefinition(portalId, "Preferences", "Photo", "Image", 0, UserVisibilityMode.AllUsers, dataTypes);

            //6.0 requires the old TimeZone property to be marked as Deleted
            ProfilePropertyDefinition pdf = GetPropertyDefinitionByName(portalId, "TimeZone");
            if(pdf != null)
            {
                DeletePropertyDefinition(pdf);
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:43,代码来源:ProfileController.cs


注:本文中的DotNetNuke.Common.Lists.ListController.GetListEntryInfoDictionary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。