Package org.silverpeas.components.blog.service

# Class DefaultBlogService

java.lang.Object
org.silverpeas.components.blog.service.DefaultBlogService

All Implemented Interfaces:
  `BlogService`, `org.silverpeas.core.ApplicationService`, `org.silverpeas.core.initialization.Initialization`

@Service @Named("blogService") public class DefaultBlogService extends Object implements BlogService, org.silverpeas.core.initialization.Initialization
Default implementation of the services provided by the Blog component. It is managed by the underlying IoC container. At initialization by the IoC container, it registers itself among different services for which it is interested.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultBlogService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `createCategory(Category category)`
  `String`
  `createPost(PostDetail post)`
  `String`
  `createPost(PostDetail post, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)`
  `void`
  `deleteCategory(String instanceId, String id)`
  `void`
  `deletePost(String instanceId, String postId)`
  `void`
  `draftOutPost(PostDetail post)`
  `Collection<Archive>`
  `getAllArchives(String instanceId)`
  `Collection<org.silverpeas.core.node.model.NodeDetail>`
  `getAllCategories(String instanceId)`
  `Collection<PostDetail>`
  `getAllPosts(String instanceId)`
  `Category`
  `getCategory(org.silverpeas.core.node.model.NodePK pk)`
  `protected org.silverpeas.core.comment.service.CommentService`
  `getCommentService()`
  Gets a DefaultCommentService instance.
  `org.silverpeas.kernel.bundle.LocalizationBundle`
  `getComponentMessages(String language)`
  `org.silverpeas.kernel.bundle.SettingBundle`
  `getComponentSettings()`
  `Optional<PostDetail>`
  `getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)`
  `Collection<PostDetail>`
  `getLastPosts(String instanceId, BlogFilters filters)`
  `Collection<PostDetail>`
  `getLastValidPosts(String instanceId, BlogFilters filters)`
  `Collection<PostDetail>`
  `getPostsByArchive(String instanceId, String beginDate, String endDate, BlogFilters filters)`
  `Collection<PostDetail>`
  `getPostsByCategory(String instanceId, String categoryId, BlogFilters filters)`
  `Collection<PostDetail>`
  `getPostsByEventDate(String instanceId, String date, BlogFilters filters)`
  `Collection<PostDetail>`
  `getResultSearch(String instanceId, String word, String userId, BlogFilters filters)`
  `void`
  `indexBlog(String componentId)`
  `void`
  `init()`
  `boolean`
  `isRelatedTo(String instanceId)`
  `boolean`
  `isSubscribed(String userId, String instanceId)`
  `void`
  `sendSubscriptionsNotification(org.silverpeas.core.node.model.NodePK fatherPK, PostDetail post, org.silverpeas.core.comment.model.Comment comment, String type, String senderId)`
  `void`
  `updateCategory(Category category)`
  `void`
  `updatePost(PostDetail post, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)`

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

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

  ### Methods inherited from interface org.silverpeas.core.initialization.Initialization

  `getPriority, release`

- ## Constructor Details

  - ### DefaultBlogService

    public DefaultBlogService()

- ## Method Details

  - ### init

    public void init()
    Specified by:
      `init` in interface `org.silverpeas.core.initialization.Initialization`

  - ### getContributionById

    public Optional<PostDetail> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)
    Specified by:
      `getContributionById` in interface `org.silverpeas.core.ApplicationService`
    Specified by:
      `getContributionById` in interface `BlogService`

  - ### getComponentSettings

    public org.silverpeas.kernel.bundle.SettingBundle getComponentSettings()
    Specified by:
      `getComponentSettings` in interface `org.silverpeas.core.ApplicationService`

  - ### getComponentMessages

    public org.silverpeas.kernel.bundle.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`

  - ### createPost

    public String createPost(PostDetail post)
    Specified by:
      `createPost` in interface `BlogService`

  - ### createPost

    public String createPost(PostDetail post, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)
    Specified by:
      `createPost` in interface `BlogService`

  - ### sendSubscriptionsNotification

    public void sendSubscriptionsNotification(org.silverpeas.core.node.model.NodePK fatherPK, PostDetail post, org.silverpeas.core.comment.model.Comment comment, String type, String senderId)
    Specified by:
      `sendSubscriptionsNotification` in interface `BlogService`

  - ### updatePost

    public void updatePost(PostDetail post, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)
    Specified by:
      `updatePost` in interface `BlogService`

  - ### deletePost

    public void deletePost(String instanceId, String postId)
    Specified by:
      `deletePost` in interface `BlogService`

  - ### getLastPosts

    public Collection<PostDetail> getLastPosts(String instanceId, BlogFilters filters)
    Specified by:
      `getLastPosts` in interface `BlogService`

  - ### getAllPosts

    public Collection<PostDetail> getAllPosts(String instanceId)
    Specified by:
      `getAllPosts` in interface `BlogService`

  - ### getLastValidPosts

    public Collection<PostDetail> getLastValidPosts(String instanceId, BlogFilters filters)
    Specified by:
      `getLastValidPosts` in interface `BlogService`

  - ### getPostsByCategory

    public Collection<PostDetail> getPostsByCategory(String instanceId, String categoryId, BlogFilters filters)
    Specified by:
      `getPostsByCategory` in interface `BlogService`

  - ### getPostsByEventDate

    public Collection<PostDetail> getPostsByEventDate(String instanceId, String date, BlogFilters filters)
    Specified by:
      `getPostsByEventDate` in interface `BlogService`

  - ### getPostsByArchive

    public Collection<PostDetail> getPostsByArchive(String instanceId, String beginDate, String endDate, BlogFilters filters)
    Specified by:
      `getPostsByArchive` in interface `BlogService`

  - ### getResultSearch

    public Collection<PostDetail> getResultSearch(String instanceId, String word, String userId, BlogFilters filters)
    Specified by:
      `getResultSearch` in interface `BlogService`

  - ### createCategory

    public void createCategory(Category category)
    Specified by:
      `createCategory` in interface `BlogService`

  - ### updateCategory

    public void updateCategory(Category category)
    Specified by:
      `updateCategory` in interface `BlogService`

  - ### deleteCategory

    public void deleteCategory(String instanceId, String id)
    Specified by:
      `deleteCategory` in interface `BlogService`

  - ### getCategory

    public Category getCategory(org.silverpeas.core.node.model.NodePK pk)
    Specified by:
      `getCategory` in interface `BlogService`

  - ### getAllCategories

    public Collection<org.silverpeas.core.node.model.NodeDetail> getAllCategories(String instanceId)
    Specified by:
      `getAllCategories` in interface `BlogService`

  - ### getAllArchives

    public Collection<Archive> getAllArchives(String instanceId)
    Specified by:
      `getAllArchives` in interface `BlogService`

  - ### indexBlog

    public void indexBlog(String componentId)
    Specified by:
      `indexBlog` in interface `BlogService`

  - ### isSubscribed

    public boolean isSubscribed(String userId, String instanceId)
    Specified by:
      `isSubscribed` in interface `BlogService`

  - ### draftOutPost

    public void draftOutPost(PostDetail post)
    Specified by:
      `draftOutPost` in interface `BlogService`

  - ### getCommentService

    protected org.silverpeas.core.comment.service.CommentService getCommentService()
    Gets a DefaultCommentService instance.
    Returns:
      a DefaultCommentService instance.