[Yanel-commits] rev 22751 - public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Sat Feb 17 21:25:19 CET 2007


Author: michi
Date: 2007-02-17 21:25:18 +0100 (Sat, 17 Feb 2007)
New Revision: 22751

Modified:
   public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java
Log:
get mime type fixed

Modified: public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java	2007-02-17 20:15:07 UTC (rev 22750)
+++ public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java	2007-02-17 20:25:18 UTC (rev 22751)
@@ -58,9 +58,17 @@
     /**
      *
      */
+    public String getMimeType(String viewId) {
+        if (viewId != null && viewId.equals("source")) return "application/xml";
+        return "application/xhtml+xml";
+    }
+
+    /**
+     *
+     */
     public View getView(String viewId) {
         View view = new View();
-        view.setMimeType("application/xhtml+xml");
+        view.setMimeType(getMimeType(viewId));
         view.setInputStream(new java.io.StringBufferInputStream(getScreen()));
         return view;
     }
@@ -71,9 +79,9 @@
     public ViewDescriptor[] getViewDescriptors() {
         ViewDescriptor[] vd = new ViewDescriptor[2];
         vd[0] = new ViewDescriptor("default");
-        vd[0].setMimeType("application/xhtml+xml");
+        vd[0].setMimeType(getMimeType(null));
         vd[1] = new ViewDescriptor("source");
-        vd[1].setMimeType("application/xml");
+        vd[1].setMimeType(getMimeType("source"));
         return vd;
     }
 




More information about the Yanel-commits mailing list