public class PageServiceImpl extends java.lang.Object implements PageService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INDEX_GROOVY |
static java.lang.String |
INDEX_HTML |
static java.lang.String |
PAGE_TOKEN_PREFIX |
static java.lang.String |
RESOURCES_INDEX_HTML |
PAGE, PROPERTIES_CONTENT_TYPE, PROPERTIES_DESCRIPTION, PROPERTIES_DISPLAY_NAME, PROPERTIES_FILE_NAME, PROPERTIES_NAME| Constructor and Description |
|---|
PageServiceImpl(ReadPersistenceService persistenceService,
Recorder recorder,
TechnicalLoggerService logger,
QueriableLoggerService queriableLoggerService,
ProfileService profileService) |
| Modifier and Type | Method and Description |
|---|---|
SPage |
addPage(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 zip
|
SPage |
addPage(SPage page,
byte[] content)
add a page using the zip in parameters and the given properties
|
protected void |
checkPageDuplicate(SPage sPage,
EntityUpdateDescriptor entityUpdateDescriptor,
SPageLogBuilder logBuilder,
java.lang.String logMethodName) |
protected void |
createPage(ImportPageDescriptor pageDescriptor,
byte[] providedPageContent,
java.util.Properties pageProperties) |
void |
deletePage(long pageId) |
long |
getNumberOfPages(QueryOptions options) |
SPage |
getPage(long pageId) |
SPage |
getPageByName(java.lang.String pageName) |
SPage |
getPageByNameAndProcessDefinitionId(java.lang.String name,
long processDefinitionId)
get a page attached to a process
|
java.util.List<SPage> |
getPageByProcessDefinitionId(long processDefinitionId,
int fromIndex,
int numberOfResults)
get a list of page attached to a process
|
byte[] |
getPageContent(long pageId) |
java.util.List<PageServiceListener> |
getPageServiceListeners() |
java.util.List<ImportPageDescriptor> |
getProvidedPages() |
void |
pause()
Temporary halt the execution of this service.
|
java.util.Properties |
readPageZip(byte[] content)
Read the content of a page in a zip
|
void |
resume()
resume the execution the service
|
java.util.List<SPage> |
searchPages(QueryOptions options) |
void |
setPageServiceListeners(java.util.List<PageServiceListener> pageServiceListeners) |
void |
setProvidedPages(java.util.List<ImportPageDescriptor> providedPages) |
void |
start()
Start the service
|
void |
stop() |
SPage |
updatePage(long pageId,
EntityUpdateDescriptor entityUpdateDescriptor) |
void |
updatePageContent(long pageId,
byte[] content,
java.lang.String contentName) |
protected void |
updatePageNameInProfileEntry(EntityUpdateDescriptor entityUpdateDescriptor,
java.lang.String oldPageName) |
public static final java.lang.String PAGE_TOKEN_PREFIX
public static final java.lang.String INDEX_GROOVY
public static final java.lang.String INDEX_HTML
public static final java.lang.String RESOURCES_INDEX_HTML
public PageServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, TechnicalLoggerService logger, QueriableLoggerService queriableLoggerService, ProfileService profileService)
public SPage addPage(SPage page, byte[] content) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException
PageServiceaddPage in interface PageServiceSObjectCreationExceptionSObjectAlreadyExistsExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionpublic SPage addPage(byte[] content, java.lang.String contentName, long userId) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException
PageServiceaddPage in interface PageServiceSObjectCreationExceptionSObjectAlreadyExistsExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionpublic SPage getPageByNameAndProcessDefinitionId(java.lang.String name, long processDefinitionId) throws SBonitaReadException
PageServicegetPageByNameAndProcessDefinitionId in interface PageServiceSBonitaReadExceptionpublic java.util.List<SPage> getPageByProcessDefinitionId(long processDefinitionId, int fromIndex, int numberOfResults) throws SBonitaReadException
PageServicegetPageByProcessDefinitionId in interface PageServiceSBonitaReadExceptionpublic java.util.Properties readPageZip(byte[] content)
throws SInvalidPageZipMissingIndexException,
SInvalidPageZipMissingAPropertyException,
SInvalidPageZipInconsistentException,
SInvalidPageZipMissingPropertiesException,
SInvalidPageTokenException
PageServicereadPageZip in interface PageServicecontent - the page contentSInvalidPageZipMissingIndexException - 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 unreadableSInvalidPageZipMissingPropertiesExceptionSInvalidPageTokenExceptionpublic SPage getPage(long pageId) throws SBonitaReadException, SObjectNotFoundException
getPage in interface PageServiceSBonitaReadExceptionSObjectNotFoundExceptionpublic SPage getPageByName(java.lang.String pageName) throws SBonitaReadException
getPageByName in interface PageServiceSBonitaReadExceptionpublic long getNumberOfPages(QueryOptions options) throws SBonitaReadException
getNumberOfPages in interface PageServiceSBonitaReadExceptionpublic java.util.List<SPage> searchPages(QueryOptions options) throws SBonitaReadException
searchPages in interface PageServiceSBonitaReadExceptionpublic void deletePage(long pageId)
throws SObjectModificationException,
SObjectNotFoundException
deletePage in interface PageServiceSObjectModificationExceptionSObjectNotFoundExceptionpublic byte[] getPageContent(long pageId)
throws SBonitaReadException,
SObjectNotFoundException
getPageContent in interface PageServiceSBonitaReadExceptionSObjectNotFoundExceptionpublic SPage updatePage(long pageId, EntityUpdateDescriptor entityUpdateDescriptor) throws SObjectModificationException, SObjectAlreadyExistsException, SInvalidPageTokenException
updatePage in interface PageServiceSObjectModificationExceptionSObjectAlreadyExistsExceptionSInvalidPageTokenExceptionprotected void updatePageNameInProfileEntry(EntityUpdateDescriptor entityUpdateDescriptor, java.lang.String oldPageName) throws SInvalidPageTokenException, SBonitaReadException, SProfileEntryUpdateException
protected void checkPageDuplicate(SPage sPage, EntityUpdateDescriptor entityUpdateDescriptor, SPageLogBuilder logBuilder, java.lang.String logMethodName) throws SBonitaReadException, SObjectAlreadyExistsException
public void updatePageContent(long pageId,
byte[] content,
java.lang.String contentName)
throws SObjectModificationException,
SInvalidPageZipException,
SInvalidPageTokenException,
SObjectAlreadyExistsException
updatePageContent in interface PageServiceSObjectModificationExceptionSInvalidPageZipExceptionSInvalidPageTokenExceptionSObjectAlreadyExistsExceptionpublic void start()
throws SBonitaException
LifecycleServicestart in interface LifecycleServicestart in interface PageServiceSBonitaExceptionprotected void createPage(ImportPageDescriptor pageDescriptor, byte[] providedPageContent, java.util.Properties pageProperties) throws SObjectAlreadyExistsException, SObjectCreationException
public void stop()
stop in interface LifecycleServicepublic void pause()
LifecycleServicepause in interface LifecycleServicepublic void resume()
LifecycleServiceresume in interface LifecycleServicepublic java.util.List<PageServiceListener> getPageServiceListeners()
public void setPageServiceListeners(java.util.List<PageServiceListener> pageServiceListeners)
public java.util.List<ImportPageDescriptor> getProvidedPages()
public void setProvidedPages(java.util.List<ImportPageDescriptor> providedPages)