Needs to be ReviewedFacelets This document is describing what has been changed within Alfresco Web Client in order to make it work with Facelets:
PanelGenerator static methods
Static methods of PanelGenerator class are very often used within markup to output HTML which than decorates certain content with nice rounded corner panel. This has been replaced with <aanelGenerator> composite component which does exactly the same thing but eliminates Java from markup
<rage> jsp tag which generates header and footer of every page has been replaced with <rage> custom component which has exactly the same attributes and produces the same output
Facelets framework automatically does appropriate method binding of â€žactionListenerâ€œ and â€žactionâ€œ properties. If the property is not one of these two and it has to be bound to a method, than it has to be done manually within appropriate ComponentHandler class. Fortunately, it seems that custom action listeners of Alfresco web client are following the same pattern (expandActionListener, clickActionListener..) therefore it was possible to create generic AlfrescoComponentHandler class which bounds all properties with such name pattern to a appropriate action listener method
Java flow control
Java is not allowed in facelet pages therefore Java flow control has been replaced with jstl condition tags
Java code inside of markup
As mentioned, Java is not allowed, therefore pieces of java code which would normally become a part of servlet has been moved to TagHandler classes and has been registered inside of alfresco.taglib.xml. That way the code will be executed on every refresh of the page, just as it is part of servlet. Example: <a:authenticationChex/> <a:setLocale/>
Setting of component properties
Since there are no longer Tag classes, framework itself is setting the properties of components from tag attributes specified on the page. To enable this, component properties has to be exposed, and there are some components where attributes map is updated from the tag class and properties are not exposed. To correct this, component properties are exposed. Such cases have been found within following components so far: UIImagePicker, UINodePath.
This component is doing some handling inside of Tag class in order to correctly render content even if the content is html not enclosed within verbatim tags. Since, in Facelet, everything is a component, even html and plain text, this can be left out and we can allow UIPanel component to normally render its children according to the value of isExpanded attribute
Since markup has to be valid XML, a lot of tag closing, attribute quoting and other corrections had to be done. Fortunately, this is predictable process and it has been automated.