<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>JHeadstart Blog</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/jheadstart/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55</id>
   <updated>2009-08-12T14:05:23Z</updated>
   <subtitle>Java EE Consultants - JHeadstart, ADF, JSF</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.23-en</generator>


<entry>
   <title>Oracle JHeadstart 11.1.1 Technical Preview 2 Now Available</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/08/oracle_jheadstart_1111_technic.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.13757</id>
   
   <published>2009-08-12T12:17:46Z</published>
   <updated>2009-08-12T14:05:23Z</updated>
   
   <summary>Oracle JHeadstart 11.1.1 Technical Preview 2 is now available for download (build 11.1.1.0.46). This release is compatible with JDeveloper 11 release 1 (11.1.1.1.0), as well as with the two JDeveloper Boxer releases (11.1.1.0.1 and 11.1.1.0.2). Customers who own a JHeadstart...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="JHeadstart Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>Oracle JHeadstart 11.1.1 Technical Preview 2 is now available for download (build 11.1.1.0.46). <br />
This release is compatible with JDeveloper 11 release 1 (11.1.1.1.0), as well as with the two JDeveloper Boxer releases (11.1.1.0.1 and 11.1.1.0.2).<br />
Customers who own a JHeadstart supplement option license can download it from the <a href="http://cso.oracle.com">Consulting Supplement Option</a> portal. </p>

<p>An evaluation version of JHeadstart 11.1.1 is not yet available. We plan to make an evaluation version available in the fall of calendar year 2009.</p>

<p>In addition to many small enhancements, the following features have been added to the second technical preview: </p>

<ul>
 <li><b>Support for Stretching Layouts</b>: JHeadstart now fully supports stretching options for ADF Faces Rich Client components.
Through a new group-level property <b>Enable Stretching</b>, you can stretch the generate group content to fill the available space. Whether or not stretching 
will actually occur depends on some additional conditions that must be met. See the help description of this new group property in the application definition editor, and the 
JHeadstart Developer's guide for more info.</li>
 <li><b>New Table Overflow Styles</b>: The <b>Table Overflow Style</b> group property has two new allowable values: 'Right with Splitter' and 'Below with Splitter', which are 
useful settings when you want to generate multiple panes with stretching layouts that adjust based on the position of the splitter.</li>
 <li><b>New Allowable Values for Same Page Display Position</b>: The <b>Same Page Display Position</b> group property has two new allowable values: 'At the Right of Parent Group with Splitter' 
and 'Below Parent Group with Splitter', which are useful settings when you want to generate multiple panes with stretching group layouts that adjust 
based on the position of the splitter.</li>

<p> <li><b>New Allowable Values for Region Container Layout</b>: The <b>Layout</b> property of a region container has two new allowable values: 'Horizontal with Splitter' <br />
and 'Vertical with Splitter', which are useful settings when you want to generate multiple panes with stretching region layouts that adjust <br />
based on the position of the splitter.</li></p>

<p> <li><b>Ability to Add Bindings to PageDefinition using Velocity Templates</b>: It is now possible to add bindings and iterators to the page definition using<br />
custom velocity templates. Here are some examples:<br />
<pre></p>

<p> ${JHS.pageDefGenerator.addBinding($JHS.page,"myBinding","#CUSTOM_BINDING()")}<br />
 ${JHS.pageDefGenerator.addExecutable($JHS.page,"myIterator","#CUSTOM_BINDING()")}<br />
 ${JHS.pageDefGenerator.addParameter($JHS.page,"myParam","#CUSTOM_BINDING()")}<br />
</pre><br />
The custom binding macro simply contains the XML you want to add to the page definition. This macro can be defined within the same<br />
velocity template.</li></p>

<p> <li><b>Flex items</b>: The 10.1.3 functionality of Flex Items (items added dynamically at runtime) is now re-implemented for release 11. The region that<br />
 contains the flex items is now a reusable task flow, providing you with more flexibility and re-use of code. </li><br />
 <li><b>File up/download</b>: File upload, file download and display of images is now supported in release 11. It supports Intermedia (ORDSYS) column types, as well <br />
as BLOB column types </li><br />
 <li><b>XML Reformatting</b>: There is a new application-level property <b>Reformat all XML Files</b> which will reformat all generated XML files (except for the page definitions),<br />
 giving you more readable and consistent files accross your application.<br />
</li><br />
 <li><b>Upgrading from 10.1.3</b>: When opening a 10.1.3 application definition file, JHeadstart will migrate this to release 11 upon your approval. </li><br />
 </ul></p>

<p>Click <a href="http://blogs.oracle.com/jheadstart/2009/03/jheadstart_1111_technical_prev.html">here</a> for a list of features added in the first technical preview: </p>

<p>For a complete list of all existing features in JHeadstart 10.1.3, use <a href="http://www.oracle.com/technology/products/jheadstart/jhsfeaturelist.html">this link</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>2 members JHeadstart Team in Oracle Innovation Showcase</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/07/2_members_jheadstart_team_innovator.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.13371</id>
   
   <published>2009-07-16T13:07:27Z</published>
   <updated>2009-07-16T13:53:51Z</updated>
   
   <summary>We are honored that 2 of our JHeadstart Team members are included in the Conversations with Oracle Innovators of the Oracle Innovation Showcase. Interview with Steven Davelaar Interview with Sandra Muller Full credit to Steven, who is the driving power...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="JHeadstart Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="innovation" label="innovation" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jheadstart" label="jheadstart" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>We are honored that 2 of our JHeadstart Team members are included in the <a href="http://www.oracle.com/innovation/innovator-archive.html">Conversations with Oracle Innovators</a> of the <a href="http://www.oracle.com/innovation/index.html">Oracle Innovation Showcase</a>. </p>

<ul><li><a href="http://www.oracle.com/innovation/innovator-steven-davelaar.html">Interview with Steven Davelaar<br><img src="http://oracleimg.com/admin/images/innovation/innovator_davelaar.jpg" alt="Steven Davelaar" width="85" height="85" /><img src="http://www.oracle.com/admin/images/innovation/innovator_completestory_branding.gif" width="165" height="88" border="0" alt="Oracle Innovator" /></a></li>
<li><a href="http://www.oracle.com/innovation/innovator-sandra-muller.html">Interview with Sandra Muller<br><img src="http://oracleimg.com/admin/images/innovation/innovator_muller.jpg" alt="Sandra Muller" width="85" height="85" /><img src="http://www.oracle.com/admin/images/innovation/innovator_completestory_branding.gif" width="165" height="88" border="0" alt="Oracle Innovator" /></a></li></ul>

<p>Full credit to Steven, who is the driving power behind the JHeadstart innovations!</p>]]>
      
   </content>
</entry>

<entry>
   <title>Core ADF 11: Mapping Multiple FocusViewId&apos;s with XMLMenuModel</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/04/core_adf_11_mapping_multiple_f.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.11606</id>
   
   <published>2009-04-17T09:48:07Z</published>
   <updated>2009-04-17T09:56:22Z</updated>
   
   <summary>In the first post of this Core ADF 11 series, I discussed various options for designing your page structure. This post applies when you use stand-alone .jspx pages. If you make these pages available through a menu (af:navigationPane) using XMLMenuModel...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="ADF Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adfcontroller" label="ADF Controller" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="adffaces" label="ADF Faces" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xmlmenumodel" label="XML menu model" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="standalonepages" label="stand-alone pages" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>In the <a href="http://blogs.oracle.com/jheadstart/2009/03/core_adf_11_designing_the_page.html">first post</a> of this Core ADF 11 series, I discussed various options for designing your page structure. This post applies when you use stand-alone .jspx pages. If you make these pages available through a menu (af:navigationPane) using XMLMenuModel where each menu item navigates to a page (either in the unbounded task flow or by calling a bounded task flow), the menu tab will be automatically highlighted when you set the focusViewId property of the itemNode in the XML Menu Model file to the name of the .jspx page that appears when you click on the menu item. Unfortunately, you can specify only one focusViewId for an itemNode. If your .jspx page has a button or link to navigate to a secondary page, you will loose the menu item highlighting because the focusViewId of the menu itemNode no longer matches the view id of the current (secondary) page. Even worse, if you have nested itemNodes defined in the XML Menu Model, the submenu that was displayed with the primary page will disappear when navigating to the secondary page.</p>

<p>The "poor-man's solution" to this problem is adding nested item nodes to the XML Menu Model for the detail pages. This technique is easy but can only be applied when there is no page-specific submenu that should be displayed with the pages. You simply create child itemNodes in the XML Menu model for the detail pages in the task flow, which will never be displayed as menu items because you do not include an af:navigationPane that displays this menu level.</p>

<p>A more sophisticated solution, that allows for page-specific submenus, is to subclass XMLMenuModel. The subclass looks up a MenuViewIdMapping managed bean that maps all viewIds of the secondary pages in the task flow to the viewId of the primary page that is defined as focusViewId in the XML Menu Model file.</p>

<p>Here are the steps to implement this technique:</p>

<p>1. Create a subclass of org.apache.myfaces.trinidad.model.XMLMenuModel and override method getFocusRowKey as follows:<br />
<code><br />
&nbsp;&nbsp;public&nbsp;Object&nbsp;getFocusRowKey()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;first&nbsp;check&nbsp;whether&nbsp;default&nbsp;behavior&nbsp;results&nbsp;in&nbsp;focus&nbsp;of&nbsp;some&nbsp;menu&nbsp;item&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;focusRowKey&nbsp;=&nbsp;super.getFocusRowKey();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(focusRowKey!=null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;focusRowKey;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;Map<String,&nbsp;List<Object>>&nbsp;focusPathMap&nbsp;=&nbsp;getViewIdFocusPathMap();<br />
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;check&nbsp;whether&nbsp;there&nbsp;is&nbsp;a&nbsp;menu&nbsp;mapping&nbsp;for&nbsp;the&nbsp;current&nbsp;viewId<br />
&nbsp;&nbsp;&nbsp;&nbsp;Map&nbsp;viewIdMapping&nbsp;=&nbsp;getViewIdMapping();<br />
&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;viewId&nbsp;=&nbsp;FacesContext.getCurrentInstance().getViewRoot().getViewId();<br />
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(viewIdMapping!=null&nbsp;&&&nbsp;viewIdMapping.get(viewId)!=null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;mappedViewId&nbsp;=&nbsp;(String)&nbsp;viewIdMapping.get(viewId);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List<Object>&nbsp;focusPath&nbsp;=&nbsp;focusPathMap.get(mappedViewId);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;focusPath&nbsp;!=&nbsp;null?&nbsp;focusPath.get(0):&nbsp;null;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;null;<br />
&nbsp;&nbsp;}<br />
</code><br />
Add the following helper method:<br />
<code><br />
&nbsp;&nbsp;public&nbsp;Map&nbsp;getViewIdMapping()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;ExpressionFactory&nbsp;ef&nbsp;=&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FacesContext.getCurrentInstance().getApplication().getExpressionFactory();<br />
&nbsp;&nbsp;&nbsp;&nbsp;ELContext&nbsp;context&nbsp;=&nbsp;FacesContext.getCurrentInstance().getELContext();<br />
&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(Map)&nbsp;ef.createValueExpression(context<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,"#{pageFlowScope.MenuViewIdMapping}"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;Map.class).getValue(context);<br />
&nbsp;&nbsp;}<br />
</code><br />
2. Change the menu bean property managed-bean-class to reference your subclass:<br />
<code><br />
&nbsp;&nbsp;&lt;managed-bean&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;Menu&nbsp;Model&nbsp;Managed&nbsp;Bean&lt;/description&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-name&gt;root_menu&lt;/managed-bean-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-class&gt;view.MyXMLMenuModel&lt;/managed-bean-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-scope&gt;request&lt;/managed-bean-scope&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-property&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property-name&gt;createHiddenNodes&lt;/property-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;false&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/managed-property&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-property&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property-name&gt;source&lt;/property-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property-class&gt;java.lang.String&lt;/property-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;/WEB-INF/root_menu.xml&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/managed-property&gt;<br />
&nbsp;&nbsp;&lt;/managed-bean&gt;<br />
</code> <br />
3. In each taskflow that can be launched from a menu item, add a managed bean named "MenuViewIdMapping" that defines the mapping between secondary pages and the page defined as focusViewId in the XML Menu Model. Here is an example:<br />
<code><br />
&nbsp;&nbsp;&lt;managed-bean&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-name&gt;MenuViewIdMapping&lt;/managed-bean-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-class&gt;java.util.HashMap&lt;/managed-bean-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-scope&gt;pageFlow&lt;/managed-bean-scope&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;map-entries&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;map-entry&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;/task-flow-definition1/BoundedTaskFlow1DetailPage&lt;/key&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;/task-flow-definition1/BoundedTaskFlow1Page&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/map-entry&gt;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;map-entry&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;/task-flow-definition1/BoundedTaskFlow1AnotherDetailPage&lt;/key&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;/task-flow-definition1/BoundedTaskFlow1Page&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/map-entry&gt;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/map-entries&gt;<br />
&nbsp;&nbsp;&lt;/managed-bean&gt;<br />
</code></p>

<p>That's it. You can download a sample workspace that illustrates the solution <a href="http://blogs.oracle.com/jheadstart/XMLMenuModelMapping.zip">here</a>. In a later post, we will discuss the solution for the "one-page application" design with dynamic regions. In that scenario the correct menu item should be highlighted based on the currently selected dynamic region. <br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Core ADF 11: Abandoning a Bounded Taskflow with Stand-Alone Pages</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/04/core_adf_11_abandoning_a_bound.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.11223</id>
   
   <published>2009-04-03T11:14:59Z</published>
   <updated>2009-04-06T11:03:29Z</updated>
   
   <summary>In the first post of this Core ADF 11 series, I discussed various options for designing your page structure. This post applies when you choose to use bounded task flows with stand-alone .jspx pages. If you make these bounded task...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="ADF Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adf" label="ADF" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="adfcontroller" label="ADF Controller" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xmlmenumodel" label="XML menu model" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="boundedtaskflows" label="bounded task flows" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="standalonepages" label="stand-alone pages" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>In the <a href="http://blogs.oracle.com/jheadstart/2009/03/core_adf_11_designing_the_page.html">first post</a> of this Core ADF 11 series, I discussed various options for designing your page structure. This post applies when you choose to use bounded task flows with stand-alone .jspx pages. If you make these bounded task flows available through a menu where each menu item calls a bounded task flow, you will hit the "cannot abandon bounded taskflow" issue: when you start the home page of your application (located in the unbounded taskflow), and then click on a menu item for the first time, you start the bounded taskflow associated with the menu item. Now, the menu is still visible, and the end user might decide to click on another menu item before he correctly finished the bounded task flow. In other words, he wants to abandon the task flow he started through the first menu item. However, when the user clicks on another menu item, nothing will happen! This is because the control flow rules that start each bounded taskflow are defined in the unbounded taskflow (in adfc-config.xml). They are not available in the context of the first bounded taskflow started by the user. </p>

<p>The "poor man's" solution to this problem is hiding or disabling all menu items and other global actions that will launch a bounded task flow (like "Help" and "Preferences")  until the user executes a bounded task flow return action and returns to a page in the unbounded task flow. Not a very user friendly solution....</p>

<p>Another technique is to use a bounded taskflow template for all your bounded task flows. In the template you duplicate all control flow rules and all task-flow call activities that are defined in the unbounded task flow. While this might seem to work at first sight, this is not a viable option. What happens with this approach is that each time you click on another menu item, a new bounded <i>sub</i> task flow is started in the context of the current task flow: in other words, you keep on nesting bounded task flows. This is highly undesirable and will cause problems sooner or later with memory resources and/or transaction management. Since the task flows are nested, taskflow resources are never released, and transactions are never rolled back. Don't do this!</p>

<p>The only proper solution is to execute a return activity to quit the current task flow before starting the new bounded task flow. In this post, I will describe how you can implement this in a generic way which hides the complexity for your developers. The outline of the solution is as follows: <ul> <li>The action property of all menu items as defined in the XML menu Model is prefixed with "abandon:" (This is all what your developers need to know)</li><li>A custom navigation handler is used that checks whether the navigation outcome starts with "abandon:". If so, and the current task flow context is a bounded task flow, then the navigation outcome as specified after the "abandon:" prefix is stored in a request attribute named "callMenuItem", and the super navigation handler is called with the CallMenuItem outcome. If we are not in the context of a bound taskflow, we call the super navigation handler directly with the navigation outcome as specified after the "abandon:" prefix.</li><li>The CallMenuItem outcome navigates to a generic task flow return activity named "CallMenuItem" which in turn navigates to the CallMenuItem activity in the unbounded taskflow.</li><li>The CallMenuItem activity in the unbounded taskflow is a "dynamic router" a Java class with a getOutcome method that  returns the value of the EL expression passed in as argument. In our case, the router returns the value of the currentMenuItem request attribute, which causes navigation to the end target: either some page in the unbounded task flow, or another bounded task flow call activity in the unbounded task flow.</li></ul></p>

<p>Here are the detailed steps to implement this:</p>

<p>1. Prefix the value of the action property in all your menu items in XML MenuModel with "abandon:"</p>

<p>2. Create a custom navigation handler with the following code:<br />
<code><br />
public&nbsp;class&nbsp;MyNavigationHandler<br />
&nbsp;&nbsp;extends&nbsp;NavigationHandlerImpl<br />
{<br />
&nbsp;&nbsp;public&nbsp;static&nbsp;final&nbsp;String&nbsp;ABANDON_PREFIX&nbsp;=&nbsp;"abandon:";<br />
&nbsp;&nbsp;private&nbsp;static&nbsp;final&nbsp;String&nbsp;CURRENT_MENU_ITEM&nbsp;=&nbsp;"currentMenuItem";<br />
&nbsp;&nbsp;private&nbsp;static&nbsp;final&nbsp;String&nbsp;CALL_MENU_ITEM&nbsp;=&nbsp;"CallMenuItem";<br />
<br><br />
&nbsp;&nbsp;public&nbsp;MyNavigationHandler(NavigationHandler&nbsp;navHandler)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(navHandler);<br />
&nbsp;&nbsp;}<br />
<br><br />
&nbsp;&nbsp;public&nbsp;void&nbsp;handleNavigation(FacesContext&nbsp;facesContext,&nbsp;String&nbsp;action,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;outcome)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(outcome&nbsp;!=&nbsp;null&nbsp;&&&nbsp;outcome.startsWith(ABANDON_PREFIX))<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;abandonTaskFlowIfNeeded(facesContext,&nbsp;action,&nbsp;outcome);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.handleNavigation(facesContext,&nbsp;action,&nbsp;outcome);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
<br><br />
&nbsp;&nbsp;public&nbsp;void&nbsp;abandonTaskFlowIfNeeded(FacesContext&nbsp;facesContext,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;action,&nbsp;String&nbsp;outcome)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;strippedOutcome&nbsp;=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outcome.substring(MyNavigationHandler.ABANDON_PREFIX.length());<br />
&nbsp;&nbsp;&nbsp;&nbsp;TaskFlowContext&nbsp;tfc&nbsp;=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ControllerContext.getInstance().getCurrentViewPort().getTaskFlowContext();<br />
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(tfc.getTaskFlowId()&nbsp;==&nbsp;null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;we&nbsp;are&nbsp;not&nbsp;in&nbsp;a&nbsp;bounded&nbsp;task&nbsp;flow,&nbsp;do&nbsp;normal&nbsp;navigation<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handleNavigation(facesContext,&nbsp;action,&nbsp;strippedOutcome);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;newOutcome&nbsp;=&nbsp;strippedOutcome;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&nbsp;requestMap&nbsp;=&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FacesContext.getCurrentInstance().getExternalContext().getRequestMap();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requestMap.put(CURRENT_MENU_ITEM,&nbsp;newOutcome);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handleNavigation(facesContext,&nbsp;null,&nbsp;CALL_MENU_ITEM);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
}<br />
</code></p>

<p>3. Register your custom navigation handler in the faces-config.xml. Go to the Overview tab, click on Application, and set your class name in the navigation handler property.</p>

<p>4. Create a bounded taskflow template used by all your bounded task flows, and add the following code to it:<br />
<code><br />
&lt;task-flow-return&nbsp;id="CallMenuItem"&gt;<br />
&nbsp;&nbsp;&lt;outcome&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;CallMenuItem&lt;/name&gt;<br />
&nbsp;&nbsp;&lt;/outcome&gt;<br />
&lt;/task-flow-return&gt;<br />
&lt;control-flow-rule&gt;<br />
&nbsp;&nbsp;&lt;from-activity-id&gt;*&lt;/from-activity-id&gt;<br />
&nbsp;&nbsp;&lt;control-flow-case&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;from-outcome&gt;CallMenuItem&lt;/from-outcome&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;to-activity-id&gt;CallMenuItem&lt;/to-activity-id&gt;<br />
&nbsp;&nbsp;&lt;/control-flow-case&gt;<br />
&lt;/control-flow-rule&gt;<br />
&lt;/task-flow-template&gt;<br />
</code><br />
When using declarative transaction management, you can add that a rollback should be performed as part of the return activity.</p>

<p>5. Create a Java class named DynamicRouter with the following code:<br />
<code><br />
public class DynamicRouter  implements Serializable<br />
{<br />
&nbsp;&nbsp;public String getOutcome(String outcome)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return outcome;<br />
&nbsp;&nbsp;} <br />
}<br />
</code></p>

<p>6. Add the following code to adfc-config.xml (the unbounded task flow):<br />
<code><br />
&lt;method-call&nbsp;id="CallMenuItem"&gt;<br />
&nbsp;&nbsp;&lt;method&gt;#{dynamicRouter.getOutcome}&lt;/method&gt;<br />
&nbsp;&nbsp;&lt;parameter&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;class&gt;java.lang.String&lt;/class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;#{requestScope.currentMenuItem}&lt;/value&gt;<br />
&nbsp;&nbsp;&lt;/parameter&gt;<br />
&nbsp;&nbsp;&lt;outcome&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;to-string/&gt;<br />
&nbsp;&nbsp;&lt;/outcome&gt;<br />
&lt;/method-call&gt;<br />
<br><br />
&lt;control-flow-rule&gt;<br />
&nbsp;&nbsp;&lt;from-activity-id&gt;*&lt;/from-activity-id&gt;<br />
&nbsp;&nbsp;&lt;control-flow-case&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;from-outcome&gt;CallMenuItem&lt;/from-outcome&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;to-activity-id&gt;CallMenuItem&lt;/to-activity-id&gt;<br />
&nbsp;&nbsp;&lt;/control-flow-case&gt;<br />
&nbsp;&nbsp;...<br />
&lt;/control-flow-rule&gt;&nbsp;&nbsp;<br />
<br><br />
&nbsp;&nbsp;&lt;managed-bean&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-name&gt;dynamicRouter&lt;/managed-bean-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-class&gt;view.DynamicRouter&lt;/managed-bean-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;managed-bean-scope&gt;request&lt;/managed-bean-scope&gt;<br />
&nbsp;&nbsp;&lt;/managed-bean&gt;<br />
</code></p>

<p>That's it. You can download a sample workspace that illustrates the solution <a href="http://blogs.oracle.com/jheadstart/AbandonBoundedTaskFlow.zip">here</a>. In a later post, we will discuss how to add an alert to warn the end user about unsaved changes when he abandons a task flow.<br />
 </p>]]>
      
   </content>
</entry>

<entry>
   <title>Core ADF 11: Designing the Page and Taskflow Structure</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/03/core_adf_11_designing_the_page.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.10917</id>
   
   <published>2009-03-20T13:53:50Z</published>
   <updated>2009-04-17T10:02:42Z</updated>
   
   <summary>JDeveloper&apos;s tagline is &quot;productivity with choice&quot;. In previous releases this choice merely applied to the various technologies that could be used in each of the ADF layers. With release 11 this has changed. When choosing the &quot;Fusion&quot; technology stack within...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="ADF Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adf" label="ADF" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="adfcontroller" label="ADF Controller" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xmlmenumodel" label="XML menu model" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="boundedtaskflows" label="bounded task flows" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="dynamicregions" label="dynamic regions" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="pagefragments" label="page fragments" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="pagetemplates" label="page templates" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="shellpage" label="shell page" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="standalonepages" label="stand-alone pages" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="staticregions" label="static regions" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="unboundedtaskflows" label="unbounded task flows" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>JDeveloper's tagline is "productivity with choice". In previous releases this choice merely applied to the various technologies that could be used in each of the ADF layers. With release 11 this has changed. When choosing the "Fusion" technology stack within ADF (ADF Faces, ADF Task Flows and ADF Business Components), there are many new and powerful concepts and techniques available that allow you to build the required functionality in different ways. Concepts like (un)bounded taskflows, page fragments, (dynamic) regions, page templates, declarative components, declarative transaction support, XML Menu Model, ADF Faces Layout Components and ADF Libraries open up a wide range of new possibilities to build the view and controller layers.</p>

<p>These new possibilities imply that new design decisions must be made on how to build the required functionality. This is not a trivial task. Many of the concepts relate to each other, and choosing how to use one concept can have impact on the usage of other concepts. I admit that's pretty vague, but in this new "Core ADF 11" series, we (the <a href="http://www.oracle.com/technology/products/jheadstart/index.html">JHeadstart</a> team) will try to make this more concrete. In this series we will share with you the experiences, issues, challenges, design considerations, design decisions and best practices that we faced/encountered/developed when building <a href="http://blogs.oracle.com/jheadstart/2009/03/jheadstart_1111_technical_prev.html">JHeadstart release 11</a>.</p>

<p>Note that we will assume that you have a basic understanding of the new ADF 11 concepts. If this is not the case, we recommend you take the <a href="http://education.oracle.com/pls/web_prod-plq-dad/show_desc.redirect?dc=D53979GC10&p_org_id=1001&lang=US&source_call=">ADF 11 course from Oracle University</a>, or if you prefer self-study, take a look at the <a href="http://www.oracle.com/technology/products/adf/learnadf.html">ADF Learning Center</a>. </p>

<p>In this first post, we will start at the beginning: you want to build your first "serious" ADF 11 page, and you immediately need to choose: do I create a page or a page fragment, do I base the page (fragment) on a template, and do I put the page in an unbounded or bounded task flow. </p>

<p><strong>Page Templates</strong><br />
This one is easy: we recommend to always use a page template. Design the template whatever way you want but make sure you include all the UI elements that need to be displayed on each and every page. Typical content of a page template include a branding image/application logo, global actions like Home, Help, Log Out, Preferences,  the menu of the application (either a tree menu, or various levels of navigation panes like tabs, buttons or lists) and a footer area with for example a copyright message. Use page template attributes to pass in properties that might differ between pages like the page title, and to conditionally show/hide parts of the page template for specific pages. In a later post, we will go into more details on designing page templates.<br />
Note that you can also dynamically change the page template associated with a page at runtime. Instead of hardcoding the page template path, you can use an EL expression that binds to a look and feel bean that contains the current page template path.</p>

<p><strong>Bounded or Unbounded Taskflows</strong><br />
Each ADF 11 web application has one unbounded taskflow, and can have one or more bounded task flows. So, the choice is not so much about using bounded or unbounded task flows, but about putting a JSF page inside the unbounded taskflow, or inside a bounded task flow.<br />
When building transactional applications, bounded task flows have major advantages over unbounded task flows. For a start, bounded task flows support additional features that can be very useful when building transactional applications:<br />
<ul><li>Save for Later</li><li>Declarative Transaction Support</li><li>Exception Handling</li><li>Own Memory Scope</li><li>Back button handling</li></ul><p>In addition, bounded task flows allow you to benefit from concepts well-known in the world of object oriented programming and component-based development. Using bounded task flows:</p><ul><li>you can create truly reusable user interface components through page fragments and regions;</li><li>with a well-defined service contract; through taskflow parameters you can configure the behavior of the taskflow;</li><li>that are loosely coupled; to use a task flow, you only need to know about the available task flows parameters. The internal flow, structure of user interface components and data structures can be changed without any impact on the pages or other taskflows that are using/calling the taskflow.</li></ul><p>In short, well-designed bounded task flows have many advantages over the unbounded task flow. We recommend to only use the unbounded task flow for introductionary pages like the home page or a UI shell page when using regions (see below). All application uses cases should be implemented using a bounded task flow. In a later post in this series, we will discuss in more detail how to design your task flows for maximum reusability. </p></p>

<p><strong>Stand-alone Pages or Page Fragments with (Dynamic) Regions</strong><br />
For your page design, you basically have three choices<ul><li>Create stand-alone .jspx pages </li><li>Create .jsff page fragments within a region, and create a shell page for each region that contains the af:region tag.</li><li>Create .jsff page fragments within a region, and create one common UI shell .jspx page, that uses a dynamic region to display the requested region. This is the "One Page Application" model, where the UI shell page is the only .jspx page in the application, and a menu displayed in the shell page is used to set the current region displayed on the page.</li></ul><p>Some considerations and implications to take into account for each choice:<br />
<i>Stand-alone pages:</i></p><ul><li>Stand-alone pages are easiest to build and understand, it is like building your app the "10.1.3 way".</li><li>Stand-alone pages offer little reuse, they cannot be used inside regions</li><li>When you are building a menu-driven application, and each menu entry starts a bounded taskflow with stand-alone pages, there is no easy way to abandon the current task flow. When the user wants to leave the current task flow and clicks on another menu entry, nothing will happen! This is because the control flow case to start the taskflow associated with the other menu item is defined in the unbounded task flow, which is not reachable once a bounded taskflow is started. The easy solution is to not use bounded task flows at all. You will lose all the advantages of bounded task flows, but when simplicity is more important to you then reusability, this is a valid choice. We discuss a more sophisticated solution to the "abandon taskflow with stand-alone pages issue" in <a href="http://blogs.oracle.com/jheadstart/2009/04/core_adf_11_abandoning_a_bound.html">this post</a> of the ADF 11 Core series.</li> <li>When you are using the XMLMenuModel to create your menu, you can associate one focusViewId with each menu item. If you navigate to the page with this view id, the associated menu item will be highlighted automatically. However, if you then navigate to a detail page from the focusViewId page, you loose the menu item highlighting. In <a href="http://blogs.oracle.com/jheadstart/2009/04/core_adf_11_mapping_multiple_f.html">this post</a>, we discuss how you can extend the XMLMenuModel to associate multiple pages with one menu item</li></ul><p><i>Static regions with shell page:</i></p><ul><li>With this design, you leverage the reuse options of bounded task flows with page fragments</li><li>You do not run into the XMLMenuModel multi-page problem, since each menu item is associated with the shell page which remains the same while navigating between the page fragments within the ADF region embedded in the shell page</li><li>You do not run into the "abandon task flow" issue that occurs with stand-alone pages, since the shell pages are all located in the unbounded task flow.</li><li>If you navigate away to another shell page, you need to be aware that ADF will auto-execute some logic to clean up the abandoned task flow of the region in the previous shell page. The actual clean-up logic executed depends on the transaction settings of the task flow. For example, if the task flow started a new transaction, a rollback will be performed. Note that when using shared data controls, the rollback might have a performance impact since already executed queries in other task flows will need to be re-executed as well. In a later post, we will discuss taskflow transaction management in more detail.</li></ul> <p><i>One-page application:</i> <br />
With the previous design option, a shell page is created for each ADF region. Typically, all these shell pages will be very thin and very similar: they are based on the same page template that renders the menu and other common page components, the only difference is the name of the ADF region that is embedded in the shell page. In a one page application, we create one UI Shell page and use a dynamic region to display the correct region. Here are the implications:</p><ul><li>Performance increases because partial page rendering can be used to replace the content of the dynamic region, the UI shell page does not need to be reloaded. In our experience, the performance difference is quite significant. However, according to the documentation there is a feature called <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_ppr.htm#BGBICEHC">Partial Page Navigation</a> which would allow for a similar performance when using separate shell pages or stand-alone pages. I did not get this feature to work though.</li><li>The one-page application raises a problem with XMLMenuModel, opposite to the stand-alone pages design: there is only one page used by all menu items. This can be solved by creating a subclass of XMLMenuModel that highlights the correct menu item based on the currently selected region as set in the dynamic region bean. We will discuss this technique in more detail in a future post.</li><li>When using a dynamic region, the parameters for all region task flows can be defined against the dynamic task flow binding in the page definition of the UI shell page. This quickly becomes ugly and unmanageable: one long list of parameters for all task flows in the application. A better approach is to use the parameter map property of the dynamic task flow binding, and reference the parameter map of the current region through the dynamic region bean. We will discuss this technique in more detail in a future post.</li></ul></p>

<p><strong>Summary</strong><br />
While JDeveloper makes it easy to later on convert stand-alone pages to fragments, and unbounded task flows to bounded task flows, it is better to make these design decisions upfront. The choices you make have impact on the usage of XMLMenuModel, menu-driven navigation in general, reusability, transaction management and performance.<br />
We recommend to use bounded task flows with page fragments to maximize reusability. While traditional transactional applications are mostly menu-driven, composite, task-oriented user interfaces are likely to become mainstream in the future. When you start building your ADF 11 app today using (dynamic) regions accessible from a menu, you can reuse the same task flows when building more task-oriented user interfaces using the WebCenter and Human Workflow capabilities planned for JDeveloper 11 release 2. </p>]]>
      
   </content>
</entry>

<entry>
   <title>JHeadstart 11.1.1 Technical Preview Now Available</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/03/jheadstart_1111_technical_prev.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.10619</id>
   
   <published>2009-03-06T12:15:01Z</published>
   <updated>2009-08-12T12:37:22Z</updated>
   
   <summary>Oracle JHeadstart 11.1.1 Technical Preview is now available for download. Customers who own a JHeadstart supplement option license can download it from the Consulting Supplement Option portal. An evaluation version of JHeadstart 11.1.1 is not yet available. We plan to...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>Oracle JHeadstart 11.1.1 Technical Preview is now available for download. Customers who own a JHeadstart supplement option license can download it from the <a href="http://cso.oracle.com">Consulting Supplement Option</a> portal. </p>

<p>An evaluation version of JHeadstart 11.1.1 is not yet available. We plan to make an evaluation version available in the fall of calendar year 2009.</p>

<p>In addition to many small enhancements, the following features have been added in JHeadstart 11.1.1:<br />
<ul><br />
 <li><b>New Application Level in Application Definition Editor</b>: In previous versions, a project typically contained multiple JHeadstart application definition files, that were edited and generated separately. In release 11, these application definition files have been renamed to service definition files, and can be edited and generated all together in the application definition editor. The editor has a new top level application node that shows all services. The application node contains a number of properties that were previously found at the service level, but had to be the same accross all services anyway.</li><br />
 <li><b>Generation of (un)Bounded Task Flows</b>: JHeadstart now uses the new ADF 11 controller facilities that extend the JSF controller functionality. For each top-level group a bounded task flow is generated. Through the new metadata element <b>Group Parameters</b> you can specify specific custom taskflow parameters. By default, the generated task flows already contain a number of parameters to maximize reuse of the task flows. For example, you can set parameters to query or set a specific row as the current row or to start the flow in "create mode" (useful in wizard-style layouts).</li><br />
 <li><b>Ability to Generate Page Fragments and (Dynamic) Regions</b>: Through the new properties <b>(Default) Group Usage</b> and <b>(Default) Group Region Access</b> you can specify how groups are generated. You can continue to generate the groups as stand-alone pages like in version 10.1.3. However, to increase the reusability of your groups, it is recommended to generate them as page fragments within a region. You then have the option to generate one common UI shell page, with all group regions displayed through a dynamic region ("One-page application"), or to generate separate group-specific UI Shell pages.</li><br />
<li><b>Enhanced Menu Generation</b>: The generated menu now uses the new ADF 11 XML Menu Model, which greatly increases the flexibility of the menu generation, both in terms of menu structure as well as menu layout. The menu structure is specified in an XML file, and is <br />
separated from the layout of the menu. Using the ADF Faces NavigationPane or Tree elements included in the page templates that ship with JHeadstart, you can configure how the menu is displayed. The menu structure is now integrated accross services as well, allowing you to create a true application-level menu. Through the new application-level property <b>Content First-Level Menu Tabs</b> with allowable values "Base groups current service", "All services", and "All base groups" you can determine which levels of the menu are shown with group pages, and whether menu items of different services are "merged" into one menu level.<br />
If the declarative properties are not sufficient, you can use custom Velocity templates for the generation of the XML menu model files to easily generate menu structures that introduce new intermediate menu levels, effectively "hiding" the underlying structure of services and groups.</li><br />
<li><b>Support for Page Templates</b>: JHeadstart ships with sophisticated sample page templates. You can use these default templates, or create your own based on one of the sample templates. Using the new <b>Page Template</b> and <b>Region Template</b> properties you can specify which template is used by the generated page (fragments). You can even make the page templates dynamic, JHeadstart will then generate a drop down list to switch page templates which allows you to change the page template used by a page at runtime. This might be useful in prototyping situations where you you want to evaluate different page designs with end users.</li><br />
<li><b>Enhanced Support for Deeplinking</b>: Through a new item display value <b>groupLink</b> and associated new property <b>Link Group Name</b>, you can now declaratively set up taskflow calls between groups in any service. Using the new Item Parameters element, you can specify parameters that should be passed into the taskflow of the called group. For example, in the employees group, you can deeplink to the Jobs group, showing the job details of the current employee, by passing the JobId of the current employee as parameter. You can choose whether you want to display the called group in a popup window, or in the base window replacing the calling group. Using group taskflow parameters, that are referenced by the Insert/Update/Delete allowed properties you can easily show the Jobs form page in read-only mode, when deep-linked, and in editable mode when called through the menu.</li><br />
<li><b>Easy Reuse of Groups using a Group Region</b>: In version 10.1.3, group regions were introduced to provide more control over the layout of detail groups that are displayed on the same page as the master group. In version 11 we have significantly extended the functionality of this concept. By checking the new checkbox property <b>Include as ADF Region</b>, you can select any group from any service to be displayed on the page of the group owning the group region. In other words, the group region is now the key concept to reuse a group across your application. You can reuse the same group in many pages by including it as a group region. Through the new child element <b>Group Region Parameters</b>, you can specify parameters that should be passed into the taskflow of the group. For example, using these new concepts it becomes trivial to have one group "Employees" that is used to generate a top-level page with just employees, and reuse that same group as child group under the Departments group to generate a master-detail page with department and its employees. By using group query bind parameters property, that reference taskflow input parameters, you can implement the "master-detail" synchronization. By using additional task flow parameters, you can hide the "DepartmentId" item, the search area, the Save and cancel buttons in the employees group when used as child of the Departments group.</li> <br />
<li><b>Support for Model-based LOV's</b>: ADF Business Components 11 has extensive support for list of values. Using JHeadstart you can choose to use these new model-based LOV's, or the existing web-tier JHeadstart LOV's. When running the "New Jheadstart Service Definition" wizard you can choose which LOV style you want to use. When choosing model-based LOV's, JHeadstart will auto-generate View Accessors and List-of-Values definitions in the View Objects, based on the view links that exist between the view objects. You can choose whether the View Accessors are based on separate auto-generated read-only View Objects or on the existing entity-based view objects. When choosing read-only View Objects, you can choose to create the view accessors based on a shared application module instance, which allows you to reuse the LOV queries across user sessions, which is useful for static reference tables.</li><br />
<li><b>LOV Groups Reusable Accross Services</b>: It is now possible to create an LOV item that uses an LOV group that resides in a different service.</li><br />
<li><b>Ability to generate skin switcher</b>Through a new application-level property, you can generate a drop down list to switch between all skins registered in trinidad-config.xml at runtime.</li><br />
<li><b>Enhanced Template Editing</b>: The templates tab of the JHeadstart Application Definition Editor is now context-sensitive. You will only see the templates that apply to the node selected in the tree navigator. Furthermore, you can now create and modify custom templates within the application definition editor. On the Templates tab, you can change the file name of the default template, and when you tab out the modified file name field, a dialog pops up that asks for confirmation to create a custom template based on the default template. When you confirm this action, the custom template will be created, and you can edit it directly in the application definition editor, in a new area at the bottom of the templates tab.</li><br />
 <li><b>JHeadstart Forms2ADF Generator</b>: This utility allows you to reuse Oracle Forms .fmb files to create ADF web applications. The utility creates ADF Business Components based on the blocks, LOV's and Record Groups defined in the form. It also creates a JHeadstart Application  Definition file which allows you to generate fully functional web pages based on the form definition. The PL/SQL logic is extracted and displayed as documentation nodes into the Application Definition. The Application Definition Editor includes an option to move the PL/SQL logic to the database.  This utility is still lacking some functionality and has not yet proven itself in a real customer project. We invite you to test the JFG and report your findings to us. See the chapter "JHeadstart Forms2ADF Generator' in the <a href="http://download.oracle.com/consulting/jhsdevguide1111.pdf">JHeadstart Developer's Guide</a>, section "Troubleshooting" for more information on how to send us your feedback. This utility replaces the JHeadstart Designer-Forms Migrator which is no longer available in this release. </li><br />
</ul><br />
For a complete list of all existing features, use <a href="http://www.oracle.com/technology/products/jheadstart/jhsfeaturelist.html">this link</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Variations on ADF BC isAttributeChanged method</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/02/variations_on_adf_bc_isattributechanged.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.10059</id>
   
   <published>2009-02-09T12:09:10Z</published>
   <updated>2009-02-10T12:42:29Z</updated>
   
   <summary>ADF Business Components have a method isAttributeChanged available in Entity Objects that returns true if the the attribute has been changed since it was obtained from the Database. This method can cause a problem when used in business rules that...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="ADF Business Components" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adfbc" label="ADF BC" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="businessrules" label="business rules" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>ADF Business Components have a method isAttributeChanged available in Entity Objects that returns true if the the attribute has been changed since it was obtained from the Database. This method can cause a problem when used in business rules that are triggered at Commit time, or in business rules that only apply when the attribute value has actually changed.<br />
 <br />
<h3>Problem when calling isAttributeChanged at Commit time</h3></p>

<p>From the <a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e10653/oracle/jbo/server/EntityImpl.html#isAttributeChanged(int)">Javadoc of EntityImpl</a>: <em>Note that if a Posting operation is performed, and the attribute value is sync'd with the database, that subsequent requests will return false, until the next time the attribute is changed.</em></p>

<p>As <a href="http://kettenisblogs.blogspot.com/2007/07/when-using-oracle-adf-application.html">Jan Kettenis pointed out</a>, this means that if you use isAttributeChanged for a business rule that is triggered at Commit time, it will always return false, even though the attribute was changed. <a href="http://kettenisblogs.blogspot.com/2007/07/when-using-oracle-adf-application.html">Jan describes a workaround</a> for this problem.</p>

<h3>Problem calling isAttributeChanged if value changed back to old value</h3>

<p>Another quote from the <a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e10653/oracle/jbo/server/EntityImpl.html#isAttributeChanged(int)">Javadoc of EntityImpl</a>: <em>Note that this method will return true if the value has been set to the same as the database value since it doesn't perform a value comparison.</em></p>

<p>This can be a problem for validations that apply only when the value changes: for example, the rule "Department Name cannot be changed if the Department has Employees". You might have implemented the rule in a method validator using isAttributeChanged:<br />
<pre>  return (!isAttributeChanged(DEPARTMENTNAME) || !hasEmployees());</pre></p>

<p>Suppose a Department has Employees, and you change both the Department Name and the Department Manager. When you apply these changes, you obviously get an error because you are not allowed to change the Department Name. Suppose you now change the Department Name back to its original value, and try again, because you still want to change the Department Manager. You will still get the error, because isAttributeChanged(DEPARTMENTNAME) will remain false until you have posted the data, even though the attribute value is now the same as the value in the database!</p>

<p>To avoid this, you can define a variation on isAttributeChanged in your EntityImpl base class: isAttributeValueChanged (but note that when called from Commit level, it will still return false like <a href="http://kettenisblogs.blogspot.com/2007/07/when-using-oracle-adf-application.html">Jan described</a>).</p>

<pre>  /**
   * Using getPostedAttribute and getAttribute this method retrieves the old and new
   * values and compares whether it has changed. Alternative to isAttributeChanged,
   * which returns true if the value was modified to the same value as the database.
   * @param index index of the attribute.
   * @return <tt>true</tt> if the value of the attribute at the given index
   * is different from the one in the database.
   */
  public boolean isAttributeValueChanged(int index) {
    Object oldVal = getPostedAttribute(index);
    Object newVal = getAttribute(index);
    boolean valueChanged = true;
    if ((oldVal == null) && (newVal == null)) {
      valueChanged = false;
    } else if (newVal != null) {
      if (newVal instanceof String) {
        if (((String)newVal).length() == 0) {
          if (oldVal == null) {
            valueChanged = false;
          }
        }
      }
      if (valueChanged && newVal.equals(oldVal)) {
        // in new rows, the oldVal is always the same as the newVal,
        // but if the value is not null in a new row, we want to return true
        if (getEntityState() != Entity.STATUS_NEW) {
          valueChanged = false;
        }
      }
    }
    return valueChanged;
  }</pre>]]>
      
   </content>
</entry>

<entry>
   <title>Oracle launches Rich Enterprise Application (REA) site</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2009/01/oracle_launches_rich_enterpris.html" />
   <id>tag:blogs.oracle.com,2009:/jheadstart//55.9474</id>
   
   <published>2009-01-05T08:59:59Z</published>
   <updated>2009-01-05T09:11:35Z</updated>
   
   <summary>This site is targeted towards Developers that want to build highly interactive web applications that deliver desktop quality of user interface. Oracle&apos;s REA technologies consist of Oracle ADF Faces Rich Client and Oracle WebCenter. URL: http://rea.oracle.com. When you click the...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="JSF / ADF Faces" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adf" label="ADF" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="adffaces" label="ADF Faces" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="rea" label="REA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="webcenter" label="WebCenter" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>This site is targeted towards Developers that want to build highly interactive web applications that deliver desktop quality of user interface. Oracle's REA technologies consist of Oracle ADF Faces Rich Client and Oracle WebCenter. URL: <a href="http://rea.oracle.com">http://rea.oracle.com</a>.</p>

<p>When you click the "Explore Now" button, you see a very nice tree with topics, where you can flip each node to see a small explanation, or expand it to see new nodes with subtopics.<br />
<img alt="rea_site.jpg" src="http://blogs.oracle.com/jheadstart/rea_site.jpg" width="800" height="364" /><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>ADF 11 Course 12-16 January in The Netherlands</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/12/adf_11_course_1216_january_in.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.9256</id>
   
   <published>2008-12-24T13:06:27Z</published>
   <updated>2008-12-24T13:09:23Z</updated>
   
   <summary>Oracle University just released the ADF 11 course, covering many new ADF 11 features. I will be teaching this course from 12 to 16 january 2009 in De Meern, the Netherlands. There are still seats available. For a list of...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>Oracle University just released the ADF 11 course, covering many new ADF 11 features. <br />
I will be teaching this course from 12 to 16 january 2009 in De Meern, the Netherlands. </p>

<p>There are still seats available. For a list of course topics and registration, use <a href="http://education.oracle.com/pls/web_prod-plq-dad/show_desc.redirect?dc=D53979GC10&p_org_id=41&lang=NL&source_call=">this link</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Java By Exception for Business Rules in ADF BC</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/11/java_by_exception_for_business_rules_in_adfbc.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.7870</id>
   
   <published>2008-11-21T19:31:00Z</published>
   <updated>2009-04-14T18:05:49Z</updated>
   
   <summary> Oracle ADF Business Components 11g has many new features for declarative business rules, allowing a &quot;Java By Exception&quot; approach. When can and should you use these declarative features, and when and how should you use Java to implement business...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="ADF Business Components" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adfbc" label="ADF BC" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ooprinciples" label="OO principles" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="businessrules" label="business rules" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="declarativevalidationrules" label="declarative validation rules" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[     <p><a href="http://www.oracle.com/technology/products/adf/index.html">Oracle ADF</a> Business Components 11g has many new features for declarative
       business rules, allowing a "Java By Exception" approach. When can and should you use these declarative features,
       and when and how should you use Java to implement business rules in ADF
       BC?</p>
     <p>
      &nbsp;
    <table cellspacing="3" cellpadding="0" border="0" width="100%">
      <tr>
        <td>
          <h2>What are Business Rules?</h2>
          <p>Let me first explain what I mean by business rules in this context.
</p><p>Business rules are used to preserve data integrity, to prevent inconsistent data from being entered into the database. They are checks and/or data corrections you want to perform in your entity
             objects, triggered by an insert, update or delete of certain data.</p><p>
             The most common ones are <em>validation rules</em> or <em>constraints</em>: if the
             data changes do not satisfy a certain integrity rule, you return an
             error. For example: the End Date may not be before the Start Date. Another category of business rules is <em>change event rules</em>:
             if a certain change is made, you automatically want another change
             in the data to be made as well. For example: automatically converting a Code to uppercase (so that the integrity rule that a Code must be uppercase is implicitly maintained).</p>
          <p>
            The white paper 
            <a href="http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf">Business
                                                                                                                                 Rules
                                                                                                                                 in
                                                                                                                                 ADF
                                                                                                                                 BC</a>
             defines business rules as follows (in the intro of section 6,
            &quot;Business Rule Classification Scheme&quot;):
          </p>
          <blockquote>
                       <p><em>
                A business rule is either</em>
              </p><ul>
                <li>
                  <em>a restriction that applies to the state of the system, the
                  change of the system state or the authorized use of the system,</em>
                </li>
                <li><em>
                  or an automatic action that is triggered by a change to the
                  system state</em>
                </li>
              </ul>
          </blockquote>
        </td>
        <td>
          <a href="http://www.safetycenter.navy.mil/photo/archive/archive_101-150/photo107.htm"><img src="http://blogs.oracle.com/jheadstart/photo107_3.jpg"
               alt="Photo credit: Naval Safety Center" height="206" width="148"/></a>
        </td>
      </tr>
    </table></p><h2>My Preferred ADF BC 11g techniques for Business Rules</h2><p>
      In <a href="http://www.oracle.com/technology/products/jdev/index.html">Oracle JDeveloper</a> 11g, ADF BC offers several new features for
      declarative validation rules support (see also the 
      <a href="http://www.oracle.com/technology/products/jdev/collateral/papers/11/newfeatures/index.html#JDeveloperandADFRelease11NewFeatures-ADFBusinessComponents">JDeveloper
                                                                                                                                                                      11g
                                                                                                                                                                      New
                                                                                                                                                                      Features
                                                                                                                                                                      list</a>):
    </p><ul>
      <li>
        Control when a validation rule is executed by specifying a conditional
        execution expression or triggering attributes (or by deferring the execution to transaction level)
        <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
             alt="New!"/>
      </li>
      <li>
        Create parameterized error messages and warnings saved in external
        resource bundles
        <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
             alt="New!"/>
      </li>
      <li>
        New validation rule types (in the below lists they are tagged with
        <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
             alt="New!"/>
        )
      </li>
    </ul><p>
      Let me describe the ADF BC techniques (with links to relevant sections in the 
      <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/toc.htm">Fusion
                                                                                     Developer's
                                                                                     Guide
                                                                                     for
                                                                                     ADF</a> or to paragraphs below)
                                                                                            that
                                                                                            I
                                                                                            refer
                                                                                            to
                                                                                            later
                                                                                            in
                                                                                            this
                                                                                            post,
                                                                                            in
                                                                                            order
                                                                                            of
                                                                                            preference.
                                                                                            In
                                                                                            fact,
                                                                                            I
                                                                                            have
                                                                                            two
                                                                                            lists
                                                                                            of
                                                                                            preferred
                                                                                            techniques,
                                                                                            depending
                                                                                            on
                                                                                            the
                                                                                            question:
      Should the rule be implemented for more than one entity?
    </p><h3>Preferred Techniques for Rules that apply to Multiple Entities</h3><p>
      If the answer is
      Yes, the rule should be implemented in more than one entity, then
                my preferred techniques are:
    </p><ol>
       <li>
        <strong>Domain</strong>, see
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#sm0326">Section
                                                                                                  34.1
                                                                                                  Creating
                                                                                                  Custom,
                                                                                                  Validated
                                                                                                  Data
                                                                                                  Types
                                                                                                  Using
                                                                                                  Domains</a>.
      </li>
      <li>
        <strong>Custom Validator, also known as Registered Rule</strong>, where you code a new validator type in Java, which you can then
        declaratively assign to an entity (or entity attribute). See <a href="#custom_validator">How to create a Custom Validator</a>.
      </li>
      <li>
        <strong>Overriding superclass method</strong>
        in the EntityImpl java class at the base class level (see
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvgen.htm#BABFDHHB">Section
                                                                                                     33.2
                                                                                                     Creating
                                                                                                     a
                                                                                                     Layer
                                                                                                     of
                                                                                                     Framework
                                                                                                     Extensions</a>,
        which you should do before creating any individual Entity Objects),
        using separate classes and interfaces for the actual business logic (see
        <a href="#oo_in_entityimpl">How to apply OO principles in EntityImpl</a>).
      </li>
    </ol><h3>Preferred Techniques for Rules that apply to Individual Entities</h3><p>
      If the answer is 
      No, the rule should be implemented in only one entity, then my
               preferred techniques are:
    </p><ol>
      <li>
        <strong>Entity, Attribute, or Association Property</strong>, for example the Mandatory property of an attribute, or the <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcentities.htm#CIHCFGFC">History Column feature</a> for tracking creation / last update info. You can even <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#insertedID11">create your own History Type</a>.
      </li>
      <li>
        <strong>Declarative Validation Rule</strong> that doesn't require any Groovy or Java
        coding (for more information see 
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcvalidation.htm#CACGFEDC">Section 7.3,
          Adding Validation Rules to Entity Objects and Attributes</a>). If you need to postpone the calling of the rule to commit time, 
          set "Defer execution to transaction level" when adding the rule to an entity or attribute.
        <ul>
          <li>
            <strong>Collection</strong>
            <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
                 alt="New!"/>
            (validates based on aggregate values in a collection)
          </li>
          <li>
            <strong>Compare</strong>
            (performs a logical comparison between the attribute and a value)
          </li>
          <li>
            <strong>Key Exists</strong>
            <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
                 alt="New!"/>
            (checks cache and database to see if value exists as a key in a
            certain entity, useful for logical Foreign Keys that are not checked in the database)
          </li>
          <li>
            <strong>Length</strong>
            (compares the character or byte length of an attribute value to the
            specified size)
          </li>
          <li>
            <strong>List</strong>
            (compares an attribute against a list of values that can be
            specified in several ways)
          </li>
          <li>
            <strong>Range</strong>
            (tests for attribute values within specified minimum and maximum
            values)
          </li>
          <li>
            <strong>Regular Expression</strong>
            (compares an attribute value against an expression mask)
          </li>
          <li>
            <strong>UniqueKey</strong>
            <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
                 alt="New!"/>
            (business-logic tier equivalent of a unique constraint in the
            database)
          </li>
        </ul>
      </li>
      <li>
        <strong>Script Expression</strong>
        <img src="http://www.oracle.com/technology/products/jheadstart/new.jpg"
             alt="New!"/>
        (declarative validation rule used for creating Groovy validation
        expressions). Applicable if
        the Groovy syntax and constructs, see
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcintro.htm#CEGJJJBA">Section
                                                                                                    3.6
                                                                                                    Overview
                                                                                                    of
                                                                                                    Groovy
                                                                                                    Support</a>, 
      are powerful enough to implement the rule, and the expression is
        limited in length.
      </li>
      <li>
        <strong>Method</strong>
        (declarative validation rule used to call any method defined by the
        entity object that accepts a parameter of the appropriate type and
        returns a boolean value, see
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcrules.htm#CIHBBDDB">Section
                                                                                                    8.2
                                                                                                    Implementing
                                                                                                    Validation
                                                                                                    and
                                                                                                    Business
                                                                                                    Rules
          Programmatically</a>). If the method for this rule is more than a few lines of Java code,
          I prefer to implement the rule as a Custom Validator, so it can be implemented in a separate class
          with several methods.
      </li>
      <li>
        <strong>Custom Validator, also known as Registered Rule</strong>, where you code a new validator type in Java, which you can then
        declaratively assign to an entity (or entity attribute). See <a href="#custom_validator">How to create a Custom Validator</a>.
      </li>
      <li>
        <strong>Overriding superclass method</strong>
        in EntityImpl java class, at the level of an individual entity
        object (see
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcrules.htm#CIHBBDDB">Section
                                                                                                    8.2
                                                                                                    Implementing
                                                                                                    Validation
                                                                                                    and
                                                                                                    Business
                                                                                                    Rules
                                                                                                    Programmatically</a>), using separate classes and interfaces for the actual business logic
        (see
        <a href="#oo_in_entityimpl">How to apply OO principles in EntityImpl</a>).
      </li>
    </ol><p>Now these lists need a little explanation. Why do I prefer these,
            and when can or can't you use one of these techniques?</p><h2>Why
                                                                          these
                                                                          techniques?</h2><p>My
                                                                                             preferences
                                                                                             for
                                                                                             certain
                                                                                             techniques
                                                                                             are
                                                                                             based
                                                                                             on
                                                                                             the
                                                                                             following
                                                                                             assumptions:</p><ul>
      <li>
        <u>XML-based is preferred to code-based</u>
        (be it Groovy or Java code). There are several reasons for this:
        <ol>
          <li>
            One benefit of using declarative validation (versus writing your own
            validation) is that the validation framework takes care of the
            complexities of batching validation exceptions, which frees you to
            concentrate on your application's specific validation rule logic. (Quote from
            <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcvalidation.htm#CACJJBEB">Section
                                                                                                             7.1
                                                                                                             Introduction
                                                                                                             to
                                                                                                             Declarative
                                                                                                             Validation</a>.)
          </li>
          <li>Another benefit of declarative validation, is the traceability of
              the rules. It is easier to see which rules are implemented in a
              certain entity. Just open an entity definition, go to the
              Validations, and see which declarative rules are listed. Even if
              not all rules can be listed there, it is a good starting point.</li>
          <li>
            In a later version of JDeveloper 11g, when MDS (Meta Data Services)
            is fully enabled, it will be possible to customize these XML-based
            business rules without having to change the source files (see
            chapter 33 of the
            <a href="http://download.oracle.com/otn_hosted_doc/jdeveloper/11/doc/b31974.pdf">draft
                                                                                             developer's
                                                                                             guide
                                                                                             of
                                                                                             a
                                                                                             JDeveloper
                                                                                             11g
                                                                                             Preview
                                                                                             release</a>).
          </li>
          <li>
            The recently started
            <a href="http://wiki.oracle.com/page/ADF+Methodology">ADF
                                                                  Methodology
                                                                  Group</a>
            discussed the term &quot;Java By Exception&quot; (see
            <a href="http://wiki.oracle.com/page/Extreme+Reusability">Extreme
                                                                      Reusability</a>, an ADF development methodology proposed by <a href="http://www.avromroyfaderman.com/">Avrom Roy-Faderman</a>).
            Applications are supposed to be entirely declarative,
            <em>except</em>
            for those few cases where declarative uses of the framework do not
            cover needed functionality. The idea is that you can harness the
            power of Java when you need it, and avoid the complexity at other
            times. At the ADF Methodology symposium, <a href="http://radio.weblogs.com/0118231/">Steve Muench</a>, very
            appropriately, pointed out that ADF, as well, is a &quot;Java by
            exception&quot; framework.
          </li>
        </ol>
      </li>
      <li>
        <u>Generalize, Push Up, and Customize</u>
        : Avrom's
        <a href="http://wiki.oracle.com/page/Extreme+Reusability">Extreme
                                                                  Reusability</a>
        describes this practice as: Rather than writing a piece of Java code
        tailored to a highly particular need, consider the possibility of
        <em>generalizing</em>
        the code and
        <em>pushing it up</em>
        the class hierarchy to a custom framework class, allowing declarative
        <em>customization</em>
        of specific cases. <br/>I agree with this practice: if you expect that the
        functionality of the Java code is probably going to be needed in another
        place as well, possibly with a small variation, generalize it. This principle also implies that even if
        you can implement a rule with a declarative validator, but it needs to be done in more than one entity,
        then you still should create a generalized implementation so you avoid repeatedly entering the same properties like error message code, validator subtype, etc.
        Repetitive work increases the probability of mistakes, and the result is hard to maintain.
      </li>
      <li><u>Use Object Oriented Design Principles</u>
                 when coding business rule logic in Java (I took these from the
                first chapter of the excellent book <a href="http://oreilly.com/catalog/9780596007126/">Head
                                                                                                       First
                                                                                                       Design
                                                                                                       Patterns</a>):  <table cellspacing="3" cellpadding="0" border="0" width="100%">
          <tr>
            <td>

              <ol>
                <li><strong>Encapsulate what varies</strong>, translated to: put the business
                    rule logic in a separate class - see <a href="#oo_in_entityimpl">How to apply OO principles in
                                            EntityImpl</a></li>
                <li><strong>Program to interfaces, not implementations</strong>, translated to:
                    let the rule class implement an interface which you call
                    from the EntityImpl - see <a href="#oo_in_entityimpl">How to apply OO principles in
                                            EntityImpl</a></li>
              </ol>
              <p>
                This avoids very large EntityImpl classes, in which it is hard
                to keep track of what was generated by ADF BC and what was added
                by you. If you follow these principles, there are only a few
                superclass methods that are likely to be customized (see 
                <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcrules.htm#insertedID1">Section
                                                                                                               8.1
                                                                                                               Introduction
                                                                                                               to
                                                                                                               Programmatic
                                                                                                               Business
                                                                                                               Rules</a>).
              </p>
              
            </td>
            <td>
              <img src="http://tbn0.google.com/images?q=tbn:4hXTmhD38CjQUM:http://www.oreilly.com/catalog/covers/9780596007126_lrg.jpg"
                   width="116" height="134"
                   alt="Cover of Head First Design Patterns book"/>
            </td>
          </tr>
        </table>
      </li>
    </ul><h2>When to use what technique?</h2><p>
      The preferred techniques mentioned above may or may not be possible,
      depending on the type of business rule you need to implement. Besides the decision if the rule should
      be implemented for more than one entity or not, what matters as well
      is the 
      complexity
       of the rule, and at which point in the ADF Entity Object's 
        validation cycle
       it needs to be triggered.
    </p><h3>Triggering moment</h3><p>
      What you need to remember is that all techniques, except coding directly
      in the EntityImpl class, can only be called at the time a single Entity
      row is 
      validated, or at the time all Entity rows are
      committed
       (the latter occurs if you defer the execution to transaction level, using
      a setting in the Entity &quot;Add Validation Rule&quot; dialog). That is the equivalent of overriding the entity superclass methods
      validateEntity or beforeCommit.
      </p><p>However, sometimes you need to trigger the rule from the superclass methods
        doDML, remove, or some other method. The Rule Classification Scheme of the
        <a href="http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf">Business
                                                                                                                             Rules
                                                                                                                             in
                                                                                                                             ADF
                                                                                                                             BC
                                                                                                                             white
                                                                                                                             paper</a>
        can help: for the rule types &quot;Delete&quot;, &quot;Collection, no
        parent&quot;, &quot;Collection within parent&quot;, &quot;Change event
        with DML&quot;, and &quot;Change Event without DML&quot;, it might not be possible to trigger them at validate or commit time.
    </p><h3>Complexity of the rule</h3><p>
      Furthermore, validation rules are often not suitable for change event rules
      (that trigger a data change in some other attribute or entity). It might
      interfere with the Validation Cycle (see 
      <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcvalidation.htm#CIHCEEJG">Section
                                                                                                       7.2
                                                                                                       Understanding
                                                                                                       the
                                                                                                       Validation
                                                                                                       Cycle</a>).
    </p><p>The complexity of the rule determines if it is possible to implement
           it using one of the most preferred techniques, like a Compare
           validator or a Range validator. If that is not possible, it might be
           possible to implement it using a Groovy Script validator. If that is
           not possible, it might be possible to implement it with a Method Validator with a small number of lines of Java code in the method,
           etcetera.</p><h3>Algorithm to determine Best Rule Technique</h3><p>
      If you apply all of these guidelines, you have the following summary
      algorithm for determining the best rule technique: </p>
      <p><img alt="Algorithm for choosing ADF BC 11g Business Rule Technique" src="http://blogs.oracle.com/jheadstart/AlgorithmRuleTechnique.png" width="625" height="1061" />
    </p>
<h2>
      <a name="custom_validator"></a>
      How to create a Custom Validator
    </h2><p>See the Fusion
        Developer's Guide for Oracle Application Development Framework
        <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#sm0330">Section
                                                                                                  34.10:
                                                                                                  Implementing
                                                                                                  Custom
                                                                                                  Validation
                                                                                                  Rules</a>. Essentially you create a
      new Java class that extends AbstractValidator and implements the JboValidatorInterface. This forces you to implement a method <i>validate(JboValidatorContext)</i>. You can specify custom rule properties for the things that vary
      if you need to implement this rule for more than one entity or attribute.
      </p><p>If the rule must be triggered at commit time as opposed to validate time, you must also
        implement the
        JboTransValidatorInterface. This forces you to implement a method <i>validateMany</i> in addition to <i>validate</i>, but in our test case it was never called, even if you set the "Defer execution to transaction level" when assigning the rule to an entity or attribute.
        Still, a logical implementation of this method would be to loop over all JboValidatorContexts and call validate for each:</p>
<pre>    public void validateMany(ArrayList valCtxs) {
        JboValidatorContext evObj;
        for (int i = 0; i < valCtxs.size(); i++)
        {
           evObj = (JboValidatorContext) valCtxs.get(i);
           validate(evObj);
        }
    }</pre>
    <p>When you have written the Java class, you must register it as a rule in your Model project, and then you can declaratively assign it to one or more entities, possibly setting some entity-specific properties for the rule. Those properties can be exposed simply by creating getters and setters for them in the Java class.</p>
    <p>Note: if the rule should be applied to all Entity Objects, without any specific properties to configure for each individual entity, then it is easier to use the technique of <a href="#oo_in_entityimpl">Overriding a method in
                                            EntityImpl</a>, so you don't have to do any work in the individual entities.</p>
       <p><i>Note 2: You could also use the JboValidatorInterface when the trigger time is not validateEntity or commit,
      but it requires instantiating a JboValidatorContext like this:</i>    </p>
<pre>        JboValidatorInterface businessRule = new MyCustomValidator();
        JboValidatorContext entityContext =
            new JboValidatorContext(JboValidatorContext.TYP_ENTITY_OBJECT,
                                    this, getEntityDef().getFullName(), null,
                                    null, this);
        businessRule.validate(entityContext);</pre> <p><i>I find this less intuitive then the technique described below, and you don't have the added value that declarative rules have like traceability, bundling exceptions, and allowing changes through MDS. Besides, this codes gives a compiler warning, and it is not clear to me what the alternative for the deprecated constructor is:</i></p>
<pre>   constructor JboValidatorContext(int, java.lang.Object, java.lang.String,
   oracle.jbo.AttributeDef, java.lang.Object, java.lang.Object) has been deprecated</pre>
   <p><i>It works fine, though, so if you like it you can use this approach instead of the one described in <a href="#oo_in_entityimpl">
      How to apply OO Principles in EntityImpl</a>.</i></p>
    </p>
       <p>Thank you <a href="http://radio.weblogs.com/0118231/">Steve Muench</a>
        and <a href="http://kettenisblogs.blogspot.com/search/label/ADF">Jan Kettenis</a>
        for helping me to position this technique in 11g.</p><h2>
      <a name="oo_in_entityimpl"></a>
      How to apply OO Principles in EntityImpl
    </h2><p>
      This paragraph explains how I applied the Object Oriented Design
      Principles &quot;Encapsulate what varies&quot; and &quot;Program to
      interfaces, not implementations&quot;, with the help of my colleague 
      <a href="http://architectgauravmalhotra.blogspot.com/">Gaurav Malhotra</a>. I found that it helps separate out the rule implementation code from
      the Business Components classes, and clarifies the communication between
      the classes by using interfaces for different types of rules, if you want to use the technique
      of overriding a method in EntityImpl. In fact, the
      Custom Validator technique (see <a href="#custom_validator">How to create a Custom Validator</a>) also applies these OO principles.</p>
<p>Note: if the rule applies to multiple entities but not exactly the same for each entity, you can use Custom Properties in the individual entities to configure your business rule.</p>
      <h3>Take the rule code out of the EntityImpl class</h3>
      <p>One of the most complex rules we had in a large project involved a
           private helper class, several static final constants, and several
           helper methods that need to be called several times. So you can
           imagine that it is not a good idea to put all that code in the
           EntityImpl class, mixed in with the code for other rules and/or the
           ADF BC framework generated code.</p><p>
      Borrowing a phrase from
      <a href="http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/StrategyPattern.htm">Antonio
                                                                                                Garc&iacute;a's
                                                                                                description
                                                                                                of
                                                                                                the
                                                                                                Strategy
                                                                                                Pattern</a>, 
      <em>it is much simpler to keep track of them if each behaviour</em>
       (in our case business rule) 
      <em>is a separate class, and not buried in the body of some method</em>.
                                                                             That
                                                                             is
                                                                             how
                                                                             I
                                                                             interpreted
                                                                             the
                                                                             principle
                                                                             &quot;Encapsulate
                                                                             what
                                                                             varies&quot;.
    </p><h3>Inject the Entity Row</h3><p>Now, in the business rule logic we probably have to call several
           EntityImpl methods for the row that triggered the rule, like the entity's getters, or the superclass generic getAttribute method.
           How do you do that if the rule logic is in a separate class?</p><p>
      The answer is: 
      inject the Entity row into the rule class, using a setEntity
                                                      method. The rule class can
                                                      then call entity
                                                      methods by coding
                                                      getEntity().someMethod(). This way you can also retrieve values of Custom Properties of Entities in case of generic rules that apply to multiple entities: getEntity().getEntityDef().getProperty(customPropertyName).
    </p><h3>Define contract with caller using an Interface</h3><p>
      Then, apply the &quot;Program to Interfaces&quot; principle by specifying
      an 
      interface that defines which rule class methods should be callable
       from the EntityImpl class and which not. If you have multiple rules that
      have to be implemented in the EntityImpl, you can probably re-use the same
      interface for several rules.
    </p><p>
      An example of such an interface is the general-purpose 
      EntityRule
       interface (note the use of a Java 5 
      <a href="http://java.sun.com/docs/books/tutorial/extra/generics/methods.html">generic
                                                                                    method</a>):
    </p><pre>public interface EntityRule&lt;T> {
    public void setEntity(T entity);
    public void process();
}</pre><p>An implementation of this interface might be:</p><pre>public class MyComplexRuleImpl implements EntityRule&lt;MyEntityImpl></pre>
     
    <p>You call the rule by coding in the appropriate method of your
       MyEntityImpl class:</p><pre>     EntityRule myComplexRule = new MyComplexRuleImpl();
     myComplexRule.setEntity(this);
     myComplexRule.process();</pre><p>Of course you can have multiple RuleImpl
                                      classes each representing a different
                                      Entity Rule, which can be called from
                                      different places in the EntityImpl.</p>
     <h3>Benefits of this technique</h3><p>Using
                                                                                                                                                                                                     this
                                                                                                                                                                                                     approach
                                                                                                                                                                                                     you
                                                                                                                                                                                                     can
                                                                                                                                                                                                     give
                                                                                                                                                                                                     complex
                                                                                                                                                                                                     rules
                                                                                                                                                                                                     their
                                                                                                                                                                                                     own
                                                                                                                                                                                                     class,
                                                                                                                                                                                                     while
                                                                                                                                                                                                     still
                                                                                                                                                                                                     allowing
                                                                                                                                                                                                     calls
                                                                                                                                                                                                     to
                                                                                                                                                                                                     framework
                                                                                                                                                                                                     methods
                                                                                                                                                                                                     like
                                                                                                                                                                                                     the
                                                                                                                                                                                                     Entity's
                                                                                                                                                                                                     getters.
                                                                                                                                                                                                     In
                                                                                                                                                                                                     the
                                                                                                                                                                                                     rule
                                                                                                                                                                                                     class
                                                                                                                                                                                                     you
                                                                                                                                                                                                     can
                                                                                                                                                                                                     throw
                                                                                                                                                                                                     an
                                                                                                                                                                                                     exception
                                                                                                                                                                                                     if
                                                                                                                                                                                                     the
                                                                                                                                                                                                     validation
                                                                                                                                                                                                     fails.
                                                                                                                                                                                                     The
                                                                                                                                                                                                     use
                                                                                                                                                                                                     of
                                                                                                                                                                                                     an
                                                                                                                                                                                                     interface
                                                                                                                                                                                                     makes
                                                                                                                                                                                                     it
                                                                                                                                                                                                     clear
                                                                                                                                                                                                     how
                                                                                                                                                                                                     to
                                                                                                                                                                                                     call
                                                                                                                                                                                                     such
                                                                                                                                                                                                     a
                                                                                                                                                                                                     rule,
                                                                                                                                                                                                     without
                                                                                                                                                                                                     knowing
                                                                                                                                                                                                     the
                                                                                                                                                                                                     inner
                                                                                                                                                                                                     workings
                                                                                                                                                                                                     of
                                                                                                                                                                                                     the
                                                                                                                                                                                                     rule.</p>]]>
      
   </content>
</entry>

<entry>
   <title>JDeveloper: Adding Framework Debug Messages Without Changing Source Code</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/10/jdeveloper_adding_framework_debug_msgs.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.8287</id>
   
   <published>2008-10-24T11:47:50Z</published>
   <updated>2008-10-24T13:49:06Z</updated>
   
   <summary>Today I ran into a problem where I got a NullPointerException in one of the EL-expressions called when processing an ADF Model page definition. The stack trace did not tell me which EL-expression caused the problem, and it could be...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="JDeveloper IDE" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adf" label="ADF" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jdeveloper" label="JDeveloper" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jheadstart" label="JHeadstart" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="debugging" label="debugging" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>Today I ran into a problem where I got a NullPointerException in one of the EL-expressions called when processing an ADF Model page definition. The stack trace did not tell me which EL-expression caused the problem, and it could be one of the many expressions used in the page definition itself, or in one of the many JSF managed beans referenced from the page definition. I could set a breakpoint in the ADF source code where the expression was evaluated, but that breakpoint fired about a hundred times for that single page. </p>

<p>The solution I found can be applied to any situation where you cannot easily influence the source code but still want to write some logging about the values of Java variables and method arguments. You can apply it to frameworks for which you have read-only access to the source code, like ADF and JHeadstart.</p>

<p>I didn't realize at first that JDeveloper 10.1.3 and JDeveloper 11 have an interesting debug feature called BreakPoint Actions. You can set breakpoints and configure them in such a way that they don't halt execution, but only write something to the log. That something can be the value of a Java variable or some other Java expression. So I let it write to the log which EL-expressions it was parsing, and then I could easily check which expression was written just before the NullPointerException.</p>

<p>Here is how you can add your own debug message (with values of class variables) to a (framework) class without having to modify any Java code:<br />
<ul><li>You go to the source code of the class you want to add a debug message to. In case of ADF, you can get the source code by logging a Metalink Service Request for the Oracle JDeveloper product, see <a href="http://forums.oracle.com/forums/thread.jspa?messageID=1006741&">this forum discussion</a>. How to install it is described in the <a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/web_testdebug005.htm">ADF Developer's Guide, section 24.5</a>. In case of JHeadstart, the source code is automatically installed as soon as you have applied JHeadstart in your project.</li><li>In your JDeveloper project, go to that source code using for example the menu option Navigate to Java Class, keyboard shortcut Ctrl+Minus. </li><li>Set a breakpoint on a certain line by clicking the line gutter, which causes a red bullet to appear. For example, I chose the topmost line in my NPE stack trace of which I had the source. <br />
<img alt="Image of breakpoint bullet in JDeveloper source code line gutter" src="http://blogs.oracle.com/jheadstart/breakpoint.jpg" width="382" height="325" /></li><li>Then right-click the red bullet and choose Edit Breakpoint. <br />
<img alt="Context menu showing Edit Breakpoint option" src="http://blogs.oracle.com/jheadstart/editBreakpoint.jpg" width="310" height="262" /></li><li>In the Edit Breakpoint dialog, click on the Actions tab, uncheck "Halt Execution" and fill in the desired variable name in Expression. In my example, by coincidence the variable I wanted to display was called expression, so in the screen shot you see Expression: expression. <br />
<img alt="Actions tab in Edit Breakpoint dialog" src="http://blogs.oracle.com/jheadstart/breakpointActions.jpg" width="380" height="339" /></li><li>Then run your project in Debug mode, and reproduce the problem. In my case the log showed this:<br />
<img alt="breakpointActionLog.jpg" src="http://blogs.oracle.com/jheadstart/breakpointActionLog.jpg" width="857" height="216" /><br />
</li></ul>It turned out I had made a stupid typing error ... but at least now I knew which one.</p>]]>
      
   </content>
</entry>

<entry>
   <title>JDeveloper 11g Working Sets: How To Share Them With Your Team</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/10/jdeveloper_11g_working_sets_ho.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.8124</id>
   
   <published>2008-10-10T15:27:00Z</published>
   <updated>2008-10-10T16:07:55Z</updated>
   
   <summary>In JDeveloper 11g, the Working Sets feature has improved: instead of having to choose a Working Set for each project, you can now do it for the whole Application (and get a subset of each project in the application). And...</summary>
   <author>
      <name>sandra.muller</name>
      
   </author>
   
      <category term="JDeveloper IDE" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="jdeveloper" label="JDeveloper" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="workingsets" label="Working Sets" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>In JDeveloper 11g, the Working Sets feature has improved: instead of having to choose a Working Set for each project, you can now do it for the whole Application (and get a subset of each project in the application). And even better, you can do it in the Application Navigator as opposed to only in the System Navigator (the System Navigator does not exist anymore in 11g).</p>

<p>A working set allows you to define a set of files (a subset of project source path contents) that you want to work with. For large projects, you may want to work with a small subset of the source files (for example, all the files in a given package, plus a few others). Typically, you would perform the following actions scoped to the working set:<br />
<ul><li>Navigate</li><li>Make</li><li>Build/rebuild</li><li>Search</li><li>Find usages</li><li>Search in Files</li></ul><br />
<img alt="workingsets.JPG" src="http://blogs.oracle.com/jheadstart/workingsets.JPG" width="351" height="255" /></p>

<p>When you have defined some useful working sets, you may want to exchange them with your fellow development team members. 2 years ago I blogged about how to <a href="http://blogs.oracle.com/jheadstart/2006/09/jdeveloper_1013_tip_sharing_wo.html">share JDeveloper 10.1.3 Working Sets with your team</a>, and here is how to do that in JDeveloper 11.<br />
<ul><li>Open [JDevWLSHome]/jdeveloper/system/system11.1.1.0.31.51.56/o.ide/projects folder and find the .jws file starting with the name of your JDeveloper Application, for example Base08345889adfc01e0ffd7dd7bfa1c6234.jws for an application called Base.</li><li>Open this file, and you will see XML code starting with &lt;hash n="working-sets"> that specifies your working sets.</li></ul><br />
Now you can either copy this piece of xml code, e-mail it to your colleagues and they can paste it in their application working sets file, or you can make sure that you all use the same application working sets file that is available from a common source. The latter is explained below.<br />
<ul><li>Copy (and possibly rename) this application working sets file to a location where it can be maintained centrally, but everyone has a local copy (for example in your Subversion repository).</li><li>Tell everyone to change the relevant entry in their own [JDevWLSHome]/jdeveloper/system/system11.1.1.0.31.51.56/o.ide/projects/index2.xml to let it point to the new file. (And don't forget to do that yourself as well ;-)</li></ul><br />
Everyone will only have to make a change to point to the shared file, and if one person updates the working sets all others will be able to get the changes, if they have JDeveloper closed while updating their local copy.<br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Clear search criteria on lov start-up in JHeadstart 10.1.3</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/10/clear_search_criteria_on_lov_s.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.7922</id>
   
   <published>2008-10-08T16:00:00Z</published>
   <updated>2008-10-08T06:30:12Z</updated>
   
   <summary> A list of values (LOV) is an ADF Faces component that allows the user to select an item from a popup window with a list of items and load the value(s) into the specified field(s). Oracle JHeadstart automatically generates...</summary>
   <author>
      <name>diego.collado</name>
      
   </author>
   
      <category term="Generator Templates" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="JHeadstart Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="jheadstart" label="JHeadstart" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="lov" label="LOV" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="customtemplates" label="custom templates" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="search" label="search" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>
A list of values (LOV) is an ADF Faces component that allows the user to select an item from a popup window with a list of items and load the value(s) into the specified field(s). Oracle JHeadstart automatically generates several search features for LOV type fields. It generates the simple and advanced search functionalities, in addition of validating text entered against the list, showing the records that meet the filter or, if there is just one match, loading the values in the fields. The criteria and results of the latest executed search are maintained during the session. This behavior is the same for any search executed on any ViewObject usage.
<br>
It can be required for LOV type fields not to save criteria and results from the previous search but instead show the complete list to choose in the lookup. To achieve this behavior it is necessary to clear the search criteria and re-execute the query with no filter values. This represents a performance penalty by having to execute an extra query each time a LOV is opened. The positive side is that it is only necessary to execute this extra query when the previous one was executed with not null criteria values.
<br>
The steps to implement this solution in JHeadstart 10.1.3 are described below:
<ol>
 <li>Extend the <strong>oracle.jheadstart.controller.jsf.bean.LovItemBean</strong> class.
 <li>Overwrite  the <strong>setLovSearchBean</strong> method, which is invoked several times during the use of a LOV:
     <ul>
        <li>Loading a page that contains any LOV type field.
        <li>Opening the window associated to a list of values.
        <li>Validating a string against a LOV.
        <li>Selecting a value from a LOV
        <li>Closing the window associated to a list of values.
     </ul>
     <br>
     This method receives an object of type <strong>oracle.jheadstart.controller.jsf.bean.JhsSearchBean</strong> that contains the objects where the search criteria are kept:
     <ul>
       <li>SearchText and Criteria when Quick Search is executed.
       <li>Criteria when Advanced Search is executed.
     </ul>
     <br>
     To ensure that a full query is executed if the previous search was more restricted, change the overridden method as shown below:
     <pre>
       public void setLovSearchBean (JhsSearchBean lovSearchBean){
         JhsSearchBean lsb = lovSearchBean;
         if(lsb!=null && (lsb.getSearchText()!=null || lsb.getCriteria().size()>0)) {
            lsb.setSearchText(null);
            lsb.getCriteria().clear();
            lsb.quickSearch(); 
         }
         super.setLovSearchBean(lovSearchBean);
       }</pre> 
Only when SearchText object is not null or Criteria object is not empty, the search criteria is cleared (lsb.setSearchText(null) lsb.getCriteria().clear()) and the search with no filter values is re-executed (lsb.quickSearch()).
<li>Create a new version of the velocity template <strong>misc/facesconfig/lovItemBean.vm</strong> which will reference the new class created in the first step:
       <pre>
       &lt;managed-bean>
          &lt;managed-bean-name>${bean.beanName}&lt;/managed-bean-name>
          &lt;managed-bean-class>new LovItemBean class created&lt;/managed-bean-class>
          &lt;managed-bean-scope>request&lt;/managed-bean-scope>
          …
       &lt;/managed-bean></pre>
       See section <a href="http://download.oracle.com/consulting/jhsdevguide1013.pdf">4.7 of the JHeadstart Developer's Guide</a> for more information about customizing generator templates.
<li>Associate this new template to the LOVs requested to have this behavior.
</ol>
</p>]]>
      
   </content>
</entry>

<entry>
   <title>JHeadstart Forms2ADF Generator Demos</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/10/jheadstart_forms2adf_generator.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.7907</id>
   
   <published>2008-10-02T11:35:38Z</published>
   <updated>2008-10-03T09:16:45Z</updated>
   
   <summary>On the JHeadstart Product Center, we posted a series of viewlets that demonstrate how you can transform Oracle Forms into ADF applications using the JHeadstart Forms2ADF Generator. In addition to the automated transformation, the viewlets show how easy it is...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="Forms to ADF" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adf" label="ADF" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="forms" label="Forms" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="formsmigration" label="Forms Migration" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="forms2adfgenerator" label="Forms2ADF Generator" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jheadstart" label="JHeadstart" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>On the <a href="http://www.oracle.com/technology/products/jheadstart/index.html">JHeadstart Product Center</a>, we posted a series of viewlets that demonstrate how you can transform Oracle Forms into ADF applications using the JHeadstart Forms2ADF Generator. <br />
In addition to the automated transformation, the viewlets show how easy it is to customize the migration result to produce a different user interface, more suited for web applications.<br />
The viewlets are using JHeadstart 10.1.3.3. If you want to see how the migrated forms will look when using JHeadstart release 11, then you can view the screen shots <a href="http://www.oracle.com/technology/products/jheadstart/jfg11preview.pdf">here</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>JHeadstart R11 Well Received at OOW</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/jheadstart/2008/09/jheadstart_r11_well_received_a.html" />
   <id>tag:blogs.oracle.com,2008:/jheadstart//55.7084</id>
   
   <published>2008-09-22T13:53:08Z</published>
   <updated>2008-09-30T13:36:49Z</updated>
   
   <summary>Yesterday, I presented the upcoming JHeadstart release 11 at Oracle Open World. The room was packed, and everyone seemed to have a good time, including the presenter :-) The numerous demo&apos;s ran fine and seemed to impress the audience. After...</summary>
   <author>
      <name>steven.davelaar</name>
      
   </author>
   
      <category term="JHeadstart Generic" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="forms2adfgenerator" label="Forms2ADF Generator" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="jheadstart" label="JHeadstart" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oow" label="OOW" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/jheadstart/">
      <![CDATA[<p>Yesterday, I presented the upcoming JHeadstart release 11 at Oracle Open World. The room was packed, and everyone seemed to have a good time, including the presenter :-) The numerous demo's ran fine and seemed to impress the audience.  After my demo of the JHeadstart Forms2ADFGenerator, I asked whether they liked what they had seen. I didn't get any reply, just a big round of applause..... <br />
The slides can be downloaded <a href="http://www.oracle.com/technology/products/jheadstart/OracleJHeadstart11_OOW2008.pdf">here</a>.</p>

<p>I will be hanging out on the campgrounds around the JDeveloper booth on wednesday september 24 from 11.00-13.30. So, if you are at OOW and missed my presentation, or want to see more, just step by and I am happy to tell and show everything about JHeadstart.</p>]]>
      
   </content>
</entry>

</feed>
