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

Wednesday, 22 October 2008

ADF Security 11g and ADF Business Components

Posted on 13:16 by Unknown
Looks like in JDeveloper 11g, ADF Security works as it should work. In this post I will cover ADF Security part, related only to ADF Business Components. For example, Oracle Business Component Browser can be used now to test security configuration in Model layer. It wasn't working in 10g and in 11g Technology Preview builds, however in Production it works!

Now, if you will run secured Application Module with Oracle Business Component Browser, you will get authentication dialog:


This dialog was raised in previous JDeveloper builds as well, however authentication never was passed, it works now.

You can download my sample application - ADFSecurity.zip. This sample is configured with ADF Security and contains 3 users (all with welcome1 password):
  • john (role: clerk)
  • susan (role: manager)
  • steve (role: developer)
Sample application contains one Entity object - Jobs. This entity is secured for update action:


Two roles are authorized to update on entity level - manager and clerk:


Additionally, JobTitle attribute is secured for update action:


This action is authorized only to manager role:


If you will run Application Module with susan (role: manager) user:


All entity attributes will be available for udate:


With john (role: clerk) user:


All attributes except JobTitle can be updated. It happens, because only manager role is authorized to update JobTitle attribute:


If Application Module will be tested with steve (role: developer) user:


User will not be able to update any attribute, since this user is not authorized for update action:

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

Vgo Webinar - Client/Server Forms Modernizations to ADF 11g

Posted on 10:41 by Unknown
My colleague - Rob Nocera, will deliver a Web session about Client/Server Forms modernization to ADF 11g on Wednesday, November 12, 2008, 11:00 AM ET. You can register and check event agenda on this page.

This event will be interesting for all Oracle Forms customers, who are investigating their current software infrastructure modernization ways. Rob will talk not only about ADF 11g technical aspects, he also will describe what parts of Oracle Forms functionality can be mapped to ADF and what parts can't.
Read More
Posted in ADF, Events, JDeveloper 11g | No comments

Monday, 20 October 2008

JDeveloper/ADF 11g Masterclass in Latvia

Posted on 09:48 by Unknown
If you are Oracle Developer, and live in Latvia, you can register to attend Oracle Forms: The Road to SOA workshop in Riga city on October 28th.

Workshop will be based on two parts, during the first part - Grant Ronald (Group Product Manager in Oracle) will deliver one session about Oracle Forms strategy and second about JDeveloper/ADF. On the second part of this workshop, you will dive into detail technical information, it will be JDeveloper/ADF 11g Masterclass delivered by me. Masterclass will be done in similar way, as it was done in Vilnius - JDeveloper 11g Masterclass in Vilnius - After Event. However, described techniques and material will be different and updated. I will show how developers can work with:
  • ADF Business Components new features in 11g
  • ADF Templates
  • ADF Task Flows
  • Regions and Page Fragments
  • ADF Faces Rich Client
  • ADF Data Visualization Components (including Oracle Geographic Maps)
  • ADF Security
I will be happy to share and discuss my experience in Oracle Forms modernization I'm doing with JDeveloper/ADF 11g and Oracle Fusion Middleware.

See you there !
Read More
Posted in ADF, Events, JDeveloper 11g | No comments

Thursday, 16 October 2008

Form Opening in Find Mode

Posted on 12:58 by Unknown
It can be that topic for current blog post looks very basic, however I will describe one simple thing that can make your development life easier. I will explain how to use Method Call in ADF Task Flow in order to open called form in Find mode, without using invokeAction in Page Definition.

How often you develop forms, where one of key requirements is to open form in Find mode. From my experience, it is quite common behavior. However, usually it is not enough just to define invokeAction in Page Definition and execute Find action each time when page is opened (postback == false). For example, form can be opened in Find mode from main menu, but it should be opened in Edit mode, when is called from separate specific form. In such case, JDeveloper/ADF 10.1.3 developer will create parameters and evaluate through expression language in invokeAction. This approach works, however as always there is a better approach.

This better approach is to use ADF Task Flow functionality available in JDeveloper/ADF 11g. In ADF Task Flow its possible to define Method Calls and separate action logic with page logic. Please, read ADF Developer Guide 11g, in order to get more information about ADF Task Flows.

You can download sample application I have developed - FindMethod.zip. This application is based on standard HR schema from Oracle and implements two pages - index.jspx and main.jspx. First page is defined in unbounded ADF Task Flow and calls second page from bounded ADF Task Flow. Second page is opening in Find mode automatically, without invokeAction in Page Definition.

Main logic, related to this post, is in bounded ADF Task Flow task-flow-definition.xml file:


You can see that as default activity is selected Find Method Call. Idea is - when bounded ADF Task Flow will be opened, default Find activity will trigger and will set iterator to Find mode. Sounds simple, however in practice is little bit more complex. If you will just drag and drop Find action from Data Control and define it as a default activity, it will not work - separate Page Definition file for Method Call will be generated, and Find action will be invoked not for iterator available in main.jpx Page Definition file, but for iterator available in Page Definition associated with Method Call - means Form will not be opened in Find mode.

Second idea that can come to your mind is simply to associate Method Call activity with Find action available in main.jspx Page Definition file:


But, this also will not work, exception on runtime - Page Definition not found:


And now, its time to describe a solution. You need to open DataBindings.cpx file and to assign same Page Definition file to Method Call created in ADF Task Flow as is assigned to a page. In our case, there will be two Page Mappings (one is real, second is for Method Call) and one Page Definition Usage:


When assignment will be done, go back to bounded ADF Task Flow and provide Find action for Method Call from Page Definition file associated with a main.jspx page:


Now it looks everything is done and we can run application, in index.jspx page lets press Find button and open bounded ADF Task Flow with default Find action:


Form is opened in Find mode without any invokeAction declaration:


Just to summarize, ADF Task Flow functionality - Method Call, in this case allows to put form to Find mode automatically when bounded ADF Task Flow is opened. All the other pages inside bounded ADF Task Flow can open the same form without invoking Method Call, what gives higher flexibility.
Read More
Posted in ADF, JDeveloper 11g | No comments

Thursday, 9 October 2008

JDeveloper 11g Production on Mac OS

Posted on 10:00 by Unknown
Everyone who is interested in Oracle Fusion Middleware probably knows, JDeveloper 11g is production now. And its possible to install it on Mac OS as well. On Windows, installation process is more straightforward, however it is relatively easy on Mac OS also - just you will need to follow a couple of configuration steps. In this post I will give instructions, I was following in order to install JDeveloper 11g on my MacBook Pro, I will concentrate on those instructions not mentioned in installation guide.

Installation process steps:

1) Download jdevstudio11110install.jar from OTN download page. It is a base install, without JDK 6.

2) Go to Oracle Fusion Middleware Installation Guide for Oracle JDeveloper on OTN and follow listed instructions.

3) After you will install Sun Java SE 6 for Mac OS X 10.5, you will need to make Java 1.6.0 default version of Java on your machine. You must run Java Preferences utility at /Applications/Utilities/Java/ to make Java 1.6.0 the default version on your OS. But, this will not change Java version across all system, so in terminal window I executed following commands as a root user to make Java 1.6.0 default VM:

$ cd /System/Library/Frameworks/JavaVM.framework/Versions/
$ ls -l CurrentJDK
lrwxr-xr-x 1 root wheel 5 Oct 3 21:33 CurrentJDK -> 1.5.0
$ sudo rm CurrentJDK
$ sudo ln -s 1.6.0 CurrentJDK
lrwxr-xr-x 1 root wheel 5 Oct 3 21:40 CurrentJDK -> 1.6.0


Now if you will execute java - version in terminal window, you should get something similar:

java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)


4) However, if you will run JDeveloper 11g installer at this step, you still will not be able to install successfully. In my case, installer wasn't able to find Java Home, even if I was providing it directly. I have solved this, when I have found a section about Known Issues for installing JDeveloper 11g on Mac OS in Release Notes document.

When all listed steps were done, installation wizard found Java 1.6.0 automatically and installation finished successfully:


JDeveloper 11g is up and running on Macintosh:

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

Sunday, 5 October 2008

Multiple LOV's per Attribute in JDeveloper 11g

Posted on 03:01 by Unknown
During OOW 2008 I have attended Steve Muench talk about new features in ADF Business Components available in 11g release - Oracle ADF: New Declarative Validation, LOV, Search, and Services Features. Those features will be available in Production release, announced to appear this month. However, Oracle ACE Directors already have access to production release candidate - JDeveloper 11g Release Candidate for ACE Directors, so I'm able to test those new features.

Very imporant new feature for me - possibility to define multiple LOV's per one attribute. Previously it was possible to have only one LOV defined in Model layer per attribute. In this post I will describe how it works, based on mentioned Steve Muench presentation, and will publish sample application I have developed - LOV_Multiple.zip. You will not be able to run this sample in TP4, only in production when it will be available (I hope very soon).

My sample is based on HR schema, it contains one main View object - EmployeesView and two read-only View objects for LOV's - DepartmentsView and DepartmentsEuropeView. Those two LOV's are based on different SQL statements:


With multiple LOV's per attribute feature, we can use now two or more View objects with different SQL statements for the same attribute. For example, basic SQL statment in DepartmentsView, returns all departments:


And SQL statment in DepartmentsEuropeView, returns departments only from Europe:


Here is a sample screen, where you can see multiple LOV's per attribute defined:


I have defined in this sample, two LOV's for DepartmentId attribute - LOV_Department and LOV_Department_Europe. There is List of Values Switcher attribute defined - lovAttr. This attribute returns LOV name to be used, I have created it as Transient attribute in Employees View object. In its getter method I'm doing a check - if current region is Europe I'm using LOV only with European departments, otherwise default LOV with all departments is used:


On runtime, if employee is based in European department - DepartmentId LOV will use DepartmentsEuropeView and will list only departments from Europe:


In other case, default LOV will be used with all available departments listed:

Read More
Posted in ADF, JDeveloper 11g | No comments
Newer Posts 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)
      • Workaround for Null Value Bug in ADF List Of Value...
      • Hints for ADF 11g Application Credential and Polic...
      • ADF Query Component and View Criteria Functionalit...
    • ►  October (9)
      • Oracle Day'08 in Vilnius
      • After BGOUG Autumn' 2008 Conference
      • ADF Security 11g and ADF Business Components
      • Vgo Webinar - Client/Server Forms Modernizations t...
      • JDeveloper/ADF 11g Masterclass in Latvia
      • Form Opening in Find Mode
      • JDeveloper 11g Production on Mac OS
      • Multiple LOV's per Attribute in JDeveloper 11g
    • ►  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