Frank Nimphius
Oracle Fusion Developer Guide by OraclePress at McGraw Hill 2010 sent to the printer
Today I received a mail from Rachel, the copy editing coordinator at McGraw Hill, that Lynn Munsinger and my book “Oracle Fusion Developer Guide, Building Rich Internet Applications with Oracle ADF Business Components and Oracle ADF Faces” has been sent to the printer. This is good news because Lynn and I worked hard on keeping up with the tight release schedule.
Frank
How-to declaratively launch a lightweight popup in a UI Shell
UI Shell is a layout pattern in which ADF bounded task flows are used within ADF dynamic regions to create desktop like user layouts that operate in a single document window. Bounded task flows that are displayed in ADF regions use ADF Faces page fragments (jsff) to display the UI content.
In a blog article, David Giammona from the Oracle controller development team, described a pattern to use when a bounded task flow needs to be displayed in a popup dialog. The ADF region popup pattern described by David Giammona is still a valid pattern to use, but as a code centric approach appears to be less productive than a declarative approach.
In Oracle JDeveloper 11g R1 Patch Set 1, the ADF controller team implemented a declarative approach for creating lightweight dialogs that can run bounded task flows in a lightweight dialog. This blog article provides you with the implementation details to implement this new declarative pattern.
JDeveloper 11g R1 PS1 New Feature: Launching DHTML popup dialogs using the external dialogframework
A new feature added in JDeveloper 11g R1 PatchSet 1 is the ability to display the AD Faces external dialog framework as an inline DHTML dialog. This allows developers to specify navigation cases using the “dialog:” pre-fix that are then opened in an inline popup. The external dialog window functionality of using a launch and return listener for the parameter and value exchange between the calling page and the dialog page is preserved.
A common design pattern in Fusion development is to launch the content of a bounded task flow in a dialog, which in JDeveloper 11g, until Patch set 1, required developers to use an ADF region in an af:popup component, which they controlled by JavaScript and Java. Using the new external dialog behavior of ADF Faces, regions are no longer required to display bounded task flows in an inline dialog.
In the Camtasia recording I did, the new feature is explained by example of a bounded task flow that has a single JSPX page to display. A parent page launches the dialog to show employee details in the dialog to further drill down into employee details (or to update the employee record, which is not what the demo shows).
Both option, the implementation pattern using ADF regions with page fragments, as well as the implementation using the new external dialog feature and JSPX pages have their use cases and therefore can coexist in ADF applications. However, using the external dialog window to call abounded task flow through the task flow call activity, is purely declarative and therefore feels more developer friendly.
Frank
How-to open an input form in a popup launched from a detailStamp facet of a table
I started a new series on ADF Code Corner in which I’ll take interesting programming challenges from the Oracle JDeveloper OTN forum and publish a solution in form of a Camtesia demo.
In this Camtasia video I explain how to open an input form in a popup launched from a detailStamp facet of a table. While this sounds easy to do with ADF, there is a bit of a challenge in it. Because the disclosing a detail stamp of a table does not mark the row as current, you need to ensure that the binding layer always is aware of teh context – the row to edit. There are two approaches to handle this use case and I decided to use a disclosure listener that makes the row the current row upon disclosure. In this video, you learn
- how to distinguish between and opening and closing operation in a disclosure listener
- how to ensure that only a single row is disclosed at a time
- get the binding object of the hierarchical tree binding from the table value
- Use JavaScript within a managed bean
- turn a form submit into committing a transaction
Unfortunately I am limited by a 5 MB size restriction when uploading files to OTN. Therefore – because the video came out log – I had to reduce the visual quality of the Camtasia movie. I am working hard on producing shorter videos that then can run in the best quality possible – I promise
Frank
JDeveloper 11g R1 Patch Set 1 released
Oracle JDeveloper 11g R1 Patch Set 1 (build 5536) is out on OTN for you to download. Though we call it a patch set, its coming with new features and enhancements. I’ll start blogging about new features tonight with a camtesia video about the new lightweight (DHTML) dialogs you can now create using the external dialog window.
http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html
Make sure you also have a look at the product documentation, which – again – we improved in various areas.
Frank
How-to access the selected row data in a TreeTable or Tree
The ADF Faces af:treeTable component displays hierarchical data in a combined tree and table structure. In this, the leading column is displayed as a tree, while subsequent columns, which could represent different hierarchy levels, are displayed in a table format. If you use ADF to bind the af:treeTable to business data, then a tree binding definition in the PageDef file is used by the ADF binding layer to provides the CollectionModel instance that is required by the af:treeTable as a component model. The question that this blog article answers is how developers use Java in a managed bean to determine the hierarchical data that represents the af:treeTable row that a user selected. [Read More] [Get More]
Frank
ADF Code Corner: ADF Security lesson 4 – Security Expressions released
Today I completed the ADF Security lessons on ADF Code Corner with a video about ADF Security Expressions. In the video, I explain the different expressions, how to use them and how to work with them in Oracle JDeveloper 11g. As a special tip, the video explains how to implement read protection for ADF bound input fields.
You can access the video Here or get them all on ADF Code Corner
Frank
ADF Code Corner: How-to pass values from a parent page to a popup dialog
To display values of the current table row in a popup dialog, or read current row data values in Java, developers use a simple but effective binding trick: To access the values of a selected row, you create attribute bindings for all attributes of interest of the iterator that the tree binding, which populates the tree at runtime, is based on. Because tables synchronize the selected table row with the binding, the attribute bindings always provide access to the row values using #{bindings..inputValue}. This little trick comes with no additional cost and also has the advantage that you can use the Expression Language builder in Oracle JDeveloper to bind UI components to the values. The disadvantage of this approach is that a row must be current – selected – for the popup to display the correct values or Java to be able to read these values in. Use cases, like multi row selection or displaying detail information fro a row, require a special handling if the information should be for non-current rows as well. In the example explained in this article, I use a table that displays a note window when the mouse hovers over a text label in the last column.
New ADF Faces Caching filter in JDeveloper 11g R1 Patch Set 1
As a note to myself, so I don't forget about this new (late arrival) feature that becomes available in the upcoming JDeveloper 11g R1 Patch Set 1 release:
ADF Faces Rich Client provides a caching filter that allows you to write gzip compressed content to the client.
AdfFacesCachingFilter
The new AdfFacesCachingFilter marks the application resources for caching at external Web Cache and/or user-agents (browsers). It also provides functionality for compression, in which a gzip-compressed response is sent to the user-agent. Advantage with this filter is that application developers don't need to configure Web Cache for this filter to work.
Only caching-rules need to be configured for the resources in application's adf-config.xml file. Caching-rules are based on file extension or path prefix. ADF faces jars comes with the default caching-rules for it static resources. If application developer defines their rules in adf-config.xml and their rules takes precedence over the default rules in jar.
The filter must be configured in web.xml if you want to use it. It also must be the first filter in the chain of filters:
PLAIN TEXT XML:- <filter>
- <filter-name>ACF</filter-name>
- <filter-class>oracle.adf.view.rich.webapp.AdfFacesCachingFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>ACF</filter-name>
- <url-pattern>*</url-pattern>
- </filter-mapping>code]
Caching-rules are defined in adf-config.xml. Following codes shows the example caching-rules for all the js and jpeg files to be cached and/or compressed at Web Cache and user-agents:
PLAIN TEXT XML:- <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/config">
- <caching-rules>
- <caching-rule id="cache js">
- <cache>true</cache>
- <compress>true</compress>
- <duration>99999</duration>
- <agent-caching>true</agent-caching>
- <cache-key-pattern>*.js</cache-key-pattern>
- </caching-rule>
- <caching-rule id="cache jpeg">
- <cache>true</cache>
- <compress>false</compress>
- <duration>99999</duration>
- <agent-caching>true</agent-caching>
- <cache-key-pattern>*.jpeg</cache-key-pattern>
- </caching-rule>
- </caching-rules>
- </adf-faces-config>
Frank
How-to use Contextual Events in ADF Region interaction
I did a lot of work with contextual events, as well as ADF region interaction, when writing chapter 6 of the Fusion Developer Guide Lynn Munsinger and I wrote for the Oracle Press series at McGraw Hill (book is going to be released in January 2010), which is why I offered a presentation on this topic at the OOW unconference.
As part of my "Secrets of ADF region Interaction patterns" talk during OOW, I showed a simple value change example using the new contextual event editor in Oracle JDeveloper 11g R1 Patch Set 1. I recorded this demo and published it on the ADF Code Corner website.
You can directly view this video from here.
Frank
Ps.: The video is quite long and I had to get it under 5 MB for the upload to the Code Corner Website. I decided for good audio quality but sacrificed the visual quality a bit in exchange. So just in case you wonder about the initial slide background colors - its because of this. Sorry ;-(
Secrets of ADF Region Interaction during OOW Unconference – Presentation Slot change
In a previous blog post, I mentioned my talk about ADF Region interaction pattern during the OOW unconference. Since then the schedule for this talk has been changed due to demo ground conflicts. Its still on Wednesday - Oct 14 - but it is at 11 am now.
The presentation and the demos are shaping and I finished the part I plan on contextual events. I am now moving on to the bounded task flow in a dialog topic, which is more than a pattern, but a nut to crack. The whole unconference schedule is available online: http://wiki.oracle.com/page/Oracle+OpenWorld+Unconference
Frank
Framebursting: A well documented by still unknown ADF Faces Feature
Customers - internal and external - who try to run ADF Faces applications within a frame may experience problems if using JDeveloper 11g. The reason for this is click protection, which by default is enabled for ADF Faces applications and that should prevent your application from being wrapped by 3rd party sites. So in case "Framebursting" is nothing you are aware of, read on ...
Fortunately, I can't describe this feature better than our documentation team did it. So for this blog entry I leave it by quoting the product documentation (appendix A):
"Use the oracle.adf.view.rich.security.FRAME_BUSTING context parameter to use framebusting in your application. Framebusting is a way to prevent clickjacking, which occurs when a malicious web site pulls a page originating from another domain into a frame and overlays it with a counterfeit page, allowing only portions of the original, or clickjacked, page (for example, a button) to display. When the user clicks the button, they in fact are clicking a button on the clickjacked page, causing unexpected results.
For example, say your application is a web-based email application that resides in DomainA and a web site in DomainB clickjacks your page by creating a page with an IFrame that points to a page in your email application at DomainA. When the two pages are combined, the page from DomainB covers most of your page in the IFrame, and exposes only a button on your page that deletes all email for the account. The user, not knowing they are actually in the email application may click the button and inadvertently delete all their email.
Framebusting prevents clickjacking by using the following JavaScript to block the application's pages from running in frames:
top.location.href = location.href;
If you configure your application to use framebusting by setting the parameter to always, then whenever a page tries to run in a frame, an alert is shown to the user that the page is being redirected, and then the above code is run, which causes it to be the topmost page, thereby disallowing the page to run in the frame.
If your application needs to use frames, you can set the parameter value to differentDomain. This setting causes framebusting to occur only if the frame is in a page that originates from a different domain than your application. This is the default setting.
Note:
The origin of a page is defined using the domain name, application layer protocol, and in most browsers, TCP port of the HTML document running the script. Pages are considered to originate from the same domain if and only if all these values are exactly the same.
For example, say you have a page named DomainApage1 in your application that uses a frame to include the page DomainApage2. Say the external DomainBpage1 tries to clickjack the page DomainApage1. The result would be the following window hierarchy:
DomainBpage1 --> DomainApage1 --> DomainApage2
If the application has framebusting set to be differentDomain, then the framework walks the parent window hierarchy to determine whether any ancestor windows originate from a different domain. Because DoaminBpage1 originates from a different domain, the framebusting JavaScript code will run for the DomainApage1 page, causing it to become the top-level window. And because DomainApage2 originates from the same domain as DomainApage1, it will be allowed to run in the frame.
Valid values are:
- always: The page will show an error and redirect whenever it attempts to run in a frame.
- differentDomain: The page will show an error and redirect only when it attempts to run in a frame on a page that originates in a different domain (the default).
- never: The page can run in any frame on any originating domain.
This context parameter is ignored and will behave as if it were set to never when either of the following context parameters is set to true:
- org.apache.myfaces.trinidad.util. ExternalContextUtils.isPortlet
- oracle.adf.view.rich.automation.ENABLED
"
As I mention, its a well documented feature, though an unknown to many who did not take the time to read our developers guide from the beginning to their very end
Frank
Oracle Open World 2009 Unconference: A day full of ADF content
Presenting during OOW for sure is a challenge and a pleasure at the same time for those who got their papers into the conference agenda. However, the OOW unconference also provides a stage to do the same in a less formal way. For those who don't know the Oracle Open World unconference:
For the third year in a row at Oracle OpenWorld, attendees will have the opportunity to directly participate by presenting their own session or workshop on a topic they're passionate about, in an informal, interactive setting.
The Oracle OpenWorld Unconference is more than a great opportunity for would-be presenters to share their knowledge and experience with other attendees in an informal setting. It also offers attendees the ability to learn what's on the minds of the community, directly from the grass roots.
Though I did not count the number of OOW sessions I delivered as a Product Manager, the number of times I've spoken at the unconference is zero. Time for a change. This year, Shay Shmeltzer suggested to staff a day at the unconference with interesting ADF topics. Almost at the same time, I finished my work on chapter 6 of the ADF Developer Guide, the book that Lynn Munsinger and I are authoring for Oracle Press, the Oracle books series published by McGraw Hill. The chapter is about ADF regions and I liked the idea to present its content and the lessons I learned while working with ADF regions. I suggested the topic for the OOW unconference and it got in - strike. Maybe we can make this presentation interactive as well and share experience as we go over some interesting secrets of region interaction.
I hope that you manage to pencil Wednesday - Oct 14, from 3 pm to 4 pm into your OOW agenda. The room is Overlook I, like for all the other talks about ADF this day, including 2 hours of ADF Methodology group meeting, which is a "must join" session for ADF developers.
Frank
Ps.: Before you ask - unfortunately, I wont have free copies of the book with me. No pens t-shirst etc. either. Just me and my slide deck
The book is not published before 2010, though McGraw Hill mentioned that there is an OOW conference pre-order discount available at their booth. So come as you are, so do I.
ADF Methodology Group meeting is on at Oracle Open World 2009
The Oracle ADF developer community meets during Oracle Open World 2009 in San Francisco for members to share their experience and build up their networking.
OOW 2009 - Oracle ADF Enterprise Methodology Group
Session ID: S312516
Time: Sunday 11th October 10:30 - 11:15
Although Oracle provides leading edge software to build enterprise applications, there's more to creating productive teams and delivering successful projects than just the tools. The ADF Enterprise Methodology Group was formed by ADF practitioners around the world to fill that gap and considers wider issues such as best practices, maximising code reuse, optimising team working, and more. Join JDeveloper and ADF experts, including Oracle staff and Oracle ACEs, to talk about such high-level ADF considerations.
As an ADF developer, you don't want to miss the opportunity to participate this event to join a growing group of experts
Frank
ADF 10.1.3 Repost of ADF Faces Tree Search Example
This blog entry provides a JDeveloper 10.1.3.1 workspace with a tree search example. The original example was posted on the "old" blogbuster server and got lost when the server went down. You need to add jsf-impl.jar and adf-faces-impl.jar back to the WEB-INF/lib directory to get it working.
Frank


