]> source.dussan.org Git - nextcloud-server.git/commitdiff
Introduce some mimetypes for richdocuments
authorFaruk Uzun <farukuzun@collabora.com>
Sun, 17 Jan 2016 23:38:53 +0000 (01:38 +0200)
committerFaruk Uzun <farukuzun@collabora.com>
Thu, 4 Feb 2016 11:48:21 +0000 (13:48 +0200)
* application/vnd.lotus-wordpro
* application/vnd.visio
* application/vnd.wordperfect
* application/msonenote

core/js/mimetypelist.js
lib/private/repair/repairmimetypes.php
resources/config/mimetypealiases.dist.json
resources/config/mimetypemapping.dist.json
tests/lib/repair/repairmimetypes.php
version.php

index dea065814d149e74491663806a7d1ed67f24ec53..89c6e8c4d4e098e6eff1689d2ebf91068b3c0a9d 100644 (file)
@@ -17,12 +17,14 @@ OC.MimeTypeList={
     "application/json": "text/code",
     "application/msaccess": "file",
     "application/msexcel": "x-office/spreadsheet",
+    "application/msonenote": "x-office/document",
     "application/mspowerpoint": "x-office/presentation",
     "application/msword": "x-office/document",
     "application/octet-stream": "file",
     "application/postscript": "image",
     "application/rss+xml": "application/xml",
     "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.addin.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.wordprocessingml.document": "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-cbr": "text",
     "application/x-compressed": "package/x-generic",
index 692a7120a630ec250150ec003c00325768ca2972..b84f19a3082f4f71105f2a8b5e266bf4b99cbe12 100644 (file)
@@ -293,6 +293,17 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
                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
         */
@@ -356,5 +367,11 @@ class RepairMimeTypes extends BasicEmitter implements \OC\RepairStep {
                                $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'));
+                       }
+               }
        }
 }
index ed471f228e20f1276810666e442f0f50bc5b5606..545d4b0c3997f6188d65d54e2f080eb298c35295 100644 (file)
        "application/json": "text/code",
        "application/msaccess": "file",
        "application/msexcel": "x-office/spreadsheet",
+       "application/msonenote": "x-office/document",
        "application/mspowerpoint": "x-office/presentation",
        "application/msword": "x-office/document",
        "application/octet-stream": "file",
        "application/postscript": "image",
        "application/rss+xml": "application/xml",
        "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.addin.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.wordprocessingml.document": "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-cbr": "text",
        "application/x-compressed": "package/x-generic",
index e26ec7038b17dd1b9dffd61ad0e3c0e1ef3b1dd9..d08a46bb017d505cc3dd90abef734f807186b142 100644 (file)
@@ -76,6 +76,7 @@
        "key": ["application/x-iwork-keynote-sffkey"],
        "keynote": ["application/x-iwork-keynote-sffkey"],
        "kra": ["application/x-krita"],
+       "lwp": ["application/vnd.lotus-wordpro"],
        "m2t": ["video/mp2t"],
        "m4v": ["video/mp4"],
        "markdown": ["text/markdown"],
        "oga": ["audio/ogg"],
        "ogg": ["audio/ogg"],
        "ogv": ["video/ogg"],
+       "one": ["application/msonenote"],
        "opus": ["audio/ogg"],  
        "orf": ["image/x-dcraw"],
        "otf": ["application/font-sfnt"],
        "vcard": ["text/vcard"],
        "vcf": ["text/vcard"],
        "vob": ["video/dvd"],
+       "vsd": ["application/vnd.visio"],
        "wav": ["audio/wav"],
        "webm": ["video/webm"],
        "woff": ["application/font-woff"],
+       "wpd": ["application/vnd.wordperfect"],
        "wmv": ["video/x-ms-wmv"],
        "xcf": ["application/x-gimp"],
        "xla": ["application/vnd.ms-excel"],
index 1bdaa9a2dbf84e68518cf4ee496e34574966ac08..a9ebb7bc88ac442693f3c638226e7a9908bde54d 100644 (file)
@@ -346,6 +346,27 @@ class RepairMimeTypes extends \Test\TestCase {
                $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
         * new ones already exist
@@ -468,6 +489,10 @@ class RepairMimeTypes extends \Test\TestCase {
                        ['test.hpp', 'text/x-h'],
                        ['test.rss', 'application/rss+xml'],
                        ['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 = [
@@ -512,6 +537,10 @@ class RepairMimeTypes extends \Test\TestCase {
                        ['test.hpp', 'text/x-h'],
                        ['test.rss', 'application/rss+xml'],
                        ['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);
index f807b01d7d047a21f7e12122dfcf3dfad6d3af03..44bddca070085914f82ad1d1a652caee52d2719b 100644 (file)
@@ -25,7 +25,7 @@
 // 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
 // when updating major/minor version number.
-$OC_Version = array(9, 0, 0, 9);
+$OC_Version = array(9, 0, 0, 10);
 
 // The human readable string
 $OC_VersionString = '9.0 pre alpha';