[Zope] - Personalization and ZOPE

Paul Everitt Paul@digicool.com
Thu, 17 Dec 1998 11:12:35 -0500


Theodore wrote:
> How would one go about making Zope store personal data about 
> a site visitor
> (Session to Session data linked by a user logon)?
>  
> SCENARIO:
>  
> 1. The user logs on and registers.

...and goes into a User Folder somewhere.  We have done some work on
getting cookie-based authentication to work.

> 2. The user fills out forms to customize the site as part of the
> registration process.

...and gets an email, and has a facility to remember lost login
information, and gets expired after a certain time period, and...

Since they are going to want to change their personalization options
over time, they need a place to come back to. 

> 3. The site uses the user variables to make the navigation, 
> content and
> graphic changes.
> 4. If the user edits the variables the site changes.
> 5. The developer gets some sleep by using zope.
>  
> ANY RECOMMENDATIONS?
>  
> IT WOULD MAKE FOR AN EXCELLENT EXAMPLE OF ZOPE!

Except for the cookie part, this shouldn't be too hard for you to tinker
with.  Modify the User class in User.py to have other state then change
addUser.dtml and editUser.dtml to make it visible.

After that, add some methods to allow the information to be seen in
DTML.

For instance, if you added the following method to User (UNTESTED!):

  def getExperienceLevel(self):
    """Return whether the person is novice, intermediate, or
advanced."""
    return self.experience_level

then in DTML you could say:

<!--#if "AUTHENTICATED_USER.getExperienceLevel() == 'novice'"-->
  <p>The words with the funny blue lines under them are called
hyperlinks.</p>
<!--#/if-->

--Paul

Paul Everitt       Digital Creations
paul@digicool.com  540.371.6909