caf & portlet development notes
DESCRIPTION
TRANSCRIPT
CAF & Portlet Development Notes
11-14.04.2011
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
Portlets
Views:VIEW, EDIT, HELP, custom
exist on the portlets page
are not URL-addressable
SSO !
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
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...)
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
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.
Validators and Converters
Same as in the JSF, nothing new actually, maybe some cool generators over GUI
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
AJAX
many components incl. tables, tabs and trees are ajax-enabled
the Refresh() is used commonly in invocations
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.
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
Portlets
• Other application type• can be deloyed only to MWS• have many views• each view is actually CAF
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)
Portal Page
• Has many portlets• Portlets can be draged and dropped on the canvas
very easily• strict column organisation
Portlet pages
• Alias is a short name for portet (can be used for wiring and liniing portlets on the portlet page)
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.
Linking portlets
• URL link with property as parameter
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
Events
not very interesting, as usuall define, subscribe etc.
there are several wizzards to difine everything which is needed for the event handling
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).