Package org.bonitasoft.engine.page.impl
Class PageServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.page.impl.PageServiceImpl
-
- All Implemented Interfaces:
LifecycleService,TenantLifecycleService,PageService
@Service("pageService") @Order(4) public class PageServiceImpl extends java.lang.Object implements PageService- Author:
- Baptiste Mesta, Matthieu Chaffotte
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINDEX_GROOVYstatic java.lang.StringINDEX_HTMLstatic java.lang.StringPAGE_TOKEN_PREFIXstatic java.lang.StringRESOURCES_INDEX_HTML-
Fields inherited from interface org.bonitasoft.engine.page.PageService
PAGE, PROPERTIES_CONTENT_TYPE, PROPERTIES_DESCRIPTION, PROPERTIES_DISPLAY_NAME, PROPERTIES_FILE_NAME, PROPERTIES_NAME
-
-
Constructor Summary
Constructors Constructor Description PageServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService, PermissionService permissionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SPageaddPage(byte[] content, java.lang.String contentName, long userId)add a page using the zip in parameters, it get all informations from the page.properties file contain inside the zipSPageaddPage(SPage page, byte[] content)add a page using the zip in parameters and the given propertiesprotected voidcheckPageDuplicateForProcessDefinition(AbstractSPage sPage, SPageLogBuilder logBuilder, long sPageProcessDefinitionId)voiddeletePage(long pageId)longgetNumberOfPages(QueryOptions options)SPagegetPage(long pageId)SPagegetPageByName(java.lang.String pageName)SPagegetPageByNameAndProcessDefinitionId(java.lang.String name, long processDefinitionId)get a page attached to a processjava.util.List<SPage>getPageByProcessDefinitionId(long processDefinitionId, int fromIndex, int numberOfResults)get a list of page attached to a processbyte[]getPageContent(long pageId)voidinit()This method performs actions to initialize a TenantLifecycleService This method is called when creating a new tenant and when starting the platform.booleaninitialized()protected booleanisSystemSession()java.util.PropertiesreadPageZip(byte[] content)Read the content of a page in a zipjava.util.List<SPage>searchPages(QueryOptions options)voidsetPageServiceListeners(java.util.List<PageServiceListener> pageServiceListeners)SPageupdatePage(long pageId, EntityUpdateDescriptor entityUpdateDescriptor)voidupdatePageContent(long pageId, byte[] content, java.lang.String contentName)voidupdatePageContent(long pageId, byte[] content, java.lang.String contentName, SPageUpdateBuilder pageUpdateBuilder)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bonitasoft.engine.commons.LifecycleService
pause, resume, start, stop
-
-
-
-
Field Detail
-
PAGE_TOKEN_PREFIX
public static final java.lang.String PAGE_TOKEN_PREFIX
- See Also:
- Constant Field Values
-
INDEX_GROOVY
public static final java.lang.String INDEX_GROOVY
- See Also:
- Constant Field Values
-
INDEX_HTML
public static final java.lang.String INDEX_HTML
- See Also:
- Constant Field Values
-
RESOURCES_INDEX_HTML
public static final java.lang.String RESOURCES_INDEX_HTML
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PageServiceImpl
public PageServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService, PermissionService permissionService)
-
-
Method Detail
-
addPage
public SPage addPage(SPage page, byte[] content) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException
Description copied from interface:PageServiceadd a page using the zip in parameters and the given properties- Specified by:
addPagein interfacePageService- Returns:
- Throws:
SObjectCreationExceptionSObjectAlreadyExistsExceptionSInvalidPageZipExceptionSInvalidPageTokenException
-
addPage
public SPage addPage(byte[] content, java.lang.String contentName, long userId) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException
Description copied from interface:PageServiceadd a page using the zip in parameters, it get all informations from the page.properties file contain inside the zip- Specified by:
addPagein interfacePageService- Returns:
- Throws:
SObjectCreationExceptionSObjectAlreadyExistsExceptionSInvalidPageZipExceptionSInvalidPageTokenException
-
getPageByNameAndProcessDefinitionId
public SPage getPageByNameAndProcessDefinitionId(java.lang.String name, long processDefinitionId) throws SBonitaReadException
Description copied from interface:PageServiceget a page attached to a process- Specified by:
getPageByNameAndProcessDefinitionIdin interfacePageService- Returns:
- Throws:
SBonitaReadException
-
getPageByProcessDefinitionId
public java.util.List<SPage> getPageByProcessDefinitionId(long processDefinitionId, int fromIndex, int numberOfResults) throws SBonitaReadException
Description copied from interface:PageServiceget a list of page attached to a process- Specified by:
getPageByProcessDefinitionIdin interfacePageService- Returns:
- Throws:
SBonitaReadException
-
readPageZip
public java.util.Properties readPageZip(byte[] content) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenExceptionDescription copied from interface:PageServiceRead the content of a page in a zip- Specified by:
readPageZipin interfacePageService- Parameters:
content- the page content- Returns:
- the properties of the page stored in the page.properties
- Throws:
SInvalidPageZipMissingIndexException- if the page is missing an index.html or Index.groovySInvalidPageZipMissingAPropertyException- if the page is missing mandatory field in the page.propertiesSInvalidPageZipInconsistentException- if the zip is not a valid zip file or unreadableSInvalidPageZipMissingPropertiesExceptionSInvalidPageTokenException
-
getPage
public SPage getPage(long pageId) throws SBonitaReadException, SObjectNotFoundException
- Specified by:
getPagein interfacePageService- Throws:
SBonitaReadExceptionSObjectNotFoundException
-
getPageByName
public SPage getPageByName(java.lang.String pageName) throws SBonitaReadException
- Specified by:
getPageByNamein interfacePageService- Throws:
SBonitaReadException
-
getNumberOfPages
public long getNumberOfPages(QueryOptions options) throws SBonitaReadException
- Specified by:
getNumberOfPagesin interfacePageService- Throws:
SBonitaReadException
-
searchPages
public java.util.List<SPage> searchPages(QueryOptions options) throws SBonitaReadException
- Specified by:
searchPagesin interfacePageService- Throws:
SBonitaReadException
-
deletePage
public void deletePage(long pageId) throws SObjectModificationException, SObjectNotFoundException- Specified by:
deletePagein interfacePageService- Throws:
SObjectModificationExceptionSObjectNotFoundException
-
getPageContent
public byte[] getPageContent(long pageId) throws SBonitaReadException, SObjectNotFoundException- Specified by:
getPageContentin interfacePageService- Throws:
SBonitaReadExceptionSObjectNotFoundException
-
updatePage
public SPage updatePage(long pageId, EntityUpdateDescriptor entityUpdateDescriptor) throws SObjectModificationException, SObjectAlreadyExistsException, SInvalidPageTokenException
- Specified by:
updatePagein interfacePageService- Throws:
SObjectModificationExceptionSObjectAlreadyExistsExceptionSInvalidPageTokenException
-
isSystemSession
protected boolean isSystemSession()
-
checkPageDuplicateForProcessDefinition
protected void checkPageDuplicateForProcessDefinition(AbstractSPage sPage, SPageLogBuilder logBuilder, long sPageProcessDefinitionId) throws SBonitaReadException, SObjectAlreadyExistsException
-
updatePageContent
public void updatePageContent(long pageId, byte[] content, java.lang.String contentName) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException- Specified by:
updatePageContentin interfacePageService- Throws:
SObjectModificationExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionSObjectAlreadyExistsException
-
updatePageContent
public void updatePageContent(long pageId, byte[] content, java.lang.String contentName, SPageUpdateBuilder pageUpdateBuilder) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException- Specified by:
updatePageContentin interfacePageService- Throws:
SObjectModificationExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionSObjectAlreadyExistsException
-
init
public void init() throws SBonitaExceptionDescription copied from interface:TenantLifecycleServiceThis method performs actions to initialize a TenantLifecycleService This method is called when creating a new tenant and when starting the platform.- Specified by:
initin interfaceTenantLifecycleService- Throws:
SBonitaException
-
initialized
public boolean initialized()
- Specified by:
initializedin interfacePageService- Returns:
- true if the service has been started again since it was last paused/stopped
-
setPageServiceListeners
@Autowired public void setPageServiceListeners(java.util.List<PageServiceListener> pageServiceListeners)
-
-