intellectual property of the author. Permission is granted for this material to be shared for non-commercial, educational purposes, provided that this copyright statement appears on the reproduced materials and notice is given that the copying is by permission of the author. To disseminate otherwise or to republish requires written permission from the authors. Arlen Johnson Rensselaer Polytechnic Institute Apereo Conference June 4, 2013
themes – The "frame" that holds the content – Dates and times (delivered by Java) BACK END • Internationalized data (supported, but not implemented in UI!) – Content: titles and descriptions for • Events • Locations • Contacts • Categories • Etc… • Logs (unsupported) 2 yet!
the MVC framework • Separate business logic from presentation and presentation from content content design business logic MVC XML HTML RSS JSON XML … JSP Java XSLT We use this architecture with our web clients even when calling resources via AJAX
feel • Easy to change strings and locale settings • XSLT files live on the web “outside” our applications and are called over http and cached • We don’t need to rebuild or redeploy an application to change its appearance, deploy a new skin, or modify translations • Can be accessed by regular web designers Templates Images CSS XSLT HTML
set second Skin set last • Browser type and skin can be set in the request • Fall back to default if not found • Want to select locale explicitly too (easy but not done) Skin file Includes: • globals.xsl • localeSettings.xsl • strings.xsl • root of theme (e.g. bedework.xsl) The root stylesheet of a theme includes all the other theme files, e.g. header.xsl, event.xsl, etc. The globals.xsl file pulls in messages.xsl and errors.xsl from a central library (for all web clients) This folder is the “appRoot” of a calendar suite named “MainCampus” Selecting the Locale & Skin for Theming Bedework
to change the strings – Easy to accommodate locale specific needs – Don’t have to rebuild or redeploy! Just have to send a request to flush the cache! • CONS – Holy cow that’s a lot of directories to maintain... kind of baroque – and lots of duplicate files (oh no!) – Central library of messages and errors kept in yet another location 7
the web clients – must manage their own translations independently in a different place • JavaScript libraries often have their own translations (which is generally ok) – but sometimes, there are locale settings that must be configured specifically for each library - that's what the localeSettings.xsl file is for • Messages and errors from the back end that don't go through the XSL front end aren't i18n – mostly impacts log files or messages from web services (for developers) 8
strings.xsl files for the web clients during deploy – allows us to internationalize messages from back end to web clients, web services, and logs – Allows us to keep all strings files in a central repository – almost certainly easier to maintain! • Could also change underlying structure to reduce duplicate files and better organize the strings files in a common place • Probably should do both 9
– for all enabled locales – Note that this is independent of the theme translation issues altogether, and should be straightforward – it just needs to be exposed in the UI with a locale switch when editing an entity! (e.g. an event, contact, location, category, view, etc.) 10