From seam-commits at lists.jboss.org Fri Jan 25 08:45:17 2008 Content-Type: multipart/mixed; boundary="===============1943437028761389298==" MIME-Version: 1.0 From: seam-commits at lists.jboss.org To: seam-commits at lists.jboss.org Subject: [seam-commits] Seam SVN: r7233 - trunk/doc/reference/en/modules. Date: Fri, 25 Jan 2008 08:45:17 -0500 Message-ID: --===============1943437028761389298== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pete.muir(a)jboss.org Date: 2008-01-25 08:45:17 -0500 (Fri, 25 Jan 2008) New Revision: 7233 Modified: trunk/doc/reference/en/modules/conversations.xml Log: Remove explicit conversation id docs, merge in blog article to natural conv= ersation docs Modified: trunk/doc/reference/en/modules/conversations.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/doc/reference/en/modules/conversations.xml 2008-01-25 12:56:35 UT= C (rev 7232) +++ trunk/doc/reference/en/modules/conversations.xml 2008-01-25 13:45:17 UT= C (rev 7233) @@ -559,61 +559,71 @@ =
- Using an "explicit" conversation id - - Ordinarily, Seam generates a meaningless unique id for each co= nversation - in each session. You can customize the id value when you begin= the = - conversation. - - = - - This feature can be used to customize the conversation id gene= ration - algorithm like so: - - - - - - Or it can be used to assign a meaningful conversation id: - - = - - - - - - - - = - - Clearly, these example result in the same conversation id ever= y time - a particular hotel, blog or task is selected. So what happens = if a conversation - with the same conversation id already exists when the new conv= ersation - begins? Well, Seam detects the existing conversation and redir= ects - to that conversation without running the @Begin = - method again. This feature helps control the number of workspa= ces - that are created when using workspace management. - - -
- = -
Natural conversation ids When working with conversations that deal with persistent obje= cts, it may be = desirable to use the natural business key of the object instea= d of the standard, - "surrogate" conversation id. + "surrogate" conversation id: = + + + + Easy redirect to existing conversation + + + It can be useful to redirect to an existing conversation= if = + the user requests the same operation twice. Take this ex= ample: + + + You are on ebay, half way through paying for an item you= just = + won as a Christmas present for your parents. Lets say yo= u're + sending it straight to them - you enter your payment det= ails = + but you can't remember their address. You accidentally r= euse = + the same browser window finding out their address. Now y= ou = + need to return to the payment for the item. + + + With a natural conversation its really easy to have the = user + rejoin the existing conversation, and pick up where they= left = + off - just have them to rejoin the payForItem conversati= on = + with the itemId as the conversation id. + + + + + User friendly URLs + + = + + For me this consists of a navigable = + hierarchy (I can navigate by editing the url) and a mean= ingful + URL (like this Wiki uses - so don't identify things by r= andom = + ids). For some applications user friendly URLs are less = + important, of course. + + + + With a natural conversations, when you are building your= hotel = + booking system (or, of course, whatever your app is) you= can = + generate a URL like = + http://seam-hotels/book.seam?hotel=3DBestWester= nAntwerpen = + (of course, whatever parameter hotel = maps = + to on your domain model must be unique) and with URLRewr= ite = + easily transform this to = + http://seam-hotels/book/BestWesternAntwerpen. + + = + + Much better! + = + + + =
- Configuration = + Creating a natural conversation = - Natural conversations are configured in pages.xml= : = + Natural conversations are defined in pages.xml: = = ]]> = - The first thing to note from the above configuration is th= at the conversation + The first thing to note from the above definition is that = the conversation has a name, in this case PlaceBid. Thi= s name uniquely identifies this particular named conversation, and is used= by the = page definition to identify a named con= versation to participate @@ -631,8 +641,7 @@ The next attribute, parameter-name defi= nes the request parameter = that will contain the natural conversation id, in place of= the default conversation = - id parameter (which is typically either cid or conversationId). = - In this example, the parameter-name is = auctionId. = + id parameter. In this example, the parameter-name= is auctionId. = This means that instead of a conversation parameter like <= literal>cid=3D123 = appearing in the URL for your page, it will contain auctionId=3D765432 = instead. @@ -646,7 +655,7 @@ = - The next step is to configure which pages will participate= in the named conversation. + Next, we define which pages will participate in the named = conversation. This is done by specifying the conversation attribute for a page definition: @@ -669,7 +678,7 @@ When starting, or redirecting to, a natural conversation t= here are a number of options for specifying the natural conversation name. = Let's start by looking at - the following page configuration: + the following page definition: = @@ -683,7 +692,7 @@ From here, we can see that invoking the action #{= bidAction.placeBid} from our auction view (by the way, all these examples are = taken from the seamBay example in Seam), - that we will be redirected to /bid.xhtml, which as we saw previously + that we will be redirected to /bid.xhtml, which, as we saw previously, is configured with the natural conversation Place= Bid. The declaration for our action method looks like this: = @@ -696,7 +705,7 @@ redirection to the named conversation occurs as part of na= vigation rules, after the = action method has already been invoked. This is a problem= when redirecting to an existing conversation, as redirection needs to be occur be= fore the action method is = - invoked. To cater for this, it is necessary to specify th= e conversation name when + invoked. Therefore it is necessary to specify the convers= ation name when the action is invoked. One way of doing this is by using = the s:conversationName tag: --===============1943437028761389298==--