Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api
Interface UserPreferenceManager

    public interface UserPreferenceManager

Interface `UserPrefernceManager` manages the user preferences.

Method Summary
`java.lang.String` | `get(java.lang.String userName, java.lang.String key)` Gets the user preference item value by user name and preference key.
`java.util.Properties` | `getDefaultUserPreference()` Gets the default user preference setting.
`java.util.Properties` | `getUserPreference(java.lang.String userName)` Gets the user preference by user name.
`java.util.Properties` | `getUserPreference(java.lang.String userName, java.lang.String keyPrefix)` Gets the user preference by user name and preference key prefix, such as "dhtml." or "dsb."
`void` | `saveDefaultUserPreference(java.util.Properties defaultPreference)` Saves the specific user preference setting as the default.
`void` | `saveUserPreference(java.lang.String userName, java.util.Properties preference)` Saves the user preference by user name.
`void` | `set(java.lang.String userName, java.lang.String key, java.lang.String value)` Sets the user preference item value.
`boolean` | `useDefaultUserPreference(java.lang.String userName)` Changes the specific user preference setting to default.
`boolean` | `useDefaultUserPreference(java.lang.String userName, java.util.List<java.lang.String> keys)` Changes the specific user preference setting which specified by the keys to default.

Method Detail

### getUserPreference

    java.util.Properties getUserPreference(java.lang.String userName)

  Gets the user preference by user name.

  Parameters:
    `userName` - the user name, same as user ID
  Returns:
    the user preference properties which include: the preference items, for example, `APIConst.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.``

### saveUserPreference

    void saveUserPreference(java.lang.String userName,
                            java.util.Properties preference)
                            throws java.io.IOException

  Saves the user preference by user name.

  Parameters:
    `userName` - the user name, same as user ID
    `preference` - 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.
  Throws:
    `java.io.IOException` - will be thrown if the saving failed.

### getDefaultUserPreference

    java.util.Properties getDefaultUserPreference()

  Gets the default user preference setting.

  Returns:
    the default user preference properties.

### saveDefaultUserPreference

    void saveDefaultUserPreference(java.util.Properties defaultPreference)
                                   throws java.io.IOException

  Saves the specific user preference setting as the default.

  Parameters:
    `defaultPreference` - the specific user preference properties.
  Throws:
    `java.io.IOException` - will be thrown if the saving failed.

### useDefaultUserPreference

    boolean useDefaultUserPreference(java.lang.String userName)

  Changes the specific user preference setting to default.

  Parameters:
    `userName` - the user name, same as user ID
  Returns:
    true if the operation is successful, false if the operation failed.

### useDefaultUserPreference

    boolean useDefaultUserPreference(java.lang.String userName,
                                     java.util.List<java.lang.String> keys)

  Changes the specific user preference setting which specified by the keys to default.

  Parameters:
    `userName` - the user name, same as user ID
    `keys` - the property keys to reset to default setting
  Returns:
    true if the operation is successful, false if the operation failed.

### getUserPreference

    java.util.Properties getUserPreference(java.lang.String userName,
                                           java.lang.String keyPrefix)

  Gets the user preference by user name and preference key prefix, such as "dhtml." or "dsb."

  Parameters:
    `userName` - the user name, same as user ID
    `keyPrefix` - same as property value
  Returns:
    the user preference properties.

### get

    java.lang.String get(java.lang.String userName,
                         java.lang.String key)

  Gets the user preference item value by user name and preference key.

  Parameters:
    `userName` - the user name, same as user ID
    `key` - same as property key
  Returns:
    preference item value

### set

    void set(java.lang.String userName,
             java.lang.String key,
             java.lang.String value)
             throws java.io.IOException

  Sets the user preference item value.

  Parameters:
    `userName` - the user name, same as user ID
    `key` - same as property key
    `value` - same as property value
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD