Issue Details (XML | Word | Printable)

Key: SHALE-48
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: sean schofield
Votes: 3
Watchers: 1
Operations

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

[shale] Serious issue with dialog state

Created: 26/May/05 03:11 AM   Updated: 23/Jan/07 04:40 PM
Component/s: Dialog
Affects Version/s: None
Fix Version/s: 1.0.4

Environment:
Operating System: other
Platform: PC
Issue Links:
Reference
 

Bugzilla Id: 35066


 Description  « Hide
Consider the following example:

Start up the usecases example and begin creating a new profile. Stop when you
get to page 2. Now open a new tab (use Firefox) and click the logon dialog
again. You get an exception:

java.lang.IllegalArgumentException: Position[dialogName=Edit
Profile,stateName=Page 2],outcome=dialog:Log On

This is because you have initiated the same dialog without finishing the
previous dialog. This is not as crazy of a test as it might seem. Consider
what would happen if you opened the dialog in popup window (instead of a browser
tab) and the user closed the window prematurely ... same problem.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
sean schofield added a comment - 01/Jun/05 03:46 AM
Any thoughts on this one?

sean schofield added a comment - 28/Jun/05 04:55 AM
Why can't we do something like getExternalContext().getSessionMap().put
(Globals.STATUS,null) before calling the start action. Maybe there are some
issues involved with sub dialogs but IMO some solution should be found to this
problem.

Craig McClanahan added a comment - 02/Jul/05 11:52 AM
The underlying issue is broader than just trying to have two copies of the same
dialog running ... the current code doesn't support two simultaneous dialogs
(same or not). That will become attractive both in a Tiles world (where you
might well want a dialog running in each tile) and for things like a popup that
runs its own dialog without disrupting the dialog being run by the underlying
window.

An overall solution to running multiple dialogs simultaneously should address
this particular use case, plus a lot more.

Craig McClanahan added a comment - 29/Aug/05 02:51 PM
The issues raised in this ticket are the tip of the iceberg on a bunch of
improvements that are needed to the dialog facility with regards to
simultaneously active dialogs by the same user, and the back button. Deferring
those to a post-1.0.0 milestone (but not forgetting them), so they can be
addressed all at the same time.

sean schofield added a comment - 27/Sep/05 07:55 AM
I mentioned a possible solution on the dev list a while back but didn't get any
comments. I also discovered a new problem that I wasn't aware of. I'll add it
again here so we don't lost track of it.

If you are running a dialog in a popup window (very likely) or within a Tile
(also likely) your command links outside of the dialog are completely hosed by
DialogNavigationHandler. DialogNavigationHandler assumes that everything is
part of the dialog sequence as long as there is a non-null status/position.

One possible way out of this is to use something like "dialogName:" in your
actions. So to launch a dialog named Foo you would use action="Foo:". The
dialog navigation handler would check to see if there is a dialog named "Foo"
available and if so, then launch it.

For navigation inside the dialog, you would need to prepend your dialog name to
the actions. So your next and previous buttons in the Foo dialog would have
actions of "Foo:next" and "Foo:prev". The transitions in dialog-config would be
simple "next" and "foo" and DialogNavigationHandler would know what to do
because of the dialog name prefix.

I haven't worked out all of the details but perhaps there could be custom
commandLink and commandButton components that could add the appropriate prefixes
to the actions. Anyways, those are some thoughts.

sean schofield added a comment - 27/Sep/05 10:39 PM
A few more thoughts on my proposed solution. Rather than using the dialog name,
I am thinking the dialogs and their transitions should be identifiable according
to "context" (or perhaps scope, thread, track or some other word that describes
the concept.) So basically if you want to have two or more dialogs running at
the same time, you just initiate one with dialog:FooStep and the other with
dialog2:BarStep.

DialogNavigationHandler will assume anything before the ":" refers to a
particular dialog scope (I know scope isn't the right word exactly but its the
best I can do for now.) This doesn't rule out using regular faces navigation
rules with a ":" in them, if there is no such dialog then navigation will be
delegated. This way dialog positions can be stored in a map with this scope
name as the key. You can also clear the status/position information
automatically when launching a dialog (in case the dialog was a popup and the
dialog was terminated by closing the window.)

BTW, there is yet another use case the fails with this bug. In the current code
its impossible to have a sortable table in your dialog b/c all navigation is
assumed to be related to dialog transitions.

Laurie Harper added a comment - 18/Nov/05 10:54 PM
It may be well known or obvious to those familiar w/ Shale, but I found I got
bitten by this in the Use Cases sample app just by clicking the link for the
logon dialog, clicking the browser's back button to return to the home page and
then clicking any link... after which, I had to clear my session cookie to
experiment any further.

Don Brown made changes - 23/Apr/06 04:50 AM
Field Original Value New Value
issue.field.bugzillaimportkey 35066 27765
Don Brown made changes - 24/Apr/06 01:29 PM
Status Resolved [ 5 ] Closed [ 6 ]
David Evans made changes - 24/Apr/06 10:57 PM
Assignee Struts Developer Mailing List [ dev@struts.apache.org ] David Evans [ dsevans93 ]
Status Closed [ 6 ] Reopened [ 4 ]
David Evans made changes - 24/Apr/06 10:57 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
David Evans made changes - 24/Apr/06 10:57 PM
Status Resolved [ 5 ] Closed [ 6 ]
Craig McClanahan made changes - 26/Apr/06 01:13 PM
Project Struts Action 1 [ 10121 ] Shale [ 10130 ]
Key STR-2474 SHALE-48
Assignee David Evans [ dsevans93 ]
Component/s Shale [ 21241 ]
Affects Version/s Nightly Build [ 21668 ]
sean schofield added a comment - 27/Apr/06 12:40 AM
This issue hasn't really been fixed. Its was resolved as "Later" in bugzilla. Its still a pretty bug. I think we should reopen but leave it without a version to be fixed in.

Don Brown made changes - 03/May/06 01:06 AM
Workflow jira [ 37757 ] Struts [ 38327 ]
sean schofield added a comment - 04/May/06 06:20 AM
Reopening this issue now that its been migrated from Bugzilla. Craig and I discussed a potential solution to this back at ApacheCon 2005 but the details elude me at the moment. I'd like to put this back on our radar screen. I'm happy to try and help with the solution. @Craig: Maybe you can refresh my memory about your proposed solution?

sean schofield made changes - 04/May/06 06:20 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
sean schofield made changes - 04/May/06 06:21 AM
Link This issue relates to SHALE-10 [ SHALE-10 ]
Dominique Jean-Prost added a comment - 21/Jun/06 05:59 PM
one of the problem is that the exception raised is very generic (ie IllegalArgumentException). I think it could be at least changed to something a bit more specific, for example : ShaleStateMachineUnsynchronizedException or whatever instead of the IllegalArgument.

Without needing a too much complex change that seems to be needed to fix the whole stuff, it could add a way to deal with the issue.

sean schofield made changes - 06/Jul/06 10:09 AM
Component/s Dialog [ 21270 ]
Bugzilla Id 35066
Craig McClanahan made changes - 28/Aug/06 11:23 PM
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Bugzilla Id 35066
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

Craig McClanahan added a comment - 20/Oct/06 03:10 AM
The new shale-dialog functionality (and both the basic and scxml implementations) address the issue of multiple dialogs (each in their own window or frame), so I'm declaring this one as fixed.

Craig McClanahan made changes - 20/Oct/06 03:10 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Rahul Akolkar made changes - 23/Jan/07 04:40 PM
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Fix Version/s 1.0.4 [ 21790 ]
Jeff Turner made changes - 09/Aug/07 07:15 AM
Workflow Struts [ 38327 ] Struts - editable closed status [ 41675 ]
Antonio Petrelli made changes - 08/Jan/09 08:56 AM
Workflow Struts - editable closed status [ 41675 ] Struts - editable closed status (temporary) [ 46021 ]
Antonio Petrelli made changes - 08/Jan/09 09:08 AM
Workflow Struts - editable closed status (temporary) [ 46021 ] Struts - editable closed status [ 52707 ]