com.atlassian.jira.portal
Class DefaultPortalManager

java.lang.Object
  extended by com.atlassian.jira.portal.DefaultPortalManager
All Implemented Interfaces:
PortalManager

public class DefaultPortalManager
extends Object

The portal manager for Standard Edition.


Field Summary
 
Fields inherited from interface com.atlassian.jira.portal.PortalManager
DASHBOARD_PAGE_NAME, SYSTEM_PORTLET_PACKAGE
 
Constructor Summary
DefaultPortalManager(PortletAccessManager portletAccessManager, PortalPageService portalPageService, FavouritesManager favouritesManager)
           
 
Method Summary
 Long createPortalPageConfiguration(User user, String pagename, String description)
          Deprecated. Create a new portal page in JIRA.
 Long createPortalPageConfiguration(User u, String pagename, String description, Long copyPageId)
          Deprecated. Create a new portal page in JIRA by copying one already in the system.
 void decreasePageConfigurationSequence(User user, int position)
          Deprecated. Decreases the position of the page in the user's favourite page list.
 void deletePortalPageConfiguration(User u, Long pageId)
          Deprecated. This function removes a portal page configuration for a user including all of its portlet configurations and their properties.
 Collection getAllPortlets()
          Deprecated. Return all the portlets on the system.
 PortalPageConfiguration getDefaultPortalPage()
          Deprecated. Get the configuration for the default portal page.
 PortalPageConfiguration getEditablePortalPageConfiguration(User user, Long pageId)
          Deprecated. Get a PortalPageConfiguration from the database that the passed user can edit.
 PortalPageConfiguration getPortalPageConfiguration(User user, Long pageId)
          Deprecated. Get a portal page configuration from the database.
 Map getPortalPageConfigurations(User user)
          Deprecated. Get all the portal pages that the passed user should see.
 Portlet getPortlet(String portletKey)
          Deprecated. Return portlet identified by the passed portlet key.
 Collection getPortlets(User user)
          Deprecated. This function returns all the portlets a user has permission to see.
 boolean hasAccessToPage(User u, Long selectPageId)
          Deprecated. Return true only if the given User has permission to view the PortalPage with the id selectPageId.
 void increasePageConfigurationSequence(User user, int position)
          Deprecated. Increases the position of the page in the user's favourite page list.
 boolean isDefaultPortalPageName(String pageName)
          Deprecated. This method always returns false.
 boolean isMultiplePortalPagesEnabled()
          Returns true if the user is allowed to create multiple PortalPage objects.
 boolean isUsingDefaultPortalPageConfigurations(User remoteUser)
          Deprecated. Returns true only if the passed user has no portal owned portal pages.
 void movePortlets(Long[] selectedPortlets, PortalPageConfiguration sourceConfig, PortalPageConfiguration destinationConfig)
          Deprecated. Move passed portlets portlets from one page to another.
 void moveToEndPageConfigurationSequence(User user, int position)
          Deprecated. Moves the page at the given position to the end of the user's favourite page list.
 void moveToStartPageConfigurationSequence(User user, int position)
          Deprecated. Moves the page at the given position to the start of the user's favourite page list.
 void resetDefault(String pagename)
          Deprecated. This function reloads the default portal page configuration from the database.
 void updatePortalPage(User user, Long pageId, String name, String description)
          Deprecated. Updates the page with given name and description and persists it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPortalManager

public DefaultPortalManager(PortletAccessManager portletAccessManager,
                            PortalPageService portalPageService,
                            FavouritesManager favouritesManager)
Method Detail

isMultiplePortalPagesEnabled

public boolean isMultiplePortalPagesEnabled()
Description copied from interface: PortalManager
Returns true if the user is allowed to create multiple PortalPage objects. On Standard JIRA this returns False. On all other editions it returns True.


getAllPortlets

public Collection getAllPortlets()
Deprecated. 
Description copied from interface: PortalManager
Return all the portlets on the system.

Specified by:
getAllPortlets in interface PortalManager
Returns:
all the portlets available in the system. Null should never be returned.

getPortlets

public Collection getPortlets(User user)
Deprecated. 
Description copied from interface: PortalManager
This function returns all the portlets a user has permission to see.

Specified by:
getPortlets in interface PortalManager
Parameters:
user - requesting portlets
Returns:
List of portlets for this user

createPortalPageConfiguration

public Long createPortalPageConfiguration(User user,
                                          String pagename,
                                          String description)
                                   throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Create a new portal page in JIRA. The new page will be blank unless the name is 'System Dashboard'. When named 'System Dashboard' the new page will be a copy of the 'System Dashboard'.

Specified by:
createPortalPageConfiguration in interface PortalManager
Parameters:
user - the user creating the page.
pagename - the name of the page.
description - the description for the page.
Returns:
the id of the page created or null if an error occurred.
Throws:
PortletConfigurationException - when an error occurs during page creation.

createPortalPageConfiguration

public Long createPortalPageConfiguration(User u,
                                          String pagename,
                                          String description,
                                          Long copyPageId)
                                   throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Create a new portal page in JIRA by copying one already in the system.

Specified by:
createPortalPageConfiguration in interface PortalManager
Parameters:
u - the user creating the page.
pagename - the name of the page.
description - the description for the page.
copyPageId - the id of the page to copy.
Returns:
the id of the page created or null if an error occurred.
Throws:
PortletConfigurationException - when an error occurs during page creation.

getPortalPageConfiguration

public PortalPageConfiguration getPortalPageConfiguration(User user,
                                                          Long pageId)
                                                   throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Get a portal page configuration from the database. The will return the the the system default portal page configuration if no such portal page configuration exists.

Specified by:
getPortalPageConfiguration in interface PortalManager
Parameters:
user - the user.
pageId - id of portal page to return. Passing null will return the system default dashboard.
Returns:
the requested page.
Throws:
PortletConfigurationException - if an error occurs while retrieving the portal page.

getEditablePortalPageConfiguration

public PortalPageConfiguration getEditablePortalPageConfiguration(User user,
                                                                  Long pageId)
                                                           throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Get a PortalPageConfiguration from the database that the passed user can edit. The method will automatically create a new cloned PortalPageConfiguration owned by the passed user if the requested PortalPageConfiguration cannot be edited by the passed user. In this case, the queried and returned PortalPageConfigurations are two different entities.

Specified by:
getEditablePortalPageConfiguration in interface PortalManager
Parameters:
user - the user who needs the editable page configuration.
pageId - the identifier of the portal page. Can be set to null to make a copy of the system default dashboard.
Returns:
a PortalPageConfiguration that may be edited by the passed user. This may be a direct reference to the requested entity if the user owns the page or a new copy of the requested entity if the user does not own the page.
Throws:
PortletConfigurationException - if an error occurs while looking for the portal page.

resetDefault

public void resetDefault(String pagename)
Deprecated. 
Description copied from interface: PortalManager
This function reloads the default portal page configuration from the database. This is now a no-op.

Specified by:
resetDefault in interface PortalManager
Parameters:
pagename - is always ignored.

getPortalPageConfigurations

public Map getPortalPageConfigurations(User user)
                                throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Get all the portal pages that the passed user should see. On < v3.12 this returned a map of owned pages. Under >= 3.13 this will return the user's favourites (under standard it will still return owned pages).

Specified by:
getPortalPageConfigurations in interface PortalManager
Parameters:
user - the user to query for. A null user will return a map with the system dashboard.
Returns:
A map from PortalPageConfiguration.id -> PortalPageConfiguration.
Throws:
PortletConfigurationException - when an error occurs

movePortlets

public void movePortlets(Long[] selectedPortlets,
                         PortalPageConfiguration sourceConfig,
                         PortalPageConfiguration destinationConfig)
                  throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Move passed portlets portlets from one page to another. WARNING: This method will be executed as the user who retrieved sourcePgae.

Specified by:
movePortlets in interface PortalManager
Parameters:
selectedPortlets - the portlets of the source page to move.
sourceConfig - the page to move the portlets from.
destinationConfig - the page to move the portlets onto.
Throws:
PortletConfigurationException - if an error occurs while moving the portlets.

isUsingDefaultPortalPageConfigurations

public boolean isUsingDefaultPortalPageConfigurations(User remoteUser)
Deprecated. 
Description copied from interface: PortalManager
Returns true only if the passed user has no portal owned portal pages.

Specified by:
isUsingDefaultPortalPageConfigurations in interface PortalManager
Parameters:
remoteUser - the user to check.
Returns:
true if and only if the passed user has no portal pages..

increasePageConfigurationSequence

public void increasePageConfigurationSequence(User user,
                                              int position)
                                       throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Increases the position of the page in the user's favourite page list.

Specified by:
increasePageConfigurationSequence in interface PortalManager
Parameters:
user - the user performing the operation.
position - the current position of the page to re-sequence.
Throws:
PortletConfigurationException - if an error occurs while trying to re-order the page.

decreasePageConfigurationSequence

public void decreasePageConfigurationSequence(User user,
                                              int position)
                                       throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Decreases the position of the page in the user's favourite page list.

Specified by:
decreasePageConfigurationSequence in interface PortalManager
Parameters:
user - the user.
position - the current position of the page to re-sequence.
Throws:
PortletConfigurationException - if an error occurs while trying to re-order the page.

moveToStartPageConfigurationSequence

public void moveToStartPageConfigurationSequence(User user,
                                                 int position)
                                          throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Moves the page at the given position to the start of the user's favourite page list.

Specified by:
moveToStartPageConfigurationSequence in interface PortalManager
Parameters:
user - the user.
position - the current position of the page to re-sequence.
Throws:
PortletConfigurationException - if an error occurs while trying to re-order the page.

moveToEndPageConfigurationSequence

public void moveToEndPageConfigurationSequence(User user,
                                               int position)
                                        throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Moves the page at the given position to the end of the user's favourite page list.

Specified by:
moveToEndPageConfigurationSequence in interface PortalManager
Parameters:
user - the user performing the operation.
position - the current position of the page to resequence.
Throws:
PortletConfigurationException - if an error occurs while trying to re-order the page.

getDefaultPortalPage

public PortalPageConfiguration getDefaultPortalPage()
                                             throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
Get the configuration for the default portal page. WARNING: This method associates the anonymous user the configuration. This will mean that the configuration returned by this method will not be editable. To get an editable version of the configuration call PortalManager.getPortalPageConfiguration(User, Long).

Specified by:
getDefaultPortalPage in interface PortalManager
Returns:
Returns the default portal page configuration
Throws:
PortletConfigurationException - if an error occurs while retrieving the page.

deletePortalPageConfiguration

public void deletePortalPageConfiguration(User u,
                                          Long pageId)
                                   throws PortletConfigurationException
Deprecated. 
Description copied from interface: PortalManager
This function removes a portal page configuration for a user including all of its portlet configurations and their properties.

Specified by:
deletePortalPageConfiguration in interface PortalManager
Parameters:
u - the user.
pageId - id of portal page to remove.
Throws:
PortletConfigurationException - if an error occurs while deleting the page.

updatePortalPage

public void updatePortalPage(User user,
                             Long pageId,
                             String name,
                             String description)
Deprecated. 
Description copied from interface: PortalManager
Updates the page with given name and description and persists it.

Specified by:
updatePortalPage in interface PortalManager
Parameters:
user - currently logged in user
pageId - page id
name - page name
description - page description

getPortlet

public Portlet getPortlet(String portletKey)
Deprecated. 
Description copied from interface: PortalManager
Return portlet identified by the passed portlet key.

Specified by:
getPortlet in interface PortalManager
Parameters:
portletKey - the plugin key of the portlet to return.
Returns:
the portlet if it exists or null otherwise.

isDefaultPortalPageName

public boolean isDefaultPortalPageName(String pageName)
Deprecated. 
Description copied from interface: PortalManager
This method always returns false. This method used to return true when the string 'dashboard' was passed. In the old days dashboard's with the name 'dashboard' where treated specially. This is no longer the case.

Specified by:
isDefaultPortalPageName in interface PortalManager
Parameters:
pageName - the page name to check
Returns:
always false.

hasAccessToPage

public boolean hasAccessToPage(User u,
                               Long selectPageId)
Deprecated. 
Description copied from interface: PortalManager
Return true only if the given User has permission to view the PortalPage with the id selectPageId. If there is no such PortalPage, it returns false.

Specified by:
hasAccessToPage in interface PortalManager
Parameters:
u - the user.
selectPageId - the id of the page.
Returns:
whether the user has access to the view PortalPage.


Copyright © 2002-2009 Atlassian. All Rights Reserved.