Titles and Descriptions
Often, a single resource is used across different dialogs. For example, such a resource can be a generic date selection portlet. In a travel booking dialog, such a portlet can be used to select the departure date during one step and the return date during another step.
Portlets can have only one dedicated title per locale. For example, the portlet might be called Calendar Portlet. Therefore, the dialog must make the descriptions clear to the site visitor who books a trip. The portlet must clearly show when this portlet is used for selecting the departure date, and when it is used for selecting the return date for the trip.
The Dialog State Display (DSD) is the main component to visualize the following three types of steps:
- The steps that were already processed by the user.
- The step the user is processing
- The steps the user will probably process next.
If no explicit titles and descriptions were specified for a transition endpoint as part of the dialog definition. The DSD displays the step with the localized title of the referenced resource.
Thus the following applies:
- If the transition endpoint references a page, the localized page title is displayed.
- If the transition endpoint references a portlet, the localized portlet title is displayed.
But this fallback mechanism still does not provide possibilities for displaying different titles for the same resource during different steps. To resolve this problem, dialog modelers can also explicitly specify localized titles and descriptions for transition endpoints. The DSD then displays these titles and descriptions instead of the original title and description of the resource. Therefore, we can define two transition endpoints that point to the same resource but have different titles and descriptions or localized titles and descriptions for that resource.
Code sample 8 shows an example. The example references the same calendar portlet twice as part of two separate transition endpoints. In one transition endpoint, the English title is set to Date to leave, in the other one to Date to return. This way, the DSD can display the same portlet with different titles or localized titles.
Code sample 8:
01 <dialog name="dialog1"> 02 <transition-endpoint name="calendar.leave"> 03 <localedata locale="en"> 04 <title>Date to leave</title> 05 <description>Specify the date to leave</description> 06 </localedata> 07 <localedata locale="de"> 08 <title>Abreisedatum</title> 09 <description>Geben Sie Ihr Abreisedatum an</description> 10 </localedata> 11 <resource uniquename="uniquename.calendar"/> 12 <invocation type="static"/> 13 </transition-endpoint> 14 <transition-endpoint name="calendar.return"> 15 <localedata locale="en"> 16 <title>Date to return</title> 17 <description>Specify the date to return</description> 18 </localedata> 19 <localedata locale="de"> 20 <title>Rueckreisedatum</title> 21 <description>Geben Sie Ihr Rueckreisedatum an</description> 22 </localedata> 23 <resource uniquename="uniquename.calendar"/> 24 <invocation type="static"/> 25 </transition-endpoint> 26 ... 27 <transition> 28 <source> 29 <transition-endpoint nameref="portlet1"> 30 <event qname="e1"/> 31 </transition-endpoint> 32 </source> 33 <target> 34 <transition-endpoint nameref="calendar.leave"> 35 <event qname="ecl"/> 36 </transition-endpoint> 37 </target> 38 </transition> 39 ... 40 <transition> 41 <source> 42 <transition-endpoint nameref="portlet2"> 43 <event qname="e2"/> 44 </transition-endpoint> 45 </source> 46 <target> 47 <transition-endpoint nameref="calendar.return"> 48 <event qname="ecr"/> 49 </transition-endpoint> 50 </target> 51 </transition> 52 ... 53 </dialog>
Parent Transition endpoints