Author: craigmcc
Date: Wed Dec 20 23:37:50 2006
New Revision: 489275

URL: http://svn.apache.org/viewvc?view=rev&rev=489275
Log:
Document the support for dealing with SHALE-61 issues (back and forward
buttons) that will be present in the 1.0.4 release.

Modified:
    
shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
    shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml

Modified: 
shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java?view=diff&rev=489275&r1=489274&r2=489275
==============================================================================
--- 
shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
 (original)
+++ 
shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
 Wed Dec 20 23:37:50 2006
@@ -268,18 +268,18 @@
     public Object getOpaqueState() {
 
         if ("top".equals(strategy())) {
-            if (log().isInfoEnabled()) {
-                log().info("getOpaqueState<top> returns " + new 
TopState(peek().getState().getName(), positions.size()));
+            if (log().isTraceEnabled()) {
+                log().trace("getOpaqueState<top> returns " + new 
TopState(peek().getState().getName(), positions.size()));
             }
             return new TopState(peek().getState().getName(), positions.size());
         } else if ("stack".equals(strategy())) {
-            if (log().isInfoEnabled()) {
-                log().info("getOpaqueStrategy<stack> returns stack of " + 
positions.size());
+            if (log().isTraceEnabled()) {
+                log().trace("getOpaqueStrategy<stack> returns stack of " + 
positions.size());
             }
             return positions;
         } else {
-            if (log().isInfoEnabled()) {
-                log().info("getOpaqueStrategy<none> returns nothing");
+            if (log().isTraceEnabled()) {
+                log().trace("getOpaqueStrategy<none> returns nothing");
             }
             return null;
         }
@@ -292,8 +292,8 @@
 
         if ("top".equals(strategy())) {
             TopState topState = (TopState) opaqueState;
-            if (log().isInfoEnabled()) {
-                log().info("setOpaqueState<top> restores " + topState);
+            if (log().isTraceEnabled()) {
+                log().trace("setOpaqueState<top> restores " + topState);
             }
             if (topState.stackDepth != positions.size()) {
                 throw new IllegalStateException("Restored stack depth expects "
@@ -303,13 +303,13 @@
             Position top = peek();
             top.setState(top.getDialog().findState(topState.stateName));
         } else if ("stack".equals(strategy())) {
-            if (log().isInfoEnabled()) {
-                log().info("setOpaqueState<stack> restores stack of " + 
((List) opaqueState).size());
+            if (log().isTraceEnabled()) {
+                log().trace("setOpaqueState<stack> restores stack of " + 
((List) opaqueState).size());
             }
             positions = (List) opaqueState;
         } else {
-            if (log().isInfoEnabled()) {
-                log().info("setOpaqueState<none> restores nothing");
+            if (log().isTraceEnabled()) {
+                log().trace("setOpaqueState<none> restores nothing");
             }
             ; // Do nothing
         }

Modified: shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml?view=diff&rev=489275&r1=489274&r2=489275
==============================================================================
--- shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml (original)
+++ shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml Wed Dec 20 
23:37:50 2006
@@ -188,6 +188,60 @@
             Shale Dialog Manager</a>.</li>
         </ul>
 
+        <p>In order to address potential issues with the application user using
+        browser navigation buttons (back and forward) within a dialog, it is
+        also possible to configure advanced handling of storing dialog
+        state information across requests, with a context initialization
+        parameter, as follows:</p>
+
+<source>
+&lt;context-param>
+  &lt;param-name>org.apache.shale.dialog.basic.STRATEGY&lt;/param-name>
+  &lt;param-value>xxxxx&lt;/param-value>
+&lt;/context-param>
+</source>
+
+        <p>The possible strategy values, and the use cases under which they are
+        appropriate, are as follows:</p>
+
+        <ul>
+            <li><strong>none</strong> - (Default value) Save no extra 
information.
+                This works best in circumstances when you have users trained 
to not
+                use back and forward navigation buttons, so no extra overhead 
is
+                incurred.</li>
+            <li><strong>top</strong> - Record the <em>state name</em> of the
+                current state such that, if the user uses the back arrow and
+                then resubmits a previously submitted form, the current state
+                will be reset to the recorded one (so that navigation outcomes
+                work as expected).  The <code>data</code> object associated 
with
+                this dialog instance is <strong>not</strong> saved and 
restored.
+                This works best in cases like a multi-page wizard dialog that
+                is collecting data, where resubmitting the same page again only
+                mutates the state within the <code>data</code> object, and does
+                not cause any undesireable changes to the model state of the
+                application (such as submitting a credit card order more than
+                once).  This strategy can not effectively deal with cases where
+                the user has navigated across the start or end of a subdialog,
+                so an exception will be thrown in that scenario.</li>
+            <li><strong>stack</strong> - Record the entire stack of
+                <code>Position</code> information for the current dialog 
instance,
+                including any changes to the <code>data</code> object.  This
+                strategy is best used when you want, when the user presses the
+                back arrow, to "unwind" any changes that the previous form 
submit
+                did to the <code>data</code> object.  This strategy stores the
+                maximum amount of information in the JSF component tree state,
+                so it might have significant memory or network traffic impacts
+                if the size of your <code>data</code> object is large.</li>
+        </ul>
+
+        <p>Note that, no matter which strategy you choose, you can optionally
+        use the "token" facility of the <a href="../shale-core/index.html">
+        Shale Core</a> module to detect duplicate submit attempts on the same
+        form.  If you do this, you will also want to provide a "cancel" command
+        of some sort, with the <code>immediate</code> attribute set to
+        <code>true</code>, to allow the user to get out of a dialog where they
+        have mistakenly tried to submit the same form more than once.</p>
+
       </subsection>
 
     </section>


Reply via email to