WebDAV Settings

WebDAV Settings

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings.WebDAV
  • Sitecore.Data.Items.Item
  • Sitecore.StringUtil

WebDAV Settings C# Web Control Code

Sitecore.Data.Items.Item item = this.GetItem();
if (item == null) return;

string associateUsernameWithLink = Sitecore.Configuration.Settings.WebDAV.AssociateUsernameWithLink.ToString();
string webdavEnabled = Sitecore.Configuration.Settings.WebDAV.Enabled.ToString();
string engineLogLevel = Sitecore.Configuration.Settings.WebDAV.EngineLogLevel;
string fileDropAreaMediaLocation = Sitecore.Configuration.Settings.WebDAV.FileDropAreaMediaLocation;
string webdavFolder = Sitecore.Configuration.Settings.WebDAV.Folder;
string webdavLicenseFile = Sitecore.Configuration.Settings.WebDAV.LicenseFile;
string mediaHandlerPrefix = Sitecore.Configuration.Settings.WebDAV.MediaHandlerPrefix;
string promptWhenUserNameUnknown = Sitecore.Configuration.Settings.WebDAV.PromptWhenUsernameUnknown.ToString();
string urlDisplayName = Sitecore.Configuration.Settings.WebDAV.URLDisplayName;

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
string displayName = Sitecore.StringUtil.GetString(item.DisplayName, item.Name);
//using : for colon and ? for question mark and   for space
output.Write("{0}: {1}", "Item", displayName);
output.RenderEndTag(); //P

output.Write("{0}&#63;&#160;{1}", "Associate Username With Link", "<b>" + associateUsernameWithLink + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "WebDAV Enabled", "<b>" + webdavEnabled + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Engine Log Level", "<b>" + engineLogLevel + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "File Drop Area Media Location", "<b>" + fileDropAreaMediaLocation + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "WebDAV Folder", "<b>" + webdavFolder + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "WebDAV License File", "<b>" + webdavLicenseFile + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "WebDAV Media Handler Prefix", "<b>" + mediaHandlerPrefix + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "Prompt When Username Unknown", "<b>" + promptWhenUserNameUnknown + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "WebDAV URL Display Name", "<b>" + urlDisplayName + "</b>");
output.RenderEndTag(); //Div


WebDAV Settings C# Web Control Output

Associate Username With Link? Undefined
WebDAV Enabled? True
Engine Log Level: Off
File Drop Area Media Location: /sitecore/media library
WebDAV Folder: /sitecore_files
WebDAV License File: C:\Inetpub\wwwroot\TIC66Live\Data\\webdav.lic
WebDAV Media Handler Prefix: sitecore_webDAV.ashx
Prompt When Username Unknown? True
WebDAV URL Display Name: /media