public class ApplicationCenterService extends Object implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
static String |
ANY_PERMISSION |
static String |
DEFAULT_ADMINISTRATORS_GROUP |
static String |
DEFAULT_ADMINISTRATORS_PERMISSION |
static String |
DEFAULT_APP_IMAGE_BODY |
static String |
DEFAULT_APP_IMAGE_ID |
static String |
DEFAULT_APP_IMAGE_NAME |
static int |
DEFAULT_LIMIT |
static String |
DEFAULT_USERS_GROUP |
static String |
DEFAULT_USERS_PERMISSION |
static String |
LOG_ADD_FAVORITE |
static String |
LOG_CLICK_ALL_APPLICATIONS |
static String |
LOG_OPEN_APPLICATION |
static String |
LOG_OPEN_FAVORITE_DRAWER |
static String |
LOG_REMOVE_FAVORITE |
static String |
LOG_REORGANIZE_FAVORITES |
static String |
LOG_SERVICE_NAME |
static String |
MAX_FAVORITE_APPS |
| Constructor and Description |
|---|
ApplicationCenterService(org.exoplatform.container.configuration.ConfigurationManager configurationManager,
ApplicationCenterStorage appCenterStorage,
org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
org.exoplatform.services.security.Authenticator authenticator,
org.exoplatform.container.PortalContainer container,
org.exoplatform.container.xml.InitParams params) |
| Modifier and Type | Method and Description |
|---|---|
void |
addApplicationPlugin(ApplicationPlugin applicationPlugin)
Inject a default application using IOC
ComponentPlugin using
configuration |
void |
addFavoriteApplication(long applicationId,
String username)
Add an application, identified by its technical id, as favorite of a user
|
Application |
createApplication(Application application)
Create new Application that will be available for all users.
|
void |
deleteApplication(Long applicationId,
String username)
Delete application identified by its id and check if username has permission
to delete it.
|
void |
deleteFavoriteApplication(Long applicationId,
String username)
Deletes an application identified by its id from favorite applications of
user
|
Application |
findApplication(long applicationId)
Get an application by id
|
GeneralSettings |
getAppGeneralSettings() |
InputStream |
getApplicationImageInputStream(long applicationId,
String username)
Return the
Application illustration InputStream, if not
found, the default image InputStream will be retrieved |
Long |
getApplicationImageLastUpdated(long applicationId,
String username)
Return the
Application illustration last modifed timestamp (in ms),
if not found, the default image last modifed timestamp will be retrieved |
ApplicationList |
getApplicationsList(int offset,
int limit,
String keyword)
Retrieves the list of applications with offset, limit and a keyword that can
be empty
|
ApplicationList |
getAuthorizedApplicationsList(int offset,
int limit,
String keyword,
String username)
Retrieves the list of applications switch offset and limit of the query, a
keyword to filter on title and url of
Application and the username to
filter on authorized applications |
ApplicationList |
getMandatoryAndFavoriteApplicationsList(String username)
Retrieves all the list of applications for a user
|
long |
getMaxFavoriteApps() |
boolean |
isDefaultSystemApplication(Application application)
Checks whether the application is a system application injected by
configuration or not
|
void |
removeApplicationPlugin(String pluginName)
Delete an injected plugin identified by its name
|
ApplicationImage |
setDefaultAppImage(ApplicationImage defaultAppImage)
Stores default image for applications not having an attached illustration
|
void |
setMaxFavoriteApps(long maxFavoriteApplications)
Change general setting for maximum allowed favorites that a user can have
|
void |
start()
A method that will be invoked when the server starts (
PortalContainer starts ) to inject default application and to delete
injected default applications |
void |
stop() |
Application |
updateApplication(Application application,
String username)
Update an existing application on datasource.
|
void |
updateFavoriteApplicationOrder(ApplicationOrder applicationOrder,
String userName)
Update favorite applications order for a user
|
public static final String DEFAULT_ADMINISTRATORS_GROUP
public static final String DEFAULT_ADMINISTRATORS_PERMISSION
public static final String ANY_PERMISSION
public static final String DEFAULT_USERS_GROUP
public static final String DEFAULT_USERS_PERMISSION
public static final String MAX_FAVORITE_APPS
public static final String DEFAULT_APP_IMAGE_ID
public static final String DEFAULT_APP_IMAGE_NAME
public static final String DEFAULT_APP_IMAGE_BODY
public static final int DEFAULT_LIMIT
public static String LOG_SERVICE_NAME
public static String LOG_OPEN_FAVORITE_DRAWER
public static String LOG_CLICK_ALL_APPLICATIONS
public static final String LOG_OPEN_APPLICATION
public static final String LOG_REORGANIZE_FAVORITES
public static final String LOG_ADD_FAVORITE
public static final String LOG_REMOVE_FAVORITE
public ApplicationCenterService(org.exoplatform.container.configuration.ConfigurationManager configurationManager,
ApplicationCenterStorage appCenterStorage,
org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
org.exoplatform.services.security.Authenticator authenticator,
org.exoplatform.container.PortalContainer container,
org.exoplatform.container.xml.InitParams params)
public void start()
PortalContainer starts ) to inject default application and to delete
injected default applicationsstart in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic Application createApplication(Application application) throws Exception
ApplicationAlreadyExistsException will
be thrown.application - application to createApplication in datasourceException - when application already exists or an error occurs while
creating application or its attached imagepublic Application findApplication(long applicationId) throws Exception
applicationId - application to findApplication in datasourceException - when ApplicationNotFoundException is thrown or an
error occurs while saving applicationpublic Application updateApplication(Application application, String username) throws Exception
ApplicationNotFoundException will be thrown.application - dto to update on storeusername - username storing applicationApplication in datasourceException - when ApplicationNotFoundException is thrown or an
error occurs while saving applicationpublic void deleteApplication(Long applicationId, String username) throws ApplicationNotFoundException, IllegalAccessException, org.exoplatform.commons.file.services.FileStorageException
applicationId - technical identifier of applicationusername - user currently deleting applicationApplicationNotFoundException - if application wasn't foundIllegalAccessException - if user is not allowed to delete applicationorg.exoplatform.commons.file.services.FileStorageExceptionpublic void addFavoriteApplication(long applicationId,
String username)
throws ApplicationNotFoundException,
IllegalAccessException,
org.exoplatform.commons.file.services.FileStorageException
applicationId - technical application idusername - user loginApplicationNotFoundException - when application is not foundIllegalAccessException - if user hasn't access permission to the
applicationorg.exoplatform.commons.file.services.FileStorageExceptionpublic void deleteFavoriteApplication(Long applicationId, String username)
applicationId - application technical identifierusername - login of user currently deleting applicationpublic void setMaxFavoriteApps(long maxFavoriteApplications)
maxFavoriteApplications - max favorite applications countpublic long getMaxFavoriteApps()
public ApplicationImage setDefaultAppImage(ApplicationImage defaultAppImage) throws Exception
defaultAppImage - image content and nameException - if an exception occurs while storing image into databasepublic GeneralSettings getAppGeneralSettings() throws Exception
GeneralSettings of application including default image and
maximum favorite applications countException - if an exception occurs while retrieving image data from
storepublic ApplicationList getApplicationsList(int offset, int limit, String keyword) throws org.exoplatform.commons.file.services.FileStorageException
offset - offset of the querylimit - limit of the query that can be less or equal to 0, which mean,
getting all available applicationskeyword - used to search in title and urlApplicationList that contains the list of applicationsorg.exoplatform.commons.file.services.FileStorageExceptionpublic ApplicationList getAuthorizedApplicationsList(int offset, int limit, String keyword, String username) throws org.exoplatform.commons.file.services.FileStorageException
Application and the username to
filter on authorized applicationsoffset - offset of the querylimit - limit of the query that can be less or equal to 0, which mean,
getting all available applicationskeyword - used to search in title and urlusername - login of user to use to filter on authorized applicationsApplicationList that contains the List of authorized
UserApplicationorg.exoplatform.commons.file.services.FileStorageExceptionpublic ApplicationList getMandatoryAndFavoriteApplicationsList(String username)
username - login of userApplicationList that contains List of
UserApplicationpublic void updateFavoriteApplicationOrder(ApplicationOrder applicationOrder, String userName) throws ApplicationNotFoundException, org.exoplatform.commons.file.services.FileStorageException
applicationOrder - userName - ApplicationNotFoundExceptionorg.exoplatform.commons.file.services.FileStorageExceptionpublic Long getApplicationImageLastUpdated(long applicationId, String username) throws ApplicationNotFoundException, IllegalAccessException, org.exoplatform.commons.file.services.FileStorageException
Application illustration last modifed timestamp (in ms),
if not found, the default image last modifed timestamp will be retrievedapplicationId - technical id of applicationusername - login of user accessing applicationApplicationNotFoundException - if application wasn't foundIllegalAccessException - if user doesn't have access permission to
applicationorg.exoplatform.commons.file.services.FileStorageException - if an error occurs while accessing file from
storepublic InputStream getApplicationImageInputStream(long applicationId, String username) throws ApplicationNotFoundException, IllegalAccessException, org.exoplatform.commons.file.services.FileStorageException, IOException
Application illustration InputStream, if not
found, the default image InputStream will be retrievedapplicationId - technical id of applicationusername - login of user accessing applicationInputStream of application illustrationApplicationNotFoundException - if application wasn't foundIllegalAccessException - if user doesn't have access permission to
applicationorg.exoplatform.commons.file.services.FileStorageException - if an error occurs while accessing file from
storeIOException - if an error occurs while building InputStreampublic void addApplicationPlugin(ApplicationPlugin applicationPlugin)
ComponentPlugin using
configurationapplicationPlugin - plugin containing application to injectpublic void removeApplicationPlugin(String pluginName)
pluginName - plugin name to deletepublic boolean isDefaultSystemApplication(Application application)
application - application to check its stateCopyright © 2003–2020 eXo Platform SAS. All rights reserved.