com.atlassian.jira.bc.portal
Class AbstractPortalPageService

java.lang.Object
  extended by com.atlassian.jira.bc.portal.AbstractPortalPageService
All Implemented Interfaces:
PortalPageService
Direct Known Subclasses:
ProfessionalPortalPageService, StandardPortalPageSevice

public abstract class AbstractPortalPageService
extends Object
implements PortalPageService

The base class for PortalPageService implementations

Since:
v3.13

Constructor Summary
protected AbstractPortalPageService(PortalPageManager portalPageManager, ShareTypeValidatorUtils shareTypeValidatorUtils, FavouritesManager favouritesManager, PermissionManager permissionManager, UserUtil userUtil)
           
 
Method Summary
 PortletConfiguration addPortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, String portletKey, int suggestedColumn, int suggestedRow)
          Adds a Portlet to the PortalPage and returns the [@link PortletConfiguration} that represents the newly added configuration.
protected abstract  boolean canClonePortalPage(PortalPage pageToClone)
          This is expected to return a PortalPage IF the specified id is a valid PortalPage to clone.
 boolean canUserSeePortlet(User user, Portlet portlet)
          Returns true if the user is able to view the passed portlet.
 boolean canUserSeePortlet(User user, String portletKey)
          Returns true if the user is able to view the Portlet identified by portletKey.
protected abstract  boolean checkSystemDefaultSharePermissions(JiraServiceContext serviceCtx, SharedEntity.SharePermissions sharePermissions)
          Check that the passed permissions are valid for the System Dashboard.
 PortalPage copyPortletConfigurationInPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          Make a new copy of a PortletConfiguration on a PortalPage.
 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)
          Called to create and store the specified portalPage into the database by cloning its Portlet content from an existing PortalPage object.
 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(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.
 PortalPage deletePortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          This can be called to delete a specific PortletConfiguration object by id inside a PortalPage object from the underlying database store.
 Collection getFavouritePortalPages(User user)
          Retrieve all PortalPage's a user has favourited.
 Collection getNonPrivatePortalPages(User user)
          Get a user's non private PortalPage's.
 Collection getOwnedPortalPages(User user)
          Retrieve all PortalPage's a user owns/has created.
 PortalPage getPortalPage(JiraServiceContext context, Long portalPageId)
          Retrieve a given PortalPage by id.
 Collection getPortalPagesFavouritedByOthers(User user)
          Get PortalPage's owned by a given user that have been favourited by at least one other user
 PortalPage getSystemDefaultPortalPage()
          This returns the System Default PortalPage as defined by the JIRA Administrators
 Portlet getVisiblePortlet(JiraServiceContext serviceCtx, String portletKey)
          This returns a Portlet if the user can see it
 Collection getVisiblePortlets(JiraServiceContext serviceCtx)
          This returns a collections of the all the Portlet's a user can see
 void increasePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
          Increases the position of the page configuration in the user's page configuration set
 boolean isFavourite(User user, PortalPage portalPage)
          Is the passed PortalPage a favourite of the passed User.
 PortalPage movePortletConfigurationToPortalPage(JiraServiceContext serviceCtx, PortalPage srcPortalPage, PortalPage targetPortalPage, Long portletConfigId)
          Move a PortletConfiguration from one PortalPage to another.
 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.
 PortalPage saveAllPortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage)
          This can be called to save the PortletConfiguration objects inside a PortalPage object to the underlying database store.
 PortalPage savePortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          Save a specific PortletConfiguration inside the passed PortalPage to a database store.
 SharedEntitySearchResult search(JiraServiceContext serviceCtx, SharedEntitySearchParameters searchParameters, int pagePosition, int pageWidth)
          Search for the PortalPages that match the passed SearchParameters.
 PortalPage updatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage)
          Updates the specified PortalPage in the database
 PortalPage updatePortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, boolean isFavourite)
          Updates the specified PortalPage in the database
 boolean validateForAddPortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, String portletKey, int suggestedColumn, int suggestedRow)
          Called to validate that a Portlet can be added to the PortalPage
 boolean validateForChangePortalPageSequence(JiraServiceContext serviceCtx, Long portalPageId)
          Called to validate that sequence of a PortalPage can be changed.
 boolean validateForCopyPortletConfigurationInPortalPage(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          Check that it is possible to copy the PortletConfiguration on the passed PortalPage.
 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 validateForDeletePortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          Make sure that the user can delete identified PortletConfiguration object from the inside of the PortalPage.
 boolean validateForMovePortletConfigurationToPortalPage(JiraServiceContext serviceCtx, PortalPage srcPortalPage, PortalPage targetPortalPage, Long portletConfigId)
          Check that it is possible to move a PortletConfiguration from one PortalPage to another.
 boolean validateForSaveAllPortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage)
          Make sure that the user can save all the PortletConfiguration inside the PortalPage.
 boolean validateForSavePortalPagePortletConfiguration(JiraServiceContext serviceCtx, PortalPage portalPage, Long portletConfigId)
          Make sure that the user can save a specific PortletConfiguration inside the passed PortalPage.
 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
 
Methods inherited from interface com.atlassian.jira.bc.portal.PortalPageService
isMultiplePortalPagesEnabled
 

Constructor Detail

AbstractPortalPageService

protected AbstractPortalPageService(PortalPageManager portalPageManager,
                                    ShareTypeValidatorUtils shareTypeValidatorUtils,
                                    FavouritesManager favouritesManager,
                                    PermissionManager permissionManager,
                                    UserUtil userUtil)
Method Detail

getFavouritePortalPages

public Collection getFavouritePortalPages(User user)
Description copied from interface: PortalPageService
Retrieve all 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.

Specified by:
getFavouritePortalPages in interface PortalPageService
Parameters:
user - The user who has favourite PortalPage's. Also to test visibility and with
Returns:
a Collection of PortalPage objects that represent PortalPage's the user has favourited.

isFavourite

public boolean isFavourite(User user,
                           PortalPage portalPage)
Description copied from interface: PortalPageService
Is the passed PortalPage a favourite of the passed User.

Specified by:
isFavourite in interface PortalPageService
Parameters:
user - the user to check.
portalPage - the page to check.
Returns:
true if the PortalPage is a favourite of the passed User.

getOwnedPortalPages

public Collection getOwnedPortalPages(User user)
Description copied from interface: PortalPageService
Retrieve all PortalPage's a user owns/has created.

Specified by:
getOwnedPortalPages in interface PortalPageService
Parameters:
user - The user who created the PortalPage's.
Returns:
a Collection of PortalPage objects that represent PortalPage's the user has created.

getNonPrivatePortalPages

public Collection getNonPrivatePortalPages(User user)
Description copied from interface: PortalPageService
Get a user's non private PortalPage's. I.e. PortalPage's that other users can possibly see.

Specified by:
getNonPrivatePortalPages in interface PortalPageService
Parameters:
user - The author of the PortalPage's
Returns:
Collection of PortalPage objects that do not have private scope.

getPortalPagesFavouritedByOthers

public Collection getPortalPagesFavouritedByOthers(User user)
Description copied from interface: PortalPageService
Get PortalPage's owned by a given user that have been favourited by at least one other user

Specified by:
getPortalPagesFavouritedByOthers in interface PortalPageService
Parameters:
user - The author of the PortalPage's
Returns:
Collection of PortalPage objects owned by the given user and favourited by at least one other user

getPortalPage

public PortalPage getPortalPage(JiraServiceContext context,
                                Long portalPageId)
Description copied from interface: PortalPageService
Retrieve a given PortalPage by id.

Specified by:
getPortalPage in interface PortalPageService
Parameters:
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.
Returns:
The PortalPage as specified by the id, or null if none exists for the user.

getSystemDefaultPortalPage

public PortalPage getSystemDefaultPortalPage()
Description copied from interface: PortalPageService
This returns the System Default PortalPage as defined by the JIRA Administrators

Specified by:
getSystemDefaultPortalPage in interface PortalPageService
Returns:
the system default PortalPage

validateForCreate

public boolean validateForCreate(JiraServiceContext serviceCtx,
                                 PortalPage portalPage)
Description copied from interface: PortalPageService
Called to validate that the PortalPage object is in a valid state for creation. Call this before calling the create method .

Specified by:
validateForCreate in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - 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

public PortalPage createPortalPage(JiraServiceContext serviceCtx,
                                   PortalPage portalPage)
Description copied from interface: PortalPageService
Called to create and store the specified portalPage into the database.

Specified by:
createPortalPage in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage object that is to be created
Returns:
a fully fledged PortalPage with the new Id in it.

createPortalPage

public PortalPage createPortalPage(JiraServiceContext serviceCtx,
                                   PortalPage portalPage,
                                   boolean isFavourite)
Description copied from interface: PortalPageService
Called to create and store the specified portalPage into the database.

Specified by:
createPortalPage in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage object that is to be created
isFavourite - set to true if the PortalPage should be marked as a favourite
Returns:
a fully fledged PortalPage with the new Id in it.

createPortalPageByClone

public PortalPage createPortalPageByClone(JiraServiceContext serviceCtx,
                                          PortalPage portalPage,
                                          Long clonePortalPageId)
Description copied from interface: PortalPageService
Called to create and store the specified portalPage into the database by cloning its Portlet content from an existing PortalPage object.

Specified by:
createPortalPageByClone in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage object that is to be created
clonePortalPageId - the id of an existing PortalPage to clone
Returns:
a fully fledged PortalPage with the new Id in it.

validateForCreatePortalPageByClone

public boolean validateForCreatePortalPageByClone(JiraServiceContext serviceCtx,
                                                  PortalPage portalPage,
                                                  Long clonePortalPageId)
Description copied from interface: PortalPageService
Called to validate that a new PortalPage can be created by cloning its Portlet content from an existing PortalPage object.

Specified by:
validateForCreatePortalPageByClone in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage object that is to be created
clonePortalPageId - the id of an existing PortalPage to clone
Returns:
true if the PortalPage can be cloned from another page

createPortalPageByClone

public PortalPage createPortalPageByClone(JiraServiceContext serviceCtx,
                                          PortalPage portalPage,
                                          Long clonePortalPageId,
                                          boolean isFavourite)
Description copied from interface: PortalPageService
Called to create and store the specified portalPage into the database by cloning its Portlet content from an existing PortalPage object.

Specified by:
createPortalPageByClone in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage object that is to be created
clonePortalPageId - the id of an existing PortalPage to clone
isFavourite - set to true if the PortalPage should be marked as a favourite
Returns:
a fully fledged PortalPage with the new Id in it.

validateForDelete

public boolean validateForDelete(JiraServiceContext serviceCtx,
                                 Long portalPageId)
Description copied from interface: PortalPageService
Called to validate that the specified portalPage with the portalPageId can be deleted.

Specified by:
validateForDelete in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPageId - 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.

deleteAllPortalPagesForUser

public void deleteAllPortalPagesForUser(User user)
Description copied from interface: PortalPageService
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.

Specified by:
deleteAllPortalPagesForUser in interface PortalPageService
Parameters:
user - The user to clean up after.

deletePortalPage

public void deletePortalPage(JiraServiceContext serviceCtx,
                             Long portalPageId)
Description copied from interface: PortalPageService
Called to delete the PortalPage with the specified portalPageId.

Specified by:
deletePortalPage in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPageId - the id of the PortalPage to delete

validateForUpdate

public boolean validateForUpdate(JiraServiceContext serviceCtx,
                                 PortalPage portalPage)
Description copied from interface: PortalPageService
Called to validate that the PortalPage can be be updated

Specified by:
validateForUpdate in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - 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

public PortalPage updatePortalPage(JiraServiceContext serviceCtx,
                                   PortalPage portalPage)
Description copied from interface: PortalPageService
Updates the specified PortalPage in the database

Specified by:
updatePortalPage in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage to update
Returns:
a newly updated PortalPage

updatePortalPage

public PortalPage updatePortalPage(JiraServiceContext serviceCtx,
                                   PortalPage portalPage,
                                   boolean isFavourite)
Description copied from interface: PortalPageService
Updates the specified PortalPage in the database

Specified by:
updatePortalPage in interface PortalPageService
Parameters:
serviceCtx - the JiraServiceContext in play
portalPage - the PortalPage to update
isFavourite - set to true if the PortalPage is to be marked as a favourite
Returns:
a newly updated PortalPage

validateForChangePortalPageSequence

public boolean validateForChangePortalPageSequence(JiraServiceContext serviceCtx,
                                                   Long portalPageId)
Description copied from interface: PortalPageService
Called to validate that sequence of a PortalPage can be changed.

Specified by:
validateForChangePortalPageSequence in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPageId - the id of the PortalPage to re-sequence
Returns:
true if the PortalPage can be re-sequenced

increasePortalPageSequence

public void increasePortalPageSequence(JiraServiceContext serviceCtx,
                                       Long portalPageId)
Description copied from interface: PortalPageService
Increases the position of the page configuration in the user's page configuration set

Specified by:
increasePortalPageSequence in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPageId - the id of the PortalPage to re-sequence

decreasePortalPageSequence

public void decreasePortalPageSequence(JiraServiceContext serviceCtx,
                                       Long portalPageId)
Description copied from interface: PortalPageService
Decreases the position of the page configuration in the user's page configuration set.

Specified by:
decreasePortalPageSequence in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPageId - the id of the PortalPage to re-sequence

moveToStartPortalPageSequence

public void moveToStartPortalPageSequence(JiraServiceContext serviceCtx,
                                          Long portalPageId)
Description copied from interface: PortalPageService
Puts the given page to the start of the user's page configuration set.

Specified by:
moveToStartPortalPageSequence in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPageId - the id of the PortalPage to re-sequence

moveToEndPortalPageSequence

public void moveToEndPortalPageSequence(JiraServiceContext serviceCtx,
                                        Long portalPageId)
Description copied from interface: PortalPageService
Puts the given page to the end of the user's page configuration set.

Specified by:
moveToEndPortalPageSequence in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPageId - the id of the PortalPage to re-sequence

validateForSaveAllPortalPagePortletConfiguration

public boolean validateForSaveAllPortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                                PortalPage portalPage)
Description copied from interface: PortalPageService
Make sure that the user can save all the PortletConfiguration inside the PortalPage.

Specified by:
validateForSaveAllPortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
Returns:
true if the user can save the portlet or false otherwise.

saveAllPortalPagePortletConfiguration

public PortalPage saveAllPortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                        PortalPage portalPage)
Description copied from interface: PortalPageService
This can be called to save the PortletConfiguration objects inside a PortalPage object to the underlying database store.

Specified by:
saveAllPortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
Returns:
a newly refreshed PortalPage object whose internals reflects what has been saved

validateForSavePortalPagePortletConfiguration

public boolean validateForSavePortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                             PortalPage portalPage,
                                                             Long portletConfigId)
Description copied from interface: PortalPageService
Make sure that the user can save a specific PortletConfiguration inside the passed PortalPage.

Specified by:
validateForSavePortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
portletConfigId - the id of the configuration that should be saved.
Returns:
true if the user can save the portlet or false otherwise.

savePortalPagePortletConfiguration

public PortalPage savePortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                     PortalPage portalPage,
                                                     Long portletConfigId)
Description copied from interface: PortalPageService
Save a specific PortletConfiguration inside the passed PortalPage to a database store.

Specified by:
savePortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
portletConfigId - the configuration to copy.
Returns:
a newly refreshed PortalPage object whose internals reflects what has been saved

validateForDeletePortalPagePortletConfiguration

public boolean validateForDeletePortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                               PortalPage portalPage,
                                                               Long portletConfigId)
Description copied from interface: PortalPageService
Make sure that the user can delete identified PortletConfiguration object from the inside of the PortalPage.

Specified by:
validateForDeletePortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
portletConfigId - the id of the PortletConfiguration inside the PortalPage
Returns:
true if the user can delete the portlet or false otherwise.

deletePortalPagePortletConfiguration

public PortalPage deletePortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                       PortalPage portalPage,
                                                       Long portletConfigId)
Description copied from interface: PortalPageService
This can be called to delete a specific PortletConfiguration object by id inside a PortalPage object from the underlying database store.

Specified by:
deletePortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage in question
portletConfigId - the id of the PortletConfiguration inside the PortalPage
Returns:
a newly refreshed PortalPage object whose internals reflects what has been changed

validateForAddPortalPagePortletConfiguration

public boolean validateForAddPortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                            PortalPage portalPage,
                                                            String portletKey,
                                                            int suggestedColumn,
                                                            int suggestedRow)
Description copied from interface: PortalPageService
Called to validate that a Portlet can be added to the PortalPage

Specified by:
validateForAddPortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage to add the Portlet to
portletKey - the key of the Portlet to add
suggestedColumn - the suggested column inside the PortalPage
suggestedRow - the suggested row inside the PortalPage
Returns:
true if the Portlet can be added

addPortalPagePortletConfiguration

public PortletConfiguration addPortalPagePortletConfiguration(JiraServiceContext serviceCtx,
                                                              PortalPage portalPage,
                                                              String portletKey,
                                                              int suggestedColumn,
                                                              int suggestedRow)
Description copied from interface: PortalPageService
Adds a Portlet to the PortalPage and returns the [@link PortletConfiguration} that represents the newly added configuration.

Specified by:
addPortalPagePortletConfiguration in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage to add the Portlet to
portletKey - the key of the Portlet to add
suggestedColumn - the suggested column inside the PortalPage
suggestedRow - the suggested row inside the PortalPage
Returns:
a PortletConfiguration representing where the Portlet was placed. The PortalPage may in fact renumber where the PP was placed.

validateForCopyPortletConfigurationInPortalPage

public boolean validateForCopyPortletConfigurationInPortalPage(JiraServiceContext serviceCtx,
                                                               PortalPage portalPage,
                                                               Long portletConfigId)
Description copied from interface: PortalPageService
Check that it is possible to copy the PortletConfiguration on the passed PortalPage.

Specified by:
validateForCopyPortletConfigurationInPortalPage in interface PortalPageService
Parameters:
serviceCtx - the context of the service call.
portalPage - the PortalPage that contains the PortletConfiguration to copy.
portletConfigId - the id of the PortletConfiguration to copy.
Returns:
true if the PortletConfiguration can be copied or false otherwise.

copyPortletConfigurationInPortalPage

public PortalPage copyPortletConfigurationInPortalPage(JiraServiceContext serviceCtx,
                                                       PortalPage portalPage,
                                                       Long portletConfigId)
Description copied from interface: PortalPageService
Make a new copy of a PortletConfiguration on a PortalPage.

Specified by:
copyPortletConfigurationInPortalPage in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portalPage - the PortalPage that contains the PortletConfiguration to copy.
portletConfigId - the id of the PortletConfiguration to copy. It must be attached to the passed PortalPage.
Returns:
the new PortalPage with the copied PortletConfiguration.

validateForMovePortletConfigurationToPortalPage

public boolean validateForMovePortletConfigurationToPortalPage(JiraServiceContext serviceCtx,
                                                               PortalPage srcPortalPage,
                                                               PortalPage targetPortalPage,
                                                               Long portletConfigId)
Description copied from interface: PortalPageService
Check that it is possible to move a PortletConfiguration from one PortalPage to another.

Specified by:
validateForMovePortletConfigurationToPortalPage in interface PortalPageService
Parameters:
serviceCtx - the context of the service call.
srcPortalPage - the PortalPage that contains the PortletConfiguration to move.
targetPortalPage - the PortalPage to receive the PortletConfiguration.
portletConfigId - the id of the PortletConfiguration to move.
Returns:
true if the PortletConfiguration can be moved or false otherwise.

movePortletConfigurationToPortalPage

public PortalPage movePortletConfigurationToPortalPage(JiraServiceContext serviceCtx,
                                                       PortalPage srcPortalPage,
                                                       PortalPage targetPortalPage,
                                                       Long portletConfigId)
Description copied from interface: PortalPageService
Move a PortletConfiguration from one PortalPage to another.

Specified by:
movePortletConfigurationToPortalPage in interface PortalPageService
Parameters:
serviceCtx - the context of the service call.
srcPortalPage - the PortalPage that contains the PortletConfiguration to move.
targetPortalPage - the PortalPage to receive the PortletConfiguration.
portletConfigId - the id of the PortletConfiguration to move.
Returns:
the changed targetPortalPage or null if the call failed.

canUserSeePortlet

public boolean canUserSeePortlet(User user,
                                 String portletKey)
Description copied from interface: PortalPageService
Returns true if the user is able to view the Portlet identified by portletKey.

Specified by:
canUserSeePortlet in interface PortalPageService
Parameters:
user - the user to check.
portletKey - the plugin id of the portlet to test.
Returns:
true if the user is able to view the Portlet identified by portletKey.

canUserSeePortlet

public boolean canUserSeePortlet(User user,
                                 Portlet portlet)
Description copied from interface: PortalPageService
Returns true if the user is able to view the passed portlet.

Specified by:
canUserSeePortlet in interface PortalPageService
Parameters:
user - the user to check.
portlet - the portlet to test.
Returns:
true if the user is able to view the passed portlet.

getVisiblePortlets

public Collection getVisiblePortlets(JiraServiceContext serviceCtx)
Description copied from interface: PortalPageService
This returns a collections of the all the Portlet's a user can see

Specified by:
getVisiblePortlets in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
Returns:
a list of Portlet's the user can see

getVisiblePortlet

public Portlet getVisiblePortlet(JiraServiceContext serviceCtx,
                                 String portletKey)
Description copied from interface: PortalPageService
This returns a Portlet if the user can see it

Specified by:
getVisiblePortlet in interface PortalPageService
Parameters:
serviceCtx - the context of the service call
portletKey - the plugin id of the portlet to test.
Returns:
a Portlet if the user can see it

validateForSearch

public void validateForSearch(JiraServiceContext serviceCtx,
                              SharedEntitySearchParameters searchParameters)
Description copied from interface: PortalPageService
This will validate that the input parameters are valid for a search that encompasses ANY share entity type.

Specified by:
validateForSearch in interface PortalPageService
Parameters:
serviceCtx - Context containing user, error collection and i18n bean
searchParameters - the SharedEntitySearchParameters to validate

search

public SharedEntitySearchResult search(JiraServiceContext serviceCtx,
                                       SharedEntitySearchParameters searchParameters,
                                       int pagePosition,
                                       int pageWidth)
Description copied from interface: PortalPageService
Search for the PortalPages that match the passed SearchParameters. The result can be paged so that a subset of the results can be returned.

Specified by:
search in interface PortalPageService
Parameters:
serviceCtx - Context containing user, error collection and i18n bean
searchParameters - the searchParameters to query.
pagePosition - the page to return.
pageWidth - the number of results per page.
Returns:
the result of the search.

canClonePortalPage

protected abstract boolean canClonePortalPage(PortalPage pageToClone)
This is expected to return a PortalPage IF the specified id is a valid PortalPage to clone.

Parameters:
pageToClone - the PortalPage to clone
Returns:
a PortalPage or null if the portal page cant be found or its in invalid page to clone

checkSystemDefaultSharePermissions

protected abstract boolean checkSystemDefaultSharePermissions(JiraServiceContext serviceCtx,
                                                              SharedEntity.SharePermissions sharePermissions)
Check that the passed permissions are valid for the System Dashboard.

Parameters:
serviceCtx - the JiraServiceContext in play
sharePermissions - the Set of SharePermission's to check
Returns:
true if they are valid


Copyright © 2002-2008 Atlassian. All Rights Reserved.