com.atlassian.jira.portal
Interface PortletConfigurationStore

All Known Implementing Classes:
CachingPortletConfigurationStore, OfbizPortletConfigurationStore

public interface PortletConfigurationStore

Store for the PortletConfiguration domain object.


Method Summary
 PortletConfiguration add(Long pageId, String portletKey, Integer column, Integer row)
          Deprecated. since v4.0 portletConfigurations based of portlets are deprecated. They should now use gadgets.
 PortletConfiguration addGadget(Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, com.atlassian.gadgets.dashboard.Color color, Map<String,String> userPreferences)
          Creates and adds a new PortletConfiguration to given PortalPage.
 PortletConfiguration addLegacyGadget(Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, com.atlassian.gadgets.dashboard.Color color, Map<String,String> userPreferences, String portletKey)
          Creates and adds a new PortletConfiguration to given PortalPage.
 void delete(PortletConfiguration pc)
          Deletes the given PortletConfiguration.
 Set<PortletConfiguration> deleteByProject(Project project)
          Removes all the portlet configurations for a project on any portal page.
 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, com.atlassian.gadgets.dashboard.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<String,String> userPrefs)
          Given a gadget, this method updates all userprefs for this gadget.
 

Method Detail

getByPortalPage

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.

deleteByProject

Set<PortletConfiguration> deleteByProject(Project project)
Removes all the portlet configurations for a project on any portal page. This is used mainly when a project is deleted. This method will find all the portletConfigurations that make use of a project filter or the project directly, and delete them.

Parameters:
project - The project whose portlets will be deleted
Returns:
a set of all the PortletConfigurations that were deleted

getByPortletId

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.

delete

void delete(PortletConfiguration pc)
Deletes the given PortletConfiguration.

Parameters:
pc - The PortletConfiguration to delete.

store

void store(PortletConfiguration pc)
Saves the given PortletConfiguration.

Parameters:
pc - The PortletConfiguration to save.

updateGadgetPosition

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

updateGadgetColor

void updateGadgetColor(Long gadgetId,
                       com.atlassian.gadgets.dashboard.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

updateUserPrefs

void updateUserPrefs(Long gadgetId,
                     Map<String,String> 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.

add

PortletConfiguration add(Long pageId,
                         String portletKey,
                         Integer column,
                         Integer row)
Deprecated. since v4.0 portletConfigurations based of portlets are deprecated. They should now use gadgets.

Creates and adds a new PortletConfiguration to given PortalPage

Parameters:
pageId - The id of the page to add the configuration to.
portletKey - The key of the portlet.
column - The column position of the portlet.
row - The row position of the portlet
Returns:
The new PortletConfiguration with the id set.

addGadget

PortletConfiguration addGadget(Long pageId,
                               Long portletConfigurationId,
                               Integer column,
                               Integer row,
                               URI gadgetXml,
                               com.atlassian.gadgets.dashboard.Color color,
                               Map<String,String> 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. This will correspond to JiraGadgetStateFactory.createGadgetState(java.net.URI). 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.
Returns:
The new PortletConfiguration with the id set.

addLegacyGadget

PortletConfiguration addLegacyGadget(Long pageId,
                                     Long portletConfigurationId,
                                     Integer column,
                                     Integer row,
                                     URI gadgetXml,
                                     com.atlassian.gadgets.dashboard.Color color,
                                     Map<String,String> userPreferences,
                                     String portletKey)
Creates and adds a new PortletConfiguration to given PortalPage. This should be used to add a legacy gadget only!

Parameters:
pageId - The id of the page to add the configuration to.
portletConfigurationId - The id to use for adding the gadget. This will correspond to JiraGadgetStateFactory.createGadgetState(java.net.URI). 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.
portletKey - The portletKey of the old portlet.
Returns:
The new PortletConfiguration with the id set.

getAllPortletConfigurations

EnclosedIterable<PortletConfiguration> getAllPortletConfigurations()
Returns an iterable over all PortletConfigurations available in the database.

Returns:
iterable over all PortletConfigurations available in the database


Copyright © 2002-2009 Atlassian. All Rights Reserved.