Package org.bonitasoft.engine.page.impl
Class PageServiceImpl
java.lang.Object
org.bonitasoft.engine.page.impl.PageServiceImpl
- All Implemented Interfaces:
PageService
- Author:
- Baptiste Mesta, Matthieu Chaffotte
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.bonitasoft.engine.page.PageService
PAGE, PROPERTIES_CONTENT_TYPE, PROPERTIES_DESCRIPTION, PROPERTIES_DISPLAY_NAME, PROPERTIES_FILE_NAME, PROPERTIES_NAME -
Constructor Summary
ConstructorsConstructorDescriptionPageServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService, PermissionService permissionService) -
Method Summary
Modifier and TypeMethodDescriptionadd a page using the zip in parameters, it get all informations from the page.properties file contain inside the zipadd a page using the zip in parameters and the given propertiesbuildPage(byte[] content, String contentName, long userId, boolean provided, boolean removable, boolean editable) protected voidcheckPageDuplicateForProcessDefinition(AbstractSPage sPage, SPageLogBuilder logBuilder, long sPageProcessDefinitionId) voiddeletePage(long pageId) longgetNumberOfPages(QueryOptions options) getPage(long pageId) getPageByName(String pageName) getPageByNameAndProcessDefinitionId(String name, long processDefinitionId) get a page attached to a processgetPageByProcessDefinitionId(long processDefinitionId, int fromIndex, int numberOfResults) get a list of page attached to a processbyte[]getPageContent(long pageId) insertPage(SPage page, byte[] content) protected booleanreadPageZip(byte[] content) Read the content of a page in a zipsearchPages(QueryOptions options) voidsetPageServiceListeners(List<PageServiceListener> pageServiceListeners) updatePage(long pageId, EntityUpdateDescriptor entityUpdateDescriptor) voidupdatePageContent(long pageId, byte[] content, String contentName) voidupdatePageContent(long pageId, byte[] content, String contentName, SPageUpdateBuilder pageUpdateBuilder)
-
Field Details
-
PAGE_TOKEN_PREFIX
- See Also:
-
INDEX_GROOVY
- See Also:
-
INDEX_HTML
- See Also:
-
RESOURCES_INDEX_HTML
- See Also:
-
-
Constructor Details
-
PageServiceImpl
public PageServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService, PermissionService permissionService)
-
-
Method Details
-
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, 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(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 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
-
buildPage
public SPage buildPage(byte[] content, String contentName, long userId, boolean provided, boolean removable, boolean editable) throws SInvalidPageZipException, SInvalidPageTokenException - Specified by:
buildPagein interfacePageService- Throws:
SInvalidPageZipExceptionSInvalidPageTokenException
-
readPageZip
public Properties readPageZip(byte[] content) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException Description 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
-
insertPage
public SPage insertPage(SPage page, byte[] content) throws SObjectAlreadyExistsException, SObjectCreationException - Specified by:
insertPagein interfacePageService- Throws:
SObjectAlreadyExistsExceptionSObjectCreationException
-
checkIfPageAlreadyExists
- Specified by:
checkIfPageAlreadyExistsin interfacePageService- Throws:
SBonitaReadException
-
getPage
- Specified by:
getPagein interfacePageService- Throws:
SBonitaReadExceptionSObjectNotFoundException
-
getPageByName
- Specified by:
getPageByNamein interfacePageService- Throws:
SBonitaReadException
-
getNumberOfPages
- Specified by:
getNumberOfPagesin interfacePageService- Throws:
SBonitaReadException
-
searchPages
- Specified by:
searchPagesin interfacePageService- Throws:
SBonitaReadException
-
deletePage
- Specified by:
deletePagein interfacePageService- Throws:
SObjectModificationExceptionSObjectNotFoundException
-
getPageContent
- 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, String contentName) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException - Specified by:
updatePageContentin interfacePageService- Throws:
SObjectModificationExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionSObjectAlreadyExistsException
-
updatePageContent
public void updatePageContent(long pageId, byte[] content, String contentName, SPageUpdateBuilder pageUpdateBuilder) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException - Specified by:
updatePageContentin interfacePageService- Throws:
SObjectModificationExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionSObjectAlreadyExistsException
-
setPageServiceListeners
-