Class ApplicationManager

    • Field Detail

      • SHORTCUT_TYPE_CATEGORY_VID

        public static final java.lang.String SHORTCUT_TYPE_CATEGORY_VID
        See Also:
        Constant Field Values
      • INSTALL_RECOMPUTE_SCHEDULE_PROP

        public static final java.lang.String INSTALL_RECOMPUTE_SCHEDULE_PROP
        See Also:
        Constant Field Values
      • INSTALL_RECOMPUTE_DEFAULT_SCHEDULE

        public static final java.lang.String INSTALL_RECOMPUTE_DEFAULT_SCHEDULE
        See Also:
        Constant Field Values
      • INSTALL_RECOMPUTE_ALARM

        public static final java.lang.String INSTALL_RECOMPUTE_ALARM
        See Also:
        Constant Field Values
      • DEPLOY_ALERT_NAME

        public static final java.lang.String DEPLOY_ALERT_NAME
        See Also:
        Constant Field Values
      • ADMIN_ALERT_DOMAIN

        public static final java.lang.String ADMIN_ALERT_DOMAIN
        See Also:
        Constant Field Values
      • ACL_CAN_USE_APPLICATION_LAUNCHER

        public static final java.lang.String ACL_CAN_USE_APPLICATION_LAUNCHER
        See Also:
        Constant Field Values
      • ACL_CAN_USE_APPLICATION_LAUNCHER_CATALOG_ADMINISTRATION

        public static final java.lang.String ACL_CAN_USE_APPLICATION_LAUNCHER_CATALOG_ADMINISTRATION
        See Also:
        Constant Field Values
      • lastAddApplicationThread

        protected static java.lang.Thread lastAddApplicationThread
    • Method Detail

      • propertiesChange

        public void propertiesChange​(JProperties properties)
        Description copied from interface: JPropertiesListener
        Invoked 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.getProperties or channel.getProperty.

        Specified by:
        propertiesChange in interface JPropertiesListener
        Parameters:
        properties - the properties which have been submitted to change
      • isResetApplicationLauncherRunning

        public boolean isResetApplicationLauncherRunning()
      • isDeployApplicationToLauncherRunning

        public boolean isDeployApplicationToLauncherRunning()
      • isDepartmentEnabled

        public boolean isDepartmentEnabled()
      • canUseApplicationLauncher

        public boolean canUseApplicationLauncher​(Member mbr)
        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

        public boolean canUseApplicationLauncherCatalogAdministration​(Member mbr)
        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

        public boolean isApplicationInstalled​(AbstractShortcut shortcut,
                                              Member mbr)
        Parameters:
        shortcut - the AbstractShortcut
        mbr - the Member
        Returns:
        true if application is installed for given member
        Since:
        jcms-10.0.3
      • canRecomputeInstallCountCache

        public boolean canRecomputeInstallCountCache​(Member mbr)
        Parameters:
        mbr - the Member
        Returns:
        true if given member can recompute the install count cache
        Since:
        jcms-10.0.3
      • canAdministrateApplications

        public boolean canAdministrateApplications​(Member mbr)
        Parameters:
        mbr - the Member
        Returns:
        true if given member can administrate applications (Launcher / Reset / Recompute)
        Since:
        jcms-10.0.6
      • getTypeRoot

        public Category 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

        public int getInstallCount​(Application application)
        Parameters:
        application - the Application
        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

        public java.util.Set<java.lang.String> getDepartmentShortcutIds​(Group department)
        Parameters:
        department - the organization department
        Returns:
        the set of AbstractShortcut of given department
        Since:
        jcms-10.0.3
      • getInstallOrganizationGroupCount

        public int getInstallOrganizationGroupCount​(Application application,
                                                    Member mbr)
        Parameters:
        application - the Application
        mbr - the Member
        Returns:
        the install count for given application in given Member department
      • saveDefaultApplicationLauncher

        public boolean saveDefaultApplicationLauncher​(Group department,
                                                      java.lang.String data)
        Saves json data as default json launcher for the given department
        Parameters:
        department - the Group representing a department
        data - the json data
        Returns:
        true if save has succeed
        Since:
        jcms-10.0.3
      • hasCustomApplicationLauncher

        public boolean hasCustomApplicationLauncher​(Group department)
        Check if a department has a custom launcher
        Parameters:
        department -
        Returns:
        true if the department has a custom Launcher
      • getDefaultApplicationLauncher

        public ApplicationLauncher getDefaultApplicationLauncher​(Group department)
        Parameters:
        department - the Group representing department
        Returns:
        the default ApplicationLauncher for given department
        Since:
        jcms-10.0.3
      • getDefaultApplicationLauncherGroup

        public Group getDefaultApplicationLauncherGroup​(Group department)
      • hasDefaultApplicationLauncher

        public boolean hasDefaultApplicationLauncher​(Group department)
        Returns true if given department has a default launcher
        Parameters:
        department - the Group
        Returns:
        true if given department has a default launcher
        Since:
        jcms-10.0.3
      • getDefaultApplicationLauncherAsJson

        public java.lang.String getDefaultApplicationLauncherAsJson()
        Returns:
        the default application launcher as Json
        Since:
        jcms-10.0.3
      • getEmptyApplicationLauncher

        public ApplicationLauncher getEmptyApplicationLauncher()
        Returns:
        an empty ApplicationLauncher with a tab
        Since:
        jcms-10.0.3
      • getApplicationLauncher

        public 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
        Parameters:
        mbr - the Member
        Returns:
        an ApplicationLauncher
        Since:
        jcms-10.0.3
      • getCleanedApplicationLauncherAsJson

        public java.lang.String getCleanedApplicationLauncherAsJson​(ApplicationLauncher launcher)
        Transforms an application launcher into json to save in the database
        Parameters:
        launcher - the ApplicationLauncher
        Returns:
        a json representing the ApplicationLauncher to be saved in the database
        Since:
        jcms-10.0.6
      • getApplicationLauncherAsJson

        public java.lang.String getApplicationLauncherAsJson​(Member mbr)
        Parameters:
        mbr - the Member
        Returns:
        the application launcher for given Member as json
        Since:
        jcms-10.0.3
      • addApplication

        @Deprecated
        public boolean addApplication​(Member mbr,
                                      int tabIndex,
                                      java.lang.String shortcutId)
        Deprecated.
        use addApplication(Member, String, Shortcut, boolean, boolean) since it returns a ControllerStatus
        Adds an application (shortcutId) in given tab for given member
        Parameters:
        mbr - the Member
        tabIndex - the tab index
        shortcutId - the AbstractShortcut id
        Returns:
        true if adding the application has succeed
        Since:
        jcms-10.0.3
      • addApplication

        public 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
        Parameters:
        mbr - the Member which performs the action
        groups - 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 install
        Returns:
        a ControllerStatus as a result of adding the app to multiple users
        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,
                                               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
        Parameters:
        mbr - the Member to search for a matching launcher
        tabName - 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 installed
        sendAlert - to send an alert informing the user an app has been installed
        Returns:
        a ControllerStatus as a result of the operation
        Since:
        10.0.6
      • removeApplication

        public boolean removeApplication​(Member mbr,
                                         int tabIndex,
                                         java.lang.String shortcutId)
        Removes an application (shortcutId) in given tab for given member
        Parameters:
        mbr - the Member
        tabIndex - the tab index
        shortcutId - the AbstractShortcut id
        Returns:
        true if removing the application has succeed
        Since:
        jcms-10.0.3
      • removeApplicationOnAllTabs

        public boolean removeApplicationOnAllTabs​(Member mbr,
                                                  java.lang.String shortcutId)
        Remove an application (shortcutId) on all member tabs
        Parameters:
        mbr - Member
        shortcutId - the AbstractShortcut id
        Returns:
        true if the app was remove on all tabs
      • isApplicationAlreadyInTab

        public boolean isApplicationAlreadyInTab​(Member mbr,
                                                 int tabIndex,
                                                 java.lang.String shortcutId)
        Checks if application is already installed in given tab index
        Parameters:
        mbr - the Member
        tabIndex - the tab index
        shortcutId - the AbstractShortcut id
        Returns:
        true if application is already installed in tab
        Since:
        jcms-10.0.3
      • resetApplicationLauncher

        public void resetApplicationLauncher​(java.util.Collection<Member> members,
                                             java.util.Collection<Group> groups)
        Deletes saved launcher for given member and groups
        Parameters:
        members - a collection of Member
        groups - a collection of Group
        Since:
        jcms-10.0.3
      • resetDefaultApplicationLauncher

        public void resetDefaultApplicationLauncher​(Group department)