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
Class declaration- Author:
-
-
Constructor Summary
Constructors Constructor Description InfoLetterDataManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfoLetter
createDefaultLetter(String componentId)
Create a default Info Letter when instanciatedvoid
createInfoLetter(InfoLetter il)
Implementation of InfoLetterService interfacevoid
createInfoLetterPublication(InfoLetterPublicationPdC ilp, String userId)
Create information letter publicationvoid
deleteAllInfoLetters(String componentId)
Deletes all the info letters (and then all the publications and external subscribers) in the specified component instance.void
deleteInfoLetterPublication(org.silverpeas.core.WAPrimaryKey pk, String componentId)
Delete information letter publicationorg.silverpeas.core.util.LocalizationBundle
getComponentMessages(String language)
org.silverpeas.core.util.SettingBundle
getComponentSettings()
<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 addressInfoLetter
getInfoLetter(org.silverpeas.core.WAPrimaryKey letterPK)
Retrieve an information letter from his primary keyInfoLetterPublicationPdC
getInfoLetterPublication(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.SubscriptionSubscriberList
getInternalSuscribers(String componentId)
int
getSilverObjectId(String pubId, String componentId)
void
indexInfoLetter(String componentId)
Indexes all info letter indexable data.void
initTemplate(String componentId, org.silverpeas.core.WAPrimaryKey letterPK, String userId)
Initialize templateboolean
isRelatedTo(String instanceId)
boolean
isUserSuscribed(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 mailvoid
setEmailsExternalsSubscribers(org.silverpeas.core.WAPrimaryKey letterPK, Set<String> emails)
Save external subscriber emails addressvoid
setInternalSuscribers(String componentId, org.silverpeas.core.admin.user.model.UserDetail[] users, org.silverpeas.core.admin.user.model.Group[] groups)
Update internal user subscribers listvoid
toggleSuscriber(String userId, String componentId, boolean isUserSubscribing)
Toggle subscription unsubscription of a user to the news lettervoid
updateInfoLetter(InfoLetter ie)
Update information lettervoid
updateInfoLetterPublication(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:
getContributionById
in interfaceorg.silverpeas.core.ApplicationService
-
getComponentSettings
public org.silverpeas.core.util.SettingBundle getComponentSettings()
- Specified by:
getComponentSettings
in interfaceorg.silverpeas.core.ApplicationService
-
getComponentMessages
public org.silverpeas.core.util.LocalizationBundle getComponentMessages(String language)
- Specified by:
getComponentMessages
in interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
public boolean isRelatedTo(String instanceId)
- Specified by:
isRelatedTo
in interfaceorg.silverpeas.core.ApplicationService
-
createInfoLetter
public void createInfoLetter(InfoLetter il)
Implementation of InfoLetterService interface- Specified by:
createInfoLetter
in interfaceInfoLetterService
- Parameters:
il
- the information letter to create
-
updateInfoLetter
public void updateInfoLetter(InfoLetter ie)
Description copied from interface:InfoLetterService
Update information letter- Specified by:
updateInfoLetter
in interfaceInfoLetterService
- Parameters:
ie
- the information letter to update
-
getInfoLetters
public List<InfoLetter> getInfoLetters(String instanceId)
Description copied from interface:InfoLetterService
Retrieve information letters- Specified by:
getInfoLetters
in 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:InfoLetterService
Retrieve information letter publications- Specified by:
getInfoLetterPublications
in 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:InfoLetterService
Create information letter publication- Specified by:
createInfoLetterPublication
in 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:InfoLetterService
Delete information letter publication- Specified by:
deleteInfoLetterPublication
in interfaceInfoLetterService
- Parameters:
pk
- the information letter publication primary keycomponentId
- the component identifier
-
updateInfoLetterPublication
public void updateInfoLetterPublication(InfoLetterPublicationPdC ilp)
Description copied from interface:InfoLetterService
Update information letter publication- Specified by:
updateInfoLetterPublication
in interfaceInfoLetterService
- Parameters:
ilp
- the information letter publication to update
-
getInfoLetter
public InfoLetter getInfoLetter(org.silverpeas.core.WAPrimaryKey letterPK)
Description copied from interface:InfoLetterService
Retrieve an information letter from his primary key- Specified by:
getInfoLetter
in interfaceInfoLetterService
- Parameters:
letterPK
- the letter primary key- Returns:
- the infirmation letter
-
getInfoLetterPublication
public InfoLetterPublicationPdC getInfoLetterPublication(org.silverpeas.core.WAPrimaryKey publiPK)
Description copied from interface:InfoLetterService
Retrieve information letter publication from his key- Specified by:
getInfoLetterPublication
in 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:InfoLetterService
Create a default Info Letter when instanciated- Specified by:
createDefaultLetter
in 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:
deleteAllInfoLetters
in interfaceInfoLetterService
- Parameters:
componentId
- the unique identifier of the InfoLetter instance.
-
getSilverObjectId
public int getSilverObjectId(String pubId, String componentId)
- Specified by:
getSilverObjectId
in interfaceInfoLetterService
-
getInternalSuscribers
public org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSuscribers(String componentId)
- Specified by:
getInternalSuscribers
in 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:InfoLetterService
Update internal user subscribers list- Specified by:
setInternalSuscribers
in 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:InfoLetterService
Retrieve external emails address- Specified by:
getEmailsExternalsSuscribers
in 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:InfoLetterService
Save external subscriber emails address- Specified by:
setEmailsExternalsSubscribers
in 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:InfoLetterService
Toggle subscription unsubscription of a user to the news letter- Specified by:
toggleSuscriber
in 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:InfoLetterService
Check if use is an internal subscriber of the information letter- Specified by:
isUserSuscribed
in 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:InfoLetterService
Initialize template- Specified by:
initTemplate
in 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:InfoLetterService
Send letter by mail- Specified by:
sendTemplateByMail
in 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:InfoLetterService
Send letter by mail- Specified by:
sendLetterByMail
in 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:InfoLetterService
Indexes all info letter indexable data.- Specified by:
indexInfoLetter
in interfaceInfoLetterService
- Parameters:
componentId
- the identifier of the concerned component instance.
-
-