Issue Details (XML | Word | Printable)

Key: SHALE-61
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig McClanahan
Reporter: Rahul Akolkar
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Shale

[shale] Maintaining dialog synchronization when browser navigation buttons are used

Created: 21/Nov/05 01:55 AM   Updated: 23/Jan/07 04:40 PM
Return to search
Component/s: Dialog
Affects Version/s: None
Fix Version/s: 1.0.4

Environment:
Operating System: other
Platform: Other
Issue Links:
Dependency
 

Bugzilla Id: 37571


 Description  « Hide
I thought about making this an enhancement, but based on discussions on the
dev list, it seems there is a fair bit of interest in solving this at the
framework level.

The issue is about maintaining client-server dialog synchronization when
browser's navigation buttons are used while in the midst of a Shale dialog.

More details -- and the proof of concept for one potential approach at
resolving this -- are here:

http://people.apache.org/~rahul/shale/align-dialog/

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #437879 Mon Aug 28 23:48:48 UTC 2006 craigmcc Beginnings of experiments on improving the Dialog functionality in
Shale.

Abstract out the basic interfaces required to operate in a dialog
environment from the implementation of the state machine. The primary
interface is o.a.s.dialog2.Context, which is instantiated (in request
scope) once per active dialog for a user. It plays a similar role to
what Status does in the current implementation (but does not suffer from
"one active dialog per user" problems). In addition, there is a
simplified Dialog2NavigationHandler that utilizes the new approach to
start up a Context based on a logical outcome with a matching prefix,
but it will also be possible to start a dialog instance
programmatically, by interacting with a o.a.s.dialog2.Contexts (note the
trailing "s") instance provided by a state machine implementation.

This API is packaged in a separate package (org.apache.shale.dialog2),
and uses unique attribute keys for everything, so that it should not
interfere with the existing functionality while we are experimenting.
In fact, as you can see from the POM, it has no direct dependency on the
rest of Shale at the moment either. All you'd need to add is this JAR,
plus the state machine implementation for your favorite version (see
upcoming submits).

WARNING: This code has been desk checked, and compiles clean, but has
not been tested for real yet. I'm committing now for feedback on the
design approach, and so we can all experiment.

SHALE-10 SHALE-48 SHALE-61
Files Changed
ADD /shale/sandbox/shale-dialog2/src/main/resources/META-INF
ADD /shale/sandbox/shale-dialog2
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces
ADD /shale/sandbox/shale-dialog2/src/test/resources
ADD /shale/sandbox/shale-dialog2/src/test/java
ADD /shale/sandbox/shale-dialog2/src/main/resources
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache
ADD /shale/sandbox/shale-dialog2/src/main/resources/META-INF/NOTICE.txt
ADD /shale/sandbox/shale-dialog2/pom.xml
ADD /shale/sandbox/shale-dialog2/src/test
ADD /shale/sandbox/shale-dialog2/src/main/resources/META-INF/faces-config.xml
ADD /shale/sandbox/shale-dialog2/src/main
ADD /shale/sandbox/shale-dialog2/src/main/java/org
ADD /shale/sandbox/shale-dialog2/src/main/resources/META-INF/LICENSE.txt
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/Constants.java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2NavigationHandler.java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/Context.java
ADD /shale/sandbox/shale-dialog2/src
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/Contexts.java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale/dialog2/faces/Dialog2PhaseListener.java
ADD /shale/sandbox/shale-dialog2/src/main/java
ADD /shale/sandbox/shale-dialog2/src/main/java/org/apache/shale

Repository Revision Date User Message
ASF #437880 Mon Aug 28 23:51:07 UTC 2006 craigmcc State machine implementation for shale-dialog2 that refactors the
existing machinery to use the new APIs. The new implementation has not
been tested yet.

This implementation was partly done as a proof that the abstracted API
in shale-dialog2 is actually sufficient to implement a version of the
existing functionality, but also might be useful if we decide to stick
with some variant of the existing state machine approach.

SHALE-10 SHALE-48 SHALE-61
Files Changed
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/LegacyContext.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/Position.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/AbstractState.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/ViewStateImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/resources
ADD /shale/sandbox/shale-dialog2-legacy/src/main/resources/META-INF
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache
ADD /shale/sandbox/shale-dialog2-legacy
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/SubdialogStateImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src/test
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/DialogImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src/test/java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/State.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/SubdialogState.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/Dialog.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/ActionStateImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/LegacyContexts.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/ViewState.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org
ADD /shale/sandbox/shale-dialog2-legacy/src/main/resources/META-INF/LICENSE.txt
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/EndStateImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/TransitionImpl.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config/ConfigurationParser.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale
ADD /shale/sandbox/shale-dialog2-legacy/src/test/resources
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy
ADD /shale/sandbox/shale-dialog2-legacy/src/main/resources/META-INF/NOTICE.txt
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/EndState.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/ActionState.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/model/Transition.java
ADD /shale/sandbox/shale-dialog2-legacy/pom.xml
ADD /shale/sandbox/shale-dialog2-legacy/src/main/resources/META-INF/faces-config.xml
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/Globals.java
ADD /shale/sandbox/shale-dialog2-legacy/src/main
ADD /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/config

Repository Revision Date User Message
ASF #437881 Mon Aug 28 23:52:23 UTC 2006 craigmcc Skeleton of support for Jakarta Commons SCXML as a state machine using
the shale-dialog2 abstraction APIs. I got distracted by refactoring the
legacy state machine support so there isn't any meat here yet ... but
that will be the next step.

SHALE-10 SHALE-48 SHALE-61
Files Changed
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale/dialog2
ADD /shale/sandbox/shale-dialog2-scxml/src/test/java
ADD /shale/sandbox/shale-dialog2-scxml/pom.xml
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale
ADD /shale/sandbox/shale-dialog2-scxml/src/test/resources
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org
ADD /shale/sandbox/shale-dialog2-scxml/src/main/resources/META-INF/LICENSE.txt
ADD /shale/sandbox/shale-dialog2-scxml/src/main/resources
ADD /shale/sandbox/shale-dialog2-scxml/src/main/resources/META-INF/NOTICE.txt
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache
ADD /shale/sandbox/shale-dialog2-scxml/src
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale/dialog2/scxml/ScxmlContext.java
ADD /shale/sandbox/shale-dialog2-scxml/src/test
ADD /shale/sandbox/shale-dialog2-scxml/src/main/resources/META-INF/faces-config.xml
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale/dialog2/scxml
ADD /shale/sandbox/shale-dialog2-scxml/src/main
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java
ADD /shale/sandbox/shale-dialog2-scxml/src/main/resources/META-INF
ADD /shale/sandbox/shale-dialog2-scxml
ADD /shale/sandbox/shale-dialog2-scxml/src/main/java/org/apache/shale/dialog2/scxml/ScxmlContexts.java

Repository Revision Date User Message
ASF #437894 Tue Aug 29 00:54:39 UTC 2006 craigmcc Refactor the reading of the configuration files from LegacyContext to
LegacyContexts, because that is where it's going to get encountered first
(in the create() method).

SHALE-10 SHALE-48 SHALE-61
Files Changed
MODIFY /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/LegacyContexts.java
MODIFY /shale/sandbox/shale-dialog2-legacy/src/main/java/org/apache/shale/dialog2/legacy/LegacyContext.java

Repository Revision Date User Message
ASF #487741 Sat Dec 16 00:51:06 UTC 2006 craigmcc Refine the dialog framework APIs as a foundation for improving handling of
browser navigation buttons:

* Provide an "escape hatch" (getOpaqueState/setOpaqueState) such that a
  DialogContext implementation can optionally request that additional
  information be saved and restored with each JSF component tree that
  is rendered. There is a restriction that any such opaque state data
  must be Serializable.

* Modify the two existing implementations to obey the updated API
  contract,but otherwise do nothing at the moment.

* Refactor DialogPhaseListener a bit:

  - Make Constants.CONTEXT_ID_ATTR a private constant in this class.
    This information is a private implementation detail.

  - Create a private beforeRenderResponse() method, parallel to the
    existing afterRestoreView() method, in case we have to deal with
    more phases later. These are private APIs, so no disruption of
    apps can occur

  - Implement the saving and restoring of opaque data, if requested
    by the DialogContext implementation. If saved, it will be stored
    as another generic attribute on the view root component, but (again)
    this is an implementation detail not visible to callers.

SHALE-61
Files Changed
MODIFY /shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/Constants.java
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
MODIFY /shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/faces/DialogPhaseListener.java
MODIFY /shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java
MODIFY /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java

Repository Revision Date User Message
ASF #489271 Thu Dec 21 07:13:45 UTC 2006 craigmcc Implement three strategies for dealing with the back button issues described
in SHALE-61 for saving extra state in the JSF component tree:
* "none" (default) - as before, save nothing
* "top" - save the state name of the topmost stack element, plus the stack
  depth to catch cases where the user crosses subdialog boundaries
* "stack" - save the entire position stack, *including* the user data object
  at each level

Need to document this on the website page, but I believe this is sufficient
support for handling back buttons in dialogs for the "basic" implementation,
for the 1.0.4 upcoming release.
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/Globals.java
MODIFY /shale/framework/trunk/shale-apps/shale-test-dialog-basic/pom.xml
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/Position.java
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java
MODIFY /shale/framework/trunk/shale-apps/shale-test-dialog-basic/src/main/webapp/wizardpage2.jsp
MODIFY /shale/framework/trunk/shale-apps/shale-test-dialog-basic/src/main/webapp/WEB-INF/web.xml

Repository Revision Date User Message
ASF #489275 Thu Dec 21 07:37:50 UTC 2006 craigmcc Document the support for dealing with SHALE-61 issues (back and forward
buttons) that will be present in the 1.0.4 release.
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java

Repository Revision Date User Message
ASF #489732 Fri Dec 22 19:19:24 UTC 2006 rahul Serial version UID for BasicDialogContext.TopState (related to changes for SHALE-61).
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java

Repository Revision Date User Message
ASF #489753 Fri Dec 22 20:46:40 UTC 2006 rahul Better handling of UA navigation buttons usage for shale-dialog-scxml. The opaqueState is fairly lightweight (the current state ID, which is a String). Unlike the basic impl, there are no strategies (since subdialogs are transparent, and the 'none' strategy doesn't really add any value for this impl -- its unreleased, so semantic incompatibilities don't matter).
SHALE-61
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java

Repository Revision Date User Message
ASF #489827 Sat Dec 23 02:20:48 UTC 2006 craigmcc Implement the agreed-upon behavior when setOpaqueData() modifies the current
state. As with the SCXML implementation, this will trigger an onExit event
from the old state and an onEntry event to the new state, but no onTransition
event (since this particular change might not represent a legal transition arc
in a state diagram for the current dialog.

SHALE-61
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java

Repository Revision Date User Message
ASF #489834 Sat Dec 23 02:36:38 UTC 2006 craigmcc Make the default strategy for extended state saving be "top" instead of
"none". This is the most compatible choice with the SCXML implementation,
and should recover the majority of use cases.

SHALE-61
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/site/xdoc/index.xml
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java

Repository Revision Date User Message
ASF #490579 Wed Dec 27 22:32:26 UTC 2006 rahul Catching up on documentation (alas). Added bits for shale-dialog-scxml custom actions (redirect, view), application developer defined custom actions, DTD for dialog-config and authoring best practices. Also fixed a botched conditional in code. Includes docs for:
SHALE-61 SHALE-337 SHALE-347 SHALE-348 SHALE-366

The shale-dialog-scxml docs have become too bulky for one page, need to refactor into a "true" site (post v1.0.4)
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-scxml/src/site/xdoc/index.xml
MODIFY /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java