com.atlassian.jira.portal
Class AbstractPortalManager

java.lang.Object
  extended bycom.atlassian.jira.portal.AbstractPortalManager
All Implemented Interfaces:
PortalManager
Direct Known Subclasses:
DefaultPortalManager, ProfessionalPortalManager

public abstract class AbstractPortalManager
extends Object
implements PortalManager


Field Summary
protected  OfBizDelegator delegator
           
protected  org.apache.log4j.Category log
           
protected  com.atlassian.plugin.PluginManager pluginManager
           
 
Fields inherited from interface com.atlassian.jira.portal.PortalManager
DASHBOARD_PAGE_NAME, SYSTEM_PORTLET_PACKAGE
 
Constructor Summary
AbstractPortalManager(com.atlassian.plugin.PluginManager pluginManager, OfBizDelegator delegator, CollectionReorderer collectionReorderer)
           
 
Method Summary
 Long createPortalPageConfiguration(User u, String pagename, String description)
          Creates a new Portal Page Configuration in the database.
 Long createPortalPageConfiguration(User u, String pagename, String description, Long copyPageId)
           
 void decreasePageConfigurationSequence(User remoteUser, int position)
          Decreases the position of the page configuration in the user's page configuration set.
 void deletePortalPageConfiguration(User u, Long pageId)
          This function removes a portal page configuration for a user including all of its portlet configurations and their properties.
 Collection getAllPortlets()
          Get all the available portlets.
 PortalPageConfiguration getDefaultPortalPage()
          Goes to the database and fetches the default dashboard configuration.
 PortalPageConfiguration getEditablePortalPageConfiguration(User user, Long pageId)
           
 PortalPageConfiguration getPortalPageConfiguration(User user, Long pageId)
          Get a portlet configuration for a particular user and page from the database.
 Map getPortalPageConfigurations(User user)
          Get all the portal pages for a given user.
 Portlet getPortlet(String id)
          Get a particular portlet, based on it's id.
 Collection getPortlets(User user)
          This function returns all the portlets a user has permission to see.
 boolean hasAccessToPage(User u, Long selectPageId)
          Return true only if the given User has permission to see the page with id selectPageId.
 void increasePageConfigurationSequence(User remoteUser, int position)
          Increases the position of the page configuration in the user's page configuration set
protected abstract  boolean isAllowedPortalName(String name)
           
 boolean isDefaultPortalPageName(String pageName)
           
 boolean isUsingDefaultPortalPageConfigurations(User remoteUser)
          Returns true only if the user has the default portal page configuration.
 void movePortlets(Long[] selectedPortlets, PortalPageConfiguration sourcePage, PortalPageConfiguration destinationPage)
          Move portlets from one page to another
 void moveToEndPageConfigurationSequence(User remoteUser, int position)
          Puts the page at the given position to the end fo the user's page configuration set.
 void moveToStartPageConfigurationSequence(User remoteUser, int position)
          Puts the page at the given position to the start of the user's page configuration set.
 void resetDefault(String pagename)
          This function reloads the default portal page configuration from the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.portal.PortalManager
isMultiplePortalPagesEnabled
 

Field Detail

log

protected final org.apache.log4j.Category log

pluginManager

protected final com.atlassian.plugin.PluginManager pluginManager

delegator

protected final OfBizDelegator delegator
Constructor Detail

AbstractPortalManager

public AbstractPortalManager(com.atlassian.plugin.PluginManager pluginManager,
                             OfBizDelegator delegator,
                             CollectionReorderer collectionReorderer)
Method Detail

isAllowedPortalName

protected abstract boolean isAllowedPortalName(String name)

getAllPortlets

public Collection getAllPortlets()
Get all the available portlets.

Specified by:
getAllPortlets in interface PortalManager
Returns:
A Collection of all available portlets.

getPortlets

public Collection getPortlets(User user)
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 u,
                                          String pagename,
                                          String description)
                                   throws PortletConfigurationException
Creates a new Portal Page Configuration in the database.

Specified by:
createPortalPageConfiguration in interface PortalManager
Parameters:
u -
pagename -
Throws:
PortletConfigurationException

createPortalPageConfiguration

public Long createPortalPageConfiguration(User u,
                                          String pagename,
                                          String description,
                                          Long copyPageId)
                                   throws PortletConfigurationException
Specified by:
createPortalPageConfiguration in interface PortalManager
Throws:
PortletConfigurationException

getPortalPageConfiguration

public PortalPageConfiguration getPortalPageConfiguration(User user,
                                                          Long pageId)
                                                   throws PortletConfigurationException
Description copied from interface: PortalManager
Get a portlet configuration for a particular user and page from the database. If it does not exist, the default portlet configuration will be used.

Specified by:
getPortalPageConfiguration in interface PortalManager
Parameters:
user - the user.
pageId - id of portal page to remove.
Throws:
PortletConfigurationException

getEditablePortalPageConfiguration

public PortalPageConfiguration getEditablePortalPageConfiguration(User user,
                                                                  Long pageId)
                                                           throws PortletConfigurationException
Specified by:
getEditablePortalPageConfiguration in interface PortalManager
Throws:
PortletConfigurationException

resetDefault

public void resetDefault(String pagename)
This function reloads the default portal page configuration from the database. Into the static variable.

Specified by:
resetDefault in interface PortalManager
Parameters:
pagename - e.g. dashboard.

getPortalPageConfigurations

public Map getPortalPageConfigurations(User user)
                                throws PortletConfigurationException
Description copied from interface: PortalManager
Get all the portal pages for a given user.

Specified by:
getPortalPageConfigurations in interface PortalManager
Throws:
PortletConfigurationException

movePortlets

public void movePortlets(Long[] selectedPortlets,
                         PortalPageConfiguration sourcePage,
                         PortalPageConfiguration destinationPage)
                  throws PortletConfigurationException,
                         org.ofbiz.core.entity.GenericEntityException
Description copied from interface: PortalManager
Move portlets from one page to another

Specified by:
movePortlets in interface PortalManager
Throws:
PortletConfigurationException
org.ofbiz.core.entity.GenericEntityException

isUsingDefaultPortalPageConfigurations

public boolean isUsingDefaultPortalPageConfigurations(User remoteUser)
Description copied from interface: PortalManager
Returns true only if the user has the default portal page configuration.

Specified by:
isUsingDefaultPortalPageConfigurations in interface PortalManager
Parameters:
remoteUser - the user.
Returns:
true if and only if remoteUser has default dashboard.

increasePageConfigurationSequence

public void increasePageConfigurationSequence(User remoteUser,
                                              int position)
                                       throws PortletConfigurationException
Description copied from interface: PortalManager
Increases the position of the page configuration in the user's page configuration set

Specified by:
increasePageConfigurationSequence in interface PortalManager
Parameters:
remoteUser -
position - the current position of the page to resequence.
Throws:
PortletConfigurationException

decreasePageConfigurationSequence

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

Specified by:
decreasePageConfigurationSequence in interface PortalManager
Parameters:
remoteUser - the user.
position - the current position of the page to resequence.
Throws:
PortletConfigurationException

moveToStartPageConfigurationSequence

public void moveToStartPageConfigurationSequence(User remoteUser,
                                                 int position)
                                          throws PortletConfigurationException
Description copied from interface: PortalManager
Puts the page at the given position to the start of the user's page configuration set.

Specified by:
moveToStartPageConfigurationSequence in interface PortalManager
Parameters:
remoteUser - the user.
position - the current position of the page to resequence.
Throws:
PortletConfigurationException

moveToEndPageConfigurationSequence

public void moveToEndPageConfigurationSequence(User remoteUser,
                                               int position)
                                        throws PortletConfigurationException
Description copied from interface: PortalManager
Puts the page at the given position to the end fo the user's page configuration set.

Specified by:
moveToEndPageConfigurationSequence in interface PortalManager
Parameters:
remoteUser -
position - the current position of the page to resequence.
Throws:
PortletConfigurationException

getDefaultPortalPage

public PortalPageConfiguration getDefaultPortalPage()
                                             throws PortletConfigurationException
Goes to the database and fetches the default dashboard configuration.

Specified by:
getDefaultPortalPage in interface PortalManager
Throws:
PortletConfigurationException

deletePortalPageConfiguration

public void deletePortalPageConfiguration(User u,
                                          Long pageId)
                                   throws PortletConfigurationException
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

getPortlet

public Portlet getPortlet(String id)
Get a particular portlet, based on it's id.

Specified by:
getPortlet in interface PortalManager

isDefaultPortalPageName

public boolean isDefaultPortalPageName(String pageName)
Specified by:
isDefaultPortalPageName in interface PortalManager

hasAccessToPage

public boolean hasAccessToPage(User u,
                               Long selectPageId)
Description copied from interface: PortalManager
Return true only if the given User has permission to see the page with id selectPageId. If there is no such page, 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 page.


Copyright © 2002-2006 Atlassian. All Rights Reserved.