webdav portal web.config file added to ignore

This commit is contained in:
a.skorina 2015-01-09 11:48:38 +03:00
parent ef0115a1ab
commit 2ec10f6988
4 changed files with 17 additions and 3 deletions

View file

@ -1,14 +1,19 @@
namespace WebsitePanel.WebDavPortal.Config.Entities using System.Collections.Generic;
using System.Linq;
namespace WebsitePanel.WebDavPortal.Config.Entities
{ {
public class ElementsRendering : AbstractConfigCollection public class ElementsRendering : AbstractConfigCollection
{ {
public int DefaultCount { get; private set; } public int DefaultCount { get; private set; }
public int AddElementsCount { get; private set; } public int AddElementsCount { get; private set; }
public List<string> ElementsToIgnore { get; private set; }
public ElementsRendering() public ElementsRendering()
{ {
DefaultCount = ConfigSection.ElementsRendering.DefaultCount; DefaultCount = ConfigSection.ElementsRendering.DefaultCount;
AddElementsCount = ConfigSection.ElementsRendering.AddElementsCount; AddElementsCount = ConfigSection.ElementsRendering.AddElementsCount;
ElementsToIgnore = ConfigSection.ElementsRendering.ElementsToIgnore.Split(',').ToList();
} }
} }
} }

View file

@ -41,7 +41,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
try try
{ {
webDavManager.OpenFolder(pathPart); webDavManager.OpenFolder(pathPart);
IEnumerable<IHierarchyItem> children = webDavManager.GetChildren(); IEnumerable<IHierarchyItem> children = webDavManager.GetChildren().Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/')));
var model = new ModelForWebDav { Items = children.Take(WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount), UrlSuffix = pathPart }; var model = new ModelForWebDav { Items = children.Take(WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount), UrlSuffix = pathPart };
Session[WebDavAppConfigManager.Instance.SessionKeys.ResourseRenderCount] = WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount; Session[WebDavAppConfigManager.Instance.SessionKeys.ResourseRenderCount] = WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount;

View file

@ -24,7 +24,7 @@
<webDavExplorerConfigurationSettings> <webDavExplorerConfigurationSettings>
<!--<userDomain value=""/>--> <!--<userDomain value=""/>-->
<applicationName value="WebDAV Explorer"/> <applicationName value="WebDAV Explorer"/>
<elementsRendering defaultCount="20" addElementsCount="20"/> <elementsRendering defaultCount="20" addElementsCount="20" elementsToIgnoreKey="web.config"/>
<websitePanelConstantUser login="serveradmin" password="HtR7J8dtBhovYLigXNtVutxqpvaE48Z+FBIokWZlR/g=" /> <websitePanelConstantUser login="serveradmin" password="HtR7J8dtBhovYLigXNtVutxqpvaE48Z+FBIokWZlR/g=" />
<sessionKeys> <sessionKeys>
<add key="AccountInfoSessionKey" value="AccountInfo"/> <add key="AccountInfoSessionKey" value="AccountInfo"/>

View file

@ -6,6 +6,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
{ {
private const string DefaultCountKey = "defaultCount"; private const string DefaultCountKey = "defaultCount";
private const string AddElementsCountKey = "addElementsCount"; private const string AddElementsCountKey = "addElementsCount";
private const string ElementsToIgnoreKey = "elementsToIgnoreKey";
[ConfigurationProperty(DefaultCountKey, IsKey = true, IsRequired = true, DefaultValue = 30)] [ConfigurationProperty(DefaultCountKey, IsKey = true, IsRequired = true, DefaultValue = 30)]
public int DefaultCount public int DefaultCount
@ -20,5 +21,12 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
get { return (int)this[AddElementsCountKey]; } get { return (int)this[AddElementsCountKey]; }
set { this[AddElementsCountKey] = value; } set { this[AddElementsCountKey] = value; }
} }
[ConfigurationProperty(ElementsToIgnoreKey, IsKey = true, IsRequired = true, DefaultValue = "")]
public string ElementsToIgnore
{
get { return (string)this[ElementsToIgnoreKey]; }
set { this[ElementsToIgnoreKey] = value; }
}
} }
} }