Friday 17 June 2011

ADF Task Flows

A Fusion web application is broken up into a collection of reusable task flows. A task flow represents an activity that is performed when running that task flow.

Task flows can be bounded or unbounded. There can be only one unbounded task flow in an application, which contains the entry points of the application, if the application has more than one. If your application has a single entry point, it is no necessary to define an unbounded  task flow. However, even if empty, an unbounded task flow will always exist as the first  entry on the application's task flow stack.

Some task flow components and their definitions are enumerated below.

Activities
  • View Activities: Display a page or page fragment
  • Flow Calls: Invoke another task flow from within a task flow
  • Task Flow Return Activities: Specify the outcome returned to the caller
Control Flow Cases:  Identify how control passes from one activity to another

Outcomes: Labels on control flow cases representing values that determine the following activity (e.g. values specified in the action attribute of the UI component)

Control Flow
  • Control Flow Rules: Are invoked by components used to implement navigation on pages(links, buttons, trains, tabs, breadcrumbs); Are stored in task flow configuration files
  • Wildcard Control Flow Rules: Global navigation rules(Rules that can be called from any  page)

An example of task flow design using JDeveloper is shown in the following picture. The yellow triangles show that the respective activities do not point to pages yet.

An example of task flow design




Wednesday 25 May 2011

Tuesday 17 May 2011

Swing vs. ADF UI components

I am trying to build a small application to help the voting system for contests at ROMANIAN HAIKU,  a yahoo group dedicated to Japanese short-poem writers that I have recently joined.

I am planning to develop two versions of the application, at first using Swing, and then ADF UI components, in order to be able to compare them and draw some useful conclusions. (I already feel that the central point might be the fact that most of the Swing API is not thread safe.)

I hope this task I have set for myself to result in an article that I will publish here, dedicated to a friend that I have recently disappointed in a discussion over Swing. (Please forgive me...)

As a starting point I shall use this example of displaying and editing table data with JTable:
http://download.oracle.com/javase/tutorial/uiswing/components/table.html

Happy programming!

Friday 13 May 2011

Managed Beans and Backing Beans in Standard JavaServer Faces, Java EE and ADF Applications

A typical JavaServer Faces application includes one or more backing beans, each of which is a JavaServer Faces managed bean that is associated with the UI components used in a particular page.

The managed beans can be referenced in an EL expression, allowing access to the beans' properties and methods.

"Technically, a Managed Bean is a POJO that's constructed and injected by the JSF framework. It's commonly referenced by JSF pages, but it doesn't have to be. For example, it could be a Session-scope repository of data for other (non-page) resources to reference.

A Backing Bean is a bean that's referenced on JSF pages, and offhand I can't think of any way to establish that reference unless it's a ManagedBean.

So there's a difference, but for most people most of the time, it's small enough that the terms tend to get used interchangeably." (Tim Holloway, http://www.coderanch.com/t/214065/JSF/java/backing-beans-vs-managed-beans)

Managed Beans are new to the Java EE 6 platform, represent a generalization of the managed beans specified by JavaServer Faces technology and can be used anywhere in a Java EE application, not just in web modules. (http://download.oracle.com/javaee/6/tutorial/doc/bnacj.html#gjxsd)

 

Managed Beans in ADF

In a standard JSF application, managed beans are registered in the faces-config.xml configuration file. In a Fusion web application, managed beans can be registered in the faces-config.xml file, the adfc-config.xml file, or a task flow definition file.

Creating and Using Managed Beans in ADF


Deeper Study Path

"Expression Language in JavaServer Faces 1.2 does not support passing arguments to methods in a managed bean. Not a big deal though as you can pass the required information using memory attributes, managed bean properties of the ADF binding layer."

Planning the User Interface in Oracle ADF

1.Describe the Model-View-Controller design pattern
http://javing.blogspot.com/2011/02/web-programmers-most-powerful-weapon.html?spref=bl

2.Differentiate between bounded and unbounded task flows
"An ADF bounded task flow is used to encapsulate a reusable portion of an application. A bounded task flow is similar in some ways to a Java method." 
"A Fusion web application always contains an ADF unbounded task flow, which contains the entry point or points to the application."
(Bounded Task Flows)
Unbounded task flow: A set of activities, control flow rules, and managed beans that interact to allow a user to complete a task. An ADF unbounded task flow consists of all activities and control flows in an application that are not included within any bounded task flow.
Bounded task flow: A specialized form of task flow that, in contrast to an unbounded task flow, has a single entry point and zero or more exit points. It contains its own set of private control flow rules, activities, and managed beans. An ADF bounded task flow allows reuse, parameters, transaction management, and reentry.
(Introduction to ADF Task Flows )
  • There is only one unbounded task flow within an application. Even if you use multiple definition files for unbounded task flows within the application, they will be combined into a single flat namespace at runtime with the entire flow being loaded into memory at startup.
  • Any view activity in the unbounded flow is URL accessible by the user.
  • Unbounded task flows are restricted to view activities that are implemented as whole pages.
  • Bookmarking is only supported by views in an unbounded task flow and is not available in bounded task flows.  (Task Flow Design Fundamentals, An Oracle White Paper, April 2011 )
3.Create task flows to define control flow in an application
http://download.oracle.com/docs/cd/E21764_01/web.1111/b31974/taskflows.htm#ADFFD21726

4.Specify control flow rules
 When the user acts on a command component(e.g. button,link) in a JSF application, a rule is invoked to determine the next page to display. These rules are called control flow rules. They can also be invoked by tabs, breadcrumbs or train components. Control flow rules can be defined using one of the following:
  • the visual editor (Navigation Modeler)
  • the Configuration editor (XML Console)
  • the XML file directly
  • the Structure window

5.Define global navigation
A global control flow rule is a rule that applies for all pages (that is a rule that can be called from any page). Use the wildcard control flow rule element in the Component Palette of JDeveloper to define a global control flow rule.

6.Use routers to declaratively route control flow to activities based on an EL expression
http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/taskflows_activities.htm#ADFFD1673

7.Define the role of managed beans in task flows
Managed beans are registered with the application in task flow .xml files.
http://download.oracle.com/docs/cd/E21764_01/web.1111/b31974/web_getstarted.htm#CACCFIII

8.Explain the types of validation available in the user interface
  • UI component attributes for validating data (e.g. required)
  • default validation
  • custom validation

Wednesday 11 May 2011

Binding ADF Faces UI Components to Data

1. Create an empty JSF page
You create JSF JSP pages using the Create JSF Page dialog. 
If you use ADF Faces components you must have af:document enclosed within f:view.

2. Use three different ways to add ADF Faces UI components to a page  
3. Describe the types of data-bound components that can be added to a JSF page 
  • Iterator bindings
  • Value bindings
  • Action bindings
(http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcdcpal.htm#ADFFD492)

4. Describe the structure of an EL (Expression Language) expression  

     #{bindings.BindingObject.propertyName} 
(http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcdcpal.htm#ADFFD526)


    Tuesday 10 May 2011

    Java SCJP Mock Exam Engine

    This looks good practice for Java SCJP:

    http://www.ii.uib.no/~khalid/pgjc3e/engine.html

    I haven't tried it yet, Java SCJP exam still scares me :)

    I'll stick by ADF for a while...

    Monday 2 May 2011

    Training for Oracle ADF Certification

    I would like to attend in-class, group training for Oracle ADF certification. If you know of any such possibility in Bucharest, please share the information. Thank you!
    Accelebrate
    Oracle Fusion Developer's Guides

    Thursday 28 April 2011

    Thursday 17 March 2011

    FEDERATED CONFERENCE ON COMPUTER SCIENCE AND INFORMATION SYSTEMS

    FEDERATED CONFERENCE ON COMPUTER SCIENCE AND INFORMATION SYSTEMS

    Szczecin, Poland, 19-21 September, 2011
    Submissions of Event Proposals:     May 1, 2011
    Paper Submissions:     May 31, 2011

    You can submit your article in any of the three formats:
    • LaTeX (preferred)
    • OpenDocument
    • MSWord (deprecated)
    Includes The 6th International Symposium on Advances in Artificial Intelligence and Applications (AAIA'11) .

    Adding a workshop on e-learning might be interesting, too.

    Monday 7 March 2011

    ADF View Criteria vs. EJB Named Queries

    The article quoted below presents one implementation of displaying the result of a complex query by using JPA Named Queries. As an exercise, as I am now studying ADF "View Criteria", I shall try to achieve the same result by using ADF-BC.

    "Displaying Employee (HR schema) records in Hierarchical Tree can be achieved in ADF-BC by creating custom VO and a Viewlink for displaying root node.This can be more easily done using  EJB-DC by just introducing a NamedQuery to get the root node."
    Display root node of Hierarchical Tree using ADF - EJB DC

    Saturday 19 February 2011

    Javing: web programmers most powerful weapon

    Javing: web programmers most powerful weapon: "The MVC(Model View Controller) Pattern Today the most of the existing web frameworks that exist since web 2.0 support separation of concerns..."

    Wednesday 26 January 2011

    Java Development Focused on Enterprise Use

    Forrester Research cited by PCWorld Business Center predicts that Java will become a specialized server-side language for Oracle and IBM enterprise customers. I think so too, and that will only just increase the demand for Java programmers!
    Forrester: Oracle Confining Java Future to Enterprise Use

    Monday 24 January 2011

    Free Online SQL Tests and Tutorials

    SQL Tutorial
    Interactive SQL tutorial (SQLzoo.net)
    SQL Quick Reference
    Database Normalization Basics

    http://www.geekinterview.com/quiz/SQLQuiz.html
    Oracle specific, includes questions about SQL Plus commands.

    http://www.wiziq.com/tests/sql
    Mostly Oracle specific, need to sign up to see your score.

    http://www.sqlquiz.com/
    Very good!
    After taking the test you get a report with your time, your score, your answer for each question, if this is correct or not, and recommended reading for incorrect answers.

    http://tools.people-centric.ro/index.php?option=com_otests&view=order

    http://www.w3schools.com/sql/sql_quiz.asp
    20 questions, no time limit, at the end of the Quiz, your total score will be displayed.

    Wednesday 5 January 2011

    Python vs. Java ?

    "Python is a high-level programming language suitable for simple tasks, as well as for learning computer algorithms and programming main functions." José Braga de Vasconcelos - The Official Association for Computing Machinery (ACM) Group on LinkedIn