public interface ApplicationAPI
Application
).Application
Modifier and Type | Method and Description |
---|---|
Application |
createApplication(ApplicationCreator applicationCreator)
Creates a new
Application based on the supplied ApplicationCreator |
ApplicationMenu |
createApplicationMenu(ApplicationMenuCreator applicationMenuCreator)
Creates a
ApplicationMenu based on the supplied ApplicationMenuCreator . |
ApplicationPage |
createApplicationPage(long applicationId,
long pageId,
String token)
Creates an
ApplicationPage |
void |
deleteApplication(long applicationId)
Deletes an
Application by its identifier. |
void |
deleteApplicationMenu(long applicationMenuId)
Deletes an
ApplicationMenu by its identifier. |
void |
deleteApplicationPage(long applicationPageId)
Deletes an
ApplicationPage by its identifier. |
byte[] |
exportApplications(long... applicationIds)
Exports the
Application s which identifier is in
applicationIds |
List<String> |
getAllPagesForProfile(long profileId)
Return all pages names that can be accessed by the profile through applications.
|
List<String> |
getAllPagesForProfile(String profile)
Returns all pages names that can be accessed by the profile through applications.
|
Application |
getApplication(long applicationId)
Retrieves an
Application from its identifier. |
ApplicationPage |
getApplicationHomePage(long applicationId)
Retrieves the
ApplicationPage defined as the Application home page |
ApplicationMenu |
getApplicationMenu(long applicationMenuId)
Retrieves the
ApplicationMenu from its identifier |
ApplicationPage |
getApplicationPage(long applicationPageId)
Retrieves the
ApplicationPage from its identifier |
ApplicationPage |
getApplicationPage(String applicationToken,
String applicationPageToken)
|
List<ImportStatus> |
importApplications(byte[] xmlContent,
ApplicationImportPolicy policy)
Imports
Application s based on a XML file content. |
SearchResult<ApplicationMenu> |
searchApplicationMenus(SearchOptions searchOptions)
Searches for
ApplicationMenu s with specific search criteria. |
SearchResult<ApplicationPage> |
searchApplicationPages(SearchOptions searchOptions)
Searches for
ApplicationPage s with specific search criteria. |
SearchResult<Application> |
searchApplications(SearchOptions searchOptions)
Searches for
Application s with specific search criteria. |
void |
setApplicationHomePage(long applicationId,
long applicationPageId)
Defines which
ApplicationPage will represent the Application home page |
Application |
updateApplication(long applicationId,
ApplicationUpdater updater)
Updates an
Application based on the information supplied by the ApplicationUpdater |
ApplicationMenu |
updateApplicationMenu(long applicationMenuId,
ApplicationMenuUpdater updater)
Updates an
ApplicationMenu based on the information supplied
by the
ApplicationMenuUpdater . |
Application createApplication(ApplicationCreator applicationCreator) throws AlreadyExistsException, CreationException
Application
based on the supplied ApplicationCreator
applicationCreator
- creator describing characteristics of application to be createdApplication
AlreadyExistsException
- if an application already exists with the same nameCreationException
- if an error occurs during the creationApplication
,
ApplicationCreator
Application getApplication(long applicationId) throws ApplicationNotFoundException
Application
from its identifier.applicationId
- the application identifierApplication
from its identifier.ApplicationNotFoundException
- if no application is found for the given identifierApplication
void deleteApplication(long applicationId) throws DeletionException
Application
by its identifier. All related
ApplicationPage
s and
ApplicationMenu
s will be automatically deleted.applicationId
- the Application
identifierDeletionException
- if an error occurs during the deletionApplication
,
ApplicationPage
,
ApplicationMenu
Application updateApplication(long applicationId, ApplicationUpdater updater) throws ApplicationNotFoundException, UpdateException, AlreadyExistsException
Application
based on the information supplied by the ApplicationUpdater
applicationId
- a long representing the application identifierupdater
- an ApplicationUpdater
describing the fields to be updated.Application
as it is after the update.ApplicationNotFoundException
- if no Application
is found for the given idAlreadyExistsException
- if another Application
already exists with the new name valueUpdateException
- if an error occurs during the updateApplication
,
ApplicationUpdater
SearchResult<Application> searchApplications(SearchOptions searchOptions) throws SearchException
Application
s with specific search criteria. Use
ApplicationSearchDescriptor
to
know the available filters.searchOptions
- the search criteria. See SearchOptions
for details.SearchResult
containing the number and the list of applications matching the search criteria.SearchException
- if an error occurs during searchApplication
,
ApplicationSearchDescriptor
,
SearchOptions
,
SearchResult
ApplicationPage createApplicationPage(long applicationId, long pageId, String token) throws AlreadyExistsException, CreationException, ApplicationNotFoundException
ApplicationPage
applicationId
- the identifier of the Application
to
which the
Page
will be associatedpageId
- the identifier of Page
to be associated to the Application
token
- the token that this Page
will take in this ApplicationPage
. The token must
be unique for a given application and
should contain only alpha numeric characters and the following special characters '-', '.', '_' or '~'. In
addition, the following words are reserved
key words and cannot be used
as token: 'api', 'content', 'theme'.ApplicationPage
AlreadyExistsException
- if the token is already used by another ApplicationPage
on this
Application
CreationException
- if an error occurs during the creationApplicationNotFoundException
- if the referenced application does not exist.ApplicationPage
,
Application
,
Page
ApplicationPage getApplicationPage(String applicationToken, String applicationPageToken) throws ApplicationPageNotFoundException
applicationToken
- the Application
nameapplicationPageToken
- the ApplicationPage
tokenApplicationPage
for the given Application
token and ApplicationPage
tokenApplicationPageNotFoundException
- if no ApplicationPage
is found for the given
Application
token and
ApplicationPage
tokenApplicationPage
ApplicationPage getApplicationPage(long applicationPageId) throws ApplicationPageNotFoundException
ApplicationPage
from its identifierapplicationPageId
- the ApplicationPage
identifierApplicationPage
from its identifierApplicationPageNotFoundException
- if no ApplicationPage
is found for the given identifierApplicationPage
void deleteApplicationPage(long applicationPageId) throws DeletionException
ApplicationPage
by its identifier. All related
ApplicationMenu
will be
automatically deleted.applicationPageId
- the ApplicationPage
identifierDeletionException
- if an error occurs during the deletionApplicationPage
,
ApplicationMenu
SearchResult<ApplicationPage> searchApplicationPages(SearchOptions searchOptions) throws SearchException
ApplicationPage
s with specific search criteria.searchOptions
- the search criteria. See SearchOptions
for details. Use
ApplicationPageSearchDescriptor
to know the available
filters.SearchResult
containing the number and the list of
org.bonitasoft.engine.business.application.ApplicationPageSearchDescriptor
s
matching the search criteria.SearchException
- if an error occurs during the search executionApplicationPage
,
ApplicationPageSearchDescriptor
,
SearchOptions
,
SearchResult
void setApplicationHomePage(long applicationId, long applicationPageId) throws UpdateException, ApplicationNotFoundException
ApplicationPage
will represent the Application
home pageapplicationId
- the Application
identifierapplicationPageId
- the identifier of the ApplicationPage
to be used as home pageUpdateException
- if an error occurs during the updateApplicationNotFoundException
- if no Application
is found with the given idApplication
,
ApplicationPage
ApplicationPage getApplicationHomePage(long applicationId) throws ApplicationPageNotFoundException
ApplicationPage
defined as the Application
home pageapplicationId
- the Application
identifierApplicationPage
defined as Application
home pageApplicationPageNotFoundException
- if no home page is found for the given applicationApplication
,
ApplicationPage
ApplicationMenu createApplicationMenu(ApplicationMenuCreator applicationMenuCreator) throws CreationException
ApplicationMenu
based on the supplied ApplicationMenuCreator
. The new created
ApplicationMenu
will be ordered at the
last position of its level with an auto generated index.applicationMenuCreator
- creator describing the characteristics of the ApplicationMenu
to be createdApplicationMenu
CreationException
- if an error occurs during the creationApplicationMenu
,
ApplicationMenuCreator
ApplicationMenu updateApplicationMenu(long applicationMenuId, ApplicationMenuUpdater updater) throws ApplicationMenuNotFoundException, UpdateException
ApplicationMenu
based on the information supplied
by the
ApplicationMenuUpdater
.
When the ApplicationMenu
index is updated all other ApplicationMenu
s in the same level will have
indexes automatically updated in order
to keep indexes coherency. For instance, when an ApplicationMenu
is moved from index 4 to index 2, the
ApplicationMenu
previously at
index 2 will be moved to index 3 and the ApplicationMenu
previously at index 3 will be moved to index 4.
applicationMenuId
- the ApplicationMenu
identifierupdater
- the ApplicationMenuUpdater
describing the fields to be updated.ApplicationMenu
up to dateApplicationMenuNotFoundException
- if no ApplicationMenu
is found for the given identifierUpdateException
- if an exception occurs during the updateApplicationMenu
,
ApplicationMenuUpdater
ApplicationMenu getApplicationMenu(long applicationMenuId) throws ApplicationMenuNotFoundException
ApplicationMenu
from its identifierapplicationMenuId
- the ApplicationMenu
menu identifierApplicationMenu
from its identifierApplicationMenuNotFoundException
- if no ApplicationMenu
is found for the given identifierApplicationMenu
void deleteApplicationMenu(long applicationMenuId) throws DeletionException
ApplicationMenu
by its identifier. All children ApplicationMenu
will be automatically
deleted.
When an ApplicationMenu
is deleted all others ApplicationMenu
s having index greater than the
index of deleted ApplicationMenu
in
the same level will be automatically updated in order to keep indexes coherency.
applicationMenuId
- the ApplicationMenu
identifierDeletionException
- if an error occurs during the deletionApplicationMenu
SearchResult<ApplicationMenu> searchApplicationMenus(SearchOptions searchOptions) throws SearchException
ApplicationMenu
s with specific search criteria.searchOptions
- the search criteria. See SearchOptions
for details. Use
ApplicationMenuSearchDescriptor
to know the available
filtersSearchResult
containing the number and the list of ApplicationMenu
s matching the search
criteria.SearchException
- if an error occurs during searchApplicationMenu
,
SearchOptions
,
ApplicationMenuSearchDescriptor
,
SearchResult
List<String> getAllPagesForProfile(long profileId)
profileId
- the id of the profileList<String> getAllPagesForProfile(String profile)
profile
- the name of the profilebyte[] exportApplications(long... applicationIds) throws ExportException
Application
s which identifier is in
applicationIds
applicationIds
- the identifiers of Application
s to be exportedApplication
sExportException
- if an exception occurs during the export.Application
List<ImportStatus> importApplications(byte[] xmlContent, ApplicationImportPolicy policy) throws ImportException, AlreadyExistsException
Application
s based on a XML file content.
Before importing Application
s ensure that all Profile
s referenced
by Application
s and all
Page
s referenced by
ApplicationPage
s are available.
Profile
does not exist the Application
will be imported, but no Profile
will
be associated to it. An
ImportError
will be added to the ImportStatus
related to this Application
.
Page
does not exist the related ApplicationPage
and
ApplicationMenu
s
pointing to this ApplicationPage
will not be created. An ImportError
will be added to the
ImportStatus
related to the
Application
containing this ApplicationPage
.xmlContent
- a byte array representing the content of XML file containing the applications to be imported.policy
- the ApplicationImportPolicy
used to execute the
importList
of ImportStatus
representing the
ImportStatus
for each imported
Application
ImportException
- if an error occurs during the importAlreadyExistsException
- if one of applications being imported already
exists and the policy
ApplicationImportPolicy.FAIL_ON_DUPLICATES
is usedApplication
,
ApplicationImportPolicy
,
ImportStatus
,
ImportError
,
ApplicationPage
,
ApplicationMenu
,
Profile
,
Page
Copyright © 2020 Bonitasoft S.A. All rights reserved.