public interface UserPreferenceManager
UserPrefernceManager manages the user preferences.| Modifier and Type | Method and Description |
|---|---|
String |
get(String userName,
String key)
Gets the user preference item value by user name and preference key.
|
Properties |
getDefaultUserPreference()
Gets the default user preference setting.
|
Properties |
getUserPreference(String userName)
Gets the user preference by user name.
|
Properties |
getUserPreference(String userName,
String keyPrefix)
Gets the user preference by user name and preference key prefix, such as
"dhtml." or "dsb."
|
void |
saveDefaultUserPreference(Properties defaultPreference)
Saves the specific user preference setting as the default.
|
void |
saveUserPreference(String userName,
Properties preference)
Saves the user preference by user name.
|
void |
set(String userName,
String key,
String value)
Sets the user preference item value.
|
boolean |
useDefaultUserPreference(String userName)
Changes the specific user preference setting to default.
|
boolean |
useDefaultUserPreference(String userName,
List<String> keys)
Changes the specific user preference setting which specified by the keys to default.
|
Properties getUserPreference(String userName)
userName - the user name, same as user IDAPIConst.PREFERENCE_NAME_DEFAULT_VIEW_FORMAT, used to set default format for
viewing reports, its values are defined in APIConst,
such as APIConst.HTML, APIConst.PDF, APIConst.TEXT,
APIConst.EXCEL, APIConst.PS, APIConst.RTF, APIConst.XML
and give run report parameter.
APIConst.POPUP_DHTML_WINDOW, used to specify whether to pop up a new window for DHTML,
its values are true or false, true to pop up new window.
APIConst.PREFERENCE_NAME_DAYS_DEFINITION_FOR_COMPLETED, used to specify the number of
days that JReport Server must keep the completed tasks in the completed task list,
a setting of 0 will keep all completed tasks.
etc,
and the column's name, used to set which columns will be shown when you log on JReport Server, for example,
APIConst.COLUMN_NAME_REPORTS_NAME,
APIConst.COLUMN_NAME_SCHEDULED_TASK_ID,
APIConst.COLUMN_NAME_ACTIVE_TASK_ID,
APIConst.COLUMN_NAME_COMPLETED_REPORT,
APIConst.COLUMN_NAME_VERSION_VERSION_DATE etc,
all of their values are boolean.
If the value is true, the column will be shown on the web page.void saveUserPreference(String userName, Properties preference) throws IOException
userName - the user name, same as user IDpreference - a subset of all preference items, the preference properties
include: the preference items, for example,
APIConst.PREFERENCE_NAME_DEFAULT_VIEW_FORMAT,
APIConst.POPUP_DHTML_WINDOW,
APIConst.PREFERENCE_NAME_DAYS_DEFINITION_FOR_COMPLETED etc,
and the column's name, for example,
APIConst.COLUMN_NAME_REPORTS_NAME,
APIConst.COLUMN_NAME_SCHEDULED_TASK_ID,
APIConst.COLUMN_NAME_ACTIVE_TASK_ID,
APIConst.COLUMN_NAME_COMPLETED_REPORT,
APIConst.COLUMN_NAME_VERSION_VERSION_DATE etc.IOException - will be thrown if the saving failed.Properties getDefaultUserPreference()
void saveDefaultUserPreference(Properties defaultPreference) throws IOException
defaultPreference - the specific user preference properties.IOException - will be thrown if the saving failed.boolean useDefaultUserPreference(String userName)
userName - the user name, same as user IDboolean useDefaultUserPreference(String userName, List<String> keys)
userName - the user name, same as user IDkeys - the property keys to reset to default settingProperties getUserPreference(String userName, String keyPrefix)
userName - the user name, same as user IDkeyPrefix - same as property valueString get(String userName, String key)
userName - the user name, same as user IDkey - same as property keyvoid set(String userName, String key, String value) throws IOException
userName - the user name, same as user IDkey - same as property keyvalue - same as property valueIOException© insightsoftware. All rights reserved.