Our institution has been using CAS and the service manager fro quite a while now but recently we added a new service and because of the expected client group (Alumni) there was a need to revamp our CAS UI significantly, more so then was reasonable to do by simply updating the css. I did some research on the methods that other institutions were using to tie views to services and I didn't find any that quite fit our intentions, so I designed/coded our own solution. I'm sharing it in case someone else has a similar need. First I copied default_views.properties to template.properties. Within template.properties I edited each URL property to point to a new template folder. i.e. casLoginView.url from /WEB-INF/view/jsp/default/ui/casLoginView.jsp to /WEB-INF/view/jsp/template/ui/casLoginView.jsp In my cas.properties I set the cas.viewResolver.basename property to template. I then created the template folder in /WEB-INF/view/jsp/ and created a jsp file for each view. The magic happens in these new jsp files for example casLoginView.jsp <spring:theme code="theme.casLoginView.url" text="/WEB-INF/view/jsp/default/ui/casLoginView.jsp" var="myview" /> <jsp:include page="${myview}" /> With this jsp if there is a theme.*.url property in my <theme>.properties then that page will be rendered if there isn't a a custom view defined then the default jsp will be rendered instead. I then set up my theme property file as normal but I can now add a theme.*.url to override any view where I don't want the default view to show. For example in cctheme.properties mobile.custom.css.file=css/cctheme-mobile.css standard.custom.css.file=css/cctheme.css theme.casLoginView.url=""> theme.casLoginConfirmView.url=""> Any pages where I want the default view I can leave out the theme.*.url property or if instead I want to display the view from a different theme I can set that url in the property. Andrew Tillinghast Sr. Web Developer Ph:860 439-5265 Fax: 860 439-2871 P Think before you print CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and privileged information, and unauthorized disclosure or use is prohibited. If you received this email in error, please notify the sender and delete this email from your system. -- |
