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
PageService
addPage
in interface PageService
SObjectCreationException
SObjectAlreadyExistsException
SInvalidPageZipException
SInvalidPageTokenException
public SPage addPage(byte[] content, java.lang.String contentName, long userId) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException
PageService
addPage
in interface PageService
SObjectCreationException
SObjectAlreadyExistsException
SInvalidPageZipException
SInvalidPageTokenException
public SPage getPageByNameAndProcessDefinitionId(java.lang.String name, long processDefinitionId) throws SBonitaReadException
PageService
getPageByNameAndProcessDefinitionId
in interface PageService
SBonitaReadException
public java.util.List<SPage> getPageByProcessDefinitionId(long processDefinitionId, int fromIndex, int numberOfResults) throws SBonitaReadException
PageService
getPageByProcessDefinitionId
in interface PageService
SBonitaReadException
public java.util.Properties readPageZip(byte[] content) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException
PageService
readPageZip
in interface PageService
content
- 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 unreadableSInvalidPageZipMissingPropertiesException
SInvalidPageTokenException
public SPage getPage(long pageId) throws SBonitaReadException, SObjectNotFoundException
getPage
in interface PageService
SBonitaReadException
SObjectNotFoundException
public SPage getPageByName(java.lang.String pageName) throws SBonitaReadException
getPageByName
in interface PageService
SBonitaReadException
public long getNumberOfPages(QueryOptions options) throws SBonitaReadException
getNumberOfPages
in interface PageService
SBonitaReadException
public java.util.List<SPage> searchPages(QueryOptions options) throws SBonitaReadException
searchPages
in interface PageService
SBonitaReadException
public void deletePage(long pageId) throws SObjectModificationException, SObjectNotFoundException
deletePage
in interface PageService
SObjectModificationException
SObjectNotFoundException
public byte[] getPageContent(long pageId) throws SBonitaReadException, SObjectNotFoundException
getPageContent
in interface PageService
SBonitaReadException
SObjectNotFoundException
public SPage updatePage(long pageId, EntityUpdateDescriptor entityUpdateDescriptor) throws SObjectModificationException, SObjectAlreadyExistsException, SInvalidPageTokenException
updatePage
in interface PageService
SObjectModificationException
SObjectAlreadyExistsException
SInvalidPageTokenException
protected 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 PageService
SObjectModificationException
SInvalidPageZipException
SInvalidPageTokenException
SObjectAlreadyExistsException
public void start() throws SBonitaException
LifecycleService
start
in interface LifecycleService
start
in interface PageService
SBonitaException
protected void createPage(ImportPageDescriptor pageDescriptor, byte[] providedPageContent, java.util.Properties pageProperties) throws SObjectAlreadyExistsException, SObjectCreationException
public void stop()
stop
in interface LifecycleService
public void pause()
LifecycleService
pause
in interface LifecycleService
public void resume()
LifecycleService
resume
in interface LifecycleService
public 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)