CAF & Portlet Development Notes


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

CAF & Portlet Development Notes

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