Methods Summary |
---|
protected void | checkLength(java.lang.String key, java.lang.String msg, java.lang.String value, int length)
//~ Methods ----------------------------------------------------------------
if ( ( value == null ) || ( value.length( ) < length ) )
{
addError( key, getText( msg ) );
}
|
protected void | checkNotEmpty(java.lang.String key, java.lang.String msg, java.lang.String value)
if ( ( value == null ) || ( value.length( ) == 0 ) )
{
addError( key, getText( msg ) );
}
|
protected void | clearSession()
_session.remove( USERID_KEY );
_session.remove( USERNAME_KEY );
_session.remove( CART_KEY );
|
public java.lang.String | execute()
_log.info( "execute()" );
return super.execute( );
|
public java.util.Map | getCart()Returns the shoppping cart.
The cart is a java.util.Map containing the quantities of
the items of the shopping cart indexed by their itemId
Map cart = ( Map ) _session.get( CART_KEY );
if ( cart == null )
{
cart = new HashMap( );
_session.put( CART_KEY, cart );
}
return cart;
|
public cirrus.hibernate.Session | getHibernateSession()
if ( _hibernateSession == null )
{
SessionFactory factory = ( SessionFactory ) _application.get( ActionServlet.SESSION_FACTORY_KEY );
_hibernateSession = factory.openSession( );
}
if ( !_hibernateSession.isOpen( ) )
{
_hibernateSession.reconnect( );
}
return _hibernateSession;
|
public java.util.Locale | getLocale()
return _locale;
|
public java.lang.String | getRedirectUri()
return _redirectUri;
|
public java.lang.String | getText(java.lang.String key)
try
{
return getTexts( ).getString( key );
}
catch ( MissingResourceException m )
{
return "???" + key + "???";
}
|
public java.util.ResourceBundle | getTexts()
return ResourceBundle.getBundle( BUNDLE_NAME, getLocale( ) );
|
public java.lang.String | getUserId()
return ( String ) _session.get( USERID_KEY );
|
protected void | initSession(xpetstore.domain.Customer customer)
_session.put( USERID_KEY, customer.getUserId( ) );
_session.put( USERNAME_KEY, customer.getFirstname( ) + " " + customer.getLastname( ) );
/* TODO set the locale */
|
public void | setApplication(java.util.Map application)
_application = application;
|
public void | setLocale(java.util.Locale locale)
_locale = locale;
|
public void | setRedirectUri(java.lang.String nextUri)Sets the nextUri.
_redirectUri = nextUri;
|
public void | setSession(java.util.Map session)
_session = session;
|