protected override TaskList GetTaskList(IServiceProvider serviceProvider, ModulePageInfo selectedModulePage) { var connection = (Connection)serviceProvider.GetService(typeof(Connection)); var serverManager = new ServerManager(); var siteName = connection.ConfigurationPath.SiteName; var virtualPath = connection.ConfigurationPath.ApplicationPath + connection.ConfigurationPath.FolderPath; BpmOnlineSite site; try { site = new BpmOnlineSite(serverManager, siteName, virtualPath); } catch (Exception) { return(null); } if (site.ConnectionStringsConfig == null) { return(null); } if (_lastConfigPath != connection.ConfigurationPath || _cachedTaskList == null) { _lastConfigPath = connection.ConfigurationPath; _cachedTaskList = new BpmOnlineHomepageTaskList(this, MethodTaskItemUsages.TaskList, site); } return(_cachedTaskList); }
protected override void OnRefresh() { this.taskList = null; this.lastConfigPath = null; base.OnRefresh(); }
public static FtpSite GetFtpSite(ManagementConfigurationPath configPath, ServerManager serverManager) { FtpSite ftpSiteDefaultElement = null; if (configPath.PathType == ConfigurationPathType.Server) { ftpSiteDefaultElement = GetFtpSiteDefaultElement(serverManager.SiteDefaults); } else { Site site = serverManager.Sites[configPath.SiteName]; if (site == null) { WebManagementServiceException exception = new WebManagementServiceException("GetSettingsExceptionError", string.Empty); throw exception; } if (!IsFtpSite(site)) { WebManagementServiceException exception2 = new WebManagementServiceException("SiteIsNotFtpSiteExceptionError", string.Empty); throw exception2; } ftpSiteDefaultElement = GetFtpSiteElement(site); } if (ftpSiteDefaultElement == null) { WebManagementServiceException exception3 = new WebManagementServiceException("GetSettingsExceptionError", string.Empty); throw exception3; } return(ftpSiteDefaultElement); }
public NavigationItem(Connection connection, ManagementConfigurationPath configurationPath, Type pageType, object navigationData) { Connection = connection; ConfigurationPath = configurationPath; PageType = pageType; NavigationData = navigationData; }
protected override TaskList GetTaskList(IServiceProvider serviceProvider, ModulePageInfo selectedModulePage) { this.serviceProvider = serviceProvider; if (!initialised) { initialised = true; var hierarchyService = (HierarchyService)serviceProvider.GetService(typeof(HierarchyService)); hierarchyService.InfoUpdated += (s, e) => OnRefresh(); } Connection connection = (Connection)serviceProvider.GetService(typeof(Connection)); if (connection.ConfigurationPath != lastConfigPath || taskList == null) { taskList = new ManageHostsHomepageTaskList(this, serviceProvider); lastConfigPath = connection.ConfigurationPath; } return(taskList); }
public bool Navigate(Connection connection, ManagementConfigurationPath configurationPath, Type pageType, object navigationData) { var item = new NavigationItem(connection, configurationPath, pageType, navigationData); return(NavigateToItem(item, true)); }
public bool StartConfigurationManagement(ManagementConfigurationPath configurationPath, Type pageType) { return(false); }
public void SetConfigurationPath(ManagementConfigurationPath configurationPath) { ConfigurationPath = configurationPath; }
/// <summary> /// Gets authorization collection for a given site. /// </summary> /// <param name="siteName">Site's name to get authorization collection for.</param> /// <returns>Authorization collection.</returns> public AuthorizationRuleCollection GetAuthorizationRuleCollection(string siteName) { AuthorizationSection section = (AuthorizationSection)FtpHelper.GetAppHostSection(ServerManager, "system.ftpServer/security/authorization", typeof(AuthorizationSection), ManagementConfigurationPath.CreateSiteConfigurationPath(siteName)); AuthorizationRuleCollection rules = section.Rules; if (rules == null) { throw new Exception("ConfigurationError"); } return(rules); }
public static FtpSite GetFtpSite(ManagementConfigurationPath configPath, ServerManager serverManager) { FtpSite ftpSiteDefaultElement = null; if (configPath.PathType == ConfigurationPathType.Server) { ftpSiteDefaultElement = GetFtpSiteDefaultElement(serverManager.SiteDefaults); } else { Site site = serverManager.Sites[configPath.SiteName]; if (site == null) { WebManagementServiceException exception = new WebManagementServiceException("GetSettingsExceptionError", string.Empty); throw exception; } if (!IsFtpSite(site)) { WebManagementServiceException exception2 = new WebManagementServiceException("SiteIsNotFtpSiteExceptionError", string.Empty); throw exception2; } ftpSiteDefaultElement = GetFtpSiteElement(site); } if (ftpSiteDefaultElement == null) { WebManagementServiceException exception3 = new WebManagementServiceException("GetSettingsExceptionError", string.Empty); throw exception3; } return ftpSiteDefaultElement; }
public static ConfigurationSection GetAppHostSection(ServerManager serverManager, string sectionName, Type type, ManagementConfigurationPath configPath) { if ((serverManager == null) || (configPath == null)) { throw new ArgumentNullException("ConfigurationError"); } Configuration applicationHostConfiguration = serverManager.GetApplicationHostConfiguration(); string effectiveConfigurationPath = configPath.GetEffectiveConfigurationPath(ManagementScope.Server); ConfigurationSection section = applicationHostConfiguration.GetSection(sectionName, type, effectiveConfigurationPath); if (section == null) { throw new NullReferenceException("ConfigurationError"); } return section; }
internal void ClearCache() { _lastConfigPath = null; _cachedTaskList = null; }
public static ConfigurationSection GetAppHostSection(ServerManager serverManager, string sectionName, Type type, ManagementConfigurationPath configPath) { if ((serverManager == null) || (configPath == null)) { throw new ArgumentNullException("ConfigurationError"); } Configuration applicationHostConfiguration = serverManager.GetApplicationHostConfiguration(); string effectiveConfigurationPath = configPath.GetEffectiveConfigurationPath(ManagementScope.Server); ConfigurationSection section = applicationHostConfiguration.GetSection(sectionName, type, effectiveConfigurationPath); if (section == null) { throw new NullReferenceException("ConfigurationError"); } return(section); }