コード例 #1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        ///   UpdateWorkFlow updates the currently active Workflow
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="WorkFlowType">The type of workflow (Module | Page | Site)</param>
        /// <param name = "WorkflowID">The ID of the Workflow</param>
        /// <param name="ObjectID">The ID of the object to apply the update to (depends on WorkFlowType)</param>
        /// <param name="ReplaceExistingSettings">Should existing settings be overwritten?</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bool ReplaceExistingSettings)
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            switch (WorkFlowType)
            {
                case "Module":
                    moduleController.UpdateModuleSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    break;
                case "Page":
                    tabController.UpdateTabSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Modules on the current Tab
                        foreach (var kvp in moduleController.GetTabModules(ObjectID))
                        {
                            ClearModuleSettings(kvp.Value);
                        }
                    }
                    break;
                case "Site":
                    PortalController.UpdatePortalSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Tabs aon the Site
                        foreach (var kvp in tabController.GetTabsByPortal(ObjectID))
                        {
                            tabController.DeleteTabSetting(kvp.Value.TabID, "WorkFlowID");
                        }
                        //Get All Modules in the current Site
                        foreach (ModuleInfo objModule in moduleController.GetModules(ObjectID))
                        {
                            ClearModuleSettings(objModule);
                        }
                    }
                    break;
            }
        }
コード例 #2
0
        private void BindPages() {
            ModuleController mc = new ModuleController();
            TabController tc = new TabController();
            TabInfo tabInfo;
            foreach (ModuleInfo moduleInfo in mc.GetModules(PortalId)) {

                if (moduleInfo.DesktopModule.ModuleName.Contains("Social Groups") && moduleInfo.IsDeleted == false) {
                    tabInfo = tc.GetTab(moduleInfo.TabID, PortalId, false);
                    if (tabInfo != null) {
                        if (tabInfo.IsDeleted == false) {

                            foreach (KeyValuePair<string, ModuleDefinitionInfo> def in moduleInfo.DesktopModule.ModuleDefinitions) {
                                if (moduleInfo.ModuleDefinition.FriendlyName == def.Key) {
                                    
                                        if (drpGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null) {
                                            drpGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString()));
                                        }
                                                             

                                    }

                                }
                            }



                        }
                    }
                }
            }
コード例 #3
0
ファイル: CachingProvider.cs プロジェクト: biganth/Curt
        private void ClearPortalCacheInternal(int portalId, bool cascade, bool clearRuntime)
        {
            RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId);

            Dictionary<string, Locale> locales = LocaleController.Instance.GetLocales(portalId);
            if (locales == null || locales.Count == 0)
            {
                //At least attempt to remove default locale
                string defaultLocale = PortalController.GetPortalDefaultLanguage(portalId);
                RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, defaultLocale), clearRuntime);
            }
            else
            {
                foreach (Locale portalLocale in LocaleController.Instance.GetLocales(portalId).Values)
                {
                    RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, portalLocale.Code), clearRuntime);
                }
            }
            if (cascade)
            {
                var objTabs = new TabController();
                foreach (KeyValuePair<int, TabInfo> tabPair in objTabs.GetTabsByPortal(portalId))
                {
                    ClearModuleCacheInternal(tabPair.Value.TabID, clearRuntime);
                }
                var moduleController = new ModuleController();
                foreach (ModuleInfo moduleInfo in moduleController.GetModules(portalId))
                {
                    RemoveCacheKey("GetModuleSettings" + moduleInfo.ModuleID, clearRuntime);
                }
            }
			
            //Clear "portal keys" for Portal
            ClearFolderCacheInternal(portalId, clearRuntime);
            ClearCacheKeysByPortalInternal(portalId, clearRuntime);
            ClearDesktopModuleCacheInternal(portalId, clearRuntime);
            ClearTabCacheInternal(portalId, clearRuntime);

            RemoveCacheKey(String.Format(DataCache.RolesCacheKey, portalId), clearRuntime);
        }
コード例 #4
0
        private void LoadData()
        {
            var moduleController = new ModuleController();
            var tabController = new TabController();
            var currentLocale = LocaleController.Instance.GetCurrentLocale(PortalId);

            TabCollection tabsList = modeButtonList.SelectedValue == "ALL"
                             ? tabController.GetTabsByPortal(PortalId)
                             : tabController.GetTabsByPortal(PortalId).WithCulture(currentLocale.Code, true);

            DeletedTabs = tabsList.Values.Where(tab => tab.IsDeleted)
                                            .OrderBy(tab => tab.TabPath)
                                            .ToList();

            DeletedModules = moduleController.GetModules(PortalId)
                                                .Cast<ModuleInfo>()
                                                .Where(module => module.IsDeleted && (modeButtonList.SelectedValue == "ALL" || module.CultureCode == currentLocale.Code))
                                                .ToList();
        }
コード例 #5
0
		/// <summary>
		/// Loads deleted tabs and modules into the lists 
		/// </summary>
		/// <remarks>
		/// </remarks>
		/// <history>
		/// 	[VMasanas]	18/08/2004	
		///   [VMasanas]  20/08/2004  Update display information for deleted modules to:
		///               ModuleFriendlyName: ModuleTitle - Tab: TabName
		/// </history>
		private void BindData()
		{
			var objModules = new ModuleController();
			var objTabs = new TabController();
			TabInfo objTab;
			ModuleInfo objModule;
			int intModule;

			lstModules.Items.Clear();
			lstTabs.Items.Clear();

			var currentLocale = LocaleController.Instance.GetCurrentLocale(PortalId);

			var arrDeletedTabs = new ArrayList();
			TabCollection tabsList;
			if (modeButtonList.SelectedValue == "ALL")
			{
				tabsList = objTabs.GetTabsByPortal(PortalId);
			}
			else
			{
				tabsList = objTabs.GetTabsByPortal(PortalId).WithCulture(currentLocale.Code, true);
			}

			foreach (var tab in tabsList.Values)
			{
				if (tab.IsDeleted)
				{
					arrDeletedTabs.Add(tab);
				}
			}

			var arrModules = objModules.GetModules(PortalId);
			for (intModule = 0; intModule <= arrModules.Count - 1; intModule++)
			{
				objModule = (ModuleInfo) arrModules[intModule];
				if (objModule.IsDeleted && (modeButtonList.SelectedValue == "ALL" || objModule.CultureCode == currentLocale.Code))
				{
					if (String.IsNullOrEmpty(objModule.ModuleTitle))
					{
						objModule.ModuleTitle = objModule.DesktopModule.FriendlyName;
					}
					var locale = LocaleController.Instance.GetLocale(objModule.CultureCode);
					if (locale != null)
					{
						objTab = objTabs.GetTabByCulture(objModule.TabID, PortalId, locale);
					}
					else
					{
						objTab = objTabs.GetTab(objModule.TabID, PortalId, false);
					}

					if (objTab == null)
					{
						lstModules.Items.Add(new ListItem(objModule.ModuleTitle, objModule.TabID + "-" + objModule.ModuleID));
					}
					else if (objTab.TabID == objModule.TabID)
					{
						lstModules.Items.Add(new ListItem(objTab.TabName + " - " + objModule.ModuleTitle, objModule.TabID + "-" + objModule.ModuleID));
					}
				}
			}
			lstTabs.DataSource = arrDeletedTabs;
			lstTabs.DataBind();

			cmdRestoreTab.Enabled = (arrDeletedTabs.Count > 0);
			cmdDeleteTab.Enabled = (arrDeletedTabs.Count > 0);

			cmdRestoreModule.Enabled = (lstModules.Items.Count > 0);
			cmdDeleteModule.Enabled = (lstModules.Items.Count > 0);

			cmdEmpty.Enabled = arrDeletedTabs.Count > 0 || lstModules.Items.Count > 0;
		}
コード例 #6
0
        private void BindData()
        {
            LocalizeModule();

            // load the pages that have social group modules on them
            var mc = new ModuleController();
            var tc = new TabController();
            TabInfo tabInfo;

            foreach (ModuleInfo moduleInfo in mc.GetModules(PortalId))
            {

                if (moduleInfo.DesktopModule.ModuleName.Contains("Social Groups") && moduleInfo.IsDeleted == false)
                {
                    tabInfo = tc.GetTab(moduleInfo.TabID, PortalId, false);
                    if (tabInfo != null)
                    {
                        if (tabInfo.IsDeleted == false)
                        {

                            foreach (KeyValuePair<string, ModuleDefinitionInfo> def in moduleInfo.DesktopModule.ModuleDefinitions)
                            {
                                if (moduleInfo.ModuleDefinition.FriendlyName == def.Key)
                                {

                                    if (ddlGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null)
                                    {
                                        ddlGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString()));
                                    }

                                }

                            }
                        }

                    }
                }
            }

            // insert a default choice for usability
            ddlGroupViewPage.Items.Insert(0, new ListItem(GetLocalizedString("ddlGroupViewPage.Items.Default")));

            // if there is more than one item in the dropdown list, enable it
            ToggleGroupDetailsList((ddlGroupViewPage.Items.Count == 1));
        }
コード例 #7
0
        //tasks

        /// <summary>
        /// Loads deleted tabs and modules into the lists
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004
        ///   [VMasanas]  20/08/2004  Update display information for deleted modules to:
        ///               ModuleFriendlyName: ModuleTitle - Tab: TabName
        /// </history>
        private void BindData()
        {
            int intTab;
            ArrayList arrDeletedTabs = new ArrayList();
            TabController objTabs = new TabController();
            TabInfo objTab;

            ArrayList arrTabs = objTabs.GetTabs( PortalId );
            for( intTab = 0; intTab <= arrTabs.Count - 1; intTab++ )
            {
                objTab = (TabInfo)arrTabs[intTab];
                if( objTab.IsDeleted == true )
                {
                    arrDeletedTabs.Add( objTab );
                }
            }

            ModuleController objModules = new ModuleController();
            ModuleInfo objModule;
            int intModule;
            ArrayList arrDeletedModules = new ArrayList();

            ArrayList arrModules = objModules.GetModules( PortalId );
            for( intModule = 0; intModule <= arrModules.Count - 1; intModule++ )
            {
                objModule = (ModuleInfo)arrModules[intModule];
                if( objModule.IsDeleted == true )
                {
                    if( objModule.ModuleTitle == "" )
                    {
                        objModule.ModuleTitle = objModule.FriendlyName;
                    }
                    arrDeletedModules.Add( objModule );
                }
            }

            lstTabs.DataSource = arrDeletedTabs;
            lstTabs.DataBind();

            lstModules.DataSource = arrDeletedModules;
            lstModules.DataBind();

            cboTab.DataSource = Globals.GetPortalTabs(PortalSettings.DesktopTabs, -1, false, true, false, false, true);
            cboTab.DataBind();
        }