[Yanel-commits] rev 55811 - public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet

michi at wyona.com michi at wyona.com
Sun Jan 2 13:09:30 CET 2011


Author: michi
Date: 2011-01-02 13:09:29 +0100 (Sun, 02 Jan 2011)
New Revision: 55811

Modified:
   public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelHTMLUI.java
Log:
check method whether toolbar is suppressed added

Modified: public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelHTMLUI.java
===================================================================
--- public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelHTMLUI.java	2011-01-02 11:54:56 UTC (rev 55810)
+++ public/yanel/trunk/src/webapp/src/java/org/wyona/yanel/servlet/YanelHTMLUI.java	2011-01-02 12:09:29 UTC (rev 55811)
@@ -30,6 +30,9 @@
 
     private static Logger log = Logger.getLogger(YanelHTMLUI.class);
 
+    /**
+     *
+     */
     YanelHTMLUI(Map map, String reservedPrefix) {
         this.reservedPrefix = reservedPrefix;
         this.map = map;
@@ -250,6 +253,7 @@
         if (toolbarStatus != null && toolbarStatus.equals("on")) {
             String yanelToolbar = request.getParameter(TOOLBAR_PARAM_NAME);
             if (yanelToolbar != null && request.getParameter(TOOLBAR_PARAM_NAME).equals("suppress")) {
+                log.info("Toolbar is actually enabled but suppressed.");
                 return false;
             }
             return true;
@@ -257,4 +261,18 @@
         return false;
     }
 
+    /**
+     * Checks whether toolbar is suppressed.
+     */
+    boolean isToolbarSuppressed(HttpServletRequest request) {
+        String toolbarStatus = (String) request.getSession(true).getAttribute(TOOLBAR_KEY);
+        if (toolbarStatus != null && toolbarStatus.equals("on")) {
+            String yanelToolbar = request.getParameter(TOOLBAR_PARAM_NAME);
+            if (yanelToolbar != null && request.getParameter(TOOLBAR_PARAM_NAME).equals("suppress")) {
+                return true;
+            }
+            return false;
+        }
+        return false;
+    }
 }



More information about the Yanel-commits mailing list