]> matita.cs.unibo.it Git - helm.git/commitdiff
- Stylesheet exceptions now printed in red.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 12 Nov 2001 09:37:39 +0000 (09:37 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 12 Nov 2001 09:37:39 +0000 (09:37 +0000)
- Load of an already loaded stylesheet now ignored (was interpreted as
  reloadin before).
- Version renumbered as 1.2.1beta.

helm/uwobo/build.xml
helm/uwobo/src/it/unibo/cs/helm/uwobo/Server.java
helm/uwobo/src/it/unibo/cs/helm/uwobo/Servlet.java

index 9efec3c7a23d7d9e91e38259520a273f2a855de8..52c3557d0609b406ee371ed955c5224365c94bff 100644 (file)
@@ -4,7 +4,7 @@
 
        <property name="Name" value="Uwobo"/>
        <property name="name" value="uwobo"/>
-       <property name="version" value="1.2.0"/>
+       <property name="version" value="1.2.1beta"/>
        <property name="serialization_dir" value=""/>
 
        <property file=".${name}.properties" />
index 51dbc14c8d1f0ccba476043fcbdc656fa941d1fb..293b2b91ba1a1533dfd75d3d61ce280eda551b54 100644 (file)
@@ -63,7 +63,6 @@ import org.xml.sax.helpers.*;
 public class Server {
        private static class Style implements Serializable {
                public String fileName;
-               public long lastModified;
                public Templates stylesheet;
        };
 
@@ -221,11 +220,9 @@ public class Server {
                    Style style = (Style)hashMap.get(key);
                    if (style.fileName.equals(filename)) {
                       String msg =
-                         "Warning: Stylesheet already loaded. Reloading...";
+                         "Warning: Stylesheet already loaded. Request ignored.";
                       log(msg);
-                      String msg2 = reload(key);
-                      return htmlOfWarning(msg) +
-                         (msg2.equals("") ? "" : "<br />" + msg2);
+                      return htmlOfWarning(msg);
                    } else {
                       String res =
                          "Error: There is already a stylesheet with keyword \""+
@@ -237,7 +234,6 @@ public class Server {
 
                Style style = new Style();
                style.fileName = filename;
-               style.lastModified = new File(filename).lastModified();
                String res = compileStylesheet(style,key);
                 log("done!");
 
@@ -405,7 +401,6 @@ public class Server {
                Style style = (Style)hashMap.get(key);
                if (style != null) {
                   log("reloading \"" + key + "\"... ");
-                  style.lastModified = new File(style.fileName).lastModified();
                    res= compileStylesheet(style,key);
                    log("done!");
                } else {
index 32014063eec7534bc19d5ac7583e1af37b0495f2..d259c3f89f68db1d8c6f48875d897a9a21ab947a 100644 (file)
@@ -142,7 +142,7 @@ public class Servlet extends HttpServlet {
       }
       String local = e.getLocalizedMessage();
       local = local.substring(local.lastIndexOf(':')+1);
-      return "<b>"+message+": "+local+"</b><br />";
+      return "<b style=\"color: red\">"+message+": "+local+"</b><br />";
    }
    
    public void doGet(HttpServletRequest request, HttpServletResponse response)
@@ -175,7 +175,7 @@ public class Servlet extends HttpServlet {
                   if(!log.equals(""))
                      out.println(msg_out(log));
                } catch (TransformerConfigurationException tce) {
-                  out.println(exc_out("stylesheet error", tce));
+                  out.println(exc_out("Stylesheet Error", tce));
                } catch (Exception e) {
                  out.println(exc_out(null, e));
               }
@@ -299,7 +299,7 @@ public class Servlet extends HttpServlet {
                     out.println(msg_out(server.reload(data[i])));
                  }
               } catch (TransformerConfigurationException tce) {
-                  out.println(exc_out("stylesheet error", tce));
+                  out.println(exc_out("Stylesheet Error", tce));
                } catch (Exception e) {
                  out.println(exc_out(null, e));
                }