Package com.atlassian.jira.portal
Class DefaultPortalPageManager
java.lang.Object
com.atlassian.jira.portal.DefaultPortalPageManager
- All Implemented Interfaces:
PortalPageManager,SharedEntityAccessor<PortalPage>
The base class for PortalPageManager implementations
- Since:
- v3.13
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionDefaultPortalPageManager(ShareManager shareManager, PortalPageStore portalPageStore, PortletConfigurationManager portletConfigurationManager, SharedEntityIndexer indexer, com.atlassian.event.api.EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustFavouriteCount(SharedEntity entity, int adjustmentValue) Adjusts the favourite counts for a given entity.create(PortalPage portalPage) Creates the specified PortalPage in the databasecreateBasedOnClone(ApplicationUser pageOwner, PortalPage portalPage, PortalPage clonePortalPage) Creates a PortalPage in the database by cloning its Portlet content from the specified clonePortalPageprotected PortalPagecreateNoEvent(PortalPage portalPage) voidDeletes the PortalPage with the specified portalPageIdget(SharedEntityAccessor.RetrievalDescriptor descriptor) Used to getsharable entitiesfrom a search result.Used to getsharable entitiesfrom a search result.getAll()Get all PortalPages.Get allsharable entitiesthis accessor can see for use in indexing.Returns a Collection of PortalPage objects that are owned by the specified UsergetPortalPage(ApplicationUser user, Long id) Returns the PortalPage with the specified portalPageId, IF the user is allowed to see it.getPortalPageById(Long portalPageId) Gets a PortalPage by id regardless of ownergetPortalPageByName(ApplicationUser owner, String pageName) Returns a PortalPage by searching for it by owner and pageName.getPortletConfigurations(Long portalPageId) Returns a sorted immutable list of lists of portletconfigurations for a particular portal page.getSharedEntity(ApplicationUser user, Long entityId) This is called to getSharedEntityby id If the user is allows to see itgetSharedEntity(Long entityId) This will call back to ask for aSharedEntitybased on id.Returns the system default PortalPage.getType()Returns the type that this object can work with.booleanhasPermissionToUse(ApplicationUser user, PortalPage portalPage) Returns true if the user has permission to use theSharedEntitybooleanhasShareRights(ApplicationUser user, PortalPage portalPage, ShareRight shareRight) Checks if provided user has share rights for given portal page.voidsaveLegacyPortletConfiguration(PortletConfiguration portletConfiguration) This can be called to save aPortletConfigurationobject inside aPortalPageobject to the underlying database store.search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth) Search for the PortalPages that match the passed SearchParameters.update(PortalPage portalPage) Updates the specified PortalPage in the database
-
Constructor Details
-
Method Details
-
getType
Description copied from interface:SharedEntityAccessorReturns the type that this object can work with.- Specified by:
getTypein interfaceSharedEntityAccessor<PortalPage>- Returns:
- the type that this object can work with.
-
hasPermissionToUse
Description copied from interface:SharedEntityAccessorReturns true if the user has permission to use theSharedEntity- Specified by:
hasPermissionToUsein interfaceSharedEntityAccessor<PortalPage>- Parameters:
user- the user in playportalPage- theSharedEntityto check- Returns:
- true if the user has permission to use it
-
getAll
Description copied from interface:PortalPageManagerGet all PortalPages.- Specified by:
getAllin interfacePortalPageManager- Specified by:
getAllin interfaceSharedEntityAccessor<PortalPage>- Returns:
- an
EnclosedIterableof PortalPages
-
getAllOwnedPortalPages
Description copied from interface:PortalPageManagerReturns a Collection of PortalPage objects that are owned by the specified User- Specified by:
getAllOwnedPortalPagesin interfacePortalPageManager- Parameters:
owner- the User who owns the PortalPage's- Returns:
- a Collection of PortalPage objects that are owned by the specified User
-
getPortalPageByName
Description copied from interface:PortalPageManagerReturns a PortalPage by searching for it by owner and pageName.- Specified by:
getPortalPageByNamein interfacePortalPageManager- Parameters:
owner- the owner in playpageName- the name of the PortalPage- Returns:
- a PortalPage object if one can be found with the name and owner or null if not
-
getSystemDefaultPortalPage
Description copied from interface:PortalPageManagerReturns the system default PortalPage. This has no owner and is used when a User has no PortalPage objects defined for them- Specified by:
getSystemDefaultPortalPagein interfacePortalPageManager- Returns:
- a non null system default PortalPage object
-
getPortalPage
Description copied from interface:PortalPageManagerReturns the PortalPage with the specified portalPageId, IF the user is allowed to see it.- Specified by:
getPortalPagein interfacePortalPageManager- Parameters:
user- the User in playid- 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
-
getPortalPageById
Description copied from interface:PortalPageManagerGets a PortalPage by id regardless of owner- Specified by:
getPortalPageByIdin interfacePortalPageManager- Parameters:
portalPageId- the id of the PortalPage to retrieve- Returns:
- a PortalPage object or null if it cant be found
-
create
Description copied from interface:PortalPageManagerCreates the specified PortalPage in the database- Specified by:
createin interfacePortalPageManager- Parameters:
portalPage- the PortalPage to create- Returns:
- the newly created PortalPage with its new id
-
createNoEvent
-
createBasedOnClone
public PortalPage createBasedOnClone(ApplicationUser pageOwner, PortalPage portalPage, PortalPage clonePortalPage) Description copied from interface:PortalPageManagerCreates a PortalPage in the database by cloning its Portlet content from the specified clonePortalPage- Specified by:
createBasedOnClonein interfacePortalPageManager- Parameters:
pageOwner- the User who will own the cloned portal pageportalPage- the PortalPage to createclonePortalPage- the PortalPage to clone Portlet content from- Returns:
- the newly created PortalPage with its new id
-
update
Description copied from interface:PortalPageManagerUpdates the specified PortalPage in the database- Specified by:
updatein interfacePortalPageManager- Parameters:
portalPage- the PortalPage to update- Returns:
- the newly updated PortalPage
-
delete
Description copied from interface:PortalPageManagerDeletes the PortalPage with the specified portalPageId- Specified by:
deletein interfacePortalPageManager- Parameters:
portalPageId- the id of the PortalPage to delete
-
saveLegacyPortletConfiguration
Description copied from interface:PortalPageManagerThis can be called to save aPortletConfigurationobject inside aPortalPageobject to the underlying database store.- Specified by:
saveLegacyPortletConfigurationin interfacePortalPageManager- Parameters:
portletConfiguration- The portletConfiguration to save.
-
getPortletConfigurations
Description copied from interface:PortalPageManagerReturns 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.- Specified by:
getPortletConfigurationsin interfacePortalPageManager- Parameters:
portalPageId- The portal page id to fetch portlet configs for- Returns:
- immutable list of lists representing portletconfigs on a dashboard
-