예제 #1
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
 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);
        }
예제 #6
0
        public bool Navigate(Connection connection, ManagementConfigurationPath configurationPath, Type pageType, object navigationData)
        {
            var item = new NavigationItem(connection, configurationPath, pageType, navigationData);

            return(NavigateToItem(item, true));
        }
예제 #7
0
 public bool StartConfigurationManagement(ManagementConfigurationPath configurationPath, Type pageType)
 {
     return(false);
 }
예제 #8
0
 public void SetConfigurationPath(ManagementConfigurationPath configurationPath)
 {
     ConfigurationPath = configurationPath;
 }
예제 #9
0
        /// <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);
        }
예제 #10
0
 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;
 }
예제 #11
0
        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;
        }
예제 #12
0
 internal void ClearCache()
 {
     _lastConfigPath = null;
     _cachedTaskList = null;
 }
예제 #13
0
        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);
        }