Class InfoLetterDataManager

  • All Implemented Interfaces:
    InfoLetterService, org.silverpeas.core.ApplicationService

    @Service
    @Named("infoLetterService")
    public class InfoLetterDataManager
    extends Object
    implements InfoLetterService
    Class declaration
    Author:
    • Constructor Detail

      • InfoLetterDataManager

        public InfoLetterDataManager()
    • 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 interface org.silverpeas.core.ApplicationService
      • getComponentSettings

        public org.silverpeas.core.util.SettingBundle getComponentSettings()
        Specified by:
        getComponentSettings in interface org.silverpeas.core.ApplicationService
      • getComponentMessages

        public org.silverpeas.core.util.LocalizationBundle getComponentMessages​(String language)
        Specified by:
        getComponentMessages in interface org.silverpeas.core.ApplicationService
      • isRelatedTo

        public boolean isRelatedTo​(String instanceId)
        Specified by:
        isRelatedTo in interface org.silverpeas.core.ApplicationService
      • createInfoLetter

        public void createInfoLetter​(InfoLetter il)
        Implementation of InfoLetterService interface
        Specified by:
        createInfoLetter in interface InfoLetterService
        Parameters:
        il - the information letter to create
      • getInfoLetters

        public List<InfoLetter> getInfoLetters​(String instanceId)
        Description copied from interface: InfoLetterService
        Retrieve information letters
        Specified by:
        getInfoLetters in interface InfoLetterService
        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 interface InfoLetterService
        Parameters:
        letterPK - the information letter primary key
        Returns:
        the list of information letter publications of an information letter
      • deleteInfoLetterPublication

        public void deleteInfoLetterPublication​(org.silverpeas.core.WAPrimaryKey pk,
                                                String componentId)
        Description copied from interface: InfoLetterService
        Delete information letter publication
        Specified by:
        deleteInfoLetterPublication in interface InfoLetterService
        Parameters:
        pk - the information letter publication primary key
        componentId - the component identifier
      • 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 interface InfoLetterService
        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 interface InfoLetterService
        Parameters:
        publiPK - the information letter publication primary key
        Returns:
        an Information Letter Publication PdC
      • 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 interface InfoLetterService
        Parameters:
        componentId - the unique identifier of the InfoLetter instance.
      • getInternalSuscribers

        public org.silverpeas.core.subscription.util.SubscriptionSubscriberList getInternalSuscribers​(String componentId)
        Specified by:
        getInternalSuscribers in interface InfoLetterService
        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 interface InfoLetterService
        Parameters:
        componentId - componentId component instance id
        users - an array of User detail
        groups - 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 interface InfoLetterService
        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 interface InfoLetterService
        Parameters:
        letterPK - the letter primary key
        emails - 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 interface InfoLetterService
        Parameters:
        userId - the user identifier
        componentId - the info letter component instance identifier
        isUserSubscribing - 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 interface InfoLetterService
        Parameters:
        userId - the user identifier
        componentId - 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 interface InfoLetterService
        Parameters:
        componentId - the info letter component instance identifier
        letterPK - the info letter identifier
        userId - 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 interface InfoLetterService
        Parameters:
        il - the template
        mimeMultipart - please have a look to https://en.wikipedia.org/wiki/MIME#Multipart_subtypes
        listEmailDest - list of email
        subject - subject of email
        emailFrom - 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 interface InfoLetterService
        Parameters:
        ilp - the information letter
        mimeMultipart - please have a look to https://en.wikipedia.org/wiki/MIME#Multipart_subtypes
        listEmailDest - list of email
        subject - subject of email
        emailFrom - 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 interface InfoLetterService
        Parameters:
        componentId - the identifier of the concerned component instance.