public final class ApplicationManager extends java.lang.Object implements JPropertiesListener
Modifier and Type | Class and Description |
---|---|
class |
ApplicationManager.InstalledApplications
A POJO class representing installed applications with utility methods
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACL_CAN_USE_APPLICATION_LAUNCHER |
static java.lang.String |
ACL_CAN_USE_APPLICATION_LAUNCHER_CATALOG_ADMINISTRATION |
static java.lang.String |
ADMIN_ALERT_DOMAIN |
static java.lang.String |
ALERT_DOMAIN |
static java.lang.String |
DEPLOY_ALERT_NAME |
static java.lang.String |
INSTALL_RECOMPUTE_ALARM |
static java.lang.String |
INSTALL_RECOMPUTE_DEFAULT_SCHEDULE |
static java.lang.String |
INSTALL_RECOMPUTE_SCHEDULE_PROP |
protected static java.lang.Thread |
lastAddApplicationThread |
static java.lang.String |
MBR_PREF |
static java.lang.String |
SHORTCUT_TYPE_CATEGORY_VID |
REVISION
Modifier and Type | Method and Description |
---|---|
ControllerStatus |
addApplication(Member mbr,
java.util.Collection<Group> groups,
java.util.Collection<Member> members,
java.lang.String tabName,
generated.Shortcut application)
Returns a controller status as a result of the action that will :
- Launch a new thread to retrieve all members from provided groups
- Install the app in a new thread for each member
- Create a tab if there's no matching tab in case tab name has been provided
- Will send an alert telling the user an app has been installed
- At the end of all threads, the author of the action will receive an alert
|
boolean |
addApplication(Member mbr,
int tabIndex,
java.lang.String shortcutId)
Deprecated.
use
addApplication(Member, String, Shortcut, boolean, boolean) since it returns a ControllerStatus |
ControllerStatus |
addApplication(Member mbr,
java.lang.String tabName,
generated.Shortcut application,
boolean checkAlreadyInstalled,
boolean sendAlert)
Returns a ControllerStatus as a result of the action which adds the given
application to the member's shortcut in given tab
|
boolean |
canAdministrateApplications(Member mbr) |
boolean |
canRecomputeInstallCountCache(Member mbr) |
boolean |
canUseApplicationLauncher(Member mbr)
Returns true if the given member can use the Application launcher.
|
boolean |
canUseApplicationLauncherCatalogAdministration(Member mbr)
Returns true if the given member can use the Application launcher catalog administration.
|
ApplicationManager.InstalledApplications |
getAlreadyInstalledTabsMap(Member mbr) |
ApplicationLauncher |
getApplicationLauncher(Member mbr)
Returns the application launcher for given member by searching for his saved launcher, or by searching
in its department default launcher, or the global default launcher
|
java.lang.String |
getApplicationLauncherAsJson(ApplicationLauncher launcher)
Transforms an application launcher into json
|
java.lang.String |
getApplicationLauncherAsJson(Member mbr) |
int |
getAverageInstallCount() |
java.lang.String |
getCleanedApplicationLauncherAsJson(ApplicationLauncher launcher)
Transforms an application launcher into json to save in the database
|
ApplicationLauncher |
getDefaultApplicationLauncher() |
ApplicationLauncher |
getDefaultApplicationLauncher(Group department) |
java.lang.String |
getDefaultApplicationLauncherAsJson() |
Group |
getDefaultApplicationLauncherGroup(Group department) |
java.util.Set<java.lang.String> |
getDepartmentShortcutIds(Group department) |
ApplicationLauncher |
getEmptyApplicationLauncher() |
int |
getInstallCount(Application application) |
java.util.List<Application> |
getInstalledApplications(Member mbr) |
int |
getInstallOrganizationGroupCount(Application application,
Member mbr) |
static ApplicationManager |
getInstance() |
ApplicationLauncherTab |
getOrAddTab(Member mbr,
ApplicationLauncher applicationLauncher,
java.lang.String tabName)
Returns a tab by either finding it in the given launcher by its name, or by creating a new one if not found
|
ApplicationLauncherTab |
getTabByName(ApplicationLauncher applicationLauncher,
java.lang.String tabName)
Returns a tab by searching by its name in given application launcher
|
java.util.List<ApplicationLauncherTab> |
getTabs(Member mbr) |
int |
getTotalInstallCount() |
Category |
getTypeRoot() |
boolean |
hasDefaultApplicationLauncher(Group department)
Returns true if given department has a default launcher
|
boolean |
isApplicationAlreadyInTab(Member mbr,
int tabIndex,
java.lang.String shortcutId)
Checks if application is already installed in given tab index
|
boolean |
isApplicationInstalled(AbstractShortcut shortcut,
Member mbr) |
boolean |
isDepartmentEnabled() |
boolean |
isDeployApplicationToLauncherRunning() |
boolean |
isInstallCountInitialized() |
boolean |
isResetApplicationLauncherRunning() |
void |
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.
|
void |
recomputeInstallCountCache()
Recomputes the install count cache asynchronously
|
boolean |
removeApplication(Member mbr,
int tabIndex,
java.lang.String shortcutId)
Removes an application (shortcutId) in given tab for given member
|
boolean |
removeApplicationOnAllTabs(Member mbr,
java.lang.String shortcutId)
Remove an application (shortcutId) on all member tabs
|
void |
resetApplicationLauncher(java.util.Collection<Member> members,
java.util.Collection<Group> groups)
Deletes saved launcher for given member and groups
|
void |
resetDefaultApplicationLauncher(Group department) |
boolean |
saveDefaultApplicationLauncher(Group department,
java.lang.String data)
Saves json data as default json launcher for the given department
|
static void |
waitForAddingAllApplications()
A convenient method for unit test to wait for the ending of the add application thread.
|
public static final java.lang.String SHORTCUT_TYPE_CATEGORY_VID
public static final java.lang.String MBR_PREF
public static final java.lang.String INSTALL_RECOMPUTE_SCHEDULE_PROP
public static final java.lang.String INSTALL_RECOMPUTE_DEFAULT_SCHEDULE
public static final java.lang.String INSTALL_RECOMPUTE_ALARM
public static final java.lang.String DEPLOY_ALERT_NAME
public static final java.lang.String ALERT_DOMAIN
public static final java.lang.String ADMIN_ALERT_DOMAIN
public static final java.lang.String ACL_CAN_USE_APPLICATION_LAUNCHER
public static final java.lang.String ACL_CAN_USE_APPLICATION_LAUNCHER_CATALOG_ADMINISTRATION
protected static java.lang.Thread lastAddApplicationThread
public static ApplicationManager getInstance()
public void propertiesChange(JProperties properties)
JPropertiesListener
You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using channel.getProperties
or
channel.getProperty
.
propertiesChange
in interface JPropertiesListener
properties
- the properties which have been submitted to changepublic boolean isResetApplicationLauncherRunning()
public boolean isDeployApplicationToLauncherRunning()
public boolean isDepartmentEnabled()
public boolean canUseApplicationLauncher(Member mbr)
mbr
- the memberpublic boolean canUseApplicationLauncherCatalogAdministration(Member mbr)
mbr
- the memberpublic boolean isApplicationInstalled(AbstractShortcut shortcut, Member mbr)
shortcut
- the AbstractShortcut
mbr
- the Member
public boolean canRecomputeInstallCountCache(Member mbr)
mbr
- the Member
public boolean canAdministrateApplications(Member mbr)
mbr
- the Member
public Category getTypeRoot()
public void recomputeInstallCountCache()
public boolean isInstallCountInitialized()
public int getAverageInstallCount()
public int getInstallCount(Application application)
application
- the Application
public int getTotalInstallCount()
public java.util.Set<java.lang.String> getDepartmentShortcutIds(Group department)
department
- the organization departmentAbstractShortcut
of given departmentpublic int getInstallOrganizationGroupCount(Application application, Member mbr)
application
- the Application
mbr
- the Member
public ApplicationLauncher getDefaultApplicationLauncher()
ApplicationLauncher
public boolean saveDefaultApplicationLauncher(Group department, java.lang.String data)
department
- the Group
representing a departmentdata
- the json datapublic ApplicationLauncher getDefaultApplicationLauncher(Group department)
department
- the Group
representing departmentApplicationLauncher
for given departmentpublic Group getDefaultApplicationLauncherGroup(Group department)
public boolean hasDefaultApplicationLauncher(Group department)
department
- the Group
public java.lang.String getDefaultApplicationLauncherAsJson()
public ApplicationLauncher getEmptyApplicationLauncher()
public ApplicationLauncher getApplicationLauncher(Member mbr)
mbr
- the Member
ApplicationLauncher
public java.lang.String getApplicationLauncherAsJson(ApplicationLauncher launcher)
launcher
- the ApplicationLauncher
ApplicationLauncher
public java.lang.String getCleanedApplicationLauncherAsJson(ApplicationLauncher launcher)
launcher
- the ApplicationLauncher
ApplicationLauncher
to be saved in the databasepublic java.lang.String getApplicationLauncherAsJson(Member mbr)
mbr
- the Member
public java.util.List<ApplicationLauncherTab> getTabs(Member mbr)
mbr
- the Member
ApplicationLauncherTab
for given memberpublic boolean addApplication(Member mbr, int tabIndex, java.lang.String shortcutId)
addApplication(Member, String, Shortcut, boolean, boolean)
since it returns a ControllerStatusmbr
- the Member
tabIndex
- the tab indexshortcutId
- the AbstractShortcut
idpublic ApplicationLauncherTab getOrAddTab(Member mbr, ApplicationLauncher applicationLauncher, java.lang.String tabName)
mbr
- the Member
to update the launcherapplicationLauncher
- the ApplicationLauncher
tabName
- the name of the tabApplicationLauncherTab
public ControllerStatus addApplication(Member mbr, java.util.Collection<Group> groups, java.util.Collection<Member> members, java.lang.String tabName, generated.Shortcut application)
mbr
- the Member
which performs the actiongroups
- a collection of Group
members
- a colletion of Member
tabName
- the tab name where the application will be installed (If empty, first tab will be used). If user doesn't have any tab by this
name, a new one will be created.application
- the Shortcut
to installpublic static void waitForAddingAllApplications()
public ControllerStatus addApplication(Member mbr, java.lang.String tabName, generated.Shortcut application, boolean checkAlreadyInstalled, boolean sendAlert)
mbr
- the Member
to search for a matching launchertabName
- the tab name where the application will be added (If not available, a new tab will be created)application
- a Shortcut
checkAlreadyInstalled
- to prevent action to be performed if app is already installedsendAlert
- to send an alert informing the user an app has been installedControllerStatus
as a result of the operationpublic ApplicationLauncherTab getTabByName(ApplicationLauncher applicationLauncher, java.lang.String tabName)
applicationLauncher
- the ApplicationLauncher
tabName
- the name of the tabApplicationLauncherTab
public boolean removeApplication(Member mbr, int tabIndex, java.lang.String shortcutId)
mbr
- the Member
tabIndex
- the tab indexshortcutId
- the AbstractShortcut
idpublic boolean removeApplicationOnAllTabs(Member mbr, java.lang.String shortcutId)
mbr
- Member
shortcutId
- the AbstractShortcut
idpublic boolean isApplicationAlreadyInTab(Member mbr, int tabIndex, java.lang.String shortcutId)
mbr
- the Member
tabIndex
- the tab indexshortcutId
- the AbstractShortcut
idpublic java.util.List<Application> getInstalledApplications(Member mbr)
mbr
- the Member
ApplicationManager.InstalledApplications
for given Member
public ApplicationManager.InstalledApplications getAlreadyInstalledTabsMap(Member mbr)
public void resetApplicationLauncher(java.util.Collection<Member> members, java.util.Collection<Group> groups)
public void resetDefaultApplicationLauncher(Group department)
Copyright © 2001-2022 Jalios SA. All Rights Reserved.