public class DefaultPortalPageManager extends Object implements PortalPageManager
SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor
Constructor and Description |
---|
DefaultPortalPageManager(ShareManager shareManager,
PortalPageStore portalPageStore,
PortletConfigurationManager portletConfigurationManager,
SharedEntityIndexer indexer,
com.atlassian.event.api.EventPublisher eventPublisher,
JiraAuthenticationContext authenticationContext) |
Modifier and Type | Method and Description |
---|---|
void |
adjustFavouriteCount(SharedEntity entity,
int adjustmentValue)
Adjusts the favourite counts for a given entity.
|
PortalPage |
create(PortalPage portalPage)
Creates the specified PortalPage in the database
|
PortalPage |
createBasedOnClone(ApplicationUser pageOwner,
PortalPage portalPage,
PortalPage clonePortalPage)
Creates a PortalPage in the database by cloning its Portlet content from the specified clonePortalPage
|
protected PortalPage |
createNoEvent(PortalPage portalPage) |
void |
delete(Long portalPageId)
Deletes the PortalPage with the specified portalPageId
|
EnclosedIterable<PortalPage> |
get(ApplicationUser user,
SharedEntityAccessor.RetrievalDescriptor ids)
Used to get
sharable entities from a search result. |
EnclosedIterable<PortalPage> |
get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get
sharable entities from a search result. |
EnclosedIterable<PortalPage> |
getAll()
Get all PortalPages.
|
EnclosedIterable<SharedEntity> |
getAllIndexableSharedEntities()
Get all
sharable entities this accessor can see for use in indexing. |
Collection<PortalPage> |
getAllOwnedPortalPages(ApplicationUser owner)
Returns a Collection of PortalPage objects that are owned by the specified User
|
PortalPage |
getPortalPage(ApplicationUser user,
Long id)
Returns the PortalPage with the specified portalPageId, IF the user is allowed to see it.
|
PortalPage |
getPortalPageById(Long portalPageId)
Gets a PortalPage by id regardless of owner
|
PortalPage |
getPortalPageByName(ApplicationUser owner,
String pageName)
Returns a PortalPage by searching for it by owner and pageName.
|
List<List<PortletConfiguration>> |
getPortletConfigurations(Long portalPageId)
Returns a sorted immutable list of lists of portletconfigurations for a particular portal page.
|
PortalPage |
getSharedEntity(ApplicationUser user,
Long entityId)
This is called to get
SharedEntity by id If the user is allows to see it |
PortalPage |
getSharedEntity(Long entityId)
This will call back to ask for a
SharedEntity based on id. |
PortalPage |
getSystemDefaultPortalPage()
Returns the system default PortalPage.
|
SharedEntity.TypeDescriptor<PortalPage> |
getType()
Returns the type that this object can work with.
|
boolean |
hasPermissionToUse(ApplicationUser user,
PortalPage portalPage)
Returns true if the user has permission to use the
SharedEntity |
boolean |
hasShareRights(ApplicationUser user,
PortalPage portalPage,
ShareRight shareRight)
Checks if provided user has share rights for given portal page.
|
void |
saveLegacyPortletConfiguration(PortletConfiguration portletConfiguration)
This can be called to save a
PortletConfiguration object
inside a PortalPage object to the underlying database store. |
SharedEntitySearchResult<PortalPage> |
search(SharedEntitySearchParameters searchParameters,
ApplicationUser user,
int pagePosition,
int pageWidth)
Search for the PortalPages that match the passed SearchParameters.
|
PortalPage |
update(PortalPage portalPage)
Updates the specified PortalPage in the database
|
public DefaultPortalPageManager(ShareManager shareManager, PortalPageStore portalPageStore, PortletConfigurationManager portletConfigurationManager, SharedEntityIndexer indexer, com.atlassian.event.api.EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext)
public SharedEntity.TypeDescriptor<PortalPage> getType()
SharedEntityAccessor
getType
in interface SharedEntityAccessor<PortalPage>
public void adjustFavouriteCount(SharedEntity entity, int adjustmentValue)
SharedEntityAccessor
adjustFavouriteCount
in interface SharedEntityAccessor<PortalPage>
entity
- the entity to adjustadjustmentValue
- the value to adjust by.public PortalPage getSharedEntity(Long entityId)
SharedEntityAccessor
SharedEntity
based on id.getSharedEntity
in interface SharedEntityAccessor<PortalPage>
entityId
- the id of the SharedEntity
SharedEntity
or null if it cant be foundpublic PortalPage getSharedEntity(ApplicationUser user, Long entityId)
SharedEntityAccessor
SharedEntity
by id If the user is allows to see itgetSharedEntity
in interface SharedEntityAccessor<PortalPage>
user
- the user in playentityId
- the id of the SharedEntity
SharedEntity
if it exists and the user can see it and null otherwisepublic boolean hasPermissionToUse(ApplicationUser user, PortalPage portalPage)
SharedEntityAccessor
SharedEntity
hasPermissionToUse
in interface SharedEntityAccessor<PortalPage>
user
- the user in playportalPage
- the SharedEntity
to checkpublic EnclosedIterable<PortalPage> getAll()
PortalPageManager
getAll
in interface PortalPageManager
getAll
in interface SharedEntityAccessor<PortalPage>
EnclosedIterable
of PortalPagespublic EnclosedIterable<SharedEntity> getAllIndexableSharedEntities()
SharedEntityAccessor
sharable entities
this accessor can see for use in indexing.getAllIndexableSharedEntities
in interface SharedEntityAccessor<PortalPage>
EnclosedIterable
of SharedEntity
'spublic EnclosedIterable<PortalPage> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
SharedEntityAccessor
sharable entities
from a search result.get
in interface SharedEntityAccessor<PortalPage>
descriptor
- retrieval descriptorEnclosedIterable
of SharedEntity
'spublic EnclosedIterable<PortalPage> get(ApplicationUser user, SharedEntityAccessor.RetrievalDescriptor ids)
SharedEntityAccessor
sharable entities
from a search result.
The entities returned may be modified by the user parameter (e.g. permissions or clause sanitisation).get
in interface SharedEntityAccessor<PortalPage>
user
- the user performing the searchids
- retrieval descriptorEnclosedIterable
of SharedEntity
'spublic Collection<PortalPage> getAllOwnedPortalPages(ApplicationUser owner)
PortalPageManager
getAllOwnedPortalPages
in interface PortalPageManager
owner
- the User who owns the PortalPage'spublic PortalPage getPortalPageByName(ApplicationUser owner, String pageName)
PortalPageManager
getPortalPageByName
in interface PortalPageManager
owner
- the owner in playpageName
- the name of the PortalPagepublic PortalPage getSystemDefaultPortalPage()
PortalPageManager
getSystemDefaultPortalPage
in interface PortalPageManager
public PortalPage getPortalPage(ApplicationUser user, Long id)
PortalPageManager
getPortalPage
in interface PortalPageManager
user
- the User in playid
- the id of the PortalPage to returnpublic PortalPage getPortalPageById(Long portalPageId)
PortalPageManager
getPortalPageById
in interface PortalPageManager
portalPageId
- the id of the PortalPage to retrievepublic PortalPage create(PortalPage portalPage)
PortalPageManager
create
in interface PortalPageManager
portalPage
- the PortalPage to createprotected PortalPage createNoEvent(PortalPage portalPage)
public PortalPage createBasedOnClone(ApplicationUser pageOwner, PortalPage portalPage, PortalPage clonePortalPage)
PortalPageManager
createBasedOnClone
in interface PortalPageManager
pageOwner
- the User who will own the cloned portal pageportalPage
- the PortalPage to createclonePortalPage
- the PortalPage to clone Portlet content frompublic PortalPage update(PortalPage portalPage)
PortalPageManager
update
in interface PortalPageManager
portalPage
- the PortalPage to updatepublic void delete(Long portalPageId)
PortalPageManager
delete
in interface PortalPageManager
portalPageId
- the id of the PortalPage to deletepublic void saveLegacyPortletConfiguration(PortletConfiguration portletConfiguration)
PortalPageManager
PortletConfiguration
object
inside a PortalPage
object to the underlying database store.saveLegacyPortletConfiguration
in interface PortalPageManager
portletConfiguration
- The portletConfiguration to save.public SharedEntitySearchResult<PortalPage> search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)
PortalPageManager
search
in interface PortalPageManager
search
in interface SharedEntityAccessor<PortalPage>
searchParameters
- the SearchParameters to query.user
- the user performing the search.pagePosition
- the page to return.pageWidth
- the number of results per page.public List<List<PortletConfiguration>> getPortletConfigurations(Long portalPageId)
PortalPageManager
getPortletConfigurations
in interface PortalPageManager
portalPageId
- The portal page id to fetch portlet configs forpublic boolean hasShareRights(@Nullable ApplicationUser user, @Nonnull PortalPage portalPage, @Nonnull ShareRight shareRight)
PortalPageManager
hasShareRights
in interface PortalPageManager
user
- user which wants for example view or edit the portal pageportalPage
- portal page which permissions and ownership are going to be checkedshareRight
- share right which will be checked if user has itCopyright © 2002-2024 Atlassian. All Rights Reserved.