support template formats

This commit is contained in:
Sergey Linnik
2017-09-07 14:29:20 +03:00
parent 84f5be3556
commit 8a7193a645
12 changed files with 57 additions and 38 deletions

View File

@ -51,14 +51,17 @@ namespace OnlineEditorsExampleMVC.Models
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".docm", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
};
@ -66,6 +69,7 @@ namespace OnlineEditorsExampleMVC.Models
{
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
};
}

View File

@ -10,8 +10,8 @@
<add key="filesize-max" value="5242880"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.docm|.doc|.odt|.xlsx|.xlsm|.xls|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.odp|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".docm|.doc|.odt|.xlsm|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.edited-docs" value=".docx|.docm|.doc|.dotx|.dotm|.dot|.odt|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.url.storage" value="https://doc.onlyoffice.com/FileUploader.ashx"/>

View File

@ -43,6 +43,7 @@ namespace OnlineEditorsExample
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
};
@ -50,14 +51,17 @@ namespace OnlineEditorsExample
{
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
};
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".docm", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static string GetInternalExtension(string extension)

View File

@ -6,8 +6,8 @@
<add key="storage-path" value=""/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.docm|.doc|.odt|.xlsx|.xlsm|.xls|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.odp|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".docm|.doc|.odt|.xlsm|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.edited-docs" value=".docx|.docm|.doc|.dotx|.dotm|.dot|.odt|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.url.storage" value="https://doc.onlyoffice.com/FileUploader.ashx"/>

View File

@ -56,19 +56,26 @@ public class FileUtility
public static List<String> ExtsDocument = Arrays.asList
(
".docx", ".docm", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
);
public static List<String> ExtsSpreadsheet = Arrays.asList
(
".xls", ".xlsx", ".xlsm", ".ods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
);
public static List<String> ExtsPresentation = Arrays.asList
(
".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".odp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
);

View File

@ -2,8 +2,8 @@ filesize-max=5242880
storage-folder=app_data
files.docservice.viewed-docs=.pdf|.djvu|.xps
files.docservice.edited-docs=.docx|.docm|.doc|.odt|.xlsx|.xlsm|.xls|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.odp|.rtf|.txt|.mht|.html|.htm
files.docservice.convert-docs=.docm|.doc|.odt|.xlsm|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.odp|.rtf|.mht|.html|.htm|.epub
files.docservice.edited-docs=.docx|.docm|.doc|.dotx|.dotm|.dot|.odt|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.txt|.mht|.html|.htm
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub
files.docservice.timeout=120000
files.docservice.url.storage=https://doc.onlyoffice.com/FileUploader.ashx

View File

@ -73,8 +73,8 @@ function key(k) {
};
var getDocumentType = function (ext) {
if (".docx.docm.doc.odt.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.ods.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.odp".indexOf(ext) != -1) return "presentation";
if (".doc.docx.docm.dot.dotx.dotm.odt.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.xlt.xltx.xltm.ods.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.pot.potx.potm.odp".indexOf(ext) != -1) return "presentation";
return null;
};

View File

@ -21,8 +21,8 @@
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
"exampleUrl": null,
"viewedDocs": [".pdf", ".djvu", ".xps"],
"editedDocs": [".docx", ".docm", ".doc", ".odt", ".xlsx", ".xlsm", ".xls", ".ods", ".csv", ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".odp", ".rtf", ".txt", ".mht", ".html", ".htm"],
"convertedDocs": [".docm", ".doc", ".odt", ".xlsm", ".xls", ".ods", ".pptm", ".ppt", ".ppsm", ".pps", ".odp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"editedDocs": [".docx", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".csv", ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".potx", ".potm", ".pot", ".pps", ".odp", ".rtf", ".txt", ".mht", ".html", ".htm"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"storageFolder": "files",
"maxFileSize": 1073741824,
"mobileRegEx": "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino",

View File

@ -77,11 +77,11 @@ fileUtility.fileType = {
presentation: "presentation"
}
fileUtility.documentExts = [".docx", ".docm", ".doc", ".odt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".ods", ".csv"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".csv"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".odp"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp"];
function getUrlParams(url) {
try {

View File

@ -6,9 +6,9 @@ $GLOBALS['ALONE'] = FALSE;
$GLOBALS['MODE'] = "";
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf",".djvu",".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx",".docm",".doc",".odt",".xlsx",".xlsm",".xls",".ods",".csv",".pptx",".pptm",".ppt",".ppsx",".ppsm",".pps",".odp",".rtf",".txt",".mht",".html",".htm");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm",".doc",".odt",".xlsm",".xls",".ods",".pptm",".ppt",".ppsm",".pps",".odp",".rtf",".mht",".html",".htm",".epub");
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".csv", ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".potx", ".potm", ".pot", ".pps", ".odp", ".rtf", ".txt", ".mht", ".html", ".htm");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".rtf", ".mht", ".html", ".htm", ".epub");
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
@ -24,15 +24,19 @@ $GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|el
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv");
$GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".odp");
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp");
$GLOBALS['ExtsDocument'] = array(".docx", ".docm", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps");
$GLOBALS['ExtsDocument'] = array(".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps");
if ( !defined('ServiceConverterMaxTry') )
define( 'ServiceConverterMaxTry', 3);

View File

@ -1,10 +1,10 @@
class FileUtility
@@exts_document = %w(.docx .docm .doc .odt .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_document = %w(.doc .docx .docm .dot .dotx .dotm .odt .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .ods .csv)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlt .xltx .xltm .ods .csv)
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .odp)
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .pot .potx .potm .odp)
class << self

View File

@ -36,8 +36,8 @@ module OnlineEditorsExampleRuby
Rails.configuration.timeout=120
Rails.configuration.viewedDocs=".pdf|.djvu|.xps"
Rails.configuration.editedDocs=".docx|.docm|.doc|.odt|.xlsx|.xlsm|.xls|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.odp|.rtf|.txt|.mht|.html|.htm"
Rails.configuration.convertDocs=".docm|.doc|.odt|.xlsm|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.odp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.editedDocs=".docx|.docm|.doc|.dotx|.dotm|.dot|.odt|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.csv|.pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.txt|.mht|.html|.htm"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.urlStorage="https://doc.onlyoffice.com/FileUploader.ashx"
Rails.configuration.urlConverter="https://doc.onlyoffice.com/ConvertService.ashx"