Package org.silverpeas.components.delegatednews.service

## Class DelegatedNewsServiceImpl

- java.lang.Object
- - org.silverpeas.components.delegatednews.service.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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.silverpeas.components.delegatednews.service.DelegatedNewsService

      `DelegatedNewsService.Constants`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DelegatedNewsServiceImpl()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `delete​(String componentInstanceId)` |
    `void` | `deleteDelegatedNews​(String contributionId)` | Deletes the specified delegated news.
    `List<DelegatedNews>` | `getAllDelegatedNews()` | Gets all the delegated news.
    `List<DelegatedNews>` | `getAllValidDelegatedNews()` | Gets all the validated delegated news.
    `DelegatedNews` | `getDelegatedNews​(String contributionId)` | Gets the delegated news matching the specified contribution.
    `List<DelegatedNews>` | `getDelegatedNews​(Collection<String> contributionIds)` | Gets the delegated news matching the specified contribution.
    `void` | `refuseDelegatedNews​(String contributionId, String validatorId, String refusalMotive)` | Refuses the specified delegated news with the given motive.
    `void` | `submitNews​(org.silverpeas.core.contribution.model.Contribution contribution, org.silverpeas.core.date.Period visibilityPeriod, String userId)` | Submits the specified contribution as a delegated news.
    `void` | `updateDateDelegatedNews​(String contributionId, org.silverpeas.core.date.Period visibilityPeriod)` | Updates the period of visibility of the specified delegated news.
    `void` | `updateDelegatedNews​(org.silverpeas.core.contribution.model.ContributionIdentifier id, String updaterId, org.silverpeas.core.date.Period visibilityPeriod)` | Updates the news matching the specified contribution and from the update information.
    `DelegatedNews` | `updateOrderDelegatedNews​(String contributionId, int newsOrder)` | Updates the order of the specified delegated news among the other news.
    `void` | `validateDelegatedNews​(String contributionId, String validatorId)` | Validates the specified delegated news.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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.

    - #### getAllDelegatedNews

          public List<DelegatedNews> getAllDelegatedNews()

      Description copied from interface: `DelegatedNewsService`
      Gets all the delegated news.
      Specified by:
        `getAllDelegatedNews` in interface `DelegatedNewsService`
      Returns:
        a list of all of the delegated news.

    - #### getAllValidDelegatedNews

          public List<DelegatedNews> getAllValidDelegatedNews()

      Description copied from interface: `DelegatedNewsService`
      Gets all the validated delegated news.
      Specified by:
        `getAllValidDelegatedNews` in interface `DelegatedNewsService`
      Returns:
        a list of all of the delegated news that are validated.

    - #### 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.