Interface InfoLetterService
- All Superinterfaces:
org.silverpeas.core.ApplicationService
- All Known Implementing Classes:
InfoLetterDataManager
public interface InfoLetterService
extends org.silverpeas.core.ApplicationService
Contract to access info letter data
-
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultLetter(String componentId) Create a default Info Letter when instantiatedvoidCreate information lettervoidcreateInfoLetterPublication(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 publicationstatic InfoLetterServiceget()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 identifier) Retrieve information letter publication from his keygetInfoLetterPublications(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve information letter publicationsgetInfoLetters(String applicationId) 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 templatebooleanisUserSubscribed(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 publicationMethods inherited from interface org.silverpeas.core.ApplicationService
getComponentMessages, getComponentSettings, getContributionById, isRelatedTo
-
Method Details
-
get
-
createInfoLetter
Create information letter- Parameters:
il- the information letter to create
-
updateInfoLetter
Update information letter- Parameters:
il- the information letter to update
-
getInfoLetters
Retrieve information letters- Parameters:
applicationId- the application identifier- Returns:
- the information letters of the current application identifier given in parameter
-
getInfoLetterPublications
List<InfoLetterPublication> getInfoLetterPublications(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve information letter publications- Parameters:
id- the information letter unique identifier- Returns:
- the list of information letter publications of an information letter
-
createInfoLetterPublication
Create information letter publication- Parameters:
ilp- the information letter publication pdc to createuserId- the creator user identifier
-
deleteInfoLetterPublication
void deleteInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier id) Delete information letter publication- Parameters:
id- the information letter publication unique identifier
-
updateInfoLetterPublication
Update information letter publication- Parameters:
ilp- the information letter publication to update
-
getInfoLetter
Retrieve an information letter from his primary key- Parameters:
id- the unique identifier of the info letter- Returns:
- the infirmation letter
-
getInfoLetterPublication
InfoLetterPublicationPdC getInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier identifier) Retrieve information letter publication from his key- Parameters:
identifier- the unique information letter identifier- Returns:
- an Information Letter Publication PdC
-
createDefaultLetter
Create a default Info Letter when instantiated- 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.- Parameters:
componentId- the unique identifier of the InfoLetter instance.
-
getInternalSubscribers
org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSubscribers(String componentId) - Parameters:
componentId- componentId component instance id- Returns:
- a list of subscriber ids indexed by type of subscriber
-
setInternalSubscribers
void setInternalSubscribers(String componentId, org.silverpeas.core.admin.user.model.User[] users, org.silverpeas.core.admin.user.model.Group[] groups) Update internal user subscribers list- Parameters:
componentId- componentId component instance idusers- an array of User detailgroups- an array of Group
-
getEmailsExternalsSubscribers
Set<String> getEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id) Retrieve external emails address- Parameters:
id- the info letter identifier- Returns:
- a set of external emails
-
setEmailsExternalsSubscribers
void setEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id, Set<String> emails) Save external subscriber emails address- Parameters:
id- the letter unique identifieremails- the list of external emails to save
-
toggleSubscriber
Toggle subscription unsubscription of a user to the newsletter- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifierisUserSubscribing- true if user is subscribing, false else if
-
isUserSubscribed
Check if use is an internal subscriber of the information letter- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifier- Returns:
- true if user is a subscriber, false else if
-
initTemplate
Initialize template- Parameters:
id- the info letter identifieruserId- the user identifier
-
sendLetterByMail
Set<String> sendLetterByMail(InfoLetterPublicationPdC ilp, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom) Send letter by mail- 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
Indexes all info letter indexable data.- Parameters:
componentId- the identifier of the concerned component instance.
-