support OpenDocument Flat Document file type

This commit is contained in:
Sergey Linnik
2017-09-26 13:03:03 +03:00
parent 8e7f7c20e4
commit 16d942a487
12 changed files with 32 additions and 32 deletions

View File

@ -53,7 +53,7 @@ namespace OnlineEditorsExampleMVC.Models
{ {
".doc", ".docx", ".docm", ".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm", ".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps" ".pdf", ".djvu", ".fb2", ".epub", ".xps"
}; };
@ -62,7 +62,7 @@ namespace OnlineEditorsExampleMVC.Models
{ {
".xls", ".xlsx", ".xlsm", ".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm", ".xlt", ".xltx", ".xltm",
".ods", ".csv" ".ods", ".fods", ".csv"
}; };
public static readonly List<string> ExtsPresentation = new List<string> public static readonly List<string> ExtsPresentation = new List<string>
@ -70,7 +70,7 @@ namespace OnlineEditorsExampleMVC.Models
".pps", ".ppsx", ".ppsm", ".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm", ".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm", ".pot", ".potx", ".potm",
".odp" ".odp", ".fodp"
}; };
} }
} }

View File

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

View File

@ -44,7 +44,7 @@ namespace OnlineEditorsExample
{ {
".xls", ".xlsx", ".xlsm", ".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm", ".xlt", ".xltx", ".xltm",
".ods", ".csv" ".ods", ".fods", ".csv"
}; };
public static readonly List<string> ExtsPresentation = new List<string> public static readonly List<string> ExtsPresentation = new List<string>
@ -52,14 +52,14 @@ namespace OnlineEditorsExample
".pps", ".ppsx", ".ppsm", ".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm", ".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm", ".pot", ".potx", ".potm",
".odp" ".odp", ".fodp"
}; };
public static readonly List<string> ExtsDocument = new List<string> public static readonly List<string> ExtsDocument = new List<string>
{ {
".doc", ".docx", ".docm", ".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm", ".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps" ".pdf", ".djvu", ".fb2", ".epub", ".xps"
}; };

View File

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

View File

@ -37,14 +37,14 @@ import java.util.Map;
public class FileUtility public class FileUtility
{ {
static {} static {}
public static FileType GetFileType(String fileName) public static FileType GetFileType(String fileName)
{ {
String ext = GetFileExtension(fileName).toLowerCase(); String ext = GetFileExtension(fileName).toLowerCase();
if (ExtsDocument.contains(ext)) if (ExtsDocument.contains(ext))
return FileType.Text; return FileType.Text;
if (ExtsSpreadsheet.contains(ext)) if (ExtsSpreadsheet.contains(ext))
return FileType.Spreadsheet; return FileType.Spreadsheet;
@ -58,7 +58,7 @@ public class FileUtility
( (
".doc", ".docx", ".docm", ".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm", ".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps" ".pdf", ".djvu", ".fb2", ".epub", ".xps"
); );
@ -67,7 +67,7 @@ public class FileUtility
( (
".xls", ".xlsx", ".xlsm", ".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm", ".xlt", ".xltx", ".xltm",
".ods", ".csv" ".ods", ".fods", ".csv"
); );
public static List<String> ExtsPresentation = Arrays.asList public static List<String> ExtsPresentation = Arrays.asList
@ -75,14 +75,14 @@ public class FileUtility
".pps", ".ppsx", ".ppsm", ".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm", ".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm", ".pot", ".potx", ".potm",
".odp" ".odp", ".fodp"
); );
public static String GetFileName (String url) public static String GetFileName (String url)
{ {
if(url == null) return null; if(url == null) return null;
//for external file url //for external file url
String tempstorage = ConfigManager.GetProperty("files.docservice.url.tempstorage"); String tempstorage = ConfigManager.GetProperty("files.docservice.url.tempstorage");
if(!tempstorage.isEmpty() && url.startsWith(tempstorage)) if(!tempstorage.isEmpty() && url.startsWith(tempstorage))
@ -94,7 +94,7 @@ public class FileUtility
String fileName = url.substring(url.lastIndexOf('/')+1, url.length()); String fileName = url.substring(url.lastIndexOf('/')+1, url.length());
return fileName; return fileName;
} }
public static String GetFileNameWithoutExtension (String url) public static String GetFileNameWithoutExtension (String url)
{ {
String fileName = GetFileName(url); String fileName = GetFileName(url);

View File

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

View File

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

View File

@ -22,7 +22,7 @@
"exampleUrl": null, "exampleUrl": null,
"viewedDocs": [".pdf", ".djvu", ".xps"], "viewedDocs": [".pdf", ".djvu", ".xps"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt"], "editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt"],
"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"], "convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"storageFolder": "files", "storageFolder": "files",
"maxFileSize": 1073741824, "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", "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" presentation: "presentation"
} }
fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"]; fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".csv"]; fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".csv"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp"]; fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp"];
function getUrlParams(url) { function getUrlParams(url) {
try { try {

View File

@ -8,7 +8,7 @@ $GLOBALS['MODE'] = "";
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps"); $GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt"); $GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt");
$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_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".rtf", ".mht", ".html", ".htm", ".epub");
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000"; $GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
@ -25,16 +25,16 @@ $GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|el
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm", $GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm", ".xlt", ".xltx", ".xltm",
".ods", ".csv"); ".ods", ".fods", ".csv");
$GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx", ".ppsm", $GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm", ".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm", ".pot", ".potx", ".potm",
".odp"); ".odp", ".fodp");
$GLOBALS['ExtsDocument'] = array(".doc", ".docx", ".docm", $GLOBALS['ExtsDocument'] = array(".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm", ".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"); ".pdf", ".djvu", ".fb2", ".epub", ".xps");

View File

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

View File

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