public class

DefaultPortalPageManager

extends Object
implements PortalPageManager
java.lang.Object
   ↳ com.atlassian.jira.portal.DefaultPortalPageManager

Class Overview

The base class for PortalPageManager implementations

Summary

Public Constructors
DefaultPortalPageManager(ShareManager shareManager, PortalPageStore portalPageStore, PortletConfigurationManager portletConfigurationManager, SharedEntityIndexer indexer, EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext)
Public Methods
void adjustFavouriteCount(SharedEntity entity, int adjustmentValue)
Adjusts the favourite counts for a given entity.
PortalPage create(PortalPage portalPage)
Creates the specified PortalPage in the database
PortalPage createBasedOnClone(ApplicationUser pageOwner, PortalPage portalPage, PortalPage clonePortalPage)
Creates a PortalPage in the database by cloning its Portlet content from the specified clonePortalPage
PortalPage createBasedOnClone(User pageOwner, PortalPage portalPage, PortalPage clonePortalPage)
void delete(Long portalPageId)
Deletes the PortalPage with the specified portalPageId
EnclosedIterable<PortalPage> get(User user, SharedEntityAccessor.RetrievalDescriptor ids)
Used to get sharable entities from a search result.
EnclosedIterable<PortalPage> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result.
EnclosedIterable<PortalPage> getAll()
Get all PortalPages.
EnclosedIterable<SharedEntity> getAllIndexableSharedEntities()
Get all sharable entities this accessor can see for use in indexing.
Collection<PortalPage> getAllOwnedPortalPages(User owner)
Collection<PortalPage> getAllOwnedPortalPages(ApplicationUser owner)
Returns a Collection of PortalPage objects that are owned by the specified User
PortalPage getPortalPage(User user, Long id)
PortalPage getPortalPage(ApplicationUser user, Long id)
Returns the PortalPage with the specified portalPageId, IF the user is allowed to see it.
PortalPage getPortalPageById(Long portalPageId)
Gets a PortalPage by id regardless of owner
PortalPage getPortalPageByName(User owner, String pageName)
PortalPage getPortalPageByName(ApplicationUser owner, String pageName)
Returns a PortalPage by searching for it by owner and pageName.
List<List<PortletConfiguration>> getPortletConfigurations(Long portalPageId)
Returns a sorted immutable list of lists of portletconfigurations for a particular portal page.
PortalPage getSharedEntity(Long entityId)
This will call back to ask for a SharedEntity based on id.
PortalPage getSharedEntity(User user, Long entityId)
This is called to get SharedEntity by id If the user is allows to see it
PortalPage getSystemDefaultPortalPage()
Returns the system default PortalPage.
TypeDescriptor<PortalPage> getType()
Returns the type that this object can work with.
boolean hasPermissionToUse(User user, PortalPage portalPage)
void saveLegacyPortletConfiguration(PortletConfiguration portletConfiguration)
This can be called to save a PortletConfiguration object inside a PortalPage object to the underlying database store.
SharedEntitySearchResult<PortalPage> search(SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)
SharedEntitySearchResult<PortalPage> search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)
Search for the PortalPages that match the passed SearchParameters.
PortalPage update(PortalPage portalPage)
Updates the specified PortalPage in the database
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.portal.PortalPageManager
From interface com.atlassian.jira.sharing.SharedEntityAccessor

Public Constructors

public DefaultPortalPageManager (ShareManager shareManager, PortalPageStore portalPageStore, PortletConfigurationManager portletConfigurationManager, SharedEntityIndexer indexer, EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext)

Public Methods

public void adjustFavouriteCount (SharedEntity entity, int adjustmentValue)

Adjusts the favourite counts for a given entity. This resulting value must always be greater or equal to one.

Parameters
entity the entity to adjust
adjustmentValue the value to adjust by.

public PortalPage create (PortalPage portalPage)

Creates the specified PortalPage in the database

Parameters
portalPage the PortalPage to create
Returns
  • the newly created PortalPage with its new id

public PortalPage createBasedOnClone (ApplicationUser pageOwner, PortalPage portalPage, PortalPage clonePortalPage)

Creates a PortalPage in the database by cloning its Portlet content from the specified clonePortalPage

Parameters
pageOwner the User who will own the cloned portal page
portalPage the PortalPage to create
clonePortalPage the PortalPage to clone Portlet content from
Returns
  • the newly created PortalPage with its new id

public PortalPage createBasedOnClone (User pageOwner, PortalPage portalPage, PortalPage clonePortalPage)

public void delete (Long portalPageId)

Deletes the PortalPage with the specified portalPageId

Parameters
portalPageId the id of the PortalPage to delete

public EnclosedIterable<PortalPage> get (User user, SharedEntityAccessor.RetrievalDescriptor ids)

Used to get sharable entities from a search result. The entities returned may be modified by the user parameter (e.g. permissions or clause sanitisation).

Parameters
user the user performing the search
ids retrieval descriptor

public EnclosedIterable<PortalPage> get (SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result.

Parameters
descriptor retrieval descriptor

public EnclosedIterable<PortalPage> getAll ()

Get all PortalPages.

Returns

public EnclosedIterable<SharedEntity> getAllIndexableSharedEntities ()

Get all sharable entities this accessor can see for use in indexing.

public Collection<PortalPage> getAllOwnedPortalPages (User owner)

public Collection<PortalPage> getAllOwnedPortalPages (ApplicationUser owner)

Returns a Collection of PortalPage objects that are owned by the specified User

Parameters
owner the User who owns the PortalPage's
Returns
  • a Collection of PortalPage objects that are owned by the specified User

public PortalPage getPortalPage (User user, Long id)

public PortalPage getPortalPage (ApplicationUser user, Long id)

Returns the PortalPage with the specified portalPageId, IF the user is allowed to see it.

Parameters
user the User in play
id the id of the PortalPage to return
Returns
  • a PortalPage if the user is allowed to see it or null if they are not allowed

public PortalPage getPortalPageById (Long portalPageId)

Gets a PortalPage by id regardless of owner

Parameters
portalPageId the id of the PortalPage to retrieve
Returns
  • a PortalPage object or null if it cant be found

public PortalPage getPortalPageByName (User owner, String pageName)

public PortalPage getPortalPageByName (ApplicationUser owner, String pageName)

Returns a PortalPage by searching for it by owner and pageName.

Parameters
owner the owner in play
pageName the name of the PortalPage
Returns
  • a PortalPage object if one can be found with the name and owner or null if not

public List<List<PortletConfiguration>> getPortletConfigurations (Long portalPageId)

Returns a sorted immutable list of lists of portletconfigurations for a particular portal page. The outer list represents columns and the inner lists represent rows within a column. This method will return portlet configs sorted correctly as returned by the underlying persistance layer.

Parameters
portalPageId The portal page id to fetch portlet configs for
Returns
  • immutable list of lists representing portletconfigs on a dashboard

public PortalPage getSharedEntity (Long entityId)

This will call back to ask for a SharedEntity based on id.

Parameters
entityId the id of the SharedEntity
Returns

public PortalPage getSharedEntity (User user, Long entityId)

This is called to get SharedEntity by id If the user is allows to see it

Parameters
user the user in play
entityId the id of the SharedEntity
Returns
  • a SharedEntity if it exists and the user can see it and null otherwise

public PortalPage getSystemDefaultPortalPage ()

Returns the system default PortalPage. This has no owner and is used when a User has no PortalPage objects defined for them

Returns
  • a non null system default PortalPage object

public TypeDescriptor<PortalPage> getType ()

Returns the type that this object can work with.

Returns
  • the type that this object can work with.

public boolean hasPermissionToUse (User user, PortalPage portalPage)

public void saveLegacyPortletConfiguration (PortletConfiguration portletConfiguration)

This can be called to save a PortletConfiguration object inside a PortalPage object to the underlying database store.

Parameters
portletConfiguration The portletConfiguration to save.

public SharedEntitySearchResult<PortalPage> search (SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)

public SharedEntitySearchResult<PortalPage> search (SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)

Search for the PortalPages that match the passed SearchParameters. The result can be paged so that a subset of the results can be returned.

Parameters
searchParameters the SearchParameters to query.
user the user performing the search.
pagePosition the page to return.
pageWidth the number of results per page.
Returns
  • the result containing the PortalPages objects that match the request.

public PortalPage update (PortalPage portalPage)

Updates the specified PortalPage in the database

Parameters
portalPage the PortalPage to update
Returns
  • the newly updated PortalPage