Package com.jalios.jcms.application
Class ApplicationManager
java.lang.Object
com.jalios.jcms.application.ApplicationManager
- All Implemented Interfaces:
JPropertiesListener
Manager for Application
- Since:
- jcms-10.0.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassA POJO class representing installed applications with utility methodsstatic enum -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddApplication(Member mbr, int tabIndex, String shortcutId) Deprecated.addApplication(Member mbr, 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 tabvoidaddMembersFromGroups(Set<Member> mbrSet, Collection<Group> groups) booleanbooleanbooleanReturns true if the given member can use the Application launcher.booleanReturns true if the given member can use the Application launcher catalog administration.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 launcherTransforms an application launcher into jsongetApplicationLauncherOrigin(Member member) Returns an object containing the launcher (By also checking for the customized launcher of user), and the launcher origin (Default, custom or department)intTransforms an application launcher into json to save in the databasegetDefaultApplicationLauncher(Group department) getDefaultApplicationLauncherGroup(Group department) Returns an object containing the launcher, and the launcher origin (Default or department)getDepartmentShortcutIds(Group department) intgetInstallCount(Application application) intgetInstallOrganizationGroupCount(Application application, Member mbr) static ApplicationManagergetOrAddTab(Member mbr, ApplicationLauncher applicationLauncher, String tabName) Returns a tab by either finding it in the given launcher by its name, or by creating a new one if not foundgetResetApplicationLauncherProcess(Collection<Member> members, Collection<Group> groups) getTabByName(ApplicationLauncher applicationLauncher, String tabName) Returns a tab by searching by its name in given application launcherintbooleanhasCustomApplicationLauncher(Group department) Check if a department has a custom launcherbooleanhasDefaultApplicationLauncher(Group department) Returns true if given department has a default launcherbooleanhasPersonalizedLauncher(Member member) booleanisApplicationAlreadyInTab(Member mbr, int tabIndex, String shortcutId) Checks if application is already installed in given tab indexbooleanisApplicationInstalled(AbstractShortcut shortcut, Member mbr) booleanbooleanbooleanvoidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.voidRecomputes the install count cache asynchronouslybooleanremoveApplication(Member mbr, int tabIndex, String shortcutId) Removes an application (shortcutId) in given tab for given memberbooleanremoveApplicationOnAllTabs(Member mbr, String shortcutId) Remove an application (shortcutId) on all member tabsvoidresetDefaultApplicationLauncher(Group department) booleansaveDefaultApplicationLauncher(Group department, String data) Saves json data as default json launcher for the given departmentstatic voidA convenient method for unit test to wait for the ending of the add application thread.
-
Field Details
-
SHORTCUT_TYPE_CATEGORY_VID
- See Also:
-
MBR_PREF
- See Also:
-
INSTALL_RECOMPUTE_SCHEDULE_PROP
- See Also:
-
INSTALL_RECOMPUTE_DEFAULT_SCHEDULE
- See Also:
-
INSTALL_RECOMPUTE_ALARM
- See Also:
-
DEPLOY_ALERT_NAME
- See Also:
-
ALERT_DOMAIN
- See Also:
-
ACL_CAN_USE_APPLICATION_LAUNCHER
- See Also:
-
ACL_CAN_USE_APPLICATION_LAUNCHER_CATALOG_ADMINISTRATION
- See Also:
-
lastAddApplicationThread
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked after properties have been modified in JCMS and save on disk.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.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
isDeployApplicationToLauncherRunning
public boolean isDeployApplicationToLauncherRunning() -
isDepartmentEnabled
public boolean isDepartmentEnabled() -
canUseApplicationLauncher
Returns true if the given member can use the Application launcher.- Parameters:
mbr- the member- Returns:
- true if the given member can use the application launcher.
- Since:
- jcms-10.0.3
-
canUseApplicationLauncherCatalogAdministration
Returns true if the given member can use the Application launcher catalog administration.- Parameters:
mbr- the member- Returns:
- true if the given member can use the Application launcher catalog administration.
- Since:
- jcms-10.0.4
-
isApplicationInstalled
- Parameters:
shortcut- theAbstractShortcutmbr- theMember- Returns:
- true if application is installed for given member
- Since:
- jcms-10.0.3
-
canRecomputeInstallCountCache
- Parameters:
mbr- theMember- Returns:
- true if given member can recompute the install count cache
- Since:
- jcms-10.0.3
-
canAdministrateApplications
- Parameters:
mbr- theMember- Returns:
- true if given member can administrate applications (Launcher / Reset / Recompute)
- Since:
- jcms-10.0.6
-
getTypeRoot
- Returns:
- the type root of Applications
- Since:
- jcms-10.0.3
-
recomputeInstallCountCache
public void recomputeInstallCountCache()Recomputes the install count cache asynchronously- Since:
- jcms-10.0.3
-
isInstallCountInitialized
public boolean isInstallCountInitialized()- Returns:
- true if install count is initialized
- Since:
- jcms-10.0.3
-
getAverageInstallCount
public int getAverageInstallCount()- Returns:
- the average install count per user
- Since:
- jcms-10.0.3
-
getInstallCount
- Parameters:
application- theApplication- Returns:
- the install count for given application
- Since:
- jcms-10.0.3
-
getTotalInstallCount
public int getTotalInstallCount()- Returns:
- the total count of installed applications
- Since:
- jcms-10.0.3
-
getDepartmentShortcutIds
- Parameters:
department- the organization department- Returns:
- the set of
AbstractShortcutof given department - Since:
- jcms-10.0.3
-
getInstallOrganizationGroupCount
- Parameters:
application- theApplicationmbr- theMember- Returns:
- the install count for given application in given Member department
-
getApplicationLauncherOrigin
Returns an object containing the launcher (By also checking for the customized launcher of user), and the launcher origin (Default, custom or department)- Parameters:
member- theMemberto audit- Returns:
ApplicationManager.ApplicationLauncherOrigin- Since:
- jcms-10.0.8
-
getDefaultApplicationLauncherOrigin
public ApplicationManager.ApplicationLauncherOrigin getDefaultApplicationLauncherOrigin(Member member) Returns an object containing the launcher, and the launcher origin (Default or department)- Parameters:
member- theMemberto audit- Returns:
ApplicationManager.ApplicationLauncherOrigin- Since:
- jcms-10.0.8
-
getDefaultApplicationLauncher
- Returns:
- the default
ApplicationLauncher - Since:
- jcms-10.0.3
-
saveDefaultApplicationLauncher
Saves json data as default json launcher for the given department- Parameters:
department- theGrouprepresenting a departmentdata- the json data- Returns:
- true if save has succeed
- Since:
- jcms-10.0.3
-
hasCustomApplicationLauncher
Check if a department has a custom launcher- Parameters:
department-- Returns:
- true if the department has a custom Launcher
-
getDefaultApplicationLauncher
- Parameters:
department- theGrouprepresenting department- Returns:
- the default
ApplicationLauncherfor given department - Since:
- jcms-10.0.3
-
getDefaultApplicationLauncherGroup
-
hasDefaultApplicationLauncher
Returns true if given department has a default launcher- Parameters:
department- theGroup- Returns:
- true if given department has a default launcher
- Since:
- jcms-10.0.3
-
getDefaultApplicationLauncherAsJson
- Returns:
- the default application launcher as Json
- Since:
- jcms-10.0.3
-
getEmptyApplicationLauncher
- Returns:
- an empty ApplicationLauncher with a tab
- Since:
- jcms-10.0.3
-
hasPersonalizedLauncher
-
getApplicationLauncher
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- Parameters:
mbr- theMember- Returns:
- an
ApplicationLauncher - Since:
- jcms-10.0.3
-
getApplicationLauncherAsJson
Transforms an application launcher into json- Parameters:
launcher- theApplicationLauncher- Returns:
- a json representing the
ApplicationLauncher - Since:
- jcms-10.0.3
-
getCleanedApplicationLauncherAsJson
Transforms an application launcher into json to save in the database- Parameters:
launcher- theApplicationLauncher- Returns:
- a json representing the
ApplicationLauncherto be saved in the database - Since:
- jcms-10.0.6
-
getApplicationLauncherAsJson
- Parameters:
mbr- theMember- Returns:
- the application launcher for given Member as json
- Since:
- jcms-10.0.3
-
getTabs
- Parameters:
mbr- theMember- Returns:
- the List of
ApplicationLauncherTabfor given member - Since:
- jcms-10.0.3
-
addApplication
Deprecated.useaddApplication(Member, String, Shortcut, boolean, boolean)since it returns a ControllerStatusAdds an application (shortcutId) in given tab for given member- Parameters:
mbr- theMembertabIndex- the tab indexshortcutId- theAbstractShortcutid- Returns:
- true if adding the application has succeed
- Since:
- jcms-10.0.3
-
getOrAddTab
public ApplicationLauncherTab getOrAddTab(Member mbr, ApplicationLauncher applicationLauncher, 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- Parameters:
mbr- theMemberto update the launcherapplicationLauncher- theApplicationLaunchertabName- the name of the tab- Returns:
- an
ApplicationLauncherTab - Since:
- 10.0.6
-
waitForAddingAllApplications
public static void waitForAddingAllApplications()A convenient method for unit test to wait for the ending of the add application thread. This method is not thread safe (it only wait for the last sending thread).- Since:
- jcms-10.0.6
-
addApplication
public ControllerStatus addApplication(Member mbr, 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- Parameters:
mbr- theMemberto search for a matching launchertabName- the tab name where the application will be added (If not available, a new tab will be created)application- aShortcutcheckAlreadyInstalled- to prevent action to be performed if app is already installedsendAlert- to send an alert informing the user an app has been installed- Returns:
- a
ControllerStatusas a result of the operation - Since:
- 10.0.6
-
getTabByName
Returns a tab by searching by its name in given application launcher- Parameters:
applicationLauncher- theApplicationLaunchertabName- the name of the tab- Returns:
- an
ApplicationLauncherTab - Since:
- 10.0.6
-
removeApplication
Removes an application (shortcutId) in given tab for given member- Parameters:
mbr- theMembertabIndex- the tab indexshortcutId- theAbstractShortcutid- Returns:
- true if removing the application has succeed
- Since:
- jcms-10.0.3
-
removeApplicationOnAllTabs
Remove an application (shortcutId) on all member tabs- Parameters:
mbr-MembershortcutId- theAbstractShortcutid- Returns:
- true if the app was remove on all tabs
-
isApplicationAlreadyInTab
Checks if application is already installed in given tab index- Parameters:
mbr- theMembertabIndex- the tab indexshortcutId- theAbstractShortcutid- Returns:
- true if application is already installed in tab
- Since:
- jcms-10.0.3
-
getInstalledApplications
- Parameters:
mbr- theMember- Returns:
ApplicationManager.InstalledApplicationsfor givenMember- Since:
- jcms-10.0.3
-
getAlreadyInstalledTabsMap
-
getResetApplicationLauncherProcess
public ApplicationResetProcess getResetApplicationLauncherProcess(Collection<Member> members, Collection<Group> groups) - Parameters:
members-groups-- Returns:
-
addMembersFromGroups
-
resetDefaultApplicationLauncher
-
addApplication(Member, String, Shortcut, boolean, boolean)since it returns a ControllerStatus