You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shale.apache.org by cr...@apache.org on 2006/09/12 01:00:47 UTC
svn commit: r442382 - in
/shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2:
DialogContext.java DialogContextManager.java
faces/Dialog2NavigationHandler.java faces/Dialog2PhaseListener.java
Author: craigmcc
Date: Mon Sep 11 16:00:46 2006
New Revision: 442382
URL: http://svn.apache.org/viewvc?view=rev&rev=442382
Log:
Cosmetic changes only ... clean up JavaDoc terminology and formatting.
Modified:
shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java
shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContextManager.java
shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java
shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java
Modified: shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java?view=diff&rev=442382&r1=442381&r2=442382
==============================================================================
--- shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java (original)
+++ shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContext.java Mon Sep 11 16:00:46 2006
@@ -27,7 +27,6 @@
* <p><strong>IMPLEMENTATION NOTE</strong> - Implementations of this interface
* will be stored in session scope, so they should be serializable.</p>
*
- *
* @since 1.0.4
*/
public interface DialogContext {
@@ -50,10 +49,9 @@
public Object getData();
-
/**
* <p>Set the generic data object representing model state for this
- * dialog instance.
+ * dialog instance.</p>
*
* @param data The new data instance
*/
@@ -87,10 +85,10 @@
/**
- * <p>Advance the execution of the state machine underlying this dialog
- * context instance, until an interaction with the user is required. At that
- * point, navigate to that view, call <code>FacesContext.renderResponse()</code>,
- * and return.</p>
+ * <p>Advance the execution of this {@link DialogContext) instance,
+ * until an interaction with the user is required. At that
+ * point, navigate to the appropriate view, call
+ * <code>FacesContext.renderResponse()</code>, and return.</p>
*
* @param context FacesContext for the current request
* @param outcome Logical outcome to use for driving a transition
@@ -104,11 +102,10 @@
/**
- * <p>Start the execution of the state machine underlying this newly
- * created dialog context instance, advancing through states until the
- * dialog definition determines that it is necessary to navigate to a
- * particular JavaServer Faces view. Then, navigate to that view, call
- * <code>FacesContext.renderResponse()</code>, and return.</p>
+ * <p>Start the execution of this {@link DialogContext} instance,
+ * advancing until an interaction with the user is required.
+ * At that point, navigate to the appropriate view, call
+ * <code>FacesContext.renderResopnse()</code>, and return.</p>
*
* @param context FacesContext for the current request
*
@@ -119,8 +116,9 @@
/**
- * <p>Stop the execution of a currently running dialog context instance,
- * resulting in no currently active dialog for the current JSF view.</p>
+ * <p>Stop the execution of this {@link DialogContext} instance,
+ * resulting in no currently active dialog for the current
+ * JavaServer Faces view.</p>
*
* @param context FacesContext for the current request
*
Modified: shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContextManager.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContextManager.java?view=diff&rev=442382&r1=442381&r2=442382
==============================================================================
--- shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContextManager.java (original)
+++ shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/DialogContextManager.java Mon Sep 11 16:00:46 2006
@@ -31,15 +31,15 @@
/**
- * <p>Start a new instance of the specified dialog configuration, returning
- * the newly started instance. This instance will include an
- * <code>id</code> property guaranteed to be unique among all active
- * instances for the current user. It shall also have been stored as
- * a request scope attribute under key <code>Constants.INSTANCE_BEAN</code>.
+ * <p>Create a new instance of the specified dialog configuration, returning
+ * the newly created instance. This instance must contain an
+ * <code>id</code> value that is guaranteed to be unique among all active
+ * instances for the current user. The instance must also have been stored
+ * as a request scope attribute under key <code>Constants.INSTANCE_BEAN</code>.
* The new instance will not be associated with any parent instance.</p>
*
* @param context FacesContext for the current request
- * @param name Logical name of the dialog to be executed
+ * @param name Logical name of the dialog to be created
*
* @exception IllegalArgumentException if no dialog definition
* can be found for the specified logical name
@@ -48,11 +48,11 @@
/**
- * <p>Start a new instance of the specified dialog configuration, returning
- * the newly started instance. This instance will include an
- * <code>id</code> property guaranteed to be unique among all active
- * instances for the current user. It shall also have been stored as
- * a request scope attribute under key <code>Constants.INSTANCE_BEAN</code>.
+ * <p>Create a new instance of the specified dialog configuration, returning
+ * the newly created instance. This instance must contain an
+ * <code>id</code> value that is guaranteed to be unique among all active
+ * instances for the current user. The instance must also have been stored
+ * as a request scope attribute under key <code>Constants.INSTANCE_BEAN</code>.
* The new instance will be associated with the specified parent instance,
* which must be managed by this {@link DialogContextManager} and therefore
* belong to the same user.</p>
@@ -82,9 +82,8 @@
/**
- * <p>Return the {@link DialogContext} for the specified dialog identifier;
- * otherwise, return null.</p>
- *
+ * <p>Return the {@link DialogContext} instance for the specified identifier
+ * (if any); otherwise, return <code>null</code>.</p>
*
* @param id Dialog identifier for which to return an instance
*/
@@ -92,11 +91,11 @@
/**
- * <p>Remove the specified {@link DialogContext} from the set of active
- * instances for the current user.</p>
+ * <p>Remove the specified {@link DialogContext} instance from the set of
+ * active instances for the current user.</p>
*
*
- * @param instance DialogContext to be removed
+ * @param instance {@link DialogContext} instance to be removed
*/
public void remove(DialogContext instance);
Modified: shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java?view=diff&rev=442382&r1=442381&r2=442382
==============================================================================
--- shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java (original)
+++ shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java Mon Sep 11 16:00:46 2006
@@ -27,10 +27,10 @@
import org.apache.shale.dialog2.DialogContextManager;
/**
- * <p><code>Dialog2NavigationHandler</code> implementation that allows dialogs to
- * be started via a logical outcome that returns with a specified prefix.
- * This is not the only way to start a dialog (applications can also do this
- * programmatically), but it is convenient in many cases.</p>
+ * <p><code>NavigationHandler</code> implementation that allows dialogs to
+ * be created via a logical outcome that returns with a specified prefix.
+ * This is not the only way to start a dialog instance (applications can also
+ * do this programmatically), but it is convenient in many cases.</p>
*
* @since 1.0.4
*/
@@ -78,20 +78,19 @@
* rules are applied:</p>
* <ul>
* <li>If this view is <strong>NOT</strong> currently executing
- * a dialog {@link DialogContext}:
+ * a {@link DialogContext} instance:
* <ul>
- * <li>If the logical outcome begins with the prefix identified
- * by <code>Constants.DIALOG_PREFIX</code>, create a new
- * dialog and advance its progress until it returns a
- * view identifier that should be displayed. A corresponding
- * view is created, and control is returned to the application.</li>
- * <li>Otherwise, delegate control to the original navigation
- * handler passed to our constructor.</li>
+ * <li>If the logical outcome begins with the prefix identified
+ * by <code>Constants.DIALOG_PREFIX</code>, create and start
+ * a new {@link DialogContext} instance for a logical name
+ * based on the remainder of the logical outcome after the
+ * prefix.</p>
+ * <li>Otherwise, delegate control to the original navigation
+ * handler passed to our constructor.</li>
* </ul></li>
- * <li>If this view is currently executing a {@link DialogContext},
- * advance its progress until it returns a view identifier that should
- * be displayed. A corresponding view is created, and control is
- * returned to the application.</li>
+ * <li>If this view is currently executing a {@link DialogContext}
+ * instance, advance its progress based on the specified logical
+ * outcome.</p>
* </ul>
*
*
Modified: shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java?view=diff&rev=442382&r1=442381&r2=442382
==============================================================================
--- shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java (original)
+++ shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java Mon Sep 11 16:00:46 2006
@@ -31,7 +31,10 @@
/**
* <p>Phase listener that saves and restores the dialog identifier for the
- * currently active dialog, if any.</p>
+ * currently active dialog, if any. Based on the presence of certain
+ * request parameters, it can also cause a new {@link DialogContext}
+ * instance to be created and started, optionally associated with a parent
+ * {@link DialogContext} instance also belonging to the same user.</p>
*
* @since 1.0.4
*/
@@ -74,8 +77,9 @@
/**
* <p>After the <em>Restore View</em> phase, retrieve the current
* dialog identifier (if any), and restore the corresponding
- * {@link DialogContext}.</p>
- *
+ * {@link DialogContext}. If this view is not currently executing
+ * a {@link DialogContext} instance, optionally create a new
+ * instance based o the presence of request parameters.</p>
*
* @param event The phase event to be processed
*/
@@ -178,12 +182,13 @@
getRequestParameterMap().get(Constants.PARENT_ID);
if (dialogName != null) {
+ // Create a new DialogContext instance
DialogContext dcontext = create(context, dialogName, parentId);
if (dcontext == null) {
return;
}
- // Start the new DialogContext and navigate to the requested view
+ // Start the new DialogContext instance
dcontext.start(context);
if (log.isDebugEnabled()) {
log.debug("afterPhase() creating dialog context with id '"