CAF & Portlet Development Notes
-
Upload
vladimir-ivanchenko -
Category
Documents
-
view
1.549 -
download
0
description
Transcript of CAF & Portlet Development Notes
![Page 1: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/1.jpg)
CAF & Portlet Development Notes
11-14.04.2011
![Page 2: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/2.jpg)
CAF and Portlets
Composite Application Framework
needs only Servlet container (can run on Tomcat)
Portletsneed the portlets container (my Webmethods)
before work need to deploy the caf war files to the server
![Page 3: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/3.jpg)
Portlets
Views:VIEW, EDIT, HELP, custom
exist on the portlets page
are not URL-addressable
SSO !
![Page 4: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/4.jpg)
Development
Solution View in the DesignerCanvas for visual editingPalette for elementsOutline to manage layers better Change control type: good for adjusting the fields to your needs, but is not used much actually
![Page 5: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/5.jpg)
Web Service Connector
Consumer of the Web Service
Draging the connector to the canvas creates the form with data, can not be undoable (only delete from Outline and create again, but what happens with generated classes is unclear, they will remain same or can be regenerated but partially deleted or so...)
![Page 6: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/6.jpg)
Managed Beans
... are behind each view (simple JSF approach)in total there are:View • Page Bean
o Application Beano AppNav Bean
• WebServiceConnector Bean Portlet:• View
o Page Bean Porlet Bean
Application Beano Web Service Connector Bean
![Page 7: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/7.jpg)
Beans
Business logic can be implemented as "Data Flow" (new term) which consists of actions and assignments of variables (cool, just as in WS DIAMOND) or by java implementation
"Data Flow" the expression language, but GUI of Designer allows to degign it easily without any need to write it on your own.
Reference allow to share same bean for many views.
![Page 8: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/8.jpg)
Validators and Converters
Same as in the JSF, nothing new actually, maybe some cool generators over GUI
![Page 9: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/9.jpg)
Client-side scripts
allow to use the Java Script on client side
are bind to ids of components ("defaultForm:...")
can be used to trigger the AJAX on Portlets (as only I did in the examples later)
"raise on change" event is used commonly to start such actions
![Page 10: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/10.jpg)
AJAX
many components incl. tables, tabs and trees are ajax-enabled
the Refresh() is used commonly in invocations
![Page 11: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/11.jpg)
Internationalisation
nothing new
same editing of application_en.properties files by hands
only great feature is the "CAF tools --> Externalize Strings from all views", it extracts all strings, gives them id and creates application*.property files.Sometimes it extracts too much and can not distiguish between labels and ids, so it can require cleaning by hands.
![Page 12: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/12.jpg)
Navigation in Web Application
3 main ways:• Basic Linking (over the url and link in <a> tag)• JSF navigation with faces-config.xml rules depending
on the outcomes of some of the fuctionso there is pretty cool editor of the faces-config.xml
file in Designer • Application navigation
o using App Nav Beano and app-nav.xml config file o is used mostly for menu navigations
![Page 13: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/13.jpg)
Portlets
• Other application type• can be deloyed only to MWS• have many views• each view is actually CAF
![Page 14: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/14.jpg)
MWS Portal Administration
• 2 Admins with different views:o SysAdmin (manage porlets, portlet pages, aliases
etc.)o Administrator (actually only for MWS itself)
• Manage users and groups of users and roles(can be maped to LDAP)
![Page 15: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/15.jpg)
Portal Page
• Has many portlets• Portlets can be draged and dropped on the canvas
very easily• strict column organisation
![Page 16: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/16.jpg)
Portlet pages
• Alias is a short name for portet (can be used for wiring and liniing portlets on the portlet page)
![Page 17: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/17.jpg)
Wiring portlets
Goes over the Workspace Context. Each Context Property can be used as a storage for common data ! The Source Portlet calls update Context and the target portlet has a reference to the context property.
![Page 18: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/18.jpg)
Linking portlets
• URL link with property as parameter
![Page 19: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/19.jpg)
Wiring portlets
ONLY on the same portlets page !!!
is done over the commonly shared Properties of the Context
also globally accessible is the user profile, its properties (e.g. postal code) can be binded on (wired with) the properties of the portlet
![Page 20: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/20.jpg)
Events
not very interesting, as usuall define, subscribe etc.
there are several wizzards to difine everything which is needed for the event handling
![Page 21: CAF & Portlet Development Notes](https://reader033.fdocuments.us/reader033/viewer/2022061210/548fb341b479598e6a8b4ecf/html5/thumbnails/21.jpg)
Pratics
In praxis was interesting to create the AJAX driven portlet page when only 2 out of 3 portlets are refreshed.Otherwise in common case the whole portlets page is reloaded which can cause too many useless calls to DB or what ever is behind.The AJAX-bases reload of only needed Portlets is something not standard and requires not only ajax-bases CAF components but also some client-side java scripting (with this "defaultForm:..." etc. hard coded references).