Author: craigmcc
Date: Sat Sep 30 09:56:02 2006
New Revision: 451610

URL: http://svn.apache.org/viewvc?view=rev&rev=451610
Log:
Clean up APIs (plus some checkstyle warnings) after separating the shale-view
module out of the core library.  Migrate a couple of constants from
FacesContstants (internal implementation) to Constants (available for
application use).

SHALE-299

Modified:
    
shale/framework/trunk/shale-apps/shale-test-core/src/main/java/org/apache/shale/examples/test/core/Status.java
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Status.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/Constants.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/FacesConstants.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/SubviewComponent.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewActionListener.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewControllerCallbacks.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java
    
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/package.html

Modified: 
shale/framework/trunk/shale-apps/shale-test-core/src/main/java/org/apache/shale/examples/test/core/Status.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-core/src/main/java/org/apache/shale/examples/test/core/Status.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-core/src/main/java/org/apache/shale/examples/test/core/Status.java
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-core/src/main/java/org/apache/shale/examples/test/core/Status.java
 Sat Sep 30 09:56:02 2006
@@ -20,6 +20,7 @@
 
 import javax.faces.context.FacesContext;
 import org.apache.shale.view.AbstractViewController;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.faces.FacesConstants;
 
 /**
@@ -38,7 +39,7 @@
     public String getExceptionHandler() {
         FacesContext context = FacesContext.getCurrentInstance();
         Object result = context.getApplication().getVariableResolver().
-                resolveVariable(context, FacesConstants.EXCEPTION_HANDLER);
+                resolveVariable(context, Constants.EXCEPTION_HANDLER);
         if (result == null) {
             return null;
         } else {
@@ -70,7 +71,7 @@
     public String getViewMapper() {
         FacesContext context = FacesContext.getCurrentInstance();
         Object result = context.getApplication().getVariableResolver().
-                resolveVariable(context, FacesConstants.VIEW_MAPPER);
+                resolveVariable(context, Constants.VIEW_MAPPER);
         if (result == null) {
             return null;
         } else {

Modified: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Status.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Status.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Status.java
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Status.java
 Sat Sep 30 09:56:02 2006
@@ -20,6 +20,7 @@
 
 import javax.faces.context.FacesContext;
 import org.apache.shale.view.AbstractViewController;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.faces.FacesConstants;
 
 /**
@@ -38,7 +39,7 @@
     public String getExceptionHandler() {
         FacesContext context = FacesContext.getCurrentInstance();
         Object result = context.getApplication().getVariableResolver().
-                resolveVariable(context, FacesConstants.EXCEPTION_HANDLER);
+                resolveVariable(context, Constants.EXCEPTION_HANDLER);
         if (result == null) {
             return null;
         } else {
@@ -70,7 +71,7 @@
     public String getViewMapper() {
         FacesContext context = FacesContext.getCurrentInstance();
         Object result = context.getApplication().getVariableResolver().
-                resolveVariable(context, FacesConstants.VIEW_MAPPER);
+                resolveVariable(context, Constants.VIEW_MAPPER);
         if (result == null) {
             return null;
         } else {

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/Constants.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/Constants.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/Constants.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/Constants.java
 Sat Sep 30 09:56:02 2006
@@ -16,9 +16,6 @@
 
 package org.apache.shale.view;
 
-import org.apache.shale.view.impl.DefaultViewControllerMapper;
-
-
 /**
  * <p>Manifest constants related to Shale view support that are relevant
  * to applications using Shale.</p>
@@ -60,17 +57,34 @@
 
 
     /**
+     * <p>Application scope attribute under which the
+     * [EMAIL PROTECTED] ExceptionHandler} for handling exceptions is 
stored.</p>
+     */
+    public static final String EXCEPTION_HANDLER =
+      "org$apache$shale$view$EXCEPTION_HANDLER";
+
+
+    /**
      * <p>Name of the context initialization parameter that defines the
      * fully qualified class name of the [EMAIL PROTECTED] 
ViewControllerMapper} to be
      * used is stored.  If not present, the default value is
      * <code>org.apache.shale.view.DefaultViewControllerMapper</code>.</p>
      *
      * @deprecated Replace the application scoped managed bean stored with
-     *  key Constants.VIEW_CONTROLLER_MAPPER_KEY instead
+     *  key Constants.VIEW_MAPPER instead
      */
     public static final String VIEW_CONTROLLER_MAPPER =
       "org.apache.shale.view.VIEW_CONTROLLER_MAPPER";
 
+
+    /**
+     * <p>Application scope attribute under which the
+     * [EMAIL PROTECTED] ViewControllerMapper} for translating view identifiers
+     * to class names of the corresponding [EMAIL PROTECTED] ViewController}
+     * is stored.</p>
+     */
+    public static final String VIEW_MAPPER =
+      "org$apache$shale$view$VIEW_MAPPER";
 
 
 }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/FacesConstants.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/FacesConstants.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/FacesConstants.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/FacesConstants.java
 Sat Sep 30 09:56:02 2006
@@ -44,15 +44,6 @@
 
 
     /**
-     * <p>Application scope attribute under which the
-     * [EMAIL PROTECTED] ExceptionHandler} for handling exceptions is 
stored.</p>
-     */
-    public static final String EXCEPTION_HANDLER =
-      "org$apache$shale$view$EXCEPTION_HANDLER";
-
-
-
-    /**
      * <p>Request scope attribute under which a <code>java.util.List</code>
      * of exceptions accumulated during the current request processing 
lifecycle
      * are accumulated.  If there is no such <code>List</code> present, then
@@ -78,16 +69,6 @@
      */
     public static final String VIEWS_INITIALIZED =
       "org$apache$shale$view$VIEWS_INITIALIZED";
-
-
-    /**
-     * <p>Application scope attribute under which the
-     * [EMAIL PROTECTED] ViewControllerMapper} for translating view identifiers
-     * to class names of the corresponding [EMAIL PROTECTED] ViewController}
-     * is stored.</p>
-     */
-    public static final String VIEW_MAPPER =
-      "org$apache$shale$view$VIEW_MAPPER";
 
 
     /**

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java
 Sat Sep 30 09:56:02 2006
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 import java.util.List;
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
 import javax.servlet.ServletContextAttributeEvent;
 import javax.servlet.ServletContextAttributeListener;
 import javax.servlet.ServletContextEvent;
@@ -41,6 +40,7 @@
 import org.apache.shale.view.AbstractApplicationBean;
 import org.apache.shale.view.AbstractRequestBean;
 import org.apache.shale.view.AbstractSessionBean;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.ExceptionHandler;
 import org.apache.shale.view.ViewController;
 
@@ -784,7 +784,7 @@
         }
         ExceptionHandler handler = (ExceptionHandler)
           context.getApplication().getVariableResolver().resolveVariable
-                (context, FacesConstants.EXCEPTION_HANDLER);
+                (context, Constants.EXCEPTION_HANDLER);
         handler.handleException(exception);
 
     }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/SubviewComponent.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/SubviewComponent.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/SubviewComponent.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/SubviewComponent.java
 Sat Sep 30 09:56:02 2006
@@ -20,19 +20,15 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
 import javax.faces.component.UINamingContainer;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.shale.util.Messages;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.ExceptionHandler;
 import org.apache.shale.view.ViewController;
-import org.apache.shale.view.faces.FacesConstants;
-import org.apache.shale.view.faces.ViewControllerCallbacks;
 
 /**
  * <p>Specialized implementation of <code>UINamingContainer</code> that
@@ -79,6 +75,8 @@
      * if any.</p>
      *
      * @param context <code>FacesContext</code> for the current request
+     *
+     * @exception IOException if an input/output error occurs
      */
     public void encodeBegin(FacesContext context) throws IOException {
 
@@ -213,7 +211,7 @@
         }
         ExceptionHandler handler = (ExceptionHandler)
           context.getApplication().getVariableResolver().resolveVariable
-                (context, FacesConstants.EXCEPTION_HANDLER);
+                (context, Constants.EXCEPTION_HANDLER);
         handler.handleException(exception);
 
     }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewActionListener.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewActionListener.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewActionListener.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewActionListener.java
 Sat Sep 30 09:56:02 2006
@@ -17,9 +17,9 @@
 package org.apache.shale.view.faces;
 
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
 import javax.faces.event.ActionEvent;
 import javax.faces.event.ActionListener;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.ExceptionHandler;
 
 /**
@@ -96,7 +96,7 @@
         }
         ExceptionHandler handler = (ExceptionHandler)
           context.getApplication().getVariableResolver().resolveVariable
-                (context, FacesConstants.EXCEPTION_HANDLER);
+                (context, Constants.EXCEPTION_HANDLER);
         handler.handleException(exception);
 
     }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewControllerCallbacks.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewControllerCallbacks.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewControllerCallbacks.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewControllerCallbacks.java
 Sat Sep 30 09:56:02 2006
@@ -17,6 +17,7 @@
 package org.apache.shale.view.faces;
 
 import javax.faces.context.FacesContext;
+import org.apache.shale.view.Constants;
 import org.apache.shale.view.ExceptionHandler;
 import org.apache.shale.view.ViewController;
 
@@ -98,7 +99,7 @@
         }
         ExceptionHandler handler = (ExceptionHandler)
           context.getApplication().getVariableResolver().resolveVariable
-                (context, FacesConstants.EXCEPTION_HANDLER);
+                (context, Constants.EXCEPTION_HANDLER);
         handler.handleException(exception);
 
     }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java
 Sat Sep 30 09:56:02 2006
@@ -56,6 +56,12 @@
 
 
     /**
+     * <p>HTTP status to report in the exception attributes we set up.</p>
+     */
+    private static final int HTTP_STATUS = 200;
+
+
+    /**
      * <p>Request scope attribute under which the [EMAIL PROTECTED] PhaseId} 
for the
      * current phase is exposed.</p>
      */
@@ -74,16 +80,16 @@
     public void afterPhase(PhaseEvent event) {
 
         if (log.isTraceEnabled()) {
-            log.trace("afterPhase(" + event.getFacesContext() +
-                      "," + event.getPhaseId() + ")");
+            log.trace("afterPhase(" + event.getFacesContext()
+                      + "," + event.getPhaseId() + ")");
         }
         PhaseId phaseId = event.getPhaseId();
         if (PhaseId.RESTORE_VIEW.equals(phaseId)) {
             afterRestoreView(event);
         } else if (PhaseId.INVOKE_APPLICATION.equals(phaseId)) {
             afterInvokeApplication(event);
-        } else if (PhaseId.RENDER_RESPONSE.equals(phaseId) ||
-                   event.getFacesContext().getResponseComplete()) {
+        } else if (PhaseId.RENDER_RESPONSE.equals(phaseId)
+                   || event.getFacesContext().getResponseComplete()) {
             afterRenderResponse(event);
         }
         
event.getFacesContext().getExternalContext().getRequestMap().remove(PHASE_ID);
@@ -100,8 +106,8 @@
     public void beforePhase(PhaseEvent event) {
 
         if (log.isTraceEnabled()) {
-            log.trace("beforePhase(" + event.getFacesContext() +
-                      "," + event.getPhaseId() + ")");
+            log.trace("beforePhase(" + event.getFacesContext()
+                      + "," + event.getPhaseId() + ")");
         }
         PhaseId phaseId = event.getPhaseId();
         
event.getFacesContext().getExternalContext().getRequestMap().put(PHASE_ID, 
phaseId);
@@ -159,7 +165,7 @@
             // container (see Section 9.9.1 of the Servlet Specification)
             ApplicationException exception = new ApplicationException(list);
             Map map = econtext.getRequestMap();
-            map.put("javax.servlet.error.status_code", new Integer(200)); // 
Not an HTTP error
+            map.put("javax.servlet.error.status_code", new 
Integer(HTTP_STATUS)); // Not an HTTP error
             map.put("javax.servlet.error.exception_type", 
ApplicationException.class);
             map.put("javax.servlet.error.message", exception.getMessage());
             map.put("javax.servlet.error.exception", exception);
@@ -291,7 +297,7 @@
         }
         ExceptionHandler handler = (ExceptionHandler)
           context.getApplication().getVariableResolver().resolveVariable
-                (context, FacesConstants.EXCEPTION_HANDLER);
+                (context, Constants.EXCEPTION_HANDLER);
         handler.handleException(exception);
 
     }

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java
 Sat Sep 30 09:56:02 2006
@@ -197,7 +197,7 @@
 
         // Live lookup of the appropriate mapper as a managed bean
         ValueBinding vb = context.getApplication().createValueBinding
-          ("#{" + FacesConstants.VIEW_MAPPER + "}");
+          ("#{" + Constants.VIEW_MAPPER + "}");
         ViewControllerMapper vcm = (ViewControllerMapper) vb.getValue(context);
         return vcm;
 

Modified: 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/package.html
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/package.html?view=diff&rev=451610&r1=451609&r2=451610
==============================================================================
--- 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/package.html
 (original)
+++ 
shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/package.html
 Sat Sep 30 09:56:02 2006
@@ -19,6 +19,7 @@
 <body>
 
 <p>This package contains integration for the Shale view controller facilities
-with standard JavaServer Faces extension points.</p>
+with standard JavaServer Faces extension points.  The classes here are not 
intended
+for general use by applications.</p>
 
 </body>


Reply via email to