From: "Andrew Hill" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: [Design] User Customisable Views Date: Mon, 24 Mar 2003 17:40:09 +0800
IMHO you would probably want to create bean(s) that contain the relevant preferences. Ie:
getFavouriteMouseOverColour() getPreferredAlignment() isShowColumnX()
In your business tier of course these get persisted to / retrieved from the database (a few hundred rows isnt going to hurt much (I think)).
If these prefs dont get changed on the fly by other users (ie: only that user changes them usually) then the best place to retrieve is when the user does a login and you can cache the bean(s) for that user in their session.
I personally don't like the idea of loading user preferences ever time they log on so i was thinking about caching their pref details e.g. a singleton object to cache all user prefs then having a thread to remove prefs which have not been accessed with a set time frame.
In your JSP (or velocity template or whatever you use for rendering) you can
access the getters to provide you the appropriate values you need, and of
course make use of such things as the equals / notEquals tags etc... (this
isnt 'logic' its just hiding/showing stuff depending on whats set in your
prefs...)
I was trying to avoid this... it adds more complexity to the JSP making mantience and UI updates a nightmare, i want to keep my jsp's
as simple as possible as i don't want to be the only who can make UI updates... after all i'm a java developer not a web designer.
If attributes of the prefs beans need to be passed as attributes to jsp tags
Id suggest you look into making the jump to JSTL (or struts EL) if you
havent done so as the expression language will save you a lot of hassle
writing the JSP code...
Havent had to do user prefs yet in my app so cant tell you from experience how well this will work, but I cant think of a simpler way! (Though I suppose for a lot of the simpler prefs, such as colours, you could handle it by generating on the fly (and caching) a css style sheet customised for that particular user.)
-----Original Message----- From: Pat Quinn [mailto:[EMAIL PROTECTED] Sent: Monday, 24 March 2003 17:21 To: [EMAIL PROTECTED] Subject: [Design] User Customisable Views
Hi Guys,
I have a requirement as follows:
I want each user within my web app to be able to customise their views for individual screens independently, I want users to be able to customise attributes such as:
� Turn on/off certain columns when displaying tabular data. � Customise Header colour, data row colours, onMouseOver colours � Text Alignment with cells, Font etc�
I�m thinking I need to persist the above attributes for each user i.e. using
some Tables in my database. My application will have a large number of users
i.e. (600+ but only 200 concurrent users) so I�m little concerned at this
approach.
Has anyone out there tried something similar to this before with Struts and if so should you provide me a few pointers i.e.
How did you persist user view details� how did you plug it in with Struts�. I want to avoid adding logic to my view layer to control the displaying of the above attributes.
Any Ideas gurus� by the way I�m not looking for a solution just a few pointers.
Cheers
Pat
_________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

