selected in the Structure window, open
the Property Inspector by selecting View
-> Property Inspector from the Oracle
JDeveloper menu.
5. In the Panel Dashboard—Property
Inspector pane, click in the Find field
(next to the magnifier icon) to activate
the search input field.
6. Type DropListener in the search field.
As you type, the DropListener attribute
becomes highlighted (in the Behavior
section of the Property Inspector pane).
7. Select Edit from the DropListener property
menu. The Edit Property: DropListener
dialog box appears.
•;Select DndHandlerBean from the menu
as the managed bean for the listener.
•;Select dashBoardDropHandler as the
method.
8. Click OK to save the setting.
Upon drop event notification, the
managed bean identifies the change in the
panelDashboard child component order and
writes this change to the Oracle ADF Faces
change persistence framework, which passes
this information on to MDS as per the configuration in the adf-conf.xml file.
For a better understanding of using Java
to access the Oracle ADF Faces change
persistence API, take a look at the code
that constitutes the DndHandlerBean.
From the Application Navigator, go to the
ViewController -> Application Sources folder,
in the oramag.sample.dashboard.view
.beans.dashboard package.
At this point, you’ve implemented drag-and-drop for the panelDashboard component, so your application users can reorder
child components at runtime. You’ve also
set up MDS to persist changes to specific UI
components. The one task remaining is to
set up Oracle ADF Security to enforce user
authentication so that UI changes can be
saved for each user.
SE T TING UP ORACLE ADF SECURI T Y AND
TES TING THE COMPLETED APPLICATION
When users access the dashboard from their
browser, you want them to be prompted for a
username and password. Implementing this
in the sample requires configuring Oracle
ADF Security in a simple wizard-driven
process. From the Oracle JDeveloper menu,
1. Select Application -> Secure -> Configure
ADF Security to launch the Oracle ADF
Security wizard. The Enable ADF Security
pane (step 1 of 4) appears, enabling you
to choose the type of authentication.
2. Click ADF Authentication (in the Security
Model section), and click Next to continue.
By default, ADF Authentication has Http
Basic Authentication selected as its type on
the next pane (step 2 of 4) of the wizard.
3. Leave Http Basic Authentication selected,
and click Finish to save the settings
and complete the wizard. A “Security
Infrastructure Created” message appears.
4. Click OK to dismiss the message.
With Oracle ADF Security enabled for
authentication, you can now create some
test users. From the Oracle JDeveloper menu,
select Application -> Secure -> Users. Click
the green plus (+) icon in the Users section
of the dialog box for adding users, and create
the test user accounts listed in Table 1.
When you have finished adding these
test users, click the save icon in the Oracle
JDeveloper tool bar to save your work.
You can now run the completed dashboard application with some real-world
personalization scenarios. Run the application by right-clicking the DashBoardPage
.jspx file in the Application Navigator pane
and selecting Run from the context menu.
In the browser’s login dialog box, authenticate as test user sking (sking/welcome1).
Rearrange the panel boxes by dragging
and dropping them to new locations within
the dashboard. (You’ll notice that the dashboard functionality itself hasn’t changed—
the graph and the gauge are updated as
they should be, and the result data in the
two graphs at the bottom of the UI remains
static.) When you’ve sufficiently modified
the order of the UI items, close the browser.
Now rerun the application. Note that you
can quickly restart the application from the
Oracle JDeveloper log window, which contains
the runtime URL, similar to the following:
http://localhost:7101/PanelDashboard-
ViewController-context-root/faces/
DashBoardPage.jspx
Open the log window if necessary by
selecting View -> Log Window from the
menu, and click the URL to rerun the dash-
board application.
CONCLUSION
This column has stepped you through
the process of using Oracle JDeveloper’s
declarative and visual tools to support persistent personalization of UI elements in a
dashboard application. You can see how the
combination of Oracle ADF Security for user
authentication, Oracle ADF Faces behavior
tags for implementing drag-and-drop, and
the integrated change persistence framework in Oracle ADF Faces enable application
developers to build personalizable application user interfaces with almost no need to
write code.
Frank Nimphius is a senior principal product
manager for Oracle JDeveloper and Oracle
Application Development Framework. He is
a coauthor of Oracle Fusion Developer Guide:
Building Rich Internet Applications with Oracle
ADF Business Components and Oracle ADF
Faces (McGraw-Hill, 2010).
NEXT STEPS
READ more about Oracle ADF
“Building Customizable Oracle ADF Business
Applications with Oracle Metadata Services
(MDS)”
bit.ly/wgLDfE
“Security for Everyone”
bit.ly/xgsD9R
LEARN more about Oracle ADF and Facelets
bit.ly/A0RpBT
DOWNLOAD the Personalized
Dashboards project