Domain Portal

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

Sunday, 28 October 2007

Central Norway - Lillehammer City

Posted on 12:21 by Unknown
Today I was doing sightseeing trip to Lillehammer city in Norway. This city is located on the north part of largest lake in Norway - Mjøsa. In the city center, through stones and mountains flows Lågen river. It's not so much water now in the river, but it is typical to Norway. Rivers here are full with water on Spring, when snow goes down from mountains. And yes, it's golden autumn here - yellow leafs are on the ground :-).

Read More
Posted in Traveling | No comments

Thursday, 25 October 2007

Security in Oracle ADF and Automatic Page Loading

Posted on 11:08 by Unknown
In enterprise applications, automatic page loading based on user role is used quite often. Automatic page load is done during user login phase. This means that when user with role A enters into system, page X will be opened for him. And in the same way, when user with role B enters into system, page Y will be opened. Information about which page to open is acquired from security container, but how to open dynamically one or another page - here is the question.

Solution I have used is to put some empty intermediate page between login module and application pages. After user is authenticated in login module, he is transfered to intermediate page. However, this intermediate page does not require any input from the user, implemented logic allows to check connected user role and based on it automatically open suitable page in application.

You can download developed sample application - OnPageLoadAuthorization.zip. Sample is based on Employees entity from standard HR schema. Two JSPX pages are implemented, first is opened when connected user have read-only access rights and second is designed for editable case. This means that two roles (clerks and managers) are defined in web.xml - one allows only read-only access and second editable. Clerks role is mapped to access clerks.jspx and managers role to access managers.jspx page. On both pages the same data from Employees entity is available.

It's time to describe how actually automatic redirection is done based on role. All logic is centered in index.jspx, so I will describe it. This page is used for automatic redirect, it is achieved with onPageLoad() function in backing bean. onPageLoad() function is defined as empty function in a class that implements oracle.adf.controller.v2.lifecycle.PagePhaseListener. In this class standard beforePhase(PagePhaseEvent event) function is implemented, provided functionality allows to call onPageLoad() during page loading process. Class code:


So, backing bean of index.jspx page extends this class and provides code for onPageLoad() function by overriding it:


In this function actual logic is implemented - depending on role, redirection is done. One important thing, do not forget to include ControllerClass definition into index.jspx page page-definition file. You should bind it to a name of backing bean for the same page:


How it works? Let's provide in login form a user with read-only access - alex (welcome):


Read-only table with Employees data is opened:


And if we are providing a user - john (welcome) who can edit data, another page is opened:



When running sample application, don't forget to add adf-faces-impl.jar and jsf-impl.jar to application's WEB-INF\lib directory.
Read More
Posted in ADF | No comments

Wednesday, 24 October 2007

Oracle OpenWorld Unconference - Session Proposal

Posted on 10:09 by Unknown
I'm planning to do a session at Oracle OpenWorld Unconference. Session is called - Oracle JDeveloper/ADF Real Life Story, more info and it's description you can find on Oracle Wiki page. Everyone is welcome - see you at Oracle OpenWorld in San Francisco!

Chris Muir also will have a presentation related to JDeveloper topic at Oracle OpenWorld Unconference. His session will be focused on testing and related stuff. This session is very important, because from my practice I can see, that JDeveloper features are not used so frequently during testing phase. So, just come and see how testing should be done! ;-).
Read More
Posted in ADF, Oracle OpenWorld | No comments

Monday, 15 October 2007

Oracle Fusion Middleware Workshop in Vilnius

Posted on 09:29 by Unknown
Today I was on Oracle FMW (Fusion Middleware) Workshop in Vilnius, actually it was a workshop based on my material available in Oracle Fusion User Group (OFUG). There were 22 people auditory, at the beginning I have presented information about Oracle ACE Directors, Oracle Fusion Middleware, Oracle JDeveloper with ADF, and Technical Resources needed to start to work with Oracle JDeveloper and ADF. Presentation took for me about 1 hour, after it people started to solve labs. There were six labs, all of them are available in OFUG for free to download. During labs solving, there were quite many questions about ADF, I was glad to provide answers. At the end I realized, that while answering questions, I got even new knowledge for me. Thanks for great auditory!



Read More
Posted in ADF, Events, OFUG | No comments

Tuesday, 9 October 2007

Using Hidden Column in af:table Component

Posted on 01:31 by Unknown
Quite often you may face requirement, when you will need to use hidden column in af:table component. Such requirement could be to insert into database, along with values provided by the user, some another value automatically. This value is not visible for the user and is inserted through a hidden column. Hidden column here should be understood as a column that doesn't exist in af:table component, but exists it's definition in page definition file for associated table.

Developed sample application - HiddenColumn.zip provides JSPX page with a table component, that allows to create new data for Employees entity. Five columns are available in the table - First name, Last name, Email, Hire date and Job Id. But along with data for those five columns, data for Salary column is stored into database as well. Value that is inserted into Salary column is retrieved from Resources.properties file. Now I will describe how actually data is inserted into a column, that is not available in af:table component.

First step is to use the same technique, which I have successfully used in my previous samples - to include managed bean method call into let's say ReadOnly property of any column available in the table. In developed sample application, I have included #{valueHolder.readOnly} into ReadOnly property of First name column. This technique allows to invoke managed bean method, when each row of af:table component is rendered. Managed bean method code:


Developed method always return false value, it is because we always want to have editable column and are using this method for other purpose. Method is used to set Salary value #{row.Salary} for newly created row. Row is determined as a newly created using #{row.EmployeeId}. If DBSequence value is negative this means that row is newly created and we set value for #{row.Salary}.

Let's say we create new row and provide values for all columns:


When Save button is pressed, new row is inserted into database. Value for Salary column is inserted as well:


When running sample application, don't forget to add adf-faces-impl.jar and jsf-impl.jar to application's WEB-INF\lib directory.
Read More
Posted in ADF | No comments

Wednesday, 3 October 2007

Conditional rendering of JSF fields based on dynamic af:selectOneChoice

Posted on 12:50 by Unknown
My friend in her recent project was implementing conditional rendering of JSF fields based on dynamic af:selectOneChoice component, and she was in trouble with this. There exists excellent Grant Ronald blog post - Conditional rendering of JSF fields depending on a drop down list (af:selectOneChoice). However, Grant in his post describes conditional rendering of JSF fields depending on fixed drop down list, not dynamic. Together with my friend we have developed needed solution and I have decided to post it.

Sample application - DependentDBList.zip is based on standard HR schema and provides one JSPX page called main.jspx. This page contains form component with navigation controls and functionality that allows to create new data and save changes in existing one. Application is focused on two form elements - DepartmentId and PhoneNumber. Functional requirement is not to show PhoneNumber element if IT is selected in DepartmentId drop down list.

Probably you will ask, what is the difference between fixed and dynamic drop down lists in conditional rendering. In fact it is similar, however you will need to add some Java code. Steps are the same like described in Grant Ronald blog I have mentioned, however implementation of some steps differs. Here I will describe differences.

At first you need to create dynamic drop down list for DepartmentId, this step is simple. In developed sample application for List Iterator is used DepartmentsView1Iterator, this iterator binds to DepartmentsView1 data control. We will need to access created drop down list to get selected value, to make it possible we have created table definition and binded it to the same DepartmentsView1Iterator iterator. Don't forget to enable AutoSubmit and set PartialTriggers on parent UI item.

PhoneNumber element property Rendered we have binded to a method available in page backing bean, this method is called - isPhoneNumberRendered(). Method code:


Code is straightforward but it allows to use dynamic drop down list in conditional rendering. In this code, DepartmentName is retrieved for selected element in drop down list, and it is compared with IT department. Depending on comparison result, true or false is returned and based on returned value component is rendered or no.

Here PhoneNumber is shown:


And when IT is selected for department, PhoneNumber is not shown. It will not be shown even if you will just open a page with IT department selected.


When running sample application, don't forget to add adf-faces-impl.jar and jsf-impl.jar to application's WEB-INF\lib directory.
Read More
Posted in ADF | 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)
    • ►  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)
      • Central Norway - Lillehammer City
      • Security in Oracle ADF and Automatic Page Loading
      • Oracle OpenWorld Unconference - Session Proposal
      • Oracle Fusion Middleware Workshop in Vilnius
      • Using Hidden Column in af:table Component
      • Conditional rendering of JSF fields based on dynam...
    • ►  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