se.kmr.scam.client.http.helper
Class PreferenceBean

java.lang.Object
  extended byse.kmr.scam.client.http.helper.PreferenceBean

public class PreferenceBean
extends Object

This bean is used to store preferred values for different application parameters. An instance of this bean is stored as an attribute with name NAME in the applications scope to be used as the preference of all sessions that have not made any alterations to the default values. If the owner of a session makes a change of the preferred value of any parameter a bean of this class with name NAME should be stored in the session scope. Any tags in a JSP-page using this bean could use an Expression Language syntax expression construct like "${preferenceBean.locale}" to retrieve the preferred locale or "${preferenceBean.resultPageLength} to retrieve the preferred length of a search result page.

Version:
$Revision: 1.7 $
Author:
Göran Holm/Ateles Consulting AB
Created:
2002-07-24

Field Summary
static String LOCALE
          Name of preference parameter locale
static String NAME
          Bean name
static String PROG_SORT_ORDER
          Name of preference parameter result page sort order
static String RESULT_PAGE_LENGTH
          Name of preference parameter result page length
 
Constructor Summary
PreferenceBean()
          Default constructor
PreferenceBean(PreferenceBean bean)
          Copy constructor.
 
Method Summary
 String getLocale()
          Gets the locale attribute of the bean
 Sorter getProgSortOrder()
          Gets the search result sort order attribute of the bean
 int getResultPageLength()
          Gets the search result page lentgh attribute of the bean
 void setLocale(String aLocale)
          Sets the locale attribute of the bean
 boolean setPreferenceAttributes(Map prefAttrs)
          Sets the appropriate preference attributes in the bean
 void setProgSortOrder(Sorter aProgSortOrder)
          Sets the search result sort order attribute of the bean
 void setProgSortOrder(String aProgSortOrder)
          Sets the search result sort order attribute of the bean from a given name
 void setResultPageLength(int aResultPageLength)
          Sets the search result page length attribute of the bean
 void setResultPageLength(String aResultPageLength)
          Sets the search result page length attribute of the bean
 String toString()
          Make a string representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Bean name

See Also:
Constant Field Values

LOCALE

public static final String LOCALE
Name of preference parameter locale

See Also:
Constant Field Values

RESULT_PAGE_LENGTH

public static final String RESULT_PAGE_LENGTH
Name of preference parameter result page length

See Also:
Constant Field Values

PROG_SORT_ORDER

public static final String PROG_SORT_ORDER
Name of preference parameter result page sort order

See Also:
Constant Field Values
Constructor Detail

PreferenceBean

public PreferenceBean()
Default constructor


PreferenceBean

public PreferenceBean(PreferenceBean bean)
Copy constructor.

Parameters:
bean - Copy values from this PreferenceBean
Method Detail

getLocale

public String getLocale()
Gets the locale attribute of the bean

Returns:
The locale value

setLocale

public void setLocale(String aLocale)
Sets the locale attribute of the bean

Parameters:
aLocale - The new locale value

getResultPageLength

public int getResultPageLength()
Gets the search result page lentgh attribute of the bean

Returns:
The resultPageLength value

setResultPageLength

public void setResultPageLength(int aResultPageLength)
Sets the search result page length attribute of the bean

Parameters:
aResultPageLength - The new page length value

setResultPageLength

public void setResultPageLength(String aResultPageLength)
Sets the search result page length attribute of the bean

Parameters:
aResultPageLength - The new page length value

setProgSortOrder

public void setProgSortOrder(Sorter aProgSortOrder)
Sets the search result sort order attribute of the bean

Parameters:
aProgSortOrder - The new sort order value

setProgSortOrder

public void setProgSortOrder(String aProgSortOrder)
Sets the search result sort order attribute of the bean from a given name

Parameters:
aProgSortOrder - The name of the new sort order value

getProgSortOrder

public Sorter getProgSortOrder()
Gets the search result sort order attribute of the bean

Returns:
The progSortOrder value

setPreferenceAttributes

public boolean setPreferenceAttributes(Map prefAttrs)
Sets the appropriate preference attributes in the bean

Parameters:
prefAttrs - The attributes to set in the bean
Returns:
Description of the Return Value

toString

public String toString()
Make a string representation of this object

Returns:
a string


Copyright © 2003 SCAM. All Rights Reserved.