Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Module Objectives
z JavaServer Faces
Architecture
C.X
Input type=“text”
Name=“custno” Private String custno;
DB
Input type=submit
<jsp:usebean id=x
Classname=“C.X”>
JavaServer Faces Architecture
HTML
z Controller
Decide the format of the o/p –Renderkit
Decide the language of the o/p—Property files
RequestDispatching-which view/page to display on what
action
z View
XML Based so that o/p can be WML/HTML- Renderkit
Display static text from property Files
(Internationalization)
Retrive/Set data in the Page bean
z Model
Page Bean/backing bean having getter/setter methods
and can talk to middleware/database or any third party
application
` and Managed by controller via config.xml
Modular Design
Model
Model
Controller
View
Component
Renderer
Listener
Model
JSP/HTML
Tag Libraries
z Composed of Controller
tree
Components - fires events to
registered listeners
Listener Classes - invoke Model beans
using Change and Action Listeners
JSF Technology
BP
CA
JSF Specification
z JavaServer Faces
z Chordiant Support for JSF
Features
XmlHttpService
FS
MVC BPS
BS/SS
Chordiant JSF and CAFE
Client Tasks
Backing Beans (Model from MVC)
z Used to drive process interaction
z Acts as a caller to Interaction Controller
z Composed of an Interface and Default
implementation
z Interface specifies methods associated with
values displayed or entered on the UI
set/get methods
}
JSPs for UI Screens
…
<ui:composition>
<f:loadBundle basename="bundles.viewmovietitle.msgs.msgs“
var="movie_msgs" />
<f:view locale="#{preferLocale.locale}">
<tr:document>
<tr:form>
<tr:inputText label="#{movie_msgs.enterMovieId_label}“
value="#{enterMovieId.movieId}"
required="true"
shortDesc="#{prompts.values.Id_prompt}"/>
</tr:form>
</tr:document>
</f:view>
</ui:composition>
…
Navigation Rules
z Associates tasks with JSF pages
z Defined in a configuration file
z Chrd JSF Navigation file given to ChrdJSF Controller
(interaction controller)
<navigation-rule>
…
<navigation-case>
<from-outcome>ic$viewmovietitle_enterMovieId</from-outcome>
<to-view-id>
/xAdvisorWeb/bundles/viewmovietitle/jsf/enterMovieId.jspx
</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>ic$viewmovietitle_showMovieTitle</from-outcome>
<to-view-id>
/xAdvisorWeb/bundles/viewmovietitle/jsf/showmovietitle.jspx
</to-view-id>
</navigation-case>
…
Interaction Controller (IC)
z Set of APIs to enable the UI layer to drive
process flow
Independent of the UI framework, process
engine and channel
Pure Java
Frontend app
Request xml/web
Struts JSF
Handler services
Communicates to BP
start next() cancel reassign next(qItem)
Via
InteractionController IC
ClientAgent webservice
Service InteractionControllerService
JxwInteractionController
PFlowService executes BP
Client PFlowservice
… … Task:
SelectAccount
… … Call
JXW Flow IC
& When client task
JXW Context
JSF and IC Interaction
2
<navigation-case>
IcFacesDispatcher <from-outcome>
IcFacesBackingBeanImpl ic$MyFlow_displayAccEntries
public String next() 4 public String next() {
</from-outcome>
<to-view-id>
/displayAccEntries.jsp
AbcPageBean extends IcFacesBackingBeanImpl 5 </to-view-id>
</navigation-case>
nextClientTask = ic.next( clientTask );
public String getAccountNumber()
3 public void setAccountNumber( String input ) return ic$ + 9
clientTask.getProcessName()+
"_" + clientTask.getName() ;
ClientTask ioMap }
String entrAccNoRetrn = “556677”;
Vector accEntries;
Service Tier
InteractionController
Ic$MyFlow.enterAccoutnnumber 6 7 8
enterAccountno.jspx
1
Setup and Configuration
Advisor/WebRoot/xAdvisorWeb
z Web.xml
Defines JSF configuration elements
_CHRD-401_Processes/build.xml
Package Process flows into jar
Exercise