Interface DelegatedNewsService
-
- All Known Implementing Classes:
DelegatedNewsServiceImpl
public interface DelegatedNewsService
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDelegatedNewsService.Constants
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteDelegatedNews(String contributionId)Deletes the specified delegated news.static DelegatedNewsServiceget()Gets the instance of the actual implementation of theDelegatedNewsServiceinterface.List<DelegatedNews>getAllDelegatedNews()Gets all the delegated news.List<DelegatedNews>getAllValidDelegatedNews()Gets all the validated delegated news.DelegatedNewsgetDelegatedNews(String contributionId)Gets the delegated news matching the specified contribution.List<DelegatedNews>getDelegatedNews(Collection<String> contributionIds)Gets the delegated news matching the specified contribution.voidrefuseDelegatedNews(String contributionId, String validatorId, String refusalMotive)Refuses the specified delegated news with the given motive.voidsubmitNews(org.silverpeas.core.contribution.model.Contribution contribution, org.silverpeas.core.date.Period visibilityPeriod, String userId)Submits the specified contribution as a delegated news.voidupdateDateDelegatedNews(String contributionId, org.silverpeas.core.date.Period visibilityPeriod)Updates the period of visibility of the specified delegated news.voidupdateDelegatedNews(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.DelegatedNewsupdateOrderDelegatedNews(String contributionId, int newsOrder)Updates the order of the specified delegated news among the other news.voidvalidateDelegatedNews(String contributionId, String validatorId)Validates the specified delegated news.
-
-
-
Method Detail
-
get
static DelegatedNewsService get()
Gets the instance of the actual implementation of theDelegatedNewsServiceinterface.- Returns:
- a
DelegatedNewsServiceinstance.
-
submitNews
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. The submitted news can then be identified by the contribution identifier from which it is spawned.- 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
DelegatedNews getDelegatedNews(String contributionId)
Gets the delegated news matching the specified contribution.- Parameters:
contributionId- the unique identifier of the delegated news. It is the unique identifier of the contribution from which it was spawned.- Returns:
-
getDelegatedNews
List<DelegatedNews> getDelegatedNews(Collection<String> contributionIds)
Gets the delegated news matching the specified contribution.- 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
List<DelegatedNews> getAllDelegatedNews()
Gets all the delegated news.- Returns:
- a list of all of the delegated news.
-
getAllValidDelegatedNews
List<DelegatedNews> getAllValidDelegatedNews()
Gets all the validated delegated news.- Returns:
- a list of all of the delegated news that are validated.
-
validateDelegatedNews
void validateDelegatedNews(String contributionId, String validatorId)
Validates the specified delegated news.- Parameters:
contributionId- the unique identifier of the contribution from which the delegated news was spawned.validatorId- the unique identifier of the validator.
-
refuseDelegatedNews
void refuseDelegatedNews(String contributionId, String validatorId, String refusalMotive)
Refuses the specified delegated news with the given motive.- 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
void updateDateDelegatedNews(String contributionId, org.silverpeas.core.date.Period visibilityPeriod)
Updates the period of visibility of the specified delegated news.- 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
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. This method should be invoked when the matching contribution is updated.- 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
void deleteDelegatedNews(String contributionId)
Deletes the specified delegated news.- Parameters:
contributionId- the unique identifier of the contribution from which the news was spawned.
-
updateOrderDelegatedNews
DelegatedNews updateOrderDelegatedNews(String contributionId, int newsOrder)
Updates the order of the specified delegated news among the other news.- 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.
-
-