• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are best practices to implement 'Branding' (different LAF) in web application?  RSS feed

 
Ivan Davidov
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a research and I neeed advice from people who have more experience in dynamic customizing of java web applications.

In my custom case I have a simple login page with some images, labels and so on. The idea is to implement it in such a way to allow easy customization of some parts from the page.

For example let's say that the application is used by company AAA. Thay might want to change the logo image with their own image and change the default 'disclaimer' text with some other text by using appropriate admin module which allows user-friendly interaction.

The task seems very easy and it really IS very easy, I just wonder if there are any 'best practices' for such a situation.

One approach is to define all changable resources in standard .properties file. Having in mind that I have < 10 changable resources this seems reasonable enough. Anyway I still prefer to use additional table with two columns (key->value) which is the same as using .properties file, only the API to access these resources would be slightly different. I have in mind that the DB approach is somehow more flexible because in the future I might need more changable resources in more than one page, and reading/writing large .properties file might not be the best solution.

Any recommendations or other approaches to solve the 'problem'?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way we handled this was to define different "themes" for each branding of the product. The theme name is used as the base folder path for picking up style sheets, images, properties files and even JS scripts, that are specific to a branding. We also defined a default area where files that didn't need to change could be defaulted out of so that no files need be repeated if there are no differences.

To make it easy to use this scheme, we defined custom tags for referencing the resources that determine what the current theme is (stored in the session when the user logs in) and that dynamically generate the URL to resource (either to a branded resource if it exists, or to the default resource if it does not).

It's all worked out pretty well, though we've never found a need to use different JS script files across brands so we probably could've ditched that.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To handle multiple clients using the same test engine, I put "vendor" information in an XML file.

XML is great for this purpose because if you have to add new elements for a particular user it does not screw up the other vendors. You can even store chunks of HTML in CDATA sections.

Typically I provide custom CSS, logo images and javascript file locations and a chunk of HTML for inserting a "questions to the author" field. CSS is a real workhorse for creating custom look and feel.

Bill
 
Ivan Davidov
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all. I like the idea with custom tags and I will research more in this area.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!