[Yanel-commits] rev 22381 - in public/yanel/trunk/src/contributions/resources/contact-form: src/java/org/wyona/yanel/impl/resources xslt

josias at wyona.com josias at wyona.com
Fri Feb 2 10:35:55 CET 2007


Author: josias
Date: 2007-02-02 10:35:54 +0100 (Fri, 02 Feb 2007)
New Revision: 22381

Modified:
   public/yanel/trunk/src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/ContactResource.java
   public/yanel/trunk/src/contributions/resources/contact-form/xslt/contact-form.xsl
Log:
fixed issues with contact resource on IE (mimetype and collapsing textarea), further removes border from table. fixes bug #5156, thanks to simon

Modified: public/yanel/trunk/src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/ContactResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/ContactResource.java	2007-02-02 09:27:51 UTC (rev 22380)
+++ public/yanel/trunk/src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/ContactResource.java	2007-02-02 09:35:54 UTC (rev 22381)
@@ -165,7 +165,7 @@
             log.error(e.getMessage(), e);
         }
         View defaultView = new View();
-        defaultView.setMimeType("application/xml");
+        defaultView.setMimeType(getMimeType());
         defaultView.setInputStream(i18nTransformer.getInputStream());
         return defaultView;
     }
@@ -247,16 +247,6 @@
                 path.toString()), getRepositoryFactory());
     }
 
-    /**
-     * 
-     * @param path
-     * @param viewId
-     * @return
-     */
-    private String getMimeType(Path path, String viewId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
     
     /**
      * 
@@ -331,30 +321,12 @@
     }
     
     /**
-     * 
-     * @param path
-     * @return
+     * Get mime type
      */
-    private String getMimeType(Path path) {
-        String mimeType = null;
-        try {
-            java.io.BufferedReader br = new java.io.BufferedReader(rp
-                    .getRepo().getReader(
-                            new org.wyona.yarep.core.Path(new Path(rp
-                                    .getPath().toString()).getRTIPath()
-                                    .toString())));
+    private String getMimeType() {
+        String mimeType = getRTI().getProperty("mime-type");
+        if (mimeType != null) return mimeType;
 
-            while ((mimeType = br.readLine()) != null) {
-                if (mimeType.indexOf("mime-type:") == 0) {
-                    mimeType = mimeType.substring(11);
-                    log.info("*" + mimeType + "*");
-                    return mimeType;
-                }
-            }
-        } catch (Exception e) {
-            log.warn(e);
-        }
-        // NOTE: Assuming fallback re dir2xhtml.xsl ...
         return "application/xhtml+xml";
     }
    

Modified: public/yanel/trunk/src/contributions/resources/contact-form/xslt/contact-form.xsl
===================================================================
--- public/yanel/trunk/src/contributions/resources/contact-form/xslt/contact-form.xsl	2007-02-02 09:27:51 UTC (rev 22380)
+++ public/yanel/trunk/src/contributions/resources/contact-form/xslt/contact-form.xsl	2007-02-02 09:35:54 UTC (rev 22381)
@@ -24,6 +24,20 @@
     <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
         <title><i18n:message key="contact"/></title>
+        <style>
+          table {
+            border-style:hidden !important;
+            border:0px hidden  !important;
+          }
+          td {
+            border-style:hidden !important;
+            border:0px hidden  !important;
+          }
+          tr {
+            border-style:hidden !important;
+            border:0px hidden  !important;
+          }
+        </style>        
       </head>
       
       <body>
@@ -70,7 +84,7 @@
           <tr>
             <td align="right" valign="top" class="contentfield"><i18n:message><xsl:attribute name="key"><xsl:value-of select="$inputName"/></xsl:attribute></i18n:message>:&#0160;</td>
             <td>
-              <textarea rows="8" name="{$inputName}" cols="30" class="box"></textarea>
+              <textarea rows="8" name="{$inputName}" cols="30" class="box">&#160;</textarea>
             </td>
             <td><xsl:if test="@required = 'true'">*</xsl:if></td>
           </tr>
@@ -148,7 +162,7 @@
         <tr>
           <td align="right" valign="top" class="contentfield"><i18n:message key="message"/>:&#0160;</td>
           <td>
-            <textarea rows="8" name="message" cols="30" class="box"><xsl:value-of select="$message"/></textarea>
+            <textarea rows="8" name="message" cols="30" class="box"><xsl:value-of select="$message"/>&#160;</textarea>
           </td>
           <td></td>
         </tr>




More information about the Yanel-commits mailing list