Introduce some mimetypes for richdocuments

* application/vnd.lotus-wordpro
* application/vnd.visio
* application/vnd.wordperfect
* application/msonenote
This commit is contained in:
Faruk Uzun 2016-01-18 01:38:53 +02:00
parent cd16ba5cb3
commit 6ffd8f3e0d
6 changed files with 59 additions and 1 deletions

View File

@ -17,12 +17,14 @@ OC.MimeTypeList={
"application/json": "text/code", "application/json": "text/code",
"application/msaccess": "file", "application/msaccess": "file",
"application/msexcel": "x-office/spreadsheet", "application/msexcel": "x-office/spreadsheet",
"application/msonenote": "x-office/document",
"application/mspowerpoint": "x-office/presentation", "application/mspowerpoint": "x-office/presentation",
"application/msword": "x-office/document", "application/msword": "x-office/document",
"application/octet-stream": "file", "application/octet-stream": "file",
"application/postscript": "image", "application/postscript": "image",
"application/rss+xml": "application/xml", "application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic", "application/vnd.android.package-archive": "package/x-generic",
"application/vnd.lotus-wordpro": "x-office/document",
"application/vnd.ms-excel": "x-office/spreadsheet", "application/vnd.ms-excel": "x-office/spreadsheet",
"application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet", "application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet", "application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet",
@ -51,6 +53,8 @@ OC.MimeTypeList={
"application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document", "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document",
"application/vnd.visio": "x-office/document",
"application/vnd.wordperfect": "x-office/document",
"application/x-7z-compressed": "package/x-generic", "application/x-7z-compressed": "package/x-generic",
"application/x-cbr": "text", "application/x-cbr": "text",
"application/x-compressed": "package/x-generic", "application/x-compressed": "package/x-generic",

View File

@ -293,6 +293,17 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
self::updateMimetypes($updatedMimetypes); self::updateMimetypes($updatedMimetypes);
} }
private function introduceRichDocumentsMimeTypes() {
$updatedMimetypes = array(
'lwp' => 'application/vnd.lotus-wordpro',
'one' => 'application/msonenote',
'vsd' => 'application/vnd.visio',
'wpd' => 'application/vnd.wordperfect',
);
self::updateMimetypes($updatedMimetypes);
}
/** /**
* Fix mime types * Fix mime types
*/ */
@ -356,5 +367,11 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
$this->emit('\OC\Repair', 'info', array('Fixed rtf mime type')); $this->emit('\OC\Repair', 'info', array('Fixed rtf mime type'));
} }
} }
if (version_compare($ocVersionFromBeforeUpdate, '9.0.0.10', '<')) {
if ($this->introduceRichDocumentsMimeTypes()) {
$this->emit('\OC\Repair', 'info', array('Fixed richdocuments additional office mime types'));
}
}
} }
} }

View File

@ -17,12 +17,14 @@
"application/json": "text/code", "application/json": "text/code",
"application/msaccess": "file", "application/msaccess": "file",
"application/msexcel": "x-office/spreadsheet", "application/msexcel": "x-office/spreadsheet",
"application/msonenote": "x-office/document",
"application/mspowerpoint": "x-office/presentation", "application/mspowerpoint": "x-office/presentation",
"application/msword": "x-office/document", "application/msword": "x-office/document",
"application/octet-stream": "file", "application/octet-stream": "file",
"application/postscript": "image", "application/postscript": "image",
"application/rss+xml": "application/xml", "application/rss+xml": "application/xml",
"application/vnd.android.package-archive": "package/x-generic", "application/vnd.android.package-archive": "package/x-generic",
"application/vnd.lotus-wordpro": "x-office/document",
"application/vnd.ms-excel": "x-office/spreadsheet", "application/vnd.ms-excel": "x-office/spreadsheet",
"application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet", "application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet", "application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet",
@ -51,6 +53,8 @@
"application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document", "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document",
"application/vnd.visio": "x-office/document",
"application/vnd.wordperfect": "x-office/document",
"application/x-7z-compressed": "package/x-generic", "application/x-7z-compressed": "package/x-generic",
"application/x-cbr": "text", "application/x-cbr": "text",
"application/x-compressed": "package/x-generic", "application/x-compressed": "package/x-generic",

View File

@ -76,6 +76,7 @@
"key": ["application/x-iwork-keynote-sffkey"], "key": ["application/x-iwork-keynote-sffkey"],
"keynote": ["application/x-iwork-keynote-sffkey"], "keynote": ["application/x-iwork-keynote-sffkey"],
"kra": ["application/x-krita"], "kra": ["application/x-krita"],
"lwp": ["application/vnd.lotus-wordpro"],
"m2t": ["video/mp2t"], "m2t": ["video/mp2t"],
"m4v": ["video/mp4"], "m4v": ["video/mp4"],
"markdown": ["text/markdown"], "markdown": ["text/markdown"],
@ -106,6 +107,7 @@
"oga": ["audio/ogg"], "oga": ["audio/ogg"],
"ogg": ["audio/ogg"], "ogg": ["audio/ogg"],
"ogv": ["video/ogg"], "ogv": ["video/ogg"],
"one": ["application/msonenote"],
"opus": ["audio/ogg"], "opus": ["audio/ogg"],
"orf": ["image/x-dcraw"], "orf": ["image/x-dcraw"],
"otf": ["application/font-sfnt"], "otf": ["application/font-sfnt"],
@ -154,9 +156,11 @@
"vcard": ["text/vcard"], "vcard": ["text/vcard"],
"vcf": ["text/vcard"], "vcf": ["text/vcard"],
"vob": ["video/dvd"], "vob": ["video/dvd"],
"vsd": ["application/vnd.visio"],
"wav": ["audio/wav"], "wav": ["audio/wav"],
"webm": ["video/webm"], "webm": ["video/webm"],
"woff": ["application/font-woff"], "woff": ["application/font-woff"],
"wpd": ["application/vnd.wordperfect"],
"wmv": ["video/x-ms-wmv"], "wmv": ["video/x-ms-wmv"],
"xcf": ["application/x-gimp"], "xcf": ["application/x-gimp"],
"xla": ["application/vnd.ms-excel"], "xla": ["application/vnd.ms-excel"],

View File

@ -346,6 +346,27 @@ class RepairMimeTypes extends \Test\TestCase {
$this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes); $this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
} }
/**
* Test renaming the richdocuments additional office mime types
*/
public function testRenameRichDocumentsMimeTypes() {
$currentMimeTypes = [
['test.lwp', 'application/octet-stream'],
['test.one', 'application/octet-stream'],
['test.vsd', 'application/octet-stream'],
['test.wpd', 'application/octet-stream'],
];
$fixedMimeTypes = [
['test.lwp', 'application/vnd.lotus-wordpro'],
['test.one', 'application/msonenote'],
['test.vsd', 'application/vnd.visio'],
['test.wpd', 'application/vnd.wordperfect'],
];
$this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
}
/** /**
* Test renaming and splitting old office mime types when * Test renaming and splitting old office mime types when
* new ones already exist * new ones already exist
@ -468,6 +489,10 @@ class RepairMimeTypes extends \Test\TestCase {
['test.hpp', 'text/x-h'], ['test.hpp', 'text/x-h'],
['test.rss', 'application/rss+xml'], ['test.rss', 'application/rss+xml'],
['test.rtf', 'text/rtf'], ['test.rtf', 'text/rtf'],
['test.lwp', 'application/vnd.lotus-wordpro'],
['test.one', 'application/msonenote'],
['test.vsd', 'application/vnd.visio'],
['test.wpd', 'application/vnd.wordperfect'],
]; ];
$fixedMimeTypes = [ $fixedMimeTypes = [
@ -512,6 +537,10 @@ class RepairMimeTypes extends \Test\TestCase {
['test.hpp', 'text/x-h'], ['test.hpp', 'text/x-h'],
['test.rss', 'application/rss+xml'], ['test.rss', 'application/rss+xml'],
['test.rtf', 'text/rtf'], ['test.rtf', 'text/rtf'],
['test.lwp', 'application/vnd.lotus-wordpro'],
['test.one', 'application/msonenote'],
['test.vsd', 'application/vnd.visio'],
['test.wpd', 'application/vnd.wordperfect'],
]; ];
$this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes); $this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);

View File

@ -25,7 +25,7 @@
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades // We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number. // when updating major/minor version number.
$OC_Version = array(9, 0, 0, 9); $OC_Version = array(9, 0, 0, 10);
// The human readable string // The human readable string
$OC_VersionString = '9.0 pre alpha'; $OC_VersionString = '9.0 pre alpha';