Domain Portal

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 7 December 2008

Groovy - Multiple LOV's per Attribute in JDeveloper 11g

Posted on 08:48 by Unknown
I was blogging previously about multiple LOV's per attribute functionality. I was using RowImpl class for View object in order to calculate value for LOV switcher attribute. However, this approach is not perfect, since it requires to create Java implementation class with getter method. Even more, getter method in RowImpl class is not invoked, when LOV component is triggered in ADF Query Criteria component. I have described this cool component in my previous post - ADF Query Component and View Criteria Functionality with Custom Query Listener in 11g.

So, as you probably already understood, I will show better approach for LOV switcher attribute implementation with Groovy language expression, defined as a Value for transient LOV switcher attribute.

You can download developed sample application - ADFSearchApp2.zip. This sample as all my samples is based on standard HR schema available in Oracle XE. This application is based on previous sample. Only one addition here is LOV switcher attribute with Groovy expression, that allows to render different LOV components on runtime, based on data values.

I have defined two LOV components for DepartmentId attribute. One LOV component will show two columns and second will show three columns with data:


As you can see, there is transient lovSwitcher attribute defined. This attribute will switch LOV's for DepartmentId attribute. This time, I'm using Groovy language expression as a value for transient attribute. This allows me to have multiple LOV's functionality even in ADF Query Criteria component. With switcher implementation in RowImpl class getter method, its not working. So, here is my transient attribute with Expression defined as a Value Type:


And here is actual expression, it checks Salary attribute value and returns first or second LOV component name to be used:


On runtime, if I will provide value 8500 for Salary criteria, for DepartmentId I will get second LOV with three columns in ADF Query Criteria and same in results table - correct logic:


If in ADF Query Criteria I will provide 4000 for Salary criteria, for DepartmentId I will get first LOV with only two columns:


Same functionality works in results table, based on Salary value contained in current row. So, I would recommend you to use Groovy for multiple LOV's implementation instead of Java getter methods in RowImpl.

Spanish Summary:

Titulo: Uso del lenguaje Groovy para la creación de Lista de Valores en JDeveloper 11g.

Resumen: Andrejus muestra como crear listas de valores en JDeveloper 11g haciendo uso del lenguaje Groovy.
Read More
Posted in ADF, Groovy, JDeveloper 11g | No comments

After UKOUG'08

Posted on 03:11 by Unknown
This week I was on UKOUG'08 conference. I really have enjoyed high quality of its content and I have learned new technical things about JDeveloper/ADF 11g and ADF Business Components performance tuning.


Myself, I did two sessions. First one was - Oracle Maps and JDeveloper 11g - Perfect Combination. It was Masterclass type demo on the fly, I have developed working application in front of auditory. And, there was no errors or exceptions, I really enjoy such kind of sessions. I believe I can better share knowledge with live demo, comparing to dead slides. And most important, auditory likes such kind of sessions.

Second session was - ADF Task Flow - Based On Practical JDeveloper 11g Experience. For this session I was using already prepared sample application and have described how it was build. Again, there was no errors or exceptions on runtime. I was focusing on ADF Task Flow functionality we are using in my project, I didn't wanted to explain all ADF Task Flow features. I have covered following items:
  1. Method Call
  2. Router
  3. Transaction Management
  4. Error Handling
  5. ADF Library
  6. ADF Query
  7. ADF Security
Spanish Summary:

Titulo: Después del evento del Grupo de Usuarios del Reino Unido

Resumen: Andrejus describe su participación en el último UKOUG, el cual es un evento realizado por el grupo de usuarios de Inglaterra.
Read More
Posted in Events | No comments

Wednesday, 26 November 2008

Workaround for Null Value Bug in ADF List Of Values 11g

Posted on 23:18 by Unknown
Those of you, who are using List Of Values (LOV) component in ADF 11g, most probably already have noticed bug related to Null value. Simple description - if any non Null value is set for LOV, it is impossible to set Null value (for non-mandatory LOV's). This bug is known for Oracle, and I'm sure they will fix it in next build. For now, there are two paths for us. First is to ignore it, and test with next build, when it will be available. Second is to apply temporal workaround, until bug will be fixed by Oracle. In my opinion, you should follow second path, if you have critical need to be able to set Null value for LOV before next build will be available from Oracle. In this post, I will describe this workaround, relatively very simple one.

You can download sample application, with implemented workaround - LOVNull.zip. This sample contains basic form, with one LOV component for DepartmentId attribute:


So, the problem is with Null value in LOV component, basically Null is not accepted. This bug is not related to the Model, because if you will test with ADF BC Browser, it works well. Bug is related to View layer. This means we can invoke exposed method in View object and set Null value for LOV attribute programmatically. To achieve this, I have created my custom method in View object class and exposed this method through Client Row interface:


Exposed custom method clearLOV(), basically invokes setter method for DepartmentId attribute and provides Null.

In View layer, for my LOV component, I have set AutoSubmit=true property and provided ValueChangeListener in order to check when user will try to provide Null value:


ValueChangeListener compares new LOV value to Null, and if user is trying to set Null, exposed custom method is invoked trough bindings to set Null value programmatically:


And how it works? Let me at first to show how it works without workaround. Here we have a form with LOV component, by default value is not set for LOV:


Let's set provide any non Null value:


And now, when LOV value is stored in database, let's try to clear it:


Press Save button to store our last change and you will get previous value back - Null (or empty) value is not accepted anymore:


However, if you will use described workaround, Null value will be set as expected:

Read More
Posted in ADF, JDeveloper 11g, Workarounds | No comments

Wednesday, 19 November 2008

Hints for ADF 11g Application Credential and Policy Migration to Standalone WebLogic Servers

Posted on 11:49 by Unknown
Recently I was deploying our ADF 11g application on standalone WebLogic server. Deployment itself is straightforward, however it is little bit more complex with security metadata migration from development environment to test environment. I have migrated application credentials and policy data using steps described in Steve Muench document - Simplified ADF 11g Application Credential and Policy Migration to Standalone WebLogic Servers. This document is very clear and useful, I would recommend to read and use for everyone who will face problem with security metadata migration to standalone WebLogic.

So, after you will read Steve's document, probably you will find those my 2 hints useful as well:

1) Even if you are not using ADF Security in your application, still in the most of the cases you will need to migrate application credentials. You will need to do this, if you are using JDBC URL as Connection Type to database, since database connection credentials are stored in credentials file. There is no need to migrate application credentials if you are using JDBC DataSource instead of JDBC URL. If credentials for JDBC URL Connection Type will not be migrated, most probably you will get similar error on runtime - Incomplete connection information:


2) After you will succeed to migrate application credentials and policy to the test environment, this doesn't mean you will be able to run your application immediately (in a case of DD Only Security Model). Its because system-jazn-data.xml available on standalone WebLogic is populated with users and policies from development environment, however those users are not mirrored to standalone WebLogic. This means, authentication step will not be completed.

In order to solve this issue, you can go to WebLogic console and in Security Realms (myrealm by default) you can define users you want to authenticate. There is no need to define roles for those users, since authorization will be done based on policies stored in system-jazn-data.xml available on standalone WebLogic after migration.
Read More
Posted in ADF, Security, WebLogic | No comments

Saturday, 8 November 2008

ADF Query Component and View Criteria Functionality with Custom Query Listener in 11g

Posted on 02:41 by Unknown
Nice new component in ADF 11g is ADF Query - af:query. This component allows to implement Search functionality in your applications with much smaller effort comparing to Search functionality implementation in 10g. In conjunction with View Criteria, ADF Query provides declarative way for Query Criteria forms development. There is no need anymore to have transient attributes for Query Criteria, since we can base it on View Criteria attributes from View object. In this post I will describe how you can implement user-friendly Search functionality in 11g and how to use custom QueryListener for ADF Query.

You can download developed application - ADFSearchApp.zip. This application provides sample page with ADF Query component and results table. Additionally, this application contains custom behavior - when there are pending changes in results table, re-query is not performed and user is forced to commit or rollback existing pending changes.

Good news about ADF Query - it can use List Of Values defined in Model layer. So, if we have List Of Values declared for DepartmentId attribute:


DepartmentId in ADF Query automatically will appear as List Of Values, since this attribute is declared in View Criteria on View object:


Sample page contains two main components - af:query and af:table with ID = resTab. First component implements ADF Query and second - table for results:


If you will select af:query component in Structure view, Property Inspector will show you all properties of af:query. You should pay attention to ResultComponentId property, its Id that points to component where Search results will be shown. Most important thing in my sample application - custom QueryListener processQuery(). I have created it custom, because I want to control query execution and not to execute query when there are pending changes in results table:


However, custom QueryListener declaration is not enough in order to control query execution regarding pending changes. Additionally, you need to set PartialTrigger on results table and point to ADF Query. This is needed in order to auto submit results table and inform Application Module about pending changes before executing query:


Created custom QueryListener is simple - if there are pending changed, query is not invoked, if there is no - standard QueryListener is invoked. Information about pending changes is retrieved from Application Module, using isDirty() function:


On runtime, you will see such screen - Query Criteria area and results table:


DepartmentId List Of Values is shown, you can use it to provide search criteria parameter:


Results table is populated and if user will decide to change for example HireDate column value:


And re-execute query with new query criteria for DepartmentId:


There will be pending changes message shown, since user didnt saved his/her last changes before re-executing query. When user will save pending changes and will query again, it will be successful:

Read More
Posted in ADF, JDeveloper 11g | No comments

Monday, 27 October 2008

Oracle Day'08 in Vilnius

Posted on 07:54 by Unknown
During this week, on October 30th, Thursday, there will be Oracle Day'08 event in Vilnius. Its a traditional Oracle event in my country, mostly for a local Oracle market. Information about how to register and attend, you can find on the official Web page.

Event schedule is mostly in Lithuanian language, however by number of speakers and sessions you can see how strong Oracle technology is in Lithuania.

Myself, I will deliver 1 hour session Oracle Maps in JDeveloper 11g - Perfect Combination. This session will be based on material I have presented during Oracle Develop at Oracle OpenWorld'08 in San Francisco.

See you there !
Read More
Posted in Events | No comments

Saturday, 25 October 2008

After BGOUG Autumn' 2008 Conference

Posted on 05:05 by Unknown
Going back home after my session on BGOUG'08 in Bulgaria, Bansko. As usual, delays in airport.

In Bulgaria, I have explained how developers can use ADF Search component and refresh results table together with graph component at the same time. Additionally, I have described how to use ADF Security with wizards and authorize user based on his role.

Here is a sample screen of application I have developed on the fly:


Tomorrow going to Riga for JDeveloper/ADF 11g Masterclass workshop, really busy time... :-)
Read More
Posted in Events, Traveling | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Multiple LOV's per Attribute in JDeveloper 11g
    During OOW 2008 I have attended Steve Muench talk about new features in ADF Business Components available in 11g release - Oracle ADF: New D...
  • JBO-25058 and JBO-26001 exceptions
    In a case if you will get JBO-25058 and JBO-26001 exceptions after running application developed with Oracle ADF in JDeveloper 11g, most pro...
  • JDeveloper 11g Masterclass in Vilnius
    I'm posting update to my previous post - Oracle Forms to SOA workshop in Vilnius , where I was describing masterclass session I will do ...
  • Opening Report Window in ADF Faces
    Such requirement as opening report window can be assumed as easy one. But, when I have received request for solution, it was not so easy to ...
  • Oracle JDeveloper/ADF Real Life Story on Oracle OpenWorld
    Yes, that right - I was presenting Oracle JDeveloper/ADF Real Life Story on Oracle OpenWorld in Unconference section. Everyone was free to c...
  • JDev/ADF samples list
    This week, Steve Muench on his examples page have added a link to my JDev/ADF samples list . Thanks, I'm very proud of this - it is co...
  • Oracle Always Rocks !
    This song was performed at Oracle OpenWorld 2007, after Larry Ellison and Safra Catz keynote - Sunday Night Live—30 Years Behind The Scenes ...
  • Oracle Fusion Middleware 11g Technology Preview 3 - whats included?
    Probably almost everyone have noticed Christmas gift from Oracle - JDeveloper 11g Technology Preview 3 . What new things are inside this gif...
  • List-Of-Values Component in Search and Edit Form
    Sample application described in this post contains high practical value, it implements real use case. Defined use case - based on value sele...
  • Oracle Magazine Peer-to-Peer column
    My profile is published in Oracle Magazine January/February 2008 edition - Favorite Things . Profiles of Oracle ACE Director - Chris Ostrow...

Categories

  • ADF
  • Apex
  • Apple
  • BPEL
  • Events
  • Forms
  • Groovy
  • JDeveloper 11g
  • Nomination
  • ODTUG Kaleidoscope
  • OFUG
  • Oracle Magazine
  • Oracle OpenWorld
  • Security
  • SOA
  • Spatial
  • TopLink
  • Traveling
  • Uncategorized
  • Vgo Software
  • Web Services
  • WebCenter
  • WebLogic
  • Workarounds

Blog Archive

  • ▼  2008 (72)
    • ▼  December (2)
      • Groovy - Multiple LOV's per Attribute in JDevelope...
      • After UKOUG'08
    • ►  November (3)
    • ►  October (9)
    • ►  September (4)
    • ►  August (9)
    • ►  July (6)
    • ►  June (10)
    • ►  May (4)
    • ►  April (5)
    • ►  March (7)
    • ►  February (5)
    • ►  January (8)
  • ►  2007 (65)
    • ►  December (6)
    • ►  November (7)
    • ►  October (6)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (5)
    • ►  April (6)
    • ►  March (4)
    • ►  February (5)
    • ►  January (9)
  • ►  2006 (9)
    • ►  December (9)
Powered by Blogger.

About Me

Unknown
View my complete profile