|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.bc.portal.DefaultPortalPageService
public class DefaultPortalPageService
The base class for PortalPageService implementations
Constructor Summary | |
---|---|
DefaultPortalPageService(PortalPageManager portalPageManager,
ShareTypeValidatorUtils shareTypeValidatorUtils,
FavouritesManager<PortalPage> favouritesManager,
PermissionManager permissionManager,
UserUtil userUtil)
|
Method Summary | |
---|---|
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(com.atlassian.crowd.embedded.api.User user)
Delete all Portal Pages owned by a user. |
void |
deletePortalPage(JiraServiceContext serviceCtx,
Long portalPageId)
Called to delete the PortalPage with the specified portalPageId. |
Collection<PortalPage> |
getFavouritePortalPages(com.atlassian.crowd.embedded.api.User user)
Retrieve all PortalPage 's a user has favourited. |
Collection<PortalPage> |
getNonPrivatePortalPages(com.atlassian.crowd.embedded.api.User user)
Get a user's non private PortalPage 's. |
Collection<PortalPage> |
getOwnedPortalPages(com.atlassian.crowd.embedded.api.User user)
Retrieve all PortalPage 's a user owns/has created. |
PortalPage |
getPortalPage(JiraServiceContext context,
Long portalPageId)
Retrieve a given PortalPage by id. |
Collection<PortalPage> |
getPortalPagesFavouritedByOthers(com.atlassian.crowd.embedded.api.User user)
Get PortalPage 's owned by a given user that have been favourited by at least one other 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(com.atlassian.crowd.embedded.api.User user,
PortalPage portalPage)
Is the passed PortalPage a favourite of the passed User. |
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,
com.atlassian.crowd.embedded.api.User user,
PortalPage portalPage)
Updates the specified PortalPage in the database , no permission checks are applied, but the user must be an administrator |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultPortalPageService(PortalPageManager portalPageManager, ShareTypeValidatorUtils shareTypeValidatorUtils, FavouritesManager<PortalPage> favouritesManager, PermissionManager permissionManager, UserUtil userUtil)
Method Detail |
---|
public Collection<PortalPage> getFavouritePortalPages(com.atlassian.crowd.embedded.api.User 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 with
PortalPage
objects that represent PortalPage
's the user has favourited.public boolean isFavourite(com.atlassian.crowd.embedded.api.User user, PortalPage portalPage)
PortalPageService
isFavourite
in interface PortalPageService
user
- the user to check.portalPage
- the page to check.
public Collection<PortalPage> getOwnedPortalPages(com.atlassian.crowd.embedded.api.User 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> getNonPrivatePortalPages(com.atlassian.crowd.embedded.api.User user)
PortalPageService
PortalPage
's. I.e. PortalPage
's that other users can possibly see.
getNonPrivatePortalPages
in interface PortalPageService
user
- The author of the PortalPage
's
public Collection<PortalPage> getPortalPagesFavouritedByOthers(com.atlassian.crowd.embedded.api.User user)
PortalPageService
PortalPage
's owned by a given user that have been favourited by at least one other user
getPortalPagesFavouritedByOthers
in interface PortalPageService
user
- The author of the PortalPage
's
public 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 get
public 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 create
public PortalPage createPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage)
PortalPageService
createPortalPage
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPage
- the PortalPage object that is to be created
public 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 favourite
public 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 clone
public 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 favourite
public boolean validateForDelete(JiraServiceContext serviceCtx, Long portalPageId)
PortalPageService
validateForDelete
in interface PortalPageService
serviceCtx
- the JiraServiceContext in playportalPageId
- the id of the PortalPage to delete
public void deleteAllPortalPagesForUser(com.atlassian.crowd.embedded.api.User user)
PortalPageService
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 update
public 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 favourite
public 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, com.atlassian.crowd.embedded.api.User 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 update
public 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-sequence
public 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 get
protected boolean checkSystemDefaultSharePermissions(JiraServiceContext serviceCtx, SharedEntity.SharePermissions sharePermissions)
serviceCtx
- the JiraServiceContext in playsharePermissions
- the Set of SharePermission
's to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |