Pageviews

Sunday, July 28, 2013

ADF Train Component


ADF Train Component


The train component represents a series of train stops, each stop representing a step in a multi-step process. Each stop is tied to a view (.jsf page). Each page can either interact or display information that will help the user to complete the multi-step process. The train component helps the user to walk through these steps one stop at a time. User will be able to navigate to next stop or the previous stop in order to take corrective action to complete the multi-step process.  The train component can be rendered in a vertical layout as well as in horizontal layout, default being a horizontal layout.  The train component walks through the user in a predefined order as defined in the train model. Each train step is rendered with an image and a textual link indicating if they are in visited, current stop, unvisited stop and disabled state. 

Check out the below demo video explaining , bounded task flow, unbounded task flow, train model, train button bar, task flow control, method call activity etc.,  Persisting the user information collected in each train stop to a database table is not intended to be covered in this demo.  This is a basic demo to explain the above mentioned concepts. Hope it is helpful.


 



Saturday, July 27, 2013

JDeveloper - MySQL DB connection setup


JDeveloper - MySQL DB connection setup


JDeveloper connection to MySQL database is not straight forward, and certainly does not work with out of the box drivers. Check out the below screen shot for details. You need to download and add, Connector/J driver to establish the connection. MySQL Connector/J is the official JDBC driver for MySQL.

Follow the below instructions to download and configure, Connector/J driver.

Here is my connection details,

Connection In: Application Resources (selected by default)
Connection Name: dbConn
Connection Type: MySQL
Username : root

Under MySQL Settings:

Host Name: <Enter your hostname, in my case it is, localhost>
Port: Enter the default MySQL DB port number, 3306
Driver Class: com.mysql.jdbc.Driver (Default)
Library: <Press Browse to select a library>




The problem here is, MySQL connection library is not available by default to establish the MySQL DB connection. 
To resolve this issue, follow the below steps..

Step 1: 

To get the driver, navigate to the following link and download the jar file.


The above link takes you to the main download Connector/J driver location. From here, you have a choice to download as a compressed tar archive file or a zip archive format.

The above link2 takes you directly to download the Connector/J driver directly in zip archive format.

Step 2: 


Place the downloaded jar file under  a domain lib folder location. In my case, I placed the jar file in

Macintosh HD/Users/RajVenugopal/Oracle/Middleware/user_projects/applications/DefaultDomain/lib/mysql-jdbc-5.1.25

Quick Note: I renamed mysql-connector-java-5.1.25,zip to mysql-jdbc-5.1.25.zip. Unzipping the folder gets you the needed driver jar file.



Step 3:


In 'Create Database Connection' wizard, click the library browse button to open up "Select Library" window. Select User selection under Libraries. Click the "New" button to open the 'Create Library' window. Then click 'Add Entry' button to add the downloaded jar file to the library. Check out the below screenshot for details.








Step 4: 

Add the download jar file to the user libraries, and then select 'Test Connection' to test the DB connection. You should get a successful db connection at this point.



Enjoy and have fun.

Friday, July 12, 2013

ADF UI Components, Task Flow and Page Fragments

ADF faces rich client components


The best way to go about exploring the Oracle ADF faces rich client component is by checking out the below link.

http://jdevadf.oracle.com/adf-richclient-demo/faces/index.jspx


Things to remember when working with ADF Task Flow


1) Bounded task flow has only a single point of entry, whereas an unbounded task flow has multiple entry points.

2) Bounded task flow can be called by another task flow, whereas an unbounded task flow cannot be called by another task flow.

3) A new XML file is created every time you create a new ADF bounded or unbounded task flow.

4) XML file for an ADF unbounded task flow is by default called adfc-config.xml.This can be renamed as needed.

5) XML file for an ADF bounded task flow is by default called task-flow-definition.xml. This can be renamed as needed.


6) In both types, Bounded task flows, activities and control flow rules are defined inside the adfc-config metadata element.

7) Bounded task flows are identified within adfc-config by the <task-flow-definition> metadata element.

8) Activity defined within <default-activity> metadata element is the first activity to execute in an ADF bounded task flow. (Note: ADF unbounded task flows do not have default acitivities.).


9) The first view that gets added to ADF bounded task flow diagram automatically identified as default activity. Assuming you have multiple views/activities in your ADF bounded task flow, you can right click any view in the task flow diagram and choose "Mark Acitivity -> Default Acitivity" to change the default activity selection.

10) A single application can have mulitple ADF unbounded task flow XML source files and multiple ADF bounded task flow XML source files.

11) After you create a task flow, you can add activities, and configure the control flow between the activities by simply dragging them from the component palette. Activities defined under Components  are, Method Call, Router, Save Point Restore, Task Flow Call, URL View and View.




Things to remember when working with ADF Page Fragments



1) Page Fragments are nothing but reusable custom components.

2) Page Fragments are incomplete JSF pages. A complete JSF page must have "document" tag enclosed within a "view" tag ( <f:view><af:document>...</af:document></f:view). Whereas a page fragment represents a portion of a complete page, and does not contain the view tag and the document tag. The contents of the page framents are enclosed within a jsp:root tag.

3) The same Page Fragments can be used any number of times within a page(JSF page) or in multiple pages.

4) Page Fragments uses .jsff file extension.

5) Because Page Fragments uses a different file extension from regular JSF page, configuration entries are added to the web.xml file for recognizing and interpreting the page frament (.jsff) files within the JSF page in an application. Entries added to web.xml will look like this..

  <jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsff</url-pattern>
      <is-xml>true</is-xml>
    </jsp-property-group>
  </jsp-config>


6) You can include the reusable component (or page fragment) by dragging "Include" from component palette. This is how you can include a Page Fragment inside your regular view page.
 <jsp:include page="SampleFragment.jsff"/>