[Yanel-commits] rev 44519 - public/yanel/trunk/src/core/java/org/wyona/yanel/core

michi at wyona.com michi at wyona.com
Tue Sep 1 09:58:29 CEST 2009


Author: michi
Date: 2009-09-01 09:58:29 +0200 (Tue, 01 Sep 2009)
New Revision: 44519

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java
Log:
javadoc added and state of view check added

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java	2009-09-01 07:45:06 UTC (rev 44518)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java	2009-09-01 07:58:29 UTC (rev 44519)
@@ -18,13 +18,18 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.wyona.security.core.api.Identity;
 
+import org.apache.log4j.Logger;
+
 /**
  * The environment stores items which belong to the environment from which a resource
  * is called, i.e. the request, the response, the identity, the state of view, and the resource container path.
  */
 public class Environment {
+    private static Logger log = Logger.getLogger(Environment.class);
+
     private HttpServletRequest request;
     private HttpServletResponse response;
     private Identity identity;
@@ -50,10 +55,6 @@
     public HttpServletResponse getResponse() {
         return response;
     }
-
-    public String getStateOfView() {
-        return sov;
-    }
     
     public String getResourceContainerPath() {
     	return rcp;
@@ -63,10 +64,23 @@
         this.rcp = path;
     }
 
+    /**
+     * Set state of view
+     */
     public void setStateOfView(String state) {
+        if (StateOfView.LIVE.equals(state) || StateOfView.AUTHORING.equals(state)) {
+            log.warn("No such state '" + state + "' explicitely supported by Yanel!");
+        }
         this.sov = state;
     }
 
+    /**
+     * Get state of view (LIVE, AUTHORING)
+     */
+    public String getStateOfView() {
+        return sov;
+    }
+
     public void setIdentity(Identity identity) {
         this.identity = identity;
     }
@@ -78,5 +92,4 @@
     public void setResponse(HttpServletResponse response) {
         this.response = response;
     }
-
 }



More information about the Yanel-commits mailing list