Package com.atlassian.jira.bc.portal
Interface PortalPageService
- All Known Implementing Classes:
DefaultPortalPageService
@PublicApi
public interface PortalPageService
The PortalPageService is the top level service for Dashboard operations.
For historical reasons, Dashboards where called Portals and hence the prefix "Portal" is used consistently throughout the code.
- Since:
- v3.13
-
Method Summary
Modifier and TypeMethodDescriptioncreatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage) Called to create and store the specified portalPage into the database.createPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite) Called to create and store the specified portalPage into the database.createPortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId, boolean isFavourite) Called to create and store the specified portalPage into the database by cloning its Portlet content from an existing PortalPage object.voiddecreasePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId) Decreases the position of the page configuration in the user's page configuration set.voidDelete all Portal Pages owned by a user.voiddeletePortalPage(JiraServiceContext serviceCtx, Long portalPageId) Called to delete the PortalPage with the specified portalPageId.Retrieve allPortalPage's a user has favourited.Get a user's non privatePortalPage's.Retrieve allPortalPage's a user owns/has created.getPortalPage(JiraServiceContext servceCtx, Long portalPageId) Retrieve a givenPortalPageby id.GetPortalPage's owned by a given user that have been favourited by at least one other usergetPortletConfigurations(JiraServiceContext context, Long portalPageId) Returns all portlet configurations for a particular dashboard in colums and rows.This returns the System Default PortalPage as defined by the JIRA AdministratorsvoidincreasePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId) Increases the position of the page configuration in the user's page configuration setbooleanisFavourite(ApplicationUser user, PortalPage portalPage) Is the passed PortalPage a favourite of the passed User.voidmoveToEndPortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId) Puts the given page to the end of the user's page configuration set.voidmoveToStartPortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId) Puts the given page to the start of the user's page configuration set.voidsaveLegacyPortletConfiguration(JiraServiceContext serviceCtx, PortletConfiguration portletConfiguration) Save a specificPortletConfigurationto a database store.search(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters, int pagePosition, int pageWidth) Search for the PortalPages that match the passed SearchParameters.updatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite) Updates the specified PortalPage in the databaseupdatePortalPageOwner(JiraServiceContext serviceCtx, Long portalPageId, ApplicationUser newOwner) Changes the owner of the portal page.voidvalidateForChangeOwner(JiraServiceContext ctx, PortalPage dashboard) This will validate that the dashboard page can be changed to the new owbner.booleanvalidateForChangePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId) Called to validate that sequence of a PortalPage can be changed.booleanvalidateForCreate(JiraServiceContext serviceCtx, PortalPage portalPage) Called to validate that the PortalPage object is in a valid state for creation.booleanvalidateForCreatePortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId) Called to validate that a new PortalPage can be created by cloning its Portlet content from an existing PortalPage object.booleanvalidateForDelete(JiraServiceContext serviceCtx, Long portalPageId) Called to validate that the specified portalPage with the portalPageId can be deleted.booleanvalidateForGetPortalPage(JiraServiceContext context, Long portalPageId) Check if the user in the service context has permission to get the portal page with the id provided.voidvalidateForSearch(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters) This will validate that the input parameters are valid for a search that encompasses ANY share entity type.booleanvalidateForUpdate(JiraServiceContext serviceCtx, PortalPage portalPage) Called to validate that the PortalPage can be be updated
-
Method Details
-
getPortalPage
Retrieve a givenPortalPageby id.- Parameters:
servceCtx- JIRA Service context containing an error collection and user requesting (to run) thePortalPage. ThePortalPagemust exist and the user must be able to seePortalPageelse an error will result.portalPageId- The id of thePortalPageto retrieve. Id must not be null.- Returns:
- The PortalPage as specified by the id, or null if none exists for the user.
-
getFavouritePortalPages
Retrieve allPortalPage's a user has favourited. Permission checks are done to ensure the user can see thePortalPage, as visibility may have been removed from underneath them.- Parameters:
user- The user who has favouritePortalPage's. Also to test visibility and with- Returns:
- a Collection of
PortalPageobjects that representPortalPage's the user has favourited.
-
isFavourite
Is the passed PortalPage a favourite of the passed User.- Parameters:
user- the user to check.portalPage- the page to check.- Returns:
- true if the PortalPage is a favourite of the passed User.
-
getOwnedPortalPages
Retrieve allPortalPage's a user owns/has created.- Parameters:
user- The user who created thePortalPage's.- Returns:
- a Collection of
PortalPageobjects that representPortalPage's the user has created.
-
getNonPrivatePortalPages
Get a user's non privatePortalPage's. I.e.PortalPage's that other users can possibly see.- Parameters:
user- The author of thePortalPage's- Returns:
- Collection of PortalPage objects that do not have private scope.
-
getPortalPagesFavouritedByOthers
GetPortalPage's owned by a given user that have been favourited by at least one other user- Parameters:
user- The author of thePortalPage's- Returns:
- Collection of PortalPage objects owned by the given user and favourited by at least one other user
-
getSystemDefaultPortalPage
PortalPage getSystemDefaultPortalPage()This returns the System Default PortalPage as defined by the JIRA Administrators- Returns:
- the system default PortalPage
-
validateForCreate
Called to validate that the PortalPage object is in a valid state for creation. Call this before calling the create method .- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage object that is to be validated for create- Returns:
- true if the PortalPage is valid or false. The ErrorCollection of the serviceCtx will have any errors in it.
-
createPortalPage
Called to create and store the specified portalPage into the database.- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage object that is to be created- Returns:
- a fully fledged PortalPage with the new Id in it.
-
createPortalPage
PortalPage createPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite) Called to create and store the specified portalPage into the database.- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage object that is to be createdisFavourite- set to true if the PortalPage should be marked as a favourite- Returns:
- a fully fledged PortalPage with the new Id in it.
-
validateForCreatePortalPageByClone
boolean validateForCreatePortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId) Called to validate that a new PortalPage can be created by cloning its Portlet content from an existing PortalPage object.- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage object that is to be createdclonePortalPageId- the id of an existing PortalPage to clone- Returns:
- true if the PortalPage can be cloned from another page
-
createPortalPageByClone
PortalPage createPortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId, boolean isFavourite) Called to create and store the specified portalPage into the database by cloning its Portlet content from an existing PortalPage object.- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage object that is to be createdclonePortalPageId- the id of an existing PortalPage to cloneisFavourite- set to true if the PortalPage should be marked as a favourite- Returns:
- a fully fledged PortalPage with the new Id in it.
-
validateForDelete
Called to validate that the specified portalPage with the portalPageId can be deleted.- Parameters:
serviceCtx- the JiraServiceContext in playportalPageId- the id of the PortalPage to delete- Returns:
- true if the PortalPage can be deleted. The ErrorCollection of the serviceCtx will have any errors in it.
-
deletePortalPage
Called to delete the PortalPage with the specified portalPageId.- Parameters:
serviceCtx- the JiraServiceContext in playportalPageId- the id of the PortalPage to delete
-
validateForUpdate
Called to validate that the PortalPage can be be updated- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage to update- Returns:
- true if the PortalPage is valid or false. The ErrorCollection of the serviceCtx will have any errors in it.
-
updatePortalPage
PortalPage updatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite) Updates the specified PortalPage in the database- Parameters:
serviceCtx- the JiraServiceContext in playportalPage- the PortalPage to updateisFavourite- set to true if the PortalPage is to be marked as a favourite- Returns:
- a newly updated PortalPage
-
validateForChangePortalPageSequence
Called to validate that sequence of a PortalPage can be changed.- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to re-sequence- Returns:
- true if the PortalPage can be re-sequenced
-
increasePortalPageSequence
Increases the position of the page configuration in the user's page configuration set- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to re-sequence
-
decreasePortalPageSequence
Decreases the position of the page configuration in the user's page configuration set.- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to re-sequence
-
moveToStartPortalPageSequence
Puts the given page to the start of the user's page configuration set.- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to re-sequence
-
moveToEndPortalPageSequence
Puts the given page to the end of the user's page configuration set.- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to re-sequence
-
saveLegacyPortletConfiguration
void saveLegacyPortletConfiguration(JiraServiceContext serviceCtx, PortletConfiguration portletConfiguration) Save a specificPortletConfigurationto a database store.- Parameters:
serviceCtx- the context of the service callportletConfiguration- The portletConfiguration to update
-
deleteAllPortalPagesForUser
Delete all Portal Pages owned by a user. This method will also remove all favourites for all portlets as well as remove all favourites for the user. A nice big cleanup method for when deleting a user.- Parameters:
user- The user to clean up after.
-
validateForGetPortalPage
Check if the user in the service context has permission to get the portal page with the id provided.- Parameters:
context- Context containing user, error collection and i18n beanportalPageId- The id of the portal page to get- Returns:
- true if the user has permission, false if the user has no permission, or if the page doesn't exist.
-
getPortletConfigurations
List<List<PortletConfiguration>> getPortletConfigurations(JiraServiceContext context, Long portalPageId) Returns all portlet configurations for a particular dashboard in colums and rows. The portlet configurations are returned sorted correctly in each column by row.- Parameters:
context- Context containing user, error collection and i18n beanportalPageId- The id of the portal page to get- Returns:
- A list of lists representing all portlet configs in all columns for the gadget in question.
-
validateForChangeOwner
This will validate that the dashboard page can be changed to the new owbner.- Parameters:
ctx- Context containing user, error collection and i18n beandashboard- the PortalPage to validate
-
updatePortalPageOwner
@Nullable PortalPage updatePortalPageOwner(JiraServiceContext serviceCtx, Long portalPageId, ApplicationUser newOwner) Changes the owner of the portal page. User performing this operation must be an administrator.You should call
validateForChangeOwner(JiraServiceContext, PortalPage)prior to calling this method.- Parameters:
serviceCtx- the context of the service callportalPageId- the id of the PortalPage to updatenewOwner- the new owner- Returns:
- a newly updated PortalPage, or null if user is not an admin
-