public class DefaultPortalPageService extends Object implements PortalPageService
Constructor and Description |
---|
DefaultPortalPageService(PortalPageManager portalPageManager,
ShareTypeValidatorUtils shareTypeValidatorUtils,
FavouritesManager<PortalPage> favouritesManager,
PermissionManager permissionManager,
UserUtil userUtil) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkSystemDefaultSharePermissions(JiraServiceContext serviceCtx,
SharedEntity.SharePermissions sharePermissions)
Check that the passed permissions are valid for the System Dashboard.
|
PortalPage |
createPortalPage(JiraServiceContext serviceCtx,
PortalPage portalPage)
Called to create and store the specified portalPage into the database.
|
PortalPage |
createPortalPage(JiraServiceContext serviceCtx,
PortalPage portalPage,
boolean isFavourite)
Called to create and store the specified portalPage into the database.
|
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.
|
void |
decreasePortalPageSequence(JiraServiceContext serviceCtx,
Long portalPageId)
Decreases the position of the page configuration in the user's page configuration set.
|
void |
deleteAllPortalPagesForUser(ApplicationUser user)
Delete all Portal Pages owned by a user.
|
void |
deleteAllPortalPagesForUser(com.atlassian.crowd.embedded.api.User user) |
void |
deletePortalPage(JiraServiceContext serviceCtx,
Long portalPageId)
Called to delete the PortalPage with the specified portalPageId.
|
Collection<PortalPage> |
getFavouritePortalPages(ApplicationUser user)
Retrieve all
PortalPage 's a user has favourited. |
Collection<PortalPage> |
getFavouritePortalPages(com.atlassian.crowd.embedded.api.User user) |
Collection<PortalPage> |
getNonPrivatePortalPages(ApplicationUser user)
Get a user's non private
PortalPage 's. |
Collection<PortalPage> |
getNonPrivatePortalPages(com.atlassian.crowd.embedded.api.User user) |
Collection<PortalPage> |
getOwnedPortalPages(ApplicationUser user)
Retrieve all
PortalPage 's a user owns/has created. |
Collection<PortalPage> |
getOwnedPortalPages(com.atlassian.crowd.embedded.api.User user) |
PortalPage |
getPortalPage(JiraServiceContext context,
Long portalPageId)
Retrieve a given
PortalPage by id. |
Collection<PortalPage> |
getPortalPagesFavouritedByOthers(ApplicationUser user)
Get
PortalPage 's owned by a given user that have been favourited by at least one other user |
Collection<PortalPage> |
getPortalPagesFavouritedByOthers(com.atlassian.crowd.embedded.api.User user) |
List<List<PortletConfiguration>> |
getPortletConfigurations(JiraServiceContext serviceCtx,
Long portalPageId)
Returns all portlet configurations for a particular dashboard in colums and rows.
|
PortalPage |
getSystemDefaultPortalPage()
This returns the System Default PortalPage as defined by the JIRA Administrators
|
void |
increasePortalPageSequence(JiraServiceContext serviceCtx,
Long portalPageId)
Increases the position of the page configuration in the user's page configuration set
|
boolean |
isFavourite(ApplicationUser user,
PortalPage portalPage)
Is the passed PortalPage a favourite of the passed User.
|
boolean |
isFavourite(com.atlassian.crowd.embedded.api.User user,
PortalPage portalPage) |
void |
moveToEndPortalPageSequence(JiraServiceContext serviceCtx,
Long portalPageId)
Puts the given page to the end of the user's page configuration set.
|
void |
moveToStartPortalPageSequence(JiraServiceContext serviceCtx,
Long portalPageId)
Puts the given page to the start of the user's page configuration set.
|
void |
saveLegacyPortletConfiguration(JiraServiceContext serviceCtx,
PortletConfiguration portletConfiguration)
Save a specific
PortletConfiguration to a
database store. |
SharedEntitySearchResult<PortalPage> |
search(JiraServiceContext serviceCtx,
SharedEntitySearchParameters searchParameters,
int pagePosition,
int pageWidth)
Search for the PortalPages that match the passed SearchParameters.
|
PortalPage |
updatePortalPage(JiraServiceContext serviceCtx,
PortalPage portalPage,
boolean isFavourite)
Updates the specified PortalPage in the database
|
PortalPage |
updatePortalPageUnconditionally(JiraServiceContext serviceCtx,
ApplicationUser user,
PortalPage portalPage)
Updates the specified PortalPage in the database , no permission checks are applied, but the user must be an administrator
|
PortalPage |
updatePortalPageUnconditionally(JiraServiceContext serviceCtx,
com.atlassian.crowd.embedded.api.User user,
PortalPage portalPage) |
void |
validateForChangeOwner(JiraServiceContext serviceCtx,
PortalPage page)
This will validate that the dashboard page can be changed to the new owbner.
|
boolean |
validateForChangePortalPageSequence(JiraServiceContext serviceCtx,
Long portalPageId)
Called to validate that sequence of a PortalPage can be changed.
|
boolean |
validateForCreate(JiraServiceContext serviceCtx,
PortalPage portalPage)
Called to validate that the PortalPage object is in a valid state for creation.
|
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.
|
boolean |
validateForDelete(JiraServiceContext serviceCtx,
Long portalPageId)
Called to validate that the specified portalPage with the portalPageId can be deleted.
|
boolean |
validateForGetPortalPage(JiraServiceContext context,
Long portalPageId)
Check if the user in the service context has permission to get the portal page with the id provided.
|
void |
validateForSearch(JiraServiceContext serviceCtx,
SharedEntitySearchParameters searchParameters)
This will validate that the input parameters are valid for a search that encompasses ANY share entity type.
|
boolean |
validateForUpdate(JiraServiceContext serviceCtx,
PortalPage portalPage)
Called to validate that the PortalPage can be be updated
|
public DefaultPortalPageService(PortalPageManager portalPageManager, ShareTypeValidatorUtils shareTypeValidatorUtils, FavouritesManager<PortalPage> favouritesManager, PermissionManager permissionManager, UserUtil userUtil)
public Collection<PortalPage> getFavouritePortalPages(ApplicationUser user)
PortalPageService
PortalPage
's a user has favourited. Permission checks are done to ensure the user can see the PortalPage
, as
visibility may have been removed from underneath them.getFavouritePortalPages
in interface PortalPageService
user
- The user who has favourite PortalPage
's. Also to test visibility and withPortalPage
objects that represent PortalPage
's the user has favourited.public Collection<PortalPage> getFavouritePortalPages(com.atlassian.crowd.embedded.api.User user)
getFavouritePortalPages
in interface PortalPageService
user
- The user who has favourite PortalPage
's. Also to test visibility and withPortalPage
objects that represent PortalPage
's the user has favourited.public boolean isFavourite(ApplicationUser user, PortalPage portalPage)
PortalPageService
isFavourite
in interface PortalPageService
user
- the user to check.portalPage
- the page to check.public boolean isFavourite(com.atlassian.crowd.embedded.api.User user, PortalPage portalPage)
isFavourite
in interface PortalPageService
user
- the user to check.portalPage
- the page to check.public Collection<PortalPage> getOwnedPortalPages(ApplicationUser user)
PortalPageService
PortalPage
's a user owns/has created.getOwnedPortalPages
in interface PortalPageService
user
- The user who created the PortalPage
's.PortalPage
objects that represent PortalPage
's the user has created.public Collection<PortalPage> getOwnedPortalPages(com.atlassian.crowd.embedded.api.User user)
getOwnedPortalPages
in interface PortalPageService
user
- The user who created the PortalPage
's.PortalPage
objects that represent PortalPage
's the user has created.public Collection<PortalPage> getNonPrivatePortalPages(ApplicationUser user)
PortalPageService
PortalPage
's. I.e. PortalPage
's that other users can possibly see.getNonPrivatePortalPages
in interface PortalPageService
user
- The author of the PortalPage
'spublic Collection<PortalPage> getNonPrivatePortalPages(com.atlassian.crowd.embedded.api.User user)
getNonPrivatePortalPages
in interface PortalPageService
user
- The author of the PortalPage
'spublic Collection<PortalPage> getPortalPagesFavouritedByOthers(ApplicationUser user)
PortalPageService
PortalPage
's owned by a given user that have been favourited by at least one other usergetPortalPagesFavouritedByOthers
in interface PortalPageService
user
- The author of the PortalPage
'spublic Collection<PortalPage> getPortalPagesFavouritedByOthers(com.atlassian.crowd.embedded.api.User user)
getPortalPagesFavouritedByOthers
in interface PortalPageService
user
- The author of the PortalPage
'spublic PortalPage getPortalPage(JiraServiceContext context, Long portalPageId)
PortalPageService
PortalPage
by id.getPortalPage
in interface PortalPageService
context
- JIRA Service context containing an error collection and user requesting (to run) the
PortalPage
. The PortalPage
must exist and the user must be able to
see PortalPage
else an error will result.portalPageId
- The id of the PortalPage
to retrieve. Id must not be null.public boolean validateForGetPortalPage(JiraServiceContext context, Long portalPageId)
PortalPageService
validateForGetPortalPage
in interface PortalPageService
context
- Context containing user, error collection and i18n beanportalPageId
- The id of the portal page to getpublic PortalPage getSystemDefaultPortalPage()
PortalPageService
getSystemDefaultPortalPage
in interface PortalPageService
public boolean validateForCreate(JiraServiceContext serviceCtx, PortalPage portalPage)
PortalPageService
validateForCreate
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage object that is to be validated for createpublic PortalPage createPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage)
PortalPageService
createPortalPage
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage object that is to be createdpublic PortalPage createPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite)
PortalPageService
createPortalPage
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage object that is to be createdisFavourite
- set to true if the PortalPage should be marked as a favouritepublic boolean validateForCreatePortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId)
PortalPageService
validateForCreatePortalPageByClone
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage object that is to be createdclonePortalPageId
- the id of an existing PortalPage to clonepublic PortalPage createPortalPageByClone(JiraServiceContext serviceCtx, PortalPage portalPage, Long clonePortalPageId, boolean isFavourite)
PortalPageService
createPortalPageByClone
in interface PortalPageService
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 favouritepublic boolean validateForDelete(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
validateForDelete
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPageId
- the id of the PortalPage to deletepublic void deleteAllPortalPagesForUser(ApplicationUser user)
PortalPageService
deleteAllPortalPagesForUser
in interface PortalPageService
user
- The user to clean up after.public void deleteAllPortalPagesForUser(com.atlassian.crowd.embedded.api.User user)
deleteAllPortalPagesForUser
in interface PortalPageService
user
- The user to clean up after.public void deletePortalPage(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
deletePortalPage
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPageId
- the id of the PortalPage to deletepublic boolean validateForUpdate(JiraServiceContext serviceCtx, PortalPage portalPage)
PortalPageService
validateForUpdate
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage to updatepublic PortalPage updatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite)
PortalPageService
updatePortalPage
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage to updateisFavourite
- set to true if the PortalPage is to be marked as a favouritepublic void validateForChangeOwner(JiraServiceContext serviceCtx, PortalPage page)
PortalPageService
validateForChangeOwner
in interface PortalPageService
serviceCtx
- Context containing user, error collection and i18n beanpage
- the PortalPage to validatepublic PortalPage updatePortalPageUnconditionally(JiraServiceContext serviceCtx, ApplicationUser user, PortalPage portalPage)
PortalPageService
updatePortalPageUnconditionally
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playuser
- must be admin in order to make the changeportalPage
- the PortalPage to updatepublic PortalPage updatePortalPageUnconditionally(JiraServiceContext serviceCtx, com.atlassian.crowd.embedded.api.User user, PortalPage portalPage)
updatePortalPageUnconditionally
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playuser
- must be admin in order to make the changeportalPage
- the PortalPage to updatepublic boolean validateForChangePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
validateForChangePortalPageSequence
in interface PortalPageService
serviceCtx
- the context of the service callportalPageId
- the id of the PortalPage to re-sequencepublic void increasePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
increasePortalPageSequence
in interface PortalPageService
serviceCtx
- the context of the service callportalPageId
- the id of the PortalPage to re-sequencepublic void decreasePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
decreasePortalPageSequence
in interface PortalPageService
serviceCtx
- the context of the service callportalPageId
- the id of the PortalPage to re-sequencepublic void moveToStartPortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
moveToStartPortalPageSequence
in interface PortalPageService
serviceCtx
- the context of the service callportalPageId
- the id of the PortalPage to re-sequencepublic void moveToEndPortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
moveToEndPortalPageSequence
in interface PortalPageService
serviceCtx
- the context of the service callportalPageId
- the id of the PortalPage to re-sequencepublic void saveLegacyPortletConfiguration(JiraServiceContext serviceCtx, PortletConfiguration portletConfiguration)
PortalPageService
PortletConfiguration
to a
database store.saveLegacyPortletConfiguration
in interface PortalPageService
serviceCtx
- the context of the service callportletConfiguration
- The portletConfiguration to updatepublic void validateForSearch(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters)
PortalPageService
validateForSearch
in interface PortalPageService
serviceCtx
- Context containing user, error collection and i18n beansearchParameters
- the SharedEntitySearchParameters to validatepublic SharedEntitySearchResult<PortalPage> search(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters, int pagePosition, int pageWidth)
PortalPageService
search
in interface PortalPageService
serviceCtx
- Context containing user, error collection and i18n beansearchParameters
- the searchParameters to query.pagePosition
- the page to return.pageWidth
- the number of results per page.public List<List<PortletConfiguration>> getPortletConfigurations(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
getPortletConfigurations
in interface PortalPageService
serviceCtx
- Context containing user, error collection and i18n beanportalPageId
- The id of the portal page to getprotected boolean checkSystemDefaultSharePermissions(JiraServiceContext serviceCtx, SharedEntity.SharePermissions sharePermissions)
serviceCtx
- the JiraServiceContext in playsharePermissions
- the Set of SharePermission
's to checkCopyright © 2002-2015 Atlassian. All Rights Reserved.