org.liquidsite.app.template
Class SessionBean

java.lang.Object
  extended byorg.liquidsite.app.template.TemplateBean
      extended byorg.liquidsite.app.template.SessionBean
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateModel

public class SessionBean
extends TemplateBean
implements freemarker.template.TemplateHashModel

A user session bean. This class is used to access and manipulate session data from the template data model.


Nested Class Summary
 class SessionBean.SessionDataBean
          The session data model bean.
 
Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Method Summary
 void clear()
          Clears all the data in the user session.
 void create()
          Creates a user session if none existed previously.
 void destroy()
          Destroys the user session.
 freemarker.template.TemplateModel get(java.lang.String name)
          Returns a session data value as a template model.
 boolean isEmpty()
          Checks if the session data hash model is empty.
 
Methods inherited from class org.liquidsite.app.template.TemplateBean
getContext, getContextRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Checks if the session data hash model is empty.

Specified by:
isEmpty in interface freemarker.template.TemplateHashModel
Returns:
false as the hash model can always be extended

get

public freemarker.template.TemplateModel get(java.lang.String name)
Returns a session data value as a template model.

Specified by:
get in interface freemarker.template.TemplateHashModel
Parameters:
name - the data key name
Returns:
the template model object

clear

public void clear()
Clears all the data in the user session.


create

public void create()
Creates a user session if none existed previously.


destroy

public void destroy()
Destroys the user session. This is identical to logging out the user.