Interface ApplicationService
- All Superinterfaces:
com.appiancorp.services.ContextSensitiveService
,Service
public interface ApplicationService
extends com.appiancorp.services.ContextSensitiveService
Application service.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
Fields inherited from interface com.appiancorp.services.ContextSensitiveService
SET_SERVICE_CONTEXT_METHOD_NAME
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(Long appId, ApplicationAction action) Adds an Application Action with the given user friendly label, process model UUID, and description of the action.create
(Application application) Creates an application.void
Deletes the specified application.void
Deletes the specified applications.getApplication
(Long id) Retrieves an application given its id.getApplication
(String urlIdentifier) Retrieves an application given its URL identifier.getApplicationByUuid
(String uuid) Retrieves an application given its UUID.getApplicationsPaging
(int startIndex, int batchSize, Integer sortProperty, Integer sortOrder, boolean includeDrafts) Retrieves the applications defined on the system.getApplicationsWithRoleSetsPaging
(int startIndex, int batchSize, Integer sortProperty, Integer sortOrder, boolean includeDrafts) Retrieves the applications defined on the system with itsContentRoleSet
set to a non-null value.Retrieves an application given its id with itsContentRoleSet
set to a non-null value.Gets the default system application.getRoleMap
(Long id) Retrieves the security role map for the specified application.void
save
(Application application) Saves an application.save
(Application application, Set<Application.Section> section) Saves only the specified section of the application.void
Sets a default system application.void
setRoleMap
(Long id, ApplicationRoleMap rolemap) Sets the security role map definition for the specified application.void
updateAction
(Long appId, ApplicationAction updatedAction) Updates an existing Application Action with the given action that contains the new user friendly label, description of the action, and process model UUID.updateAssociatedObjects
(Long appId, com.appiancorp.ix.Type<?, ?, String> type, String[] add, String[] remove) Deprecated.<H extends com.appiancorp.ix.Haul<I,
U>, I, U>
ApplicationupdateAssociatedObjectsByType
(Long appId, com.appiancorp.ix.Type<H, I, U> type, U[] add, U[] remove) Associates or disassociates objects related to this application.Methods inherited from interface com.appiancorp.services.ContextSensitiveService
setServiceContext
-
Field Details
-
create$UPDATES
static final boolean create$UPDATES- See Also:
-
save$UPDATES
static final boolean save$UPDATES- See Also:
-
updateAssociatedObjects$UPDATES
static final boolean updateAssociatedObjects$UPDATES- See Also:
-
delete$UPDATES
static final boolean delete$UPDATES- See Also:
-
getApplication$UPDATES
static final boolean getApplication$UPDATES- See Also:
-
getApplicationWithRoleSet$UPDATES
static final boolean getApplicationWithRoleSet$UPDATES- See Also:
-
getApplicationsPaging$UPDATES
static final boolean getApplicationsPaging$UPDATES- See Also:
-
getApplicationsWithRoleSetsPaging$UPDATES
static final boolean getApplicationsWithRoleSetsPaging$UPDATES- See Also:
-
getRoleMap$UPDATES
static final boolean getRoleMap$UPDATES- See Also:
-
setRoleMap$UPDATES
static final boolean setRoleMap$UPDATES- See Also:
-
setDefaultApplication$UPDATES
static final boolean setDefaultApplication$UPDATES- See Also:
-
getDefaultApplication$UPDATES
static final boolean getDefaultApplication$UPDATES- See Also:
-
-
Method Details
-
create
Creates an application.- Parameters:
application
- The application object to be created.- Returns:
- The id of the created application.
- Throws:
InvalidApplicationException
- if the application is in an inconsistent state or if its identifier matches that of any of the existing applicationsPrivilegeException
- if the user does not have permission to perform this action.
-
save
void save(Application application) throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, UnavailableApplicationException, InvalidNavigationItemException, InvalidActionException Saves an application.- Parameters:
application
- The application to be updated.- Throws:
InvalidApplicationException
- If an invalid Application is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If the ID field of the Application object does not match an object in the DatabaseUnavailableApplicationException
- If the application couldn't be saved because it couldn't get the lock to it.InvalidNavigationItemException
- If the navigation item points to a page that is not already associated with the application.InvalidActionException
- If there is an action pointing to a process model that is not already associated with the application.
-
save
Application save(Application application, Set<Application.Section> section) throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, UnavailableApplicationException, InvalidNavigationItemException, InvalidActionException Saves only the specified section of the application. For example, if saving "metadata", this method won't modify the state of the bean related for associated objects nor navigation items.- Parameters:
application
- The application to be updated.section
- TheApplication.Section
(s) of the application to be updated.- Returns:
- application The updated object bean. Notice that this object might be different from the one provided as parameter because this method only updates a given section of the bean. Example, if updating navigation objects, after saving the object, the application metadata might be different if other user updated that section.
- Throws:
InvalidApplicationException
- If an invalid Application is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If the ID field of the Application object does not match an object in the DatabaseUnavailableApplicationException
- If the application couldn't be saved because it couldn't get the lock to it.InvalidNavigationItemException
- If there is a navigation item pointing to a page that is not already associated with the application.InvalidActionException
- If there is an action pointing to a process model that is not already associated with the application.
-
updateAssociatedObjects
@Deprecated Application updateAssociatedObjects(Long appId, com.appiancorp.ix.Type<?, ?, throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, InvalidOperationException, UnavailableApplicationExceptionString> type, String[] add, String[] remove) Deprecated.Associates or disassociates objects related to this application.- Parameters:
appId
- The application id to update.type
- The type of the objects to associate/disassociateadd
- The objects to associate with this application (can be null).remove
- The objects to dissasociate from this application (can be null).- Returns:
- application The updated object bean. Notice that this object might be different from the one provided as parameter because this method only updates a given section of the bean. Example, if updating navigation objects, after saving the object, the application metadata might be different if other user updated that section.
- Throws:
InvalidApplicationException
- If an invalid Application id is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
InvalidOperationException
UnavailableApplicationException
- If the application couldn't be saved because it couldn't get the lock to it.
-
updateAssociatedObjectsByType
<H extends com.appiancorp.ix.Haul<I,U>, Application updateAssociatedObjectsByTypeI, U> (Long appId, com.appiancorp.ix.Type<H, I, throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, InvalidOperationException, UnavailableApplicationExceptionU> type, U[] add, U[] remove) Associates or disassociates objects related to this application.- Parameters:
appId
- The application id to update.type
- The type of the objects to associate/disassociateadd
- The objects to associate with this application (can be null).remove
- The objects to dissasociate from this application (can be null).- Returns:
- application The updated object bean. Notice that this object might be different from the one provided as parameter because this method only updates a given section of the bean. Example, if updating navigation objects, after saving the object, the application metadata might be different if other user updated that section.
- Throws:
InvalidApplicationException
- If an invalid Application id is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
InvalidOperationException
UnavailableApplicationException
- If the application couldn't be saved because it couldn't get the lock to it.
-
addAction
void addAction(Long appId, ApplicationAction action) throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, UnavailableApplicationException, InvalidActionException Adds an Application Action with the given user friendly label, process model UUID, and description of the action.- Parameters:
appId
- The application id to update.action
- The action to add.- Throws:
InvalidApplicationException
- If an invalid Application id is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified ID.UnavailableApplicationException
- If the lock to the application cannot be obtained.InvalidActionException
- If the action points to a process model that is not already associated with the application.
-
updateAction
void updateAction(Long appId, ApplicationAction updatedAction) throws InvalidApplicationException, PrivilegeException, ApplicationNotFoundException, UnavailableApplicationException, InvalidActionException, ActionNotFoundException Updates an existing Application Action with the given action that contains the new user friendly label, description of the action, and process model UUID.- Parameters:
appId
- The application id to update.updatedAction
- The action with an updated user friendly label, description, and process model UUID.- Throws:
InvalidApplicationException
- If an invalid Application id is provided.PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified ID.UnavailableApplicationException
- If the lock to the application cannot be obtained.InvalidActionException
- If the action points to a process model that is not already associated with the application.ActionNotFoundException
- If the action to update does not exist.
-
delete
Deletes the specified application.- Parameters:
id
- The ID of the application to be deleted.- Throws:
PrivilegeException
- if the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified IDs.
-
delete
Deletes the specified applications.- Parameters:
id
- An array IDs corresponding to the applications to be deleted.- Throws:
PrivilegeException
- if the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with any of the specified IDs.
-
getApplication
Retrieves an application given its id.- Parameters:
id
- The id of the application to be retrieved.- Returns:
- The application bean whose id matches the given id.
- Throws:
PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified id.
-
getApplicationByUuid
Application getApplicationByUuid(String uuid) throws PrivilegeException, ApplicationNotFoundException Retrieves an application given its UUID.- Parameters:
uuid
- The UUID of the application to be retrieved.- Returns:
- The application bean whose uuid matches the given uuid.
- Throws:
PrivilegeException
- If the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified uuid.
-
getApplication
Application getApplication(String urlIdentifier) throws ApplicationNotFoundException, PrivilegeException Retrieves an application given its URL identifier.- Parameters:
urlIdentifier
- The URL identifier of the application to be retrieved.- Returns:
- The application bean whose id matches the given URL identifier.
- Throws:
ApplicationNotFoundException
- If there is no application associated with the specified URL identifier.PrivilegeException
- If the user does not have permission to perform this action.
-
getApplicationWithRoleSet
Application getApplicationWithRoleSet(Long id) throws PrivilegeException, ApplicationNotFoundException Retrieves an application given its id with itsContentRoleSet
set to a non-null value. TheContentRoleSet
represents the access permissions the current user has to this object. Use this method when you know in advance that you are going to use the user's access levels to the Application object. Usage example:app.getRoleSet().getCanAdministrate()
- Parameters:
id
- The id of the application to be retrieved.- Returns:
- The application bean whose id matches the given id.
- Throws:
PrivilegeException
- if the user does not have permission to perform this action.ApplicationNotFoundException
- If there is no application associated with the specified id.
-
getApplicationsPaging
ResultPage getApplicationsPaging(int startIndex, int batchSize, Integer sortProperty, Integer sortOrder, boolean includeDrafts) Retrieves the applications defined on the system.- Parameters:
startIndex
- the index of the collection of total results at which to start. Negative numbers are treated as zeros.batchSize
- the number of results to return. UseConstants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty
- The property by which the results will be sorted. This is one of theCOLUMN_XXX
constants inContentConstants
.sortOrder
- the order in which to sort the results.This is one ofConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
includeDrafts
- whether or not to include "DRAFT" applications with the results, otherwise, only "PUBLISHED" applications will be in the list. An application is in "published" mode when setting Application.setPublished(true)- Returns:
- a ResultPage containing the list of
Application
objects.
-
getApplicationsWithRoleSetsPaging
ResultPage getApplicationsWithRoleSetsPaging(int startIndex, int batchSize, Integer sortProperty, Integer sortOrder, boolean includeDrafts) Retrieves the applications defined on the system with itsContentRoleSet
set to a non-null value. TheContentRoleSet
represents the access permissions the current user has to this object. Use this method when you know in advance that you are going to* use the user's access levels to the Application object. Usage example:app.getRoleSet().getCanAdministrate()
- Parameters:
startIndex
- the index of the collection of total results at which to start. Negative numbers are treated as zeros.batchSize
- batchSize the number of results to return. UseConstants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty
- The property by which the results will be sorted. This is one of theCOLUMN_XXX
constants inContentConstants
.sortOrder
- sortOrder the order in which to sort the results.This is one ofConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
includeDrafts
- whether or not to include "DRAFT" applications with the results, otherwise, only "PUBLISHED" applications will be in the list. An application is in "published" mode when setting Application.setPublished(true)- Returns:
- a ResultPage containing the list of
Application
objects.
-
getRoleMap
Retrieves the security role map for the specified application.- Parameters:
id
- The application id.- Returns:
- ApplicationRoleMap
- Throws:
PrivilegeException
- if the user does not have permission to perform this actionApplicationNotFoundException
- If there is no application associated with the specified id.
-
setRoleMap
void setRoleMap(Long id, ApplicationRoleMap rolemap) throws ApplicationNotFoundException, InvalidUserException, PrivilegeException Sets the security role map definition for the specified application.- Parameters:
id
- The application id.rolemap
- The application role map.- Throws:
InvalidUserException
- if an invalid user or group is referencedPrivilegeException
- if the user does not have permission to perform this actionApplicationNotFoundException
- If there is no application associated with the specified id.
-
setDefaultApplication
Sets a default system application. This would be the first application that users see by default in the applications environment. Requires system administrator privileges and also assumes that the application exists.- Parameters:
id
- The application id.- Throws:
PrivilegeException
- If the user is not an admin.
-
getDefaultApplication
Long getDefaultApplication()Gets the default system application. If no default system application has been set, this will return null.- Returns:
- The id of the default application.
-
updateAssociatedObjectsByType(Long, Type, Object[], Object[])
instead