You are on page 1of 26

JSF Web DataWindow:

Taking Java Server Faces


to the Next Level

July 18, 2006


JSF Web DataWindow:
Taking Java Server Faces
to the Next Level

John Strano
Technology Evangelist
AGENDA

• Introduction to Java Server Faces


– What is Java Server Faces?
– Architecture Overview of JSF
– Key Concepts
– Why Java Server Faces?
• Sybase Workspace—Web Application Development
Tooling
– Objectives
– Architecture Overview
– Features
• Integration with the DataWindow: the JSF Web
DataWindow
– DataWindow Designer
– Java DataStore
• Demonstration

3
Java Server Faces:
In General

4
Background

• Building high-quality Web application user interfaces is


hard
– HTTP request/response model
– HTML dialect(s) and browser capabilities
– Need to support multiple client devices types

5
What is Java Server Faces?

• Java Server Faces (JSF) is a component user interface


(UI) framework for Java Web applications
• It is designed to significantly ease the burden of writing
and maintaining applications that run on an application
server and render their User Interfaces back to a target
client

6
Why JSF?

• MVC (Model-View-Controller) for Web applications


• Clean separation of roles
• Offers finer-grained separation of behavior and
presentation
• Easy to use
• Extensible component and rendering architecture
• Support for client device independence

7
Component Control

• Maintaining a reference to model objects


• Driving the event-handling
• Rendering is separate from the component
• JSF implementation provides a set of UI component
classes
• Standard Component classes, for example
– Commandbutton, Form, Graphic, Input
– Output, Panel, Parameter
– SelectBoolean, SelectMany, SelectOne

8
Rendering Model

• Renderers – Adapt components to a specific markup


language
– Encoding – Create markup to represent value
– Decoding – Retrieve request parameters and create new value
• RenderKits – Library of Renders
– Extensible at runtime
– For JSP pages, represented as a custom tag library
– Basic HTML RenderKit part of the standard

Component Rendered As
command_button
command_hyperlink

9
Sybase Workspace
Web Application Development

10
Objective

• Provide a life-cycle support including design, develop,


debug/test, and deploy a Web application utilizing Java
Server Faces technology
• Visual Development Environment
• Allows building Web pages in a manner very similar to
PowerBuilder
– A flavor of 4GL experience

11
Objective

• Provides a component model


• Allows users to think about components, events and
scripting instead of the detail of HTTP request /
response
• Leverages Java Server Faces standards runtime
• Uses Java DataStore to make data access easy
• Reuse existing DataWindows in your Web applications
• Make service and EJB invocation in the Web application
easy

12
Architecture

Integration
Web Application Development Tool
DataWindow
Painter
Eclipse
Graphical Editing Web Tool Workspace Java DataStore
Modeling
Framework Platform Service
Framework
(GEF) (WTP) Framework
(EMF)

Eclipse

13
Components of the WAD IDE

• Web Application Development Perspective


– Creation wizards (application, page and resources)
– Web Page Designer (graphical editor)
– Tab-based Properties View
– Databinding View
– Resource Bundle Editor (tabular-based editor)
– Faces-config Editor (graphical editor…navigation rules)
– Web.xml Editor (form-based editor…)
• Deployment to runtime container
– DataWindow Designer
– DataWindow Library Importer

14
Feature Set: In the Interest of Time…
Just One Sample

• Databinding View
– Resource Bundle Binding: use key to bind to UI component;
– Service Binding: generate managed bean to wrap service
invocation;
– Java Class Binding: generate managed bean with getter/setter
– EJB Binding: generate bean to lookup ejbs and create bean
instances
– Database Binding: support JSF DataWindow, or hibernate

15
JSF Web DataWindow

16
DataWindow and the JSF Technology

• Java DataStore
– A pure java package which provides the DataWindow
functionality to the Java world
• JSF DataWindow Component
– A custom UI component written to fit the JSF model
• DataWindow Java Bean
– A Java Bean non-UI component written to fit the JSF model
• JSF DataWindow tag library
– A tld file containing the attributes of the DataWindow for a
JSP page

17
DataWindow and the JSF Technology

DataWindow
JSF tag library

DataWindow
JSF
Component
Java
JSF Web Datastore
Application

DataWindow
Bean

Faces-
Config.xml

18
Java DataStore INTERFACE

• Pure Java package


– Distributed as jdatastore.jar
• Non-visual Java Wrapper for DataWindow Server
– Can be used by the Java programmer for non-UI
DataWindow functionality
• A JNI based interop layer to the DataWindow Server
• The DataWindow Server

Java JNI Interop DataWindow Server +


Marshalling and Database Interface Layer +
Datastore Layer
Event Handling XML Support +
Management PDF Support

19
JSF DataWindow in Design Time

• JSF DataWindow design time properties


– dataWindowObject
– displayOnly
– enableDataCaching
– jndiDataSource
– libraryList
– objectLink
– onLoadHandler
– rendered
– rowsperPage

20
JSF DataWindow Properties, Methods and Events

• The Rich DataWindow API is accessible through


the JSF DataWindow
– More than 100 methods are available.
– Categorized as
• Dynamic DataWindow creation function
• Retrieve functions
• Search functions
• Get / Set functions
• Import / Export Functions

21
JSF DataWindow Properties, Methods and Events

• Access and Modify DataWindow object metadata at


runtime
• Use the describe and modify methods

22
JSF DataWindow Properties, Methods and Events

• JSF DataWindow generated server events


– RetrieveEvents (BeginRetrieve,EndRetrieve,RowRetrieved)
– UpdateEvents (BeginUpdate, EndUpdate)
– SqlPreview Events (SQLPreviewEvent)
– Print Events (BeginPrint,EndPrint,PrintPage)
– DWLoadedEvent
• JSF DataWindow server event listeners
– RetrieveListener
– UpdateListener
– SqlPreviewListener
– PrintListener
– DataWindowOnLoadListener

23
JSF DataWindow Properties, Methods and Events

24
JSF DataWindow Properties, Methods and Events

• JSF DataWindow client events

25
JSF Web DataWindow
Demo

26

You might also like