1 2 3 Previous Next 30 Replies Latest reply on Jun 2, 2006 11:55 AM by jajansen Go to original post
      • 15. Re: Some thoughts about the conversations
        gavin.king

        I don't follow.

        • 16. Re: Some thoughts about the conversations
          armita

          Extremely sorry I am wrong!

          • 17. Re: Some thoughts about the conversations
            emsa

            Having several Conversations on the same page might be taking it one step to far at this time. Having named/parallell Conversations on the other hand seems very usefull to me.

            @Begin(join=true, name="wiz_one"}
            public String startWizardOne() { }
            
            @Begin(join=true, name="wiz_two"}
            public String startWizardTwo() { }
            
            @End(name="wiz_two"}
            public String commitWizardTwo() { }
            
            @End(name= { "wiz_one", "wiz_two" } )
            public String abortAll() { }
            


            • 18. Re: Some thoughts about the conversations

               

              "gavin.king@jboss.com" wrote:
              I don't follow.


              Sorry, it is not really easy for me to explain. I will try with an example.

              I have a document Finder bean:

              
              @Name("documentFinder")
              @Stateful
              @Interceptors(SeamInterceptor.class)
              public class DocumentFinderBean implements DocumentFinder {
              
               @DataModel
               private List<Document> documentList;
              
               @DataModelSelection
               private Document selectedDocument;
              
               private String searchCriteria;
              
               ......
              
               @Begin (join = true)
               public String searchDocuments() {
              
               ...... // Perform the search and update the documentList
              
               }
              
               .......
               // Setter/Getter
              }
              
              


              The user perfoms a search with searchCriteria1. The resulting documents are displayed.
              The breadcrumb displays correctly: Search [searchCritera1]

              The user now selects a document. The following bean is used for this:

              
              @Stateless
              
              @Name("documentSelector")
              
              @Interceptors(SeamInterceptor.class)
              
              public class DocumentSelectorBean implements DocumentSelector {
              
              
              
               @In (create=true)
              
               private transient DocumentEditor documentEditor;
              
              
              
               @In (create=true)
              
               private transient DocumentFinder documentFinder;
              
              
              
               @Begin (nested = true)
              
               public String selectDocument() {
              
               documentEditor.setInstance(documentFinder.getSelection());
              
               return "document/details";
              
               }
              
               ......
              
               @Begin (nested = true)
              
               public String selectCriteria() {
              
              documentFinder.setSearchCriteria(documentEditor.getSelectedPointer().getDescription());
              
               return documentFinder.searchDocuments();
              
               }
              
               ......
              }
              
              


              The document is selected and a page is presented with the document details.
              The breadCrumb now displays: search[criteria1] > document [document1]
              This document refers to other documents. He contains criteria(s) that refer to other documents.

              When the user click on a criteria (let's say critera2), I call
              selectCriteria() on the documentSelector bean.

              Eveything is fine. The breadcrump displays:search[criteria1] > document [document1] > serach[criteria2].

              The correct results are displayed to the user.

              Now, let's says that the user decide to go back on seach[criteria1].
              It is not possible. It still refers to criteria2.

              Any help with this would be appreciate. If I am not clear enough, please let me know.

              Thanks for your patience,



              • 19. Re: Some thoughts about the conversations
                lcoetzee

                The idea of starting with a new conversation every time the user selects a new sidebar menu item (e.g. User Management, Add new Issue ...) is very important to me. What I have been doing is just joining the conversation every time the user selects a new sidebar item. This however left a lot of things in the conversation which was not needed ... resulting in a lot of resource wasting.

                What I am going to do is use Gavin's suggestion of not propagating the conversation context

                <h:commandLink action="main" value="User Management">
                 <f:param name="conversationId" value="new"/>
                </h:commandLink>


                This does start a new conversation when the user selects a different sidebar item. Unfortunately it leaves a lot of "stale" conversations in the session (one for each time the user selected a different sidebar item). Ultimately leading to the same resouce wasting issue. This is expted as the documentation clearly highlights the issue.
                Note that disabling conversation context propagation is absolutely not the same thing as ending the conversation.


                What would really be good for me is to have some thing to kill all the conversations when the link is clicked, and then starting a new conversation with an @Begin

                something like
                <h:commandLink action="main" value="User Management">
                 <f:param name="conversationId" value="killAll"/>
                </h:commandLink>


                where killAll is a "magic" keyword for the interceptor. Alternatively extend the @Begin with an option specifying that all other conversations should be killed.
                @Begin(otherConversationsState="killAll")
                public String startFresh()
                


                Obviously if we have access to something through the API one can do something like
                @Begin
                public String startFresh()
                {
                conversation.killAllOthers();
                ....
                


                Anyway, my rambling thoughts ;-)

                Louis

                • 20. Re: Some thoughts about the conversations
                  armita

                   

                  "gavin.king@jboss.com" wrote:
                  You want to have two conversations in the same page?

                  No, I don't

                  "gavin.king@jboss.com" wrote:


                  Yew, we can't do that yet ;-)

                  And I don't expect to implement it anytime soon, sorry...

                  So, what you suggest for this case?

                  • 21. Re: Some thoughts about the conversations
                    armita

                    It is like my suggestions! I agree with you completely and should add that in case of submodule we may need to specify that we need some level of current conversation stack should be preserved.
                    But still I feel it lakes something!

                    • 22. Re: Some thoughts about the conversations
                      gavin.king

                       

                      Eveything is fine. The breadcrump displays:search[criteria1] > document [document1] > serach[criteria2].


                      OK, so that seems wrong. You should not make the second search be a nested conversation of the edit conversation for document1. It should be a whole new toplevel conversation, or a resumption of the earlier toplevel conversation.

                      Hmmm. I have not provided simple operations to "pop" the conversation stack. I should do that.

                      http://jira.jboss.com/jira/browse/JBSEAM-163

                      • 23. Re: Some thoughts about the conversations
                        gavin.king

                         

                        "lcoetzee" wrote:
                        What would really be good for me is to have some thing to kill all the conversations when the link is clicked, and then starting a new conversation with an @Begin


                        OK.

                        http://jira.jboss.com/jira/browse/JBSEAM-164

                        (But remember that the conversation timeout will take care of the orphaned state *eventually*.)

                        • 24. Re: Some thoughts about the conversations
                          armita

                           

                          <h:commandLink action="main" value="User Management">
                           <f:param name="conversationId" value="killAll"/>
                          </h:commandLink>
                          

                          I am using this with a @Begin( join = true ) but the conversation simply joins without any new conversation?

                          • 25. Re: Some thoughts about the conversations
                            armita

                            Sorry, I am not using killAll yet ;-)

                            <h:commandLink action="main" value="User Management">
                             <f:param name="conversationId" value="new"/>
                            </h:commandLink>
                            

                            wnd the method annotated as Begin( join= true). Still not a new conversation

                            • 26. Re: Some thoughts about the conversations
                              gavin.king

                              Pretty difficult to believe. Use your debugger to see what is really going on.

                              Look at org.jboss.seam.core.Manager.restoreConversation(Map attributes, Map parameters)

                              • 27. Re: Some thoughts about the conversations
                                armita

                                 

                                "gavin.king@jboss.com" wrote:
                                Pretty difficult to believe. Use your debugger to see what is really going on.

                                You are right. Sorry! I had a wrong scope set

                                • 28. Re: Some thoughts about the conversations
                                  armita

                                  We need a model of conversation to handle various modules in the application and also nested modules. When entering a submodule I want the user can access the parent modules menu ( to avoid the back button ) in the same page when he was working with the child module. There could be anu level of modules in the applicaiton, from complete seperate modules to simple CRUD object modules.
                                  It will be very good to have this navigation model and at the same time avoid having lots of objects in the conversation scope.
                                  I am suggesting this model to handle such a navigation:
                                  every conversational SB could have a conversation name, and a parent conversation assigned to it. In case of invocation of a @Begin method, if the current conversation name equals the SB's conversation name it simply joins the conversation, if it is not the framework will start going up in the current conversation stack to find a conversation wich name is the SB's parent conversation name, then swap to that conversation and nest a new conversation with the SB's conversation name. If no matching conversation found it could redirect to ifNotBeginOutCome with throwing a ParentConversationNotFoundException.
                                  There is also a special TopLevel keyword for top level modules wich will start a whole new conversation. And also unnamed SBs keep working as is.

                                  • 29. Re: Some thoughts about the conversations
                                    armita

                                    Any idea?