[Yanel-commits] rev 29165 - public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Fri Nov 23 12:06:23 CET 2007


Author: michi
Date: 2007-11-23 12:06:23 +0100 (Fri, 23 Nov 2007)
New Revision: 29165

Modified:
   public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
Log:
mime-type fixed

Modified: public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
===================================================================
--- public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java	2007-11-23 11:04:31 UTC (rev 29164)
+++ public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java	2007-11-23 11:06:23 UTC (rev 29165)
@@ -33,6 +33,7 @@
 import org.wyona.yanel.core.attributes.translatable.TranslationManager;
 import org.wyona.yanel.core.attributes.versionable.RevisionInformation;
 import org.wyona.yanel.core.attributes.viewable.View;
+import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;
 
 import org.wyona.yanel.core.source.ResourceResolver;
 import org.wyona.yanel.core.transformation.I18nTransformer2;
@@ -155,12 +156,19 @@
      * Get mime type
      */
     public String getMimeType(String viewId) throws Exception {
+        ViewDescriptor viewDescriptor = getViewDescriptor(viewId);
+        String mimeType;
+        if (viewDescriptor != null) {
+            mimeType = viewDescriptor.getMimeType();
+            if (mimeType != null) return mimeType;
+        }
+
         if (viewId != null && viewId.equals(SOURCE_VIEW_ID)) {
-            String mimeType = getResourceConfigProperty("source-view-mime-type");
+            mimeType = getResourceConfigProperty("source-view-mime-type");
             if (mimeType != null) return mimeType;
         }
 
-        String mimeType = getResourceConfigProperty("mime-type");
+        mimeType = getResourceConfigProperty("mime-type");
         if (mimeType != null) return mimeType;
 
         String suffix = PathUtil.getSuffix(getPath());



More information about the Yanel-commits mailing list