Class DelegatedNewsServiceImpl

  • All Implemented Interfaces:
    DelegatedNewsService, org.silverpeas.core.admin.component.ComponentInstanceDeletion

    @Service
    public class DelegatedNewsServiceImpl
    extends Object
    implements DelegatedNewsService, org.silverpeas.core.admin.component.ComponentInstanceDeletion
    • Constructor Detail

      • DelegatedNewsServiceImpl

        public DelegatedNewsServiceImpl()
    • Method Detail

      • delete

        public void delete​(String componentInstanceId)
        Specified by:
        delete in interface org.silverpeas.core.admin.component.ComponentInstanceDeletion
      • submitNews

        public void submitNews​(org.silverpeas.core.contribution.model.Contribution contribution,
                               org.silverpeas.core.date.Period visibilityPeriod,
                               String userId)
        Description copied from interface: DelegatedNewsService
        Submits the specified contribution as a delegated news. The submitted news can then be identified by the contribution identifier from which it is spawned.
        Specified by:
        submitNews in interface DelegatedNewsService
        Parameters:
        contribution - the contribution to take as a news to publish.
        visibilityPeriod - the period during which the news has to be visible. If null, the news is always visible.
        userId - the unique identifier of the user that has submitted the contribution as a news.
      • getDelegatedNews

        public DelegatedNews getDelegatedNews​(String contributionId)
        Description copied from interface: DelegatedNewsService
        Gets the delegated news matching the specified contribution.
        Specified by:
        getDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the delegated news. It is the unique identifier of the contribution from which it was spawned.
        Returns:
      • getDelegatedNews

        public List<DelegatedNews> getDelegatedNews​(Collection<String> contributionIds)
        Description copied from interface: DelegatedNewsService
        Gets the delegated news matching the specified contribution.
        Specified by:
        getDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionIds - a collection of unique identifiers, each of them referring a contribution from which a delegated news was spawned.
        Returns:
        a list of delegated news.
      • validateDelegatedNews

        public void validateDelegatedNews​(String contributionId,
                                          String validatorId)
        Description copied from interface: DelegatedNewsService
        Validates the specified delegated news.
        Specified by:
        validateDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the contribution from which the delegated news was spawned.
        validatorId - the unique identifier of the validator.
      • refuseDelegatedNews

        public void refuseDelegatedNews​(String contributionId,
                                        String validatorId,
                                        String refusalMotive)
        Description copied from interface: DelegatedNewsService
        Refuses the specified delegated news with the given motive.
        Specified by:
        refuseDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the contribution from which the delegated news was spawned.
        validatorId - the unique identifier of the validator.
        refusalMotive - the motive of the refusal.
      • updateDateDelegatedNews

        public void updateDateDelegatedNews​(String contributionId,
                                            org.silverpeas.core.date.Period visibilityPeriod)
        Description copied from interface: DelegatedNewsService
        Updates the period of visibility of the specified delegated news.
        Specified by:
        updateDateDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the contribution from which the delegated news was spawned.
        visibilityPeriod - the new visibility period. If null then the news will be always visible.
      • updateDelegatedNews

        public void updateDelegatedNews​(org.silverpeas.core.contribution.model.ContributionIdentifier id,
                                        String updaterId,
                                        org.silverpeas.core.date.Period visibilityPeriod)
        Description copied from interface: DelegatedNewsService
        Updates the news matching the specified contribution and from the update information. This method should be invoked when the matching contribution is updated.
        Specified by:
        updateDelegatedNews in interface DelegatedNewsService
        Parameters:
        id - the unique identifier of the updated contribution and from which the news has to be updated.
        updaterId - the unique identifier of the contribution updater.
        visibilityPeriod - the new period of visibility of the news. If null, then the news is always visible.
      • deleteDelegatedNews

        public void deleteDelegatedNews​(String contributionId)
        Description copied from interface: DelegatedNewsService
        Deletes the specified delegated news.
        Specified by:
        deleteDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the contribution from which the news was spawned.
      • updateOrderDelegatedNews

        public DelegatedNews updateOrderDelegatedNews​(String contributionId,
                                                      int newsOrder)
        Description copied from interface: DelegatedNewsService
        Updates the order of the specified delegated news among the other news.
        Specified by:
        updateOrderDelegatedNews in interface DelegatedNewsService
        Parameters:
        contributionId - the unique identifier of the contribution from which the deletaged news was spawned.
        newsOrder - the new order of the news.
        Returns:
        the updated delegated news.