Class LeadCaptureSettingsService
java.lang.Object
org.exoplatform.leadcapture.services.LeadCaptureSettingsService
-
Constructor Summary
ConstructorsConstructorDescriptionLeadCaptureSettingsService(org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.portal.config.UserACL userACL) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanManageSettings(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-teamgroup.Reads the settings from theSettingServiceon every call.static booleanhasLeadCaptureStatuses(List<org.exoplatform.task.dto.StatusDto> statuses) booleanisUxTeamManager(String userName) voidsaveSettings(LeadCaptureSettings leadCaptureSettings)
-
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
Reads the settings from theSettingServiceon every call.There is deliberately no local copy: the platform
SettingServicecatches any exception raised while reading a value and returnsnullinstead, 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 aSettingServicecache 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
- 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-teamgroup.- Parameters:
identity- the caller's security identity- Returns:
truewhen the caller can read and update the settings
-
isUxTeamManager
- Parameters:
userName- the user to check- Returns:
truewhen the user holds themanagermembership in the configured UX team group (seeLeadCaptureSettings#getUserExperienceGroup()),falseotherwise or when the membership cannot be looked up
-
hasLeadCaptureStatuses
- Returns:
truewhen the project already has exactly the lead capture statuses, in order: recreating them would only move its tasks
-