public class

OfbizPortletConfigurationStore

extends Object
implements PortletConfigurationStore
java.lang.Object
   ↳ com.atlassian.jira.portal.OfbizPortletConfigurationStore

Summary

Nested Classes
class OfbizPortletConfigurationStore.Columns  
class OfbizPortletConfigurationStore.UserPreferenceColumns  
Constants
String TABLE
String USER_PREFERENCES_TABLE
Public Constructors
OfbizPortletConfigurationStore(OfBizDelegator delegator, JsonEntityPropertyManager jsonEntityPropertyManager)
Public Methods
PortletConfiguration addDashboardItem(Long pageId, Long portletConfigurationId, Integer column, Integer row, Option<URI> openSocialSpecUri, Color color, Map<StringString> userPreferences, Option<ModuleCompleteKey> moduleKey)
Creates and adds a new PortletConfiguration to given PortalPage.
PortletConfiguration addGadget(Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, Color color, Map<StringString> userPreferences)
Creates and adds a new PortletConfiguration to given PortalPage.
void delete(PortletConfiguration pc)
Deletes the given PortletConfiguration.
EnclosedIterable<PortletConfiguration> getAllPortletConfigurations()
Returns an iterable over all PortletConfigurations available in the database.
List<PortletConfiguration> getByPortalPage(Long portalPageId)
Get all PortletConfiguration objects for a given PortalPage id.
PortletConfiguration getByPortletId(Long portletId)
Gall a PortletConfiguration by its id.
void store(PortletConfiguration pc)
Saves the given PortletConfiguration.
void updateGadgetColor(Long gadgetId, Color color)
Given a gadget, this method will update the color value for this gadget.
void updateGadgetPosition(Long gadgetId, int row, int column, Long dashboardId)
Given a gadget, this method will update it's row, column and parent dashboard id.
void updateUserPrefs(Long gadgetId, Map<StringString> userPrefs)
Given a gadget, this method updates all userprefs for this gadget.
Protected Methods
void removePropertySet(GenericValue gv)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.portal.PortletConfigurationStore

Constants

public static final String TABLE

Constant Value: "PortletConfiguration"

public static final String USER_PREFERENCES_TABLE

Constant Value: "GadgetUserPreference"

Public Constructors

public OfbizPortletConfigurationStore (OfBizDelegator delegator, JsonEntityPropertyManager jsonEntityPropertyManager)

Public Methods

public PortletConfiguration addDashboardItem (Long pageId, Long portletConfigurationId, Integer column, Integer row, Option<URI> openSocialSpecUri, Color color, Map<StringString> userPreferences, Option<ModuleCompleteKey> moduleKey)

Creates and adds a new PortletConfiguration to given PortalPage. This should be used to add a gadget.

Parameters
pageId The id of the page to add the configuration to.
portletConfigurationId The id to use for adding the gadget. May be null for a generated id.
column The column position of the portlet.
row The row position of the portlet
openSocialSpecUri A URI specifying the location of the gadget XML. May be an empty option if this is a legacy portlet or dashboard item without uri replacement.
color The chrome color for the gadget.
userPreferences A map of key -> value user preference pairs used to store gadget configuration.
moduleKey A complete module key of dashboard items.
Returns
  • The new PortletConfiguration with the id set.

public PortletConfiguration addGadget (Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, Color color, Map<StringString> userPreferences)

Creates and adds a new PortletConfiguration to given PortalPage. This should be used to add a gadget.

Parameters
pageId The id of the page to add the configuration to.
portletConfigurationId The id to use for adding the gadget. May be null for a generated id.
column The column position of the portlet.
row The row position of the portlet
gadgetXml A URI specifying the location of the gadget XML. May be null if this is a legacy portlet.
color The chrome color for the gadget.
userPreferences A map of key -> value user preference pairs used to store gadget configuration.

public void delete (PortletConfiguration pc)

Deletes the given PortletConfiguration.

Parameters
pc The PortletConfiguration to delete.

public EnclosedIterable<PortletConfiguration> getAllPortletConfigurations ()

Returns an iterable over all PortletConfigurations available in the database.

Returns
  • iterable over all PortletConfigurations available in the database

public List<PortletConfiguration> getByPortalPage (Long portalPageId)

Get all PortletConfiguration objects for a given PortalPage id.

Parameters
portalPageId The id of the page to retreive all configurations for.
Returns
  • The configurations associated with the given page.

public PortletConfiguration getByPortletId (Long portletId)

Gall a PortletConfiguration by its id.

Parameters
portletId The id of the portlet configuration.
Returns
  • The configuration of the given id or null.

public void store (PortletConfiguration pc)

Saves the given PortletConfiguration.

Parameters
pc The PortletConfiguration to save.

public void updateGadgetColor (Long gadgetId, Color color)

Given a gadget, this method will update the color value for this gadget.

Parameters
gadgetId The id of the gadget being updated
color The new color value for this gadget

public void updateGadgetPosition (Long gadgetId, int row, int column, Long dashboardId)

Given a gadget, this method will update it's row, column and parent dashboard id.

Parameters
gadgetId The id of the gadget being updated
row The new row value for this gadget
column The new column value for this gadget
dashboardId The new parent dashboard id value for this gadget

public void updateUserPrefs (Long gadgetId, Map<StringString> userPrefs)

Given a gadget, this method updates all userprefs for this gadget.

Parameters
gadgetId The id of the gadget being updated
userPrefs The new userprefs to set for this gadget.

Protected Methods

protected void removePropertySet (GenericValue gv)