OWA settings added to control panel

This commit is contained in:
vfedosevich 2015-05-22 01:17:16 -07:00
parent 9bce727a65
commit ffed3b1350
9 changed files with 128 additions and 31 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
@ -15,18 +16,23 @@ namespace WebsitePanel.WebDavPortal.FileOperations
{
public class FileOpenerManager
{
private readonly IDictionary<string, FileOpenerType> _officeOperationTypes = new Dictionary<string, FileOpenerType>();
private readonly IDictionary<string, FileOpenerType> _operationTypes = new Dictionary<string, FileOpenerType>();
private readonly Lazy<IDictionary<string, FileOpenerType>> _officeOperationTypes = new Lazy<IDictionary<string, FileOpenerType>>(
() =>
{
if (WebDavAppConfigManager.Instance.OfficeOnline.IsEnabled)
{
return
WebDavAppConfigManager.Instance.OfficeOnline.ToDictionary(x => x.Extension,
y => FileOpenerType.OfficeOnline);
}
return new Dictionary<string, FileOpenerType>();
});
public FileOpenerManager()
{
if (WebDavAppConfigManager.Instance.OfficeOnline.IsEnabled)
{
_officeOperationTypes.AddRange(
WebDavAppConfigManager.Instance.OfficeOnline.ToDictionary(x => x.Extension,
y => FileOpenerType.OfficeOnline));
}
_operationTypes.AddRange(
WebDavAppConfigManager.Instance.FileOpener.ToDictionary(x => x.Extension,
y => FileOpenerType.Open));
@ -94,7 +100,7 @@ namespace WebsitePanel.WebDavPortal.FileOperations
get
{
FileOpenerType result;
if (_officeOperationTypes.TryGetValue(fileExtension, out result) && CheckBrowserSupport())
if (_officeOperationTypes.Value.TryGetValue(fileExtension, out result) && CheckBrowserSupport())
{
return result;
}

View file

@ -87,7 +87,7 @@
<add browser="InternetExplorer;IE" version="8" />
<add browser="Safari" version="4" />
</owaSupportedBrowsers>
<officeOnline isEnabled="True" url="https://owa.websitepanel.net" cobaltFileTtl="1" cobaltNewFilePath="~/Content/OwaFiles/New">
<officeOnline cobaltFileTtl="1" cobaltNewFilePath="~/Content/OwaFiles/New">
<add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&amp;" OwaNewFileView="we/wordeditorframe.aspx?new=1&amp;" />
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&amp;" OwaNewFileView="we/wordeditorframe.aspx?new=1&amp;" />
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&amp;" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&amp;" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?new=1&amp;" />