Author: craigmcc Date: Sun Jan 8 17:01:56 2006 New Revision: 367148 URL: http://svn.apache.org/viewcvs?rev=367148&view=rev Log: [38185] Basic refactoring ov ShalePhaseListener and ShaleViewHandler into the org.apache.shale.view hierarchy, along with the view-related constants that used to be in ShaleConstants.
Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java (with props) struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java - copied, changed from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java - copied, changed from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Removed: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java struts/shale/trunk/core-library/src/conf/faces-config.xml struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java struts/shale/trunk/xdocs/api-stability.xml Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java (original) +++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java Sun Jan 8 17:01:56 2006 @@ -36,6 +36,7 @@ import org.apache.shale.clay.component.Clay; import org.apache.shale.clay.config.Globals; import org.apache.shale.faces.ShaleConstants; +import org.apache.shale.view.Constants; import org.apache.shale.view.ViewController; import org.apache.shale.view.ViewControllerMapper; import org.apache.shale.view.impl.DefaultViewControllerMapper; @@ -425,7 +426,7 @@ if (mapper == null) { mapper = (ViewControllerMapper) context.getExternalContext().getApplicationMap(). - get(ShaleConstants.VIEW_MAPPER); + get(Constants.VIEW_MAPPER); if (mapper == null) mapper = new DefaultViewControllerMapper(); Modified: struts/shale/trunk/core-library/src/conf/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/faces-config.xml?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/conf/faces-config.xml (original) +++ struts/shale/trunk/core-library/src/conf/faces-config.xml Sun Jan 8 17:01:56 2006 @@ -32,7 +32,7 @@ <faces-config> - <!-- Custom JSF Lifecycle and Evaluator Objects --> + <!-- Custom JSF Application Objects --> <application> <navigation-handler> org.apache.shale.dialog.faces.DialogNavigationHandler @@ -44,16 +44,17 @@ org.apache.shale.faces.ShaleVariableResolver </variable-resolver> <view-handler> - org.apache.shale.faces.ShaleViewHandler + org.apache.shale.view.faces.ViewViewHandler </view-handler> </application> - <!-- Custom JSF PhaseListener Objects --> - <!-- Loaded from shale-remoting.jar now + <!-- Custom JSF Lifecycle Objects --> <lifecycle> + <phase-listener>org.apache.shale.view.faces.ViewPhaseListener</phase-listener> + <!-- Loaded from shale-remoting.jar now <phase-listener>org.apache.shale.remoting.faces.RemotingPhaseListener</phase-listener> - </lifecycle> --> + </lifecycle> <!-- Custom Components --> <component> Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java Sun Jan 8 17:01:56 2006 @@ -26,8 +26,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.shale.faces.ShaleConstants; import org.apache.shale.util.Messages; +import org.apache.shale.view.Constants; import org.apache.shale.view.ViewController; /** @@ -149,10 +149,10 @@ // Schedule this instance for later processing as needed Map map = econtext.getRequestMap(); - List list = (List) map.get(ShaleConstants.VIEWS_INITIALIZED); + List list = (List) map.get(Constants.VIEWS_INITIALIZED); if (list == null) { list = new ArrayList(); - map.put(ShaleConstants.VIEWS_INITIALIZED, list); + map.put(Constants.VIEWS_INITIALIZED, list); } list.add(vc); Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java Sun Jan 8 17:01:56 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import java.net.URL; import javax.faces.FactoryFinder; -import javax.faces.event.PhaseListener; import javax.faces.lifecycle.Lifecycle; import javax.faces.lifecycle.LifecycleFactory; import javax.servlet.Filter; @@ -44,6 +43,7 @@ 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.ViewControllerMapper; @@ -154,14 +154,14 @@ "org/apache/shale/faces/shale-config.xml"; - /** - * <p>The 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> - */ + /** + * <p>The 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> + */ public static final String VIEW_CONTROLLER_MAPPER = - "org.apache.shale.VIEW_CONTROLLER_MAPPER"; + "org.apache.shale.view.VIEW_CONTROLLER_MAPPER"; /** @@ -194,12 +194,6 @@ ShaleApplicationFilter.class.getClassLoader()); - /** - * <p>The JSF <code>PhaseListener</code> that we have registered.</p> - */ - private PhaseListener phaseListener = null; - - // ---------------------------------------------------------- Filter Methods @@ -222,10 +216,6 @@ } // Clean up JavaServer Faces integration linkages - if (phaseListener != null) { - getLifecycle().removePhaseListener(phaseListener); - } - phaseListener = null; context = null; catalog = null; @@ -314,9 +304,7 @@ log.info(messages.getMessage("filter.initializing")); context = config.getServletContext(); - phaseListener = new ShalePhaseListener(); - getLifecycle().addPhaseListener(phaseListener); - context.setAttribute(ShaleConstants.VIEW_MAPPER, + context.setAttribute(Constants.VIEW_MAPPER, getViewControllerMapper()); // Look up the "shale" catalog and ensure "standard" is defined Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java Sun Jan 8 17:01:56 2006 @@ -62,29 +62,4 @@ public static final String TOKENS = "org.apache.shale.TOKENS"; - /** - * <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.faces.VIEW_MAPPER"; - - - /** - * <p>Request scope attribute under which the [EMAIL PROTECTED] ViewController} - * for the view that will actually be rendered (if any) is stored.</p> - */ - public static final String VIEW_RENDERED = - "org.apache.shale.faces.VIEW_RENDERED"; - - - /** - * <p>Request scope attribute under which a <code>List</code> - * containing all [EMAIL PROTECTED] ViewController}s that have been initialized - * for the current request are stored.</p> - */ - public static final String VIEWS_INITIALIZED = - "org.apache.shale.faces.VIEWS_INITIALIZED"; } Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java?rev=367148&view=auto ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java Sun Jan 8 17:01:56 2006 @@ -0,0 +1,64 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.shale.view; + +/** + * <p>Manifest constants related to Shale view support.</p> + */ +public class Constants { + + + // ------------------------------------------------------------ Constructors + + + /** + * <p>Private constructor to avoid instantiation.</p> + */ + private Constants() {} + + + // ------------------------------------------------------ Manifest Constants + + + /** + * <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"; + + + /** + * <p>Request scope attribute under which the [EMAIL PROTECTED] ViewController} + * for the view that will actually be rendered (if any) is stored.</p> + */ + public static final String VIEW_RENDERED = + "org.apache.shale.view.VIEW_RENDERED"; + + + /** + * <p>Request scope attribute under which a <code>List</code> + * containing all [EMAIL PROTECTED] ViewController}s that have been initialized + * for the current request are stored.</p> + */ + public static final String VIEWS_INITIALIZED = + "org.apache.shale.view.VIEWS_INITIALIZED"; + + +} Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Copied: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java (from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java) URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java?p2=struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java&p1=struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java&r1=367129&r2=367148&rev=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java Sun Jan 8 17:01:56 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.apache.shale.faces; +package org.apache.shale.view.faces; import java.util.Iterator; import java.util.List; @@ -26,16 +26,18 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.shale.view.Constants; import org.apache.shale.view.ViewController; /** - * <p>[EMAIL PROTECTED] ShalePhaseListener} is a JavaServer Faces <code>PhaseListener</code> - * that implements phase related functionality.</p> + * <p>[EMAIL PROTECTED] ViewPhaseListener} is a JavaServer Faces <code>PhaseListener</code> + * that implements phase related functionality for the view controller + * portion of Shale.</p> * * $Id$ */ -public class ShalePhaseListener implements PhaseListener { +public class ViewPhaseListener implements PhaseListener { // -------------------------------------------------------- Static Variables @@ -44,14 +46,14 @@ /** * <p>The <code>Log</code> instance for this class.</p> */ - private static final Log log = LogFactory.getLog(ShalePhaseListener.class); + private static final Log log = LogFactory.getLog(ViewPhaseListener.class); /** * <p>Request scope attribute under which the [EMAIL PROTECTED] PhaseId} for the * current phase is exposed.</p> */ - public static final String PHASE_ID = "org.apache.shale.faces.PHASE_ID"; + public static final String PHASE_ID = "org.apache.shale.view.PHASE_ID"; // --------------------------------------------------- PhaseListener Methods @@ -125,7 +127,7 @@ private void afterRenderResponse(PhaseEvent event) { Map map = event.getFacesContext().getExternalContext().getRequestMap(); - List list = (List) map.get(ShaleConstants.VIEWS_INITIALIZED); + List list = (List) map.get(Constants.VIEWS_INITIALIZED); if (list == null) { return; } @@ -134,7 +136,7 @@ ViewController vc = (ViewController) vcs.next(); vc.destroy(); } - map.remove(ShaleConstants.VIEWS_INITIALIZED); + map.remove(Constants.VIEWS_INITIALIZED); } @@ -148,7 +150,7 @@ private void afterRestoreView(PhaseEvent event) { Map map = event.getFacesContext().getExternalContext().getRequestMap(); - List list = (List) map.get(ShaleConstants.VIEWS_INITIALIZED); + List list = (List) map.get(Constants.VIEWS_INITIALIZED); if (list == null) { return; } @@ -173,13 +175,12 @@ private void beforeRenderResponse(PhaseEvent event) { Map map = event.getFacesContext().getExternalContext().getRequestMap(); - ViewController vc = (ViewController) - map.get(ShaleConstants.VIEW_RENDERED); + ViewController vc = (ViewController) map.get(Constants.VIEW_RENDERED); if (vc == null) { return; } vc.prerender(); - map.remove(ShaleConstants.VIEW_RENDERED); + map.remove(Constants.VIEW_RENDERED); } Copied: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java (from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java) URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java?p2=struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java&p1=struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java&r1=367129&r2=367148&rev=367148&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java Sun Jan 8 17:01:56 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.apache.shale.faces; +package org.apache.shale.view.faces; import java.io.IOException; import java.util.ArrayList; @@ -33,31 +33,32 @@ 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.ViewController; import org.apache.shale.view.ViewControllerMapper; /** - * <p>[EMAIL PROTECTED] ShaleViewHandler} is a custom implementation of <code>ViewHandler</code> that adds support - * for on-demand creation and configuration of [EMAIL PROTECTED] ViewController} - * instances.</p> + * <p>[EMAIL PROTECTED] ViewViewHandler} is a custom implementation of <code>ViewHandler</code> + * that adds support for on-demand creation and configuration of [EMAIL PROTECTED] ViewController} + * instances, and other view related functionality.</p> * * $Id$ */ -public class ShaleViewHandler extends ViewHandler { +public class ViewViewHandler extends ViewHandler { // ------------------------------------------------------------- Constructor /** - * <p>Create a [EMAIL PROTECTED] ShaleViewHandler} instance that decorates the + * <p>Create a [EMAIL PROTECTED] ViewViewHandler} instance that decorates the * specified <code>ViewHandler</code> provided by the JSF runtime * implementation.</p> * * @param original Original <code>ViewHandler</code> to be decorated */ - public ShaleViewHandler(ViewHandler original) { + public ViewViewHandler(ViewHandler original) { this.original = original; } @@ -68,7 +69,7 @@ /** * <p>Log instance for this class.</p> */ - private static final Log log = LogFactory.getLog(ShaleViewHandler.class); + private static final Log log = LogFactory.getLog(ViewViewHandler.class); /** @@ -76,7 +77,7 @@ */ private static Messages messages = new Messages("org.apache.shale.resources.Bundle", - ShaleViewHandler.class.getClassLoader()); + ViewViewHandler.class.getClassLoader()); // ------------------------------------------------------ Instance Variables @@ -181,7 +182,7 @@ if (mapper == null) { mapper = (ViewControllerMapper) context.getExternalContext().getApplicationMap(). - get(ShaleConstants.VIEW_MAPPER); + get(Constants.VIEW_MAPPER); } return mapper; } @@ -252,11 +253,11 @@ // Schedule this instance for later processing as needed Map map = context.getExternalContext().getRequestMap(); - map.put(ShaleConstants.VIEW_RENDERED, vc); - List list = (List) map.get(ShaleConstants.VIEWS_INITIALIZED); + map.put(Constants.VIEW_RENDERED, vc); + List list = (List) map.get(Constants.VIEWS_INITIALIZED); if (list == null) { list = new ArrayList(); - map.put(ShaleConstants.VIEWS_INITIALIZED, list); + map.put(Constants.VIEWS_INITIALIZED, list); } list.add(vc); Modified: struts/shale/trunk/xdocs/api-stability.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/xdocs/api-stability.xml?rev=367148&r1=367147&r2=367148&view=diff ============================================================================== --- struts/shale/trunk/xdocs/api-stability.xml (original) +++ struts/shale/trunk/xdocs/api-stability.xml Sun Jan 8 17:01:56 2006 @@ -133,8 +133,10 @@ <td><a href="shale-core/apidocs/org/apache/shale/remote/package-summary.html"> org.apache.shale.remote</a></td> <td>Application</td> - <td>Developing</td> - <td>Consider the current APIs to be experimental.</td> + <td>Deprecated</td> + <td>Use corresponding functionality from package + <a href="shale-core/apidocs/org/apache/shale/remoting/package-summary.html"> + org.apache.shale.remoting</a>.</td> </tr> <tr> <td><a href="shale-core/apidocs/org/apache/shale/renderer/package-summary.html"> @@ -173,8 +175,54 @@ <td>---</td> </tr> <tr> + <td><a href="shale-core/apidocs/org/apache/shale/view/faces/package-summary.html"> + org.apache.shale.view.faces</a></td> + <td>Framework</td> + <td>Developing</td> + <td>---</td> + </tr> + <tr> <td><a href="shale-core/apidocs/org/apache/shale/view/impl/package-summary.html"> org.apache.shale.view.impl</a></td> + <td>Framework</td> + <td>Developing</td> + <td>---</td> + </tr> + </tbody> + </table> + + </subsection> + + <a name="stability-remoting"/> + <subsection name="Packages Delivered in shale-remoting.jar"> + + <table border="1"> + <thead> + <tr> + <th width="30%">Package Name</th> + <th width="10%">Target</th> + <th width="10%">Stability</th> + <th width="50%">Comments</th> + </tr> + </thead> + <tbody> + <tr> + <td><a href="shale-core/apidocs/org/apache/shale/remoting/package-summary.html"> + org.apache.shale.remoting</a></td> + <td>Application</td> + <td>Developing</td> + <td>---</td> + </tr> + <tr> + <td><a href="shale-core/apidocs/org/apache/shale/remoting/faces/package-summary.html"> + org.apache.shale.remoting.faces</a></td> + <td>Framework</td> + <td>Developing</td> + <td>---</td> + </tr> + <tr> + <td><a href="shale-core/apidocs/org/apache/shale/remoting/impl/package-summary.html"> + org.apache.shale.remoting.impl</a></td> <td>Framework</td> <td>Developing</td> <td>---</td> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]