|
Thanks Antonio, we looked at Dimisions but found the simple
implementation below would suffice. I'll share the details and welcome any comments or criticisms. 1. The session includes a unique key that identifies the current theme. 2. We implement our own DefinitionsFactory that decorates the default DefinitionsFactory impl (UrlDefinitionsFactory). 3. We adopt a naming convention for tiles that incorporates the theme name. eg. the default tile is "account.home". The themed tile is "companyA.account.home" 4. Within the new definitions factory, the getDefinition method checks if there's a theme defined in the session. If a theme exists, it check to see if there is a theme-specific tile defined for the requested name and returns that if it does, otherwise the default implemntation is called. eg. a call to getDefinition("account.home", tilesContext) within the customerA theme returns the "customerA.account.home" tile. Requests for theme specific tiles are passed straight through to the default impl. eg. getDefinition("customerA.account.home.intro", tilesContext) Works a treat. Using this approach we can add new theme tiles without affecting existing tiles, or with refactoring isolated only to the affected tiles. Also in order to add avoid a monolithic definitions file we add any tiles-<theme>.xml files as definition sources. regards, Jeromy Evans Antonio Petrelli wrote: 2007/8/24, Jeromy Evans <[EMAIL PROTECTED]>:Hi guys, |
- [Tiles 2] Standard practice for customising/rebranding we... Jeromy Evans
- Re: [Tiles 2] Standard practice for customising/rebr... Antonio Petrelli
- Re: [Tiles 2] Standard practice for customising/... Jeromy Evans
