Class PersonalizationHandler
- java.lang.Object
-
- org.openbravo.client.application.personalization.PersonalizationHandler
-
@RequestScoped public class PersonalizationHandler extends Object
Handles personalization settings, stores them and retrieves them, taking into account priority order.
-
-
Constructor Summary
Constructors Constructor Description PersonalizationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UIPersonalization
getPersonalization(String clientId, String orgId, String roleId, String userId, String tabId, String windowId, boolean exactMatch)
UIPersonalization
getPersonalizationForTab(Tab tab)
Returns all the personalization settings for a tab.org.codehaus.jettison.json.JSONObject
getPersonalizationForWindow(Window window)
Returns all the personalization settings in an object keyed by tabid.UIPersonalization
storePersonalization(String persId, String clientId, String orgId, String roleId, String userId, String tabId, String windowId, String target, String value)
Stores the personalization json object for a certain level, if there is no current record then a new one is created and persisted.UIPersonalization
storePersonalization(String persId, String clientId, String orgId, String roleId, String userId, String tabId, String windowId, String target, String value, Boolean saveAsNewPersonalization)
Stores the personalization json object for a certain level, if there is no current record then a new one is created and persisted.
-
-
-
Method Detail
-
getPersonalizationForWindow
public org.codehaus.jettison.json.JSONObject getPersonalizationForWindow(Window window)
Returns all the personalization settings in an object keyed by tabid. The current client, org, role and user are taken into account to find the correct personalization entry. If no personalization record is present then null is returned for that specific tab.- Parameters:
window
- the window for which the personalization settings are to be returned.- Returns:
- the personalization settings in a json object for a window.
-
getPersonalizationForTab
public UIPersonalization getPersonalizationForTab(Tab tab)
Returns all the personalization settings for a tab. The current client, org, role and user are taken into account to find the correct personalization entry. If no personalization entries are present then null is returned.- Parameters:
tab
- the tab for which the personalization settings are to be returned.- Returns:
- the personalization settings in a json object for this tab.
-
getPersonalization
public UIPersonalization getPersonalization(String clientId, String orgId, String roleId, String userId, String tabId, String windowId, boolean exactMatch)
-
storePersonalization
public UIPersonalization storePersonalization(String persId, String clientId, String orgId, String roleId, String userId, String tabId, String windowId, String target, String value)
Stores the personalization json object for a certain level, if there is no current record then a new one is created and persisted. If the pers- Parameters:
persId
- if a specific personalization id is set then the system updates that record and ignores the other parameters.clientId
- the client, maybe nullorgId
- the organization id, maybe nullroleId
- the role id, maybe nulluserId
- the user id, maybe nulltabId
- the tab id, may not be nulltarget
- the personalization target, is either form or gridvalue
- the value, a json string- Returns:
- the persisted record
-
storePersonalization
public UIPersonalization storePersonalization(String persId, String clientId, String orgId, String roleId, String userId, String tabId, String windowId, String target, String value, Boolean saveAsNewPersonalization)
Stores the personalization json object for a certain level, if there is no current record then a new one is created and persisted. If the pers- Parameters:
persId
- if a specific personalization id is set then the system updates that record and ignores the other parameters.clientId
- the client, maybe nullorgId
- the organization id, maybe nullroleId
- the role id, maybe nulluserId
- the user id, maybe nulltabId
- the tab id, may not be nulltarget
- the personalization target, is either form or gridvalue
- the value, a json stringsaveAsNewPersonalization
- to save the personalization as a new personalization- Returns:
- the persisted record
-
-