Frank Nimphius' Blog Buster http://thepeninsulasedge.com/frank_nimphius About Oracle JDeveloper, Oracle ADF, ADF Faces, JEE Security Tue, 09 Mar 2010 19:09:52 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 Gotchas when using memory scope prefixes in EL to access managed beans http://thepeninsulasedge.com/frank_nimphius/2010/03/09/gotchas-when-using-memory-scope-prefixes-in-el-to-access-managed-beans/ http://thepeninsulasedge.com/frank_nimphius/2010/03/09/gotchas-when-using-memory-scope-prefixes-in-el-to-access-managed-beans/#comments Tue, 09 Mar 2010 19:09:52 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=402 Interesting post on the Oracle JDeveloper Oracle internal mailing list, answered by Andrew Robinson. Accessing a managed bean in a standard servlet scope like sessionScope or requestScope using the scope as a prefix fails if the bean instance does not exist. Thus, bean reference like #{sessionScope.myBean} may fail while #{myBean} always succeeds. The reason for this is that #{sessionScope….} and #{requestScope…} reference a Map in memory and not the JSF framework.

But why would you want to use the memory scope as a prefix? If you reference an attribute in memory scope, then the search goes from smallest scope to broader scope, which means that if – by accident – there exist two objects with the same name and you wanted to access the object in the broader scope, chances are you access the wrong object. So prefixing the expression puts you on the save side. This however is only good to use when you access objects that already exist in memory (wich could be a previously instantiated managed bean – of course)

Managed beans must be instantiated before they become available in the memory scope, which means they need to be accessed through JSF. Luckily, JSF does not allow to configure two managed beans with the same name in different scopes. So even without a scope prefix, there is no risk that application code accidentally accesses the wrong object.

Note however that using ADFc specific scope like viewScope and pageFlowScope, a prefix of “pageFlowScope” or “viewScope” is required in the EL reference.

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/03/09/gotchas-when-using-memory-scope-prefixes-in-el-to-access-managed-beans/feed/ 0
How-to protect your ADF pages http://thepeninsulasedge.com/frank_nimphius/2010/03/08/how-to-protect-your-adf-pages/ http://thepeninsulasedge.com/frank_nimphius/2010/03/08/how-to-protect-your-adf-pages/#comments Mon, 08 Mar 2010 15:19:56 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=400 A great discussion on the JDeveloper forum on OTN brough a new addition to ADF application security that I like to share.

Chapter 30 of the Oracle® Fusion Middleware Fusion Developer’s Guide for Oracle Application Development Framework 11g Release 1 explains the JAAS protection mechanism for ADF pages and Task Flows. In here it is recommended that you reduce the number of JSF pages in the adfc-config.xml file to the absolute minimum and only give ADF Security permissions to those documents that need to be accessible from a browser request.

All other pages should be located in bounded task flows, which you can protect declaratively against GET requests, as they are issued from a browser URL. Bounded task flows need to be ganted to users through application roles to be accessible.

The discussion on OTN is about protecting the phyical JSPX files. If you are an authenticated and authorized user, then you could directly access the JSPX page, e.g. calling localhost:7101/myapp/faces/Departments.jspx. This then serves the page – though it may not be fully functional because it is not launched within the controller context.

The recommendation therefore is to store JSPX documents under the WEB-INF directory of the public_html folder. This solves the problem of users accessing physical files directly

Frank

Ps.: Note that if moving JSPX documents into the WEB-INF folder is not an option for you, you can write a servlet filter that checks the incoming request URL for the resource it accesses. If a jspx file is accessed you would return a http 403 error.

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/03/08/how-to-protect-your-adf-pages/feed/ 0
The Poetry of Wisdom in Oracle Documentation: E.g. PPR and List Of Values http://thepeninsulasedge.com/frank_nimphius/2010/03/05/the-poetry-of-wisdom-in-oracle-documentation-e-g-ppr-and-list-of-values/ http://thepeninsulasedge.com/frank_nimphius/2010/03/05/the-poetry-of-wisdom-in-oracle-documentation-e-g-ppr-and-list-of-values/#comments Fri, 05 Mar 2010 10:48:03 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=398 Our ADF Faces documentation contains little nuggets of poetry and wisdom that are easy to memorize helping you to better understand the product – and answer questions on OTN with it. For example, today I found and liked:

Note: If your trigger component is an inputLov or an inputComboBoxLov, and the target component is an input component set to required, then a validation error will be thrown for the input component when the LOV popup is displayed. To avoid this, you must use programmatic partial page rendering.

Note: In some cases, you may want a component to be rerendered only when a particular event is fired, not for every event associated with the trigger component, or you may want some logic to determine whether a component is to be rerendered. In these cases, you can programatically enable PPR.

Excellent !

Frank

Want to dig your own nuggets? here is the documentation: Looking forward to read your blogs and tweets with your favorite quotes.

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/03/05/the-poetry-of-wisdom-in-oracle-documentation-e-g-ppr-and-list-of-values/feed/ 0
ADF Code Corner : How-to Edit Bounded Task Flows in a new Browser Tab (Tab Browsing) http://thepeninsulasedge.com/frank_nimphius/2010/02/25/adf-code-corner-how-to-edit-bounded-task-flows-in-a-new-browser-tab-tab-browsing/ http://thepeninsulasedge.com/frank_nimphius/2010/02/25/adf-code-corner-how-to-edit-bounded-task-flows-in-a-new-browser-tab-tab-browsing/#comments Thu, 25 Feb 2010 15:52:47 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=396 Just finished a new blog article about launching a bounded task flow in a new browser tab. This article addresses the popular tab browsing feature in browsers, showing how – assuming the business use case requires it – you do the same in ADF Faces. The specialty is that the tab browsing is not initialted from a link but a tree component. Rading this blog post, you learn

  • Making a bounded task flow URL accessible
  • Launching a new browser window from a managed bean
  • Defining the bounded task flow request URL in Java
  • Passing input parameters to a task flow using a HashMap
  • Use the hierarchical tree context menu to invoke an action on right mouse click
  • Adding JavaScript to a managed bean response

[Read More] [Get More]

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/02/25/adf-code-corner-how-to-edit-bounded-task-flows-in-a-new-browser-tab-tab-browsing/feed/ 0
ADF Code Corner: How to deploy ADF bounded task flows in ADF Libraries http://thepeninsulasedge.com/frank_nimphius/2010/02/17/adf-code-corner-how-to-deploy-adf-bounded-task-flow-in-adf-libraries/ http://thepeninsulasedge.com/frank_nimphius/2010/02/17/adf-code-corner-how-to-deploy-adf-bounded-task-flow-in-adf-libraries/#comments Wed, 17 Feb 2010 11:15:11 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=392 I just upoaded a new how-to to ADF Code Corner. This how-to explains how to package and deploy ADF task flows – with or without dependent model projects – in ADF Libraries. In addition it explains how to import an ADF library, configure contained database connections and rename the task flow content names to be user friendly.

[Read More] [Get More] [Follow ADF Code Corner on Twitter]

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/02/17/adf-code-corner-how-to-deploy-adf-bounded-task-flow-in-adf-libraries/feed/ 0
ADF Code Corner on Twitter ! http://thepeninsulasedge.com/frank_nimphius/2010/02/08/adf-code-corner-on-twitter/ http://thepeninsulasedge.com/frank_nimphius/2010/02/08/adf-code-corner-on-twitter/#comments Mon, 08 Feb 2010 16:03:48 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=388 Just in case …

  • you are worried about missing bits of information about Oracle JDeveloper and ADF
  • you feel uncomfortable saying “If I had known this before it would have saved me …”
  • you don’t have time to frequently browse OTN
  • you enjoy technical stuff more than knowing what Paris Hilton did last week
  • you want to know more than others do

ADF Code Corner “twitters” interesting updates and information about Oracle JDeveloper, ADF and related topics.

Get More, Learn More: http://twitter.com/fnimphiu

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/02/08/adf-code-corner-on-twitter/feed/ 0
How-to Create custom ADFc Exception Handler http://thepeninsulasedge.com/frank_nimphius/2010/02/01/how-to-create-custom-adfc-exception-handler/ http://thepeninsulasedge.com/frank_nimphius/2010/02/01/how-to-create-custom-adfc-exception-handler/#comments Mon, 01 Feb 2010 08:03:20 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=386 The ADFc controller provides declarative exception handling. However, if you need to customize this exception handler, for example to redirect a request to a custom session expiry page, then you can do this as follows

  1. Create a Java class that extends AdfcExceptionHandler
  2. Create a textfile with the name “oracle.adf.view.rich.context.Exceptionhandler” (without the quotes) and store it in .adf\META-DATA\services (you need to create the “services” folder)
  3. In the file, add the absolute name of your custom exception handler class (package name and class name without the “.class” extension)

For the expiry example, in the handleException method, you check throwable.getMessage() for “ADF_FACES-30108″ which indicates the expiry message. Don’t forget to pass exceptions your custom class doesn’t handle to the super class not to break any default functionality.

However, You should always try and use declarative exception handling when possible. For example, a router activity that is marked as the exception handler can access a managed bean method, which then accesses the ControllerContext.getCurrentInstance(), and in here the ViewPort, for determining the Exception type and message. So keep the hint of how to extend the the ADFc controller class as an exception to the rule of using declarative excpetion handler and use it only if you can’t find out how to handle an exception it otherwise.

Configuring the ADFc custom exception handling class is not yet part of the product doumentation but will be added the next JDev 11g Patch Set as part of the task flow content.

The above hint is a brief summary excerpt taken from the Oracle Fusion Developer Guide book that Lynn Munsinger and I wrote for McGraw Hill. I am blogging this in response to a question on the JDeveloper OTN forum.

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/02/01/how-to-create-custom-adfc-exception-handler/feed/ 0
Oracle ADF Code Corner: How-to scroll an ADF bound ADF Faces Table using a Keyboard Shortcut http://thepeninsulasedge.com/frank_nimphius/2010/01/08/oracle-adf-code-corner-how-to-scroll-an-adf-bound-adf-faces-table-using-a-keyboard-shortcut/ http://thepeninsulasedge.com/frank_nimphius/2010/01/08/oracle-adf-code-corner-how-to-scroll-an-adf-bound-adf-faces-table-using-a-keyboard-shortcut/#comments Fri, 08 Jan 2010 12:42:41 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=384 The Oracle JDeveloper code editor allows developers to navigate to a specific line in the source code using the ctrl+g keyboard shortcut. In this how-to article, I use the same approach, which is to allow users to press ctrl+g on a table at runtime to provide the row number they want to navigate to. The sample is an improved version of the sample Lynn Munsinger and I provide in our book “Oracle Fusion Developer Guide Building Rich Internet Applications with Oracle ADF Business Components and ADF Faces” and nicely shows how JavaScript can be used to provide client side functionality in ADF Faces RC, plus how the ADF binding layer is used to scroll a table.

[Read More] [Get More]

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/01/08/oracle-adf-code-corner-how-to-scroll-an-adf-bound-adf-faces-table-using-a-keyboard-shortcut/feed/ 0
How-to scroll ADF tables using alphabetic anchor tags in an index menu http://thepeninsulasedge.com/frank_nimphius/2010/01/06/how-to-scroll-adf-tables-using-alphabetic-anchor-tags-in-an-index-menu/ http://thepeninsulasedge.com/frank_nimphius/2010/01/06/how-to-scroll-adf-tables-using-alphabetic-anchor-tags-in-an-index-menu/#comments Wed, 06 Jan 2010 08:36:07 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=376 In this example, an alphabet index anchor menu is used to scroll an ordered ADF bound ADF Faces table. The example provided for download is based on the HR Employees table. Selecting an entry from the index menu, for example the ‘F’ character, scrolls the table to the first employee record that has this character as the first character of the last name attribute value. The implementation dynamically builds the index list, ensuring that characters that are not available as leading characters in the last name attribute are rendered but disabled for selection.

index menu


[Read More]
[Get More on ADF Code Corner]

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2010/01/06/how-to-scroll-adf-tables-using-alphabetic-anchor-tags-in-an-index-menu/feed/ 0
Our book is out: Oracle Fusion Developer Guide: Building Rich Internet Applications with Oracle ADF Business Components and Oracle ADF Faces http://thepeninsulasedge.com/frank_nimphius/2009/12/22/our-book-is-out-oracle-fusion-developer-guide-building-rich-internet-applications-with-oracle-adf-business-components-and-oracle-adf-faces/ http://thepeninsulasedge.com/frank_nimphius/2009/12/22/our-book-is-out-oracle-fusion-developer-guide-building-rich-internet-applications-with-oracle-adf-business-components-and-oracle-adf-faces/#comments Tue, 22 Dec 2009 09:30:48 +0000 frank.nimphius http://thepeninsulasedge.com/frank_nimphius/?p=373 Just learned today that Lynn Munsinger and my book ships in the US since December 11. I checked the Amazon website and indeed you could get it in time for Christmas (just in case you are looking for a last minute gift for your wife or husband). See yourself.

The closer we got to Christmas, the more exiting it was for me to see if McGraw Hill would make it publishing the book before Cristmas. Not that this makes a difference, but Lyn and I worked hard on meeting our schedules and though the book was announced for January 2010 I like it to be ahead of schedule. So I can call this a year and enjoy Christmas and new year eve with my family – no thinking of Java (possibly)

Thanks to McGraw Hill.

Merry Christmas to everyone.

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2009/12/22/our-book-is-out-oracle-fusion-developer-guide-building-rich-internet-applications-with-oracle-adf-business-components-and-oracle-adf-faces/feed/ 0