Package org.bonitasoft.engine.page.impl
Class PageMappingServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.page.impl.PageMappingServiceImpl
-
- All Implemented Interfaces:
PageMappingService
public class PageMappingServiceImpl extends java.lang.Object implements PageMappingService
- Author:
- Baptiste Mesta
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPAGE_MAPPING
-
Constructor Summary
Constructors Constructor Description PageMappingServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, SessionService sessionService, ReadSessionAccessor sessionAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SPageMappingcreate(java.lang.String key, java.lang.Long pageId, java.util.List<java.lang.String> authorizationRules)SPageMappingcreate(java.lang.String key, java.lang.String url, java.lang.String urlAdapter, java.util.List<java.lang.String> authorizationRules)voiddelete(SPageMapping sPageMapping)delete this page mappingjava.util.List<SPageMapping>get(long pageId, int startIndex, int maxResults)Gets the paginated mappings of the page.SPageMappingget(java.lang.String key)protected booleanisAllowedToAccess(SPageMapping pageMapping, java.util.Map<java.lang.String,java.io.Serializable> context, java.util.List<java.lang.String> pageAuthorizationRules)SPageURLresolvePageURL(SPageMapping pageMapping, java.util.Map<java.lang.String,java.io.Serializable> context, boolean executeAuthorizationRules)voidsetAuthorizationRules(java.util.List<AuthorizationRule> authorizationRules)voidsetURLAdapters(java.util.List<URLAdapter> urlAdapters)voidupdate(SPageMapping pageMapping, java.lang.Long pageId)update the given page mappingvoidupdate(SPageMapping pageMapping, java.lang.String url, java.lang.String urlAdapter)update the given page mapping
-
-
-
Field Detail
-
PAGE_MAPPING
public static final java.lang.String PAGE_MAPPING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PageMappingServiceImpl
public PageMappingServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, SessionService sessionService, ReadSessionAccessor sessionAccessor)
-
-
Method Detail
-
setURLAdapters
public void setURLAdapters(java.util.List<URLAdapter> urlAdapters)
-
setAuthorizationRules
public void setAuthorizationRules(java.util.List<AuthorizationRule> authorizationRules)
-
create
public SPageMapping create(java.lang.String key, java.lang.Long pageId, java.util.List<java.lang.String> authorizationRules) throws SObjectCreationException
- Specified by:
createin interfacePageMappingService- Parameters:
key- the key used to retrieve the mappingpageId- the id of the custom pageauthorizationRules- the names of the authorization rules to execute- Returns:
- the created page mapping
- Throws:
SObjectCreationException- when there is an issue while creating this object
-
create
public SPageMapping create(java.lang.String key, java.lang.String url, java.lang.String urlAdapter, java.util.List<java.lang.String> authorizationRules) throws SObjectCreationException
- Specified by:
createin interfacePageMappingService- Parameters:
key- the key used to retrieve the mappingurl- the external URL the mapping points tourlAdapter- the name of the URL adapter that transform the URL in case of an external URL. i.e. it can add parametersauthorizationRules- the names of the authorization rules to execute- Returns:
- the created page mapping
- Throws:
SObjectCreationException- when there is an issue while creating this object
-
get
public SPageMapping get(java.lang.String key) throws SObjectNotFoundException, SBonitaReadException
- Specified by:
getin interfacePageMappingService- Parameters:
key- the key of the page mapping to retrieve- Returns:
- the page mapping having this key
- Throws:
SObjectNotFoundException- when there is no mapping having this keySBonitaReadException
-
resolvePageURL
public SPageURL resolvePageURL(SPageMapping pageMapping, java.util.Map<java.lang.String,java.io.Serializable> context, boolean executeAuthorizationRules) throws SExecutionException, SAuthorizationException
- Specified by:
resolvePageURLin interfacePageMappingService- Returns:
- Throws:
SExecutionExceptionSAuthorizationException
-
isAllowedToAccess
protected boolean isAllowedToAccess(SPageMapping pageMapping, java.util.Map<java.lang.String,java.io.Serializable> context, java.util.List<java.lang.String> pageAuthorizationRules) throws SExecutionException
- Throws:
SExecutionException
-
delete
public void delete(SPageMapping sPageMapping) throws SDeletionException
Description copied from interface:PageMappingServicedelete this page mapping- Specified by:
deletein interfacePageMappingService- Parameters:
sPageMapping- the page mapping to delete- Throws:
SDeletionException
-
update
public void update(SPageMapping pageMapping, java.lang.Long pageId) throws SObjectModificationException, SObjectNotFoundException, SBonitaReadException
Description copied from interface:PageMappingServiceupdate the given page mapping- Specified by:
updatein interfacePageMappingService- Parameters:
pageMapping- the pageMapping to updatepageId- the id of the page or null- Throws:
SObjectModificationExceptionSObjectNotFoundExceptionSBonitaReadException
-
update
public void update(SPageMapping pageMapping, java.lang.String url, java.lang.String urlAdapter) throws SObjectModificationException, SObjectNotFoundException, SBonitaReadException
Description copied from interface:PageMappingServiceupdate the given page mapping- Specified by:
updatein interfacePageMappingService- Parameters:
pageMapping- the pageMapping to updateurl- the URL or nullurlAdapter- the new URL adapter to use- Throws:
SObjectModificationExceptionSObjectNotFoundExceptionSBonitaReadException
-
get
public java.util.List<SPageMapping> get(long pageId, int startIndex, int maxResults) throws SBonitaReadException
Description copied from interface:PageMappingServiceGets the paginated mappings of the page.- Specified by:
getin interfacePageMappingService- Parameters:
pageId- the page identifierstartIndex- the start indexmaxResults- the max results- Returns:
- the paginated mappings of the page
- Throws:
SBonitaReadException
-
-