2 Replies Latest reply on Dec 10, 2007 9:24 AM by koen handekyn

    conversation per view-id [natural convesation scope]

    koen handekyn Newbie

      i'm developping an app part of which is plain editing of instances in a database.

      i have recently discovered natural conversation scope, that cleary should get into the documentation soon !!!

      i now find myselve repeating the below part for every entity (i have a list page and an edit page for each)

      <conversation
       name="addressList"
       parameter-name="addressListConversation"
       parameter-value="main"
       />
      
       <page
       view-id="/up/admin/addressList.xhtml"
       conversation="addressList"
       >
       <begin-conversation join="true" />
       </page>
      
       <conversation
       name="address"
       parameter-name="addressId"
       parameter-value="#{address.path}"
       />
      
       <page
       view-id="/up/admin/address.xhtml"
       conversation="address"
       >
       <begin-conversation join="true" />
       </page>


      [from pages.xml]

      TWO QUESTIONS

      1. for the list pages it would be ideal if there were a conversation per open window (in the same window returning to the same page would restore the same conversation, a new window starts a new conversation). CAN THIS BE DONE ??? ( i have been reading several related post but didn't find an answer to this: ie the subject : WANNABE EXAMPLE NEEDS HELP GROWING UP )

      something like ???

      <conversation
       name="addressList"
       parameter-name="addressListConversation"
       parameter-value="#{windowId}"
       />
      
       <page
       view-id="/up/admin/*"
       conversation="addressList"
       >
       <begin-conversation join="true" />
       </page>
      


      2. is there a shortcut possible not te repeat myselves?

      something like

      <conversation
       name="#{page}"
       parameter-name="#{page}Conversation"
       parameter-value="main"
       />
      
       <page
       view-id="/up/admin/*"
       conversation="#{page}"
       >
       <begin-conversation join="true" />
       </page>
      
      


        • 1. Re: conversation per view-id [natural convesation scope]
          Pete Muir Master

           

          "koenhandekyn" wrote:
          i'm developping an app part of which is plain editing of instances in a database.

          i have recently discovered natural conversation scope, that cleary should get into the documentation soon !!!


          This isn't an official feature until 2.0.1, and documented in 2.0.1 :)


          2. is there a shortcut possible not te repeat myselves?


          No, and I can't see a neat way of doing this.

          • 2. Re: conversation per view-id [natural convesation scope]
            koen handekyn Newbie

            i've posted a proposal in JIRA

            in short i propose to match * in a page view expression to a variable, for example named page and than alow EL expression in other elements.

            <page
            view-id="/up/admin/*.xhtml"
            conversation="%{page}Conversation"
            >
            ..


            an alternative which is maybe cleaner is to have a context variabele "view" which is a seam generated object representing the view.

            <page
            view-id="/up/admin/*.xhtml"
            conversation="%{view.name}Conversation"
            >
            ..


            view having properties like
            view.id (example /app/path/name.ext)
            view.fullPath ( example http://host/app/path/name.ext)
            view.name ( example name )