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- Author:
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description InfoLettercreateDefaultLetter(String componentId)Create a default Info Letter when instanciatedvoidcreateInfoLetter(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.WAPrimaryKey pk, String componentId)Delete information letter publicationstatic InfoLetterServiceget()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 applicationId)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 templatebooleanisUserSuscribed(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 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.WAPrimaryKey letterPK)
Retrieve information letter publications- Parameters:
letterPK- the information letter primary key- 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.WAPrimaryKey pk, String componentId)Delete information letter publication- Parameters:
pk- the information letter publication primary keycomponentId- the component identifier
-
updateInfoLetterPublication
void updateInfoLetterPublication(InfoLetterPublicationPdC ilp)
Update information letter publication- Parameters:
ilp- the information letter publication to update
-
getInfoLetter
InfoLetter getInfoLetter(org.silverpeas.core.WAPrimaryKey letterPK)
Retrieve an information letter from his primary key- Parameters:
letterPK- the letter primary key- Returns:
- the infirmation letter
-
getInfoLetterPublication
InfoLetterPublicationPdC getInfoLetterPublication(org.silverpeas.core.WAPrimaryKey publiPK)
Retrieve information letter publication from his key- Parameters:
publiPK- the information letter publication primary key- Returns:
- an Information Letter Publication PdC
-
createDefaultLetter
InfoLetter createDefaultLetter(String componentId)
Create a default Info Letter when instanciated- 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.
-
getInternalSuscribers
org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSuscribers(String componentId)
- Parameters:
componentId- componentId component instance id- Returns:
- map of subscriber ids indexed by type of subscriber
-
setInternalSuscribers
void setInternalSuscribers(String componentId, org.silverpeas.core.admin.user.model.UserDetail[] 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
-
getEmailsExternalsSuscribers
Set<String> getEmailsExternalsSuscribers(org.silverpeas.core.WAPrimaryKey letterPK)
Retrieve external emails address- Parameters:
letterPK- the info letter identifier (letter primary key)- Returns:
- a set of external emails
-
setEmailsExternalsSubscribers
void setEmailsExternalsSubscribers(org.silverpeas.core.WAPrimaryKey letterPK, Set<String> emails)Save external subscriber emails address- Parameters:
letterPK- the letter primary keyemails- the list of external emails to save
-
toggleSuscriber
void toggleSuscriber(String userId, String componentId, boolean isUserSubscribing)
Toggle subscription unsubscription of a user to the news letter- Parameters:
userId- the user identifiercomponentId- the info letter component instance identifierisUserSubscribing- true if user is subscribing, false else if
-
isUserSuscribed
boolean isUserSuscribed(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(String componentId, org.silverpeas.core.WAPrimaryKey letterPK, String userId)
Initialize template- Parameters:
componentId- the info letter component instance identifierletterPK- the info letter identifieruserId- the user identifier
-
sendTemplateByMail
Set<String> sendTemplateByMail(InfoLetter il, String mimeMultipart, Set<String> listEmailDest, String subject, String emailFrom)
Send letter by mail- 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
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:
- list of emails in error
-
indexInfoLetter
void indexInfoLetter(String componentId)
Indexes all info letter indexable data.- Parameters:
componentId- the identifier of the concerned component instance.
-
-