r1 - 12 Jan 2007 - 17:00:03 - TravisVachonYou are here: OSAF >  Journal Web  >  ContributorNotes > TravisVachonNotes > PreferencesDesign

Cosmo user preferences

Big idea

User preferences are a bag of key value pairs that can be get, set and removed by a client. They will not be validated in any way on the server side, and therefore should not be used for sensitive operations like security.

Database design

  • Key value pairs stored in a new table
  • Maximum length for preference key or value: 255 chars
  • Maximum number of preferences: 255 per user

Model design

  • New methods:
    • User.getPreferences(Set keys)
    • User.setPreferences(Map keyValuePairs)
    • User.getPreference(String key)
    • User.setPreference(String key, String value)
    • User.removePreference(String key)

RPC design

  • New methods:
    • RPCService.getPreferences(String username, Set keys) (Bobby, is this possible?)
    • RPCService.setPreferences(String username, Map keyValuePairs)
  • Old methods that need to be verified or fixed:
    • RPCService.getPreference(String username, String key)
    • RPCService.setPreference(String username, String key, String value)
    • RPCService.removePreference(String username, String key)

-- TravisVachon - 13 Jan 2007

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.