|
From: JP P. <jp....@ti...> - 2003-06-14 01:47:33
|
Hi Everybody, As I have the need for using themes, I made the job. But I don't know about your feeling on this. As many central files had to be touched, despite of the fact than no test was broken and a "real" test run well, I committed it in a new branch "theme" for now. The javadoc and the test suite are to be made. I'm waiting on reactions to know if I can make the change in the main repository and finish the doc and testsuite. For users that will not handle themes nothing new is required in the configuration. This implementation is mainly a map (themes) of new messages sources and the user is able to choose the theme to use for display. Changing the theme is close to the locale handling and using a theme is close to the message source handling, but depending on the chose theme. Accessing to the themes messages is done via a new tag "theme" which runs like the "message" tag. For be able to change theme, only a ThemeResolver bean (provided) has to be added (cookies or session). What is preferably to put in theme's resources instead of the standard message source? Obviously, stylesheets and images paths which can vary both on locale and on theme. I have changed the pagedlist demo to demonstrate also the theme handling. As I have some trouble to access on logged ftp at the official site, the demo is visible at http://tech.jppawlak.info/spring/samples/pagedlist/ The war file (renamed as zip) with sources is available at http://tech.jppawlak.info/spring/pagedlist.zip The modified spring library is on the repository under "theme" branch. The user can toggle between "theme" and "metal" themes. Note: a little bug with JSTL handling makes some links don't work as long as the session-id is added on the url. For testing, the best is to change locale first. I will fix this starting next week. For each theme, the css file is defined in the no-localized file and the images in localized since they depend on locale. The modified and added (with +) files are: context/ApplicationContext + context/NestingThemeSource + context/ThemeSource context/support/AbstractApplicationContext + context/support/ResourceBundleThemeSource web/servlet/DispatcherServlet + web/servlet/ThemeResolver web/servlet/support/RequestContextUtils + web/servlet/theme/CookieThemeResolver + web/servlet/theme/FixedThemeResolver + web/servlet/theme/SessionThemeResolver web/tags/i21.tld web/tags/TagInWebApplicationContext + web/tags/ThemeTag Regards, Jean-Pierre |