org.efaps.ui.wicket
Class EFapsSession

java.lang.Object
  extended by org.apache.wicket.Session
      extended by org.apache.wicket.protocol.http.WebSession
          extended by org.efaps.ui.wicket.EFapsSession
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.IClusterable

public class EFapsSession
extends org.apache.wicket.protocol.http.WebSession

A WebSession subclass that is used e.g. as a store for behaviors that last a Session and provides functionalities like open/close a Context and login/logout a User.

Version:
$Id: EFapsSession.java 4577 2010-05-26 04:23:59Z jan.moxter $
Author:
The eFaps Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.Session
org.apache.wicket.Session.IPageMapVisitor, org.apache.wicket.Session.PageMapAccessMetaData
 
Field Summary
static java.lang.String LOGIN_ATTRIBUTE_NAME
          This variable is used as the Key to the UserName stored in the SessionAttributes.
 
Fields inherited from class org.apache.wicket.Session
PAGEMAP_ACCESS_MDK, SESSION_ATTRIBUTE_NAME
 
Constructor Summary
EFapsSession(org.apache.wicket.Request _request)
          Standard Constructor from Wicket.
 
Method Summary
 void addUpdateBehaviors(java.lang.String _oid, UpdateInterface _behavior)
          method to add a Behavior to the updateBehaviors.
 void closeContext()
          Method that closes the opened Context openContext(), by committing or rollback it.
 java.io.File getFile()
          Getter method for instance variable file.
 ShowFileCallBackBehavior getFileCallBack()
          Getter method for instance variable fileCallBack.
 org.apache.wicket.Component getFromCache(java.lang.String _key)
          Retrieve a Component from the ComponentCache.
 Opener getOpener(java.lang.String _openerId)
          Method to get an opener from the opener cache.
 java.util.List<UpdateInterface> getUpdateBehavior(java.lang.String _oid)
          Method that returns the behaviors as aList that rely to a specified oid.
 java.util.Map<java.lang.String,java.util.List<UpdateInterface>> getUpdateBehaviors()
          This is the getter method for the instance variable updateBehaviors.
 boolean isLogedIn()
          Method to check if a user is checked in.
 void login()
          Method to log a user with the Parameters from the Request in.
 void logout()
          Logs a user out and stores the UserAttribues in the eFaps database.
 void openContext()
          Method that opens a new Context in eFaps, setting the User, the Locale, the Attributes of this Session sessionAttributes and the RequestParameters for the Context.
 void putIntoCache(java.lang.String _key, org.apache.wicket.Component _component)
          This Method stores a Component in the Cache.
 void removeFromCache(java.lang.String _key)
          Remove a Component from the ComponentCache.
 void removeOpener(java.lang.String _openerId)
          Method to remove a opener from the opener cache.
 void setFile(java.io.File _file)
           
 void setFileCallBack(ShowFileCallBackBehavior _fileCallBack)
          Setter method for instance variable fileCallBack.
 void storeOpener(Opener _opener)
          Method to store an opener in this session.
 
Methods inherited from class org.apache.wicket.protocol.http.WebSession
cleanupComponentFeedbackMessages, cleanupFeedbackMessages, isCurrentRequestValid
 
Methods inherited from class org.apache.wicket.Session
attach, bind, clear, createAutoPageMap, createAutoPageMapName, currentCreateAutoPageMapCounter, detach, dirty, error, exists, findOrCreate, findOrCreate, get, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getAutoPageMapNamePrefix, getAutoPageMapNameSuffix, getClassResolver, getClientInfo, getDefaultPageMap, getFeedbackMessages, getId, getLocale, getMetaData, getPage, getPage, getPageFactory, getPageMaps, getSessionStore, getSizeInBytes, getStyle, incrementCreateAutoPageMapCounter, info, invalidate, invalidateNow, isSessionInvalidated, isTemporary, newPageMap, nextPageId, nextSequenceValue, pageMapForName, removeAttribute, removePageMap, replaceSession, set, setApplication, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, touch, unset, untouch, update, visitPageMaps, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_ATTRIBUTE_NAME

public static final java.lang.String LOGIN_ATTRIBUTE_NAME
This variable is used as the Key to the UserName stored in the SessionAttributes.

See Also:
Constant Field Values
Constructor Detail

EFapsSession

public EFapsSession(org.apache.wicket.Request _request)
Standard Constructor from Wicket.

Parameters:
_request - Request
Method Detail

addUpdateBehaviors

public void addUpdateBehaviors(java.lang.String _oid,
                               UpdateInterface _behavior)
method to add a Behavior to the updateBehaviors. The behavior will only be added if no update behavior with the same Id is existing in the List related to the given oid.

Parameters:
_oid - Oid (used as key in the map)
_behavior - (behavoir to be added)

getUpdateBehavior

public java.util.List<UpdateInterface> getUpdateBehavior(java.lang.String _oid)
Method that returns the behaviors as aList that rely to a specified oid.

Parameters:
_oid - OID to get the List for
Returns:
List with Behaviors

getUpdateBehaviors

public java.util.Map<java.lang.String,java.util.List<UpdateInterface>> getUpdateBehaviors()
This is the getter method for the instance variable updateBehaviors.

Returns:
value of instance variable updateBehaviors

putIntoCache

public void putIntoCache(java.lang.String _key,
                         org.apache.wicket.Component _component)
This Method stores a Component in the Cache.

Parameters:
_key - Key the Component should be stored in
_component - Component to be stored
See Also:
componentcache

getFromCache

public org.apache.wicket.Component getFromCache(java.lang.String _key)
Retrieve a Component from the ComponentCache.

Parameters:
_key - Key of the Component to be retrieved
Returns:
Component if found, else null
See Also:
componentcache

removeFromCache

public void removeFromCache(java.lang.String _key)
Remove a Component from the ComponentCache.

Parameters:
_key - Key to the Component to be removed
See Also:
componentcache

removeOpener

public void removeOpener(java.lang.String _openerId)
Method to remove a opener from the opener cache.

Parameters:
_openerId - id of the opener to be removed

storeOpener

public void storeOpener(Opener _opener)
Method to store an opener in this session.

Parameters:
_opener - opener to be stored

getOpener

public Opener getOpener(java.lang.String _openerId)
Method to get an opener from the opener cache.

Parameters:
_openerId - if of the opener to get
Returns:
an opener instance

isLogedIn

public boolean isLogedIn()
Method to check if a user is checked in.

Returns:
true if a user is checked in, else false
See Also:
userName

login

public final void login()
Method to log a user with the Parameters from the Request in.

See Also:
checkLogin(String, String)

logout

public final void logout()
Logs a user out and stores the UserAttribues in the eFaps database.


openContext

public void openContext()
Method that opens a new Context in eFaps, setting the User, the Locale, the Attributes of this Session sessionAttributes and the RequestParameters for the Context.

See Also:
Session.attach()

closeContext

public void closeContext()
Method that closes the opened Context openContext(), by committing or rollback it.

See Also:
Session.detach()

getFileCallBack

public ShowFileCallBackBehavior getFileCallBack()
Getter method for instance variable fileCallBack.

Returns:
value of instance variable fileCallBack

setFileCallBack

public void setFileCallBack(ShowFileCallBackBehavior _fileCallBack)
Setter method for instance variable fileCallBack.

Parameters:
_fileCallBack - value for instance variable fileCallBack

setFile

public void setFile(java.io.File _file)

getFile

public java.io.File getFile()
Getter method for instance variable file.

Returns:
value of instance variable file


Copyright © 2003-2010 The eFaps Team. All Rights Reserved.