Class LeadCaptureSettingsService

java.lang.Object
org.exoplatform.leadcapture.services.LeadCaptureSettingsService

public class LeadCaptureSettingsService extends Object
  • Constructor Details

    • LeadCaptureSettingsService

      public LeadCaptureSettingsService(org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.portal.config.UserACL userACL)
  • Method Details

    • getSettings

      public LeadCaptureSettings getSettings()
      Reads the settings from the SettingService on every call.

      There is deliberately no local copy: the platform SettingService catches any exception raised while reading a value and returns null instead, exactly as if nothing had been stored, and does not cache that failure. A local copy filled from such a read would serve default (empty) settings until the next restart or save. Each call costs a SettingService cache read and a JSON parse.

      Returns:
      the stored settings, or default settings when nothing is stored (or when the store could not be read)
    • saveSettings

      public void saveSettings(LeadCaptureSettings leadCaptureSettings) throws Exception
      Throws:
      Exception
    • canManageSettings

      public boolean canManageSettings(org.exoplatform.services.security.Identity identity)
      Settings are read and updated by the users who can open the Lead Capture Settings page: administrators and managers of the /platform/ux-team group.
      Parameters:
      identity - the caller's security identity
      Returns:
      true when the caller can read and update the settings
    • isUxTeamManager

      public boolean isUxTeamManager(String userName)
      Parameters:
      userName - the user to check
      Returns:
      true when the user holds the manager membership in the configured UX team group (see LeadCaptureSettings#getUserExperienceGroup()), false otherwise or when the membership cannot be looked up
    • hasLeadCaptureStatuses

      public static boolean hasLeadCaptureStatuses(List<org.exoplatform.task.dto.StatusDto> statuses)
      Returns:
      true when the project already has exactly the lead capture statuses, in order: recreating them would only move its tasks