Interface InfoLetterService
-
- All Superinterfaces:
org.silverpeas.core.ApplicationService
- All Known Implementing Classes:
InfoLetterDataManager
public interface InfoLetterService extends org.silverpeas.core.ApplicationServiceContract to access info letter data
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description InfoLettercreateDefaultLetter(String componentId)Create a default Info Letter when instantiatedvoidcreateInfoLetter(InfoLetter il)Create 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()Set<String>getEmailsExternalsSubscribers(org.silverpeas.core.contribution.model.ContributionIdentifier id)Retrieve external emails addressInfoLettergetInfoLetter(org.silverpeas.core.contribution.model.ContributionIdentifier id)Retrieve an information letter from his primary keyInfoLetterPublicationPdCgetInfoLetterPublication(org.silverpeas.core.contribution.model.ContributionIdentifier identifier)Retrieve information letter publication from his keyList<InfoLetterPublication>getInfoLetterPublications(org.silverpeas.core.contribution.model.ContributionIdentifier id)Retrieve information letter publicationsList<InfoLetter>getInfoLetters(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 letterSet<String>sendLetterByMail(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 newslettervoidupdateInfoLetter(InfoLetter il)Update information lettervoidupdateInfoLetterPublication(InfoLetterPublicationPdC ilp)Update information letter publication
-
-
-
Method Detail
-
get
static InfoLetterService get()
-
createInfoLetter
void createInfoLetter(InfoLetter il)
Create information letter- Parameters:
il- the information letter to create
-
updateInfoLetter
void updateInfoLetter(InfoLetter il)
Update information letter- Parameters:
il- the information letter to update
-
getInfoLetters
List<InfoLetter> getInfoLetters(String applicationId)
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
void createInfoLetterPublication(InfoLetterPublicationPdC ilp, String userId)
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
void updateInfoLetterPublication(InfoLetterPublicationPdC ilp)
Update information letter publication- Parameters:
ilp- the information letter publication to update
-
getInfoLetter
InfoLetter getInfoLetter(org.silverpeas.core.contribution.model.ContributionIdentifier id)
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
InfoLetter createDefaultLetter(String componentId)
Create a default Info Letter when instantiated- Parameters:
componentId- the component identifier- Returns:
- a default Info Letter
-
deleteAllInfoLetters
void deleteAllInfoLetters(String componentId)
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
void toggleSubscriber(String userId, String componentId, boolean isUserSubscribing)
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
boolean isUserSubscribed(String userId, String componentId)
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
void initTemplate(org.silverpeas.core.contribution.model.ContributionIdentifier id, String userId)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
void indexInfoLetter(String componentId)
Indexes all info letter indexable data.- Parameters:
componentId- the identifier of the concerned component instance.
-
-