Class InfoLetterDataManager
java.lang.Object
org.silverpeas.components.infoletter.implementation.InfoLetterDataManager
- All Implemented Interfaces:
InfoLetterService,org.silverpeas.core.ApplicationService
@Service
@Named("infoLetterService")
public class InfoLetterDataManager
extends Object
implements InfoLetterService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultLetter(String componentId) Create a default Info Letter when instantiatedvoidImplementation of InfoLetterService interfacevoidcreateInfoLetterPublication(InfoLetterPublicationPdC ilp, String userId) Create information letter publicationvoiddeleteAllInfoLetters(String componentId) Deletes all the info letters (and then all the publications and external subscribers) in the specified component instance.voiddeleteInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier id) Delete information letter publicationorg.silverpeas.kernel.bundle.LocalizationBundlegetComponentMessages(String language) org.silverpeas.kernel.bundle.SettingBundle<T extends org.silverpeas.core.contribution.model.Contribution>
Optional<T>getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId) getEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve external emails addressgetInfoLetter(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve an information letter from his primary keygetInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve information letter publication from his keygetInfoLetterPublications(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve information letter publicationsgetInfoLetters(String instanceId) Retrieve information lettersorg.silverpeas.core.subscription.util.SubscriptionSubscriberListgetInternalSubscribers(String componentId) voidindexInfoLetter(String componentId) Indexes all info letter indexable data.voidinitTemplate(org.silverpeas.core.contribution.model.ContributionIdentifier id, String userId) Initialize templatebooleanisRelatedTo(String instanceId) booleanisUserSubscribed(String userId, String componentId) Check if use is an internal subscriber of the information lettersendLetterByMail(InfoLetterPublicationPdC ilp, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom) Send letter by mailvoidsetEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id, Set<String> emails) Save external subscriber emails addressvoidsetInternalSubscribers(String componentId, org.silverpeas.core.admin.user.model.User[] users, org.silverpeas.core.admin.user.model.Group[] groups) Update internal user subscribers listvoidtoggleSubscriber(String userId, String componentId, boolean isUserSubscribing) Toggle subscription unsubscription of a user to the newslettervoidUpdate information lettervoidUpdate information letter publication
-
Constructor Details
-
InfoLetterDataManager
public InfoLetterDataManager()
-
-
Method Details
-
getContributionById
public <T extends org.silverpeas.core.contribution.model.Contribution> Optional<T> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId) - Specified by:
getContributionByIdin interfaceorg.silverpeas.core.ApplicationService
-
getComponentSettings
public org.silverpeas.kernel.bundle.SettingBundle getComponentSettings()- Specified by:
getComponentSettingsin interfaceorg.silverpeas.core.ApplicationService
-
getComponentMessages
- Specified by:
getComponentMessagesin interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
- Specified by:
isRelatedToin interfaceorg.silverpeas.core.ApplicationService
-
createInfoLetter
Implementation of InfoLetterService interface- Specified by:
createInfoLetterin interfaceInfoLetterService- Parameters:
il- the information letter to create
-
updateInfoLetter
Description copied from interface:InfoLetterServiceUpdate information letter- Specified by:
updateInfoLetterin interfaceInfoLetterService- Parameters:
ie- the information letter to update
-
getInfoLetters
Description copied from interface:InfoLetterServiceRetrieve information letters- Specified by:
getInfoLettersin interfaceInfoLetterService- Parameters:
instanceId- the application identifier- Returns:
- the information letters of the current application identifier given in parameter
-
getInfoLetterPublications
public List<InfoLetterPublication> getInfoLetterPublications(org.silverpeas.core.contribution.model.ContributionIdentifier id) Description copied from interface:InfoLetterServiceRetrieve information letter publications- Specified by:
getInfoLetterPublicationsin interfaceInfoLetterService- Parameters:
id- the information letter unique identifier- Returns:
- the list of information letter publications of an information letter
-
createInfoLetterPublication
Description copied from interface:InfoLetterServiceCreate information letter publication- Specified by:
createInfoLetterPublicationin interfaceInfoLetterService- Parameters:
ilp- the information letter publication pdc to createuserId- the creator user identifier
-
deleteInfoLetterPublication
public void deleteInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier id) Description copied from interface:InfoLetterServiceDelete information letter publication- Specified by:
deleteInfoLetterPublicationin interfaceInfoLetterService- Parameters:
id- the information letter publication unique identifier
-
updateInfoLetterPublication
Description copied from interface:InfoLetterServiceUpdate information letter publication- Specified by:
updateInfoLetterPublicationin interfaceInfoLetterService- Parameters:
ilp- the information letter publication to update
-
getInfoLetter
Description copied from interface:InfoLetterServiceRetrieve an information letter from his primary key- Specified by:
getInfoLetterin interfaceInfoLetterService- Parameters:
id- the unique identifier of the info letter- Returns:
- the infirmation letter
-
getInfoLetterPublication
public InfoLetterPublicationPdC getInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier id) Description copied from interface:InfoLetterServiceRetrieve information letter publication from his key- Specified by:
getInfoLetterPublicationin interfaceInfoLetterService- Parameters:
id- the unique information letter identifier- Returns:
- an Information Letter Publication PdC
-
createDefaultLetter
Description copied from interface:InfoLetterServiceCreate a default Info Letter when instantiated- Specified by:
createDefaultLetterin interfaceInfoLetterService- Parameters:
componentId- the component identifier- Returns:
- a default Info Letter
-
deleteAllInfoLetters
Deletes all the info letters (and then all the publications and external subscribers) in the specified component instance.- Specified by:
deleteAllInfoLettersin interfaceInfoLetterService- Parameters:
componentId- the unique identifier of the InfoLetter instance.
-
getInternalSubscribers
public org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSubscribers(String componentId) - Specified by:
getInternalSubscribersin interfaceInfoLetterService- Parameters:
componentId- componentId component instance id- Returns:
- a list of subscriber ids indexed by type of subscriber
-
setInternalSubscribers
public void setInternalSubscribers(String componentId, org.silverpeas.core.admin.user.model.User[] users, org.silverpeas.core.admin.user.model.Group[] groups) Description copied from interface:InfoLetterServiceUpdate internal user subscribers list- Specified by:
setInternalSubscribersin interfaceInfoLetterService- Parameters:
componentId- componentId component instance idusers- an array of User detailgroups- an array of Group
-
getEmailsExternalsSubscribers
public Set<String> getEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id) Description copied from interface:InfoLetterServiceRetrieve external emails address- Specified by:
getEmailsExternalsSubscribersin interfaceInfoLetterService- Parameters:
id- the info letter identifier- Returns:
- a set of external emails
-
setEmailsExternalsSubscribers
public void setEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id, Set<String> emails) Description copied from interface:InfoLetterServiceSave external subscriber emails address- Specified by:
setEmailsExternalsSubscribersin interfaceInfoLetterService- Parameters:
id- the letter unique identifieremails- the list of external emails to save
-
toggleSubscriber
Description copied from interface:InfoLetterServiceToggle subscription unsubscription of a user to the newsletter- Specified by:
toggleSubscriberin interfaceInfoLetterService- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifierisUserSubscribing- true if user is subscribing, false else if
-
isUserSubscribed
Description copied from interface:InfoLetterServiceCheck if use is an internal subscriber of the information letter- Specified by:
isUserSubscribedin interfaceInfoLetterService- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifier- Returns:
- true if user is a subscriber, false else if
-
initTemplate
public void initTemplate(org.silverpeas.core.contribution.model.ContributionIdentifier id, String userId) Description copied from interface:InfoLetterServiceInitialize template- Specified by:
initTemplatein interfaceInfoLetterService- Parameters:
id- the info letter identifieruserId- the user identifier
-
sendLetterByMail
public Set<String> sendLetterByMail(InfoLetterPublicationPdC ilp, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom) Description copied from interface:InfoLetterServiceSend letter by mail- Specified by:
sendLetterByMailin interfaceInfoLetterService- Parameters:
ilp- the information lettermimeMultipart- please have a look to https://en.wikipedia.org/wiki/MIME#Multipart_subtypeslistEmailDest- list of emailsubject- subject of emailemailFrom- sender of email- Returns:
- set of emails in error
-
indexInfoLetter
Description copied from interface:InfoLetterServiceIndexes all info letter indexable data.- Specified by:
indexInfoLetterin interfaceInfoLetterService- Parameters:
componentId- the identifier of the concerned component instance.
-