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 Constructor Description InfoLetterDataManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfoLettercreateDefaultLetter(String componentId)Create a default Info Letter when instanciatedvoidcreateInfoLetter(InfoLetter il)Implementation 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.WAPrimaryKey pk, String componentId)Delete information letter publicationorg.silverpeas.kernel.bundle.LocalizationBundlegetComponentMessages(String language)org.silverpeas.kernel.bundle.SettingBundlegetComponentSettings()<T extends org.silverpeas.core.contribution.model.Contribution>
Optional<T>getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)Set<String>getEmailsExternalsSuscribers(org.silverpeas.core.WAPrimaryKey letterPK)Retrieve external emails addressInfoLettergetInfoLetter(org.silverpeas.core.WAPrimaryKey letterPK)Retrieve an information letter from his primary keyInfoLetterPublicationPdCgetInfoLetterPublication(org.silverpeas.core.WAPrimaryKey publiPK)Retrieve information letter publication from his keyList<InfoLetterPublication>getInfoLetterPublications(org.silverpeas.core.WAPrimaryKey letterPK)Retrieve information letter publicationsList<InfoLetter>getInfoLetters(String instanceId)Retrieve information lettersorg.silverpeas.core.subscription.util.SubscriptionSubscriberListgetInternalSuscribers(String componentId)intgetSilverObjectId(String pubId, String componentId)voidindexInfoLetter(String componentId)Indexes all info letter indexable data.voidinitTemplate(String componentId, org.silverpeas.core.WAPrimaryKey letterPK, String userId)Initialize templatebooleanisRelatedTo(String instanceId)booleanisUserSuscribed(String userId, String componentId)Check if use is an internal subscriber of the information letterSet<String>sendLetterByMail(InfoLetterPublicationPdC ilp, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom)Send letter by mailSet<String>sendTemplateByMail(InfoLetter il, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom)Send letter by mailvoidsetEmailsExternalsSubscribers(org.silverpeas.core.WAPrimaryKey letterPK, Set<String> emails)Save external subscriber emails addressvoidsetInternalSuscribers(String componentId, org.silverpeas.core.admin.user.model.UserDetail[] users, org.silverpeas.core.admin.user.model.Group[] groups)Update internal user subscribers listvoidtoggleSuscriber(String userId, String componentId, boolean isUserSubscribing)Toggle subscription unsubscription of a user to the news lettervoidupdateInfoLetter(InfoLetter ie)Update information lettervoidupdateInfoLetterPublication(InfoLetterPublicationPdC ilp)Update information letter publication
-
-
-
Method Detail
-
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
public org.silverpeas.kernel.bundle.LocalizationBundle getComponentMessages(String language)
- Specified by:
getComponentMessagesin interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
public boolean isRelatedTo(String instanceId)
- Specified by:
isRelatedToin interfaceorg.silverpeas.core.ApplicationService
-
createInfoLetter
public void createInfoLetter(InfoLetter il)
Implementation of InfoLetterService interface- Specified by:
createInfoLetterin interfaceInfoLetterService- Parameters:
il- the information letter to create
-
updateInfoLetter
public void updateInfoLetter(InfoLetter ie)
Description copied from interface:InfoLetterServiceUpdate information letter- Specified by:
updateInfoLetterin interfaceInfoLetterService- Parameters:
ie- the information letter to update
-
getInfoLetters
public List<InfoLetter> getInfoLetters(String instanceId)
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.WAPrimaryKey letterPK)
Description copied from interface:InfoLetterServiceRetrieve information letter publications- Specified by:
getInfoLetterPublicationsin interfaceInfoLetterService- Parameters:
letterPK- the information letter primary key- Returns:
- the list of information letter publications of an information letter
-
createInfoLetterPublication
public void createInfoLetterPublication(InfoLetterPublicationPdC ilp, String userId)
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.WAPrimaryKey pk, String componentId)Description copied from interface:InfoLetterServiceDelete information letter publication- Specified by:
deleteInfoLetterPublicationin interfaceInfoLetterService- Parameters:
pk- the information letter publication primary keycomponentId- the component identifier
-
updateInfoLetterPublication
public void updateInfoLetterPublication(InfoLetterPublicationPdC ilp)
Description copied from interface:InfoLetterServiceUpdate information letter publication- Specified by:
updateInfoLetterPublicationin interfaceInfoLetterService- Parameters:
ilp- the information letter publication to update
-
getInfoLetter
public InfoLetter getInfoLetter(org.silverpeas.core.WAPrimaryKey letterPK)
Description copied from interface:InfoLetterServiceRetrieve an information letter from his primary key- Specified by:
getInfoLetterin interfaceInfoLetterService- Parameters:
letterPK- the letter primary key- Returns:
- the infirmation letter
-
getInfoLetterPublication
public InfoLetterPublicationPdC getInfoLetterPublication(org.silverpeas.core.WAPrimaryKey publiPK)
Description copied from interface:InfoLetterServiceRetrieve information letter publication from his key- Specified by:
getInfoLetterPublicationin interfaceInfoLetterService- Parameters:
publiPK- the information letter publication primary key- Returns:
- an Information Letter Publication PdC
-
createDefaultLetter
public InfoLetter createDefaultLetter(String componentId)
Description copied from interface:InfoLetterServiceCreate a default Info Letter when instanciated- Specified by:
createDefaultLetterin interfaceInfoLetterService- Parameters:
componentId- the component identifier- Returns:
- a default Info Letter
-
deleteAllInfoLetters
public void deleteAllInfoLetters(String componentId)
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.
-
getSilverObjectId
public int getSilverObjectId(String pubId, String componentId)
- Specified by:
getSilverObjectIdin interfaceInfoLetterService
-
getInternalSuscribers
public org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSuscribers(String componentId)
- Specified by:
getInternalSuscribersin interfaceInfoLetterService- Parameters:
componentId- componentId component instance id- Returns:
- map of subscriber ids indexed by type of subscriber
-
setInternalSuscribers
public void setInternalSuscribers(String componentId, org.silverpeas.core.admin.user.model.UserDetail[] users, org.silverpeas.core.admin.user.model.Group[] groups)
Description copied from interface:InfoLetterServiceUpdate internal user subscribers list- Specified by:
setInternalSuscribersin interfaceInfoLetterService- Parameters:
componentId- componentId component instance idusers- an array of User detailgroups- an array of Group
-
getEmailsExternalsSuscribers
public Set<String> getEmailsExternalsSuscribers(org.silverpeas.core.WAPrimaryKey letterPK)
Description copied from interface:InfoLetterServiceRetrieve external emails address- Specified by:
getEmailsExternalsSuscribersin interfaceInfoLetterService- Parameters:
letterPK- the info letter identifier (letter primary key)- Returns:
- a set of external emails
-
setEmailsExternalsSubscribers
public void setEmailsExternalsSubscribers(org.silverpeas.core.WAPrimaryKey letterPK, Set<String> emails)Description copied from interface:InfoLetterServiceSave external subscriber emails address- Specified by:
setEmailsExternalsSubscribersin interfaceInfoLetterService- Parameters:
letterPK- the letter primary keyemails- the list of external emails to save
-
toggleSuscriber
public void toggleSuscriber(String userId, String componentId, boolean isUserSubscribing)
Description copied from interface:InfoLetterServiceToggle subscription unsubscription of a user to the news letter- Specified by:
toggleSuscriberin interfaceInfoLetterService- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifierisUserSubscribing- true if user is subscribing, false else if
-
isUserSuscribed
public boolean isUserSuscribed(String userId, String componentId)
Description copied from interface:InfoLetterServiceCheck if use is an internal subscriber of the information letter- Specified by:
isUserSuscribedin 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(String componentId, org.silverpeas.core.WAPrimaryKey letterPK, String userId)
Description copied from interface:InfoLetterServiceInitialize template- Specified by:
initTemplatein interfaceInfoLetterService- Parameters:
componentId- the info letter component instance identifierletterPK- the info letter identifieruserId- the user identifier
-
sendTemplateByMail
public Set<String> sendTemplateByMail(InfoLetter il, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom)
Description copied from interface:InfoLetterServiceSend letter by mail- Specified by:
sendTemplateByMailin interfaceInfoLetterService- Parameters:
il- the templatemimeMultipart- please have a look to https://en.wikipedia.org/wiki/MIME#Multipart_subtypeslistEmailDest- list of emailsubject- subject of emailemailFrom- sender of email- Returns:
- list of emails in error
-
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:
- list of emails in error
-
indexInfoLetter
public void indexInfoLetter(String componentId)
Description copied from interface:InfoLetterServiceIndexes all info letter indexable data.- Specified by:
indexInfoLetterin interfaceInfoLetterService- Parameters:
componentId- the identifier of the concerned component instance.
-
-