better matching of MS Office mime types (in showing file icons and indexing)
authorFotis Stamatelopoulos <fstamatelopoulos@gmail.com>
Wed, 30 Sep 2009 15:47:06 +0000 (18:47 +0300)
committerFotis Stamatelopoulos <fstamatelopoulos@gmail.com>
Wed, 30 Sep 2009 15:47:06 +0000 (18:47 +0300)
src/gr/ebs/gss/client/FileList.java
src/gr/ebs/gss/server/ejb/indexer/IndexerMDBean.java

index 4e6a4a7..8c31104 100644 (file)
@@ -635,11 +635,11 @@ public class FileList extends Composite implements TableListener, ClickListener
                mimetype = mimetype.toLowerCase();\r
                if (mimetype.startsWith("application/pdf"))\r
                        return shared ? images.pdfShared() : images.pdf();\r
-               else if (mimetype.startsWith("application/vnd.ms-excel"))\r
+               else if (mimetype.endsWith("excel"))\r
                        return shared ? images.spreadsheetShared() : images.spreadsheet();\r
-               else if (mimetype.startsWith("application/msword"))\r
+               else if (mimetype.endsWith("msword"))\r
                        return shared ? images.wordprocessorShared() : images.wordprocessor();\r
-               else if (mimetype.startsWith("application/vnd.ms-powerpoint"))\r
+               else if (mimetype.endsWith("powerpoint"))\r
                        return shared ? images.presentationShared() : images.presentation();\r
                else if (mimetype.startsWith("application/zip") ||\r
                                        mimetype.startsWith("application/gzip") ||\r
index dbffa7c..df7af03 100644 (file)
@@ -135,11 +135,11 @@ public class IndexerMDBean implements MessageListener {
                                        type = "text";
                                else if (mime.equals("text/html"))
                                        type = "html";
-                               else if (mime.equals("application/msword"))
+                               else if (mime.endsWith("msword"))
                                        type = "doc";
-                               else if (mime.equals("application/vnd.ms-excel"))
+                               else if (mime.endsWith("ms-excel"))
                                        type = "xls";
-                               else if (mime.equals("application/vnd.ms-powerpoint"))
+                               else if (mime.endsWith("powerpoint"))
                                        type = "ppt";
                                else
                                        nofile = true;