Class BlogService


  • public class BlogService
    extends java.lang.Object
    This Service manages document actions (create, update, delete, validate ...) .
    • Constructor Detail

      • BlogService

        public BlogService()
    • Method Detail

      • getInstance

        public static BlogService getInstance()
        Get the unique instance of the service
        Returns:
        The unique instance
      • createBlog

        public void createBlog​(Blog blog)
        Create an blog
        Parameters:
        blog - The Blog
      • updateBlog

        public void updateBlog​(Blog blog)
        Update an Blog
        Parameters:
        blog - The Blog
      • deleteBlog

        public void deleteBlog​(int nId)
        Remove an blog
        Parameters:
        nId - The blog id
      • deleteBlogVersion

        public void deleteBlogVersion​(int nIdBlog,
                                      int nVersion)
        Delete the specified version from a blog's history
        Parameters:
        nIdBlog - The ID of the blog to process
        nIdVersion - The value of the version to delete
      • revertBlogToPreviousVersion

        public void revertBlogToPreviousVersion​(Blog blog)
        Revert the content of a blog to its previous version's content, and delete the one currently used (no new version is created)
        Parameters:
        blog - The Blog Object that will be processed
      • getLastBlogVersionsList

        public java.util.List<Blog> getLastBlogVersionsList​(int nIdBlog,
                                                            int nLimit)
        Retrieve the last nLimit versions of a specific blog and returns them as a list
        Parameters:
        nIdBlog - The ID of the blog to process
        nLimit - Maximum amount of Blog Object versions to return
        Returns:
        The list which contains the data of nLimit last modified Blog objects
      • createBlog

        public void createBlog​(Blog blog,
                               java.util.List<DocContent> docContent)
        Create an blog
        Parameters:
        blog - The Blog
        docContent - The Doc content
      • updateBlog

        public void updateBlog​(Blog blog,
                               java.util.List<DocContent> docContent)
        Update an Blog
        Parameters:
        blog - The Blog
        docContent - The Doc Content
      • updateBlogWithoutVersion

        public void updateBlogWithoutVersion​(Blog blog,
                                             java.util.List<DocContent> docContent)
        Update an Blog
        Parameters:
        blog - The blog
        docContent - The Doc Content
      • loadBlog

        public Blog loadBlog​(int nIdDocument)
        Returns an instance of a blog whose identifier is specified in parameter
        Parameters:
        nIdDocument - The blog primary key
        Returns:
        an instance of blog
      • loadBlogByVersion

        public Blog loadBlogByVersion​(int nIdDocument,
                                      int nVersion)
        Returns an instance of a blog whose identifier and version is specified in parameter
        Parameters:
        nIdDocument - The blog primary key
        nIdDocument - The blog primary key
        Returns:
        an instance of blog
      • findByPrimaryKeyWithoutBinaries

        public Blog findByPrimaryKeyWithoutBinaries​(int nIdDocument)
        Returns an instance of a blog without binairie file whose identifier is specified in parameter
        Parameters:
        nIdDocument - The blog primary key
        Returns:
        an instance of blog
      • getListBlogWhithBinaries

        public java.util.List<Blog> getListBlogWhithBinaries()
        Load the data of all the blog objects and returns them as a list
        Returns:
        the list which contains the data of all the blog objects
      • getListBlogWithoutBinaries

        public java.util.List<Blog> getListBlogWithoutBinaries()
        Returns a list of a blog without binairie file whose identifier is specified in parameter
        Returns:
        the list which contains the data of all the blog objects
      • searchListBlogByTag

        public java.util.List<Blog> searchListBlogByTag​(int nIdTag)
        Load the data of all the blog objects whose tag is specified in parameter
        Parameters:
        nIdTag - idTag param
        Returns:
        the list which contains the data of all the blog objects
      • findByFilter

        public java.util.List<Blog> findByFilter​(BlogFilter filter)
        Returns a collection of blog objects
        Parameters:
        filter - The filter
        Returns:
        The list of blog post
      • getLastModifiedBlogsList

        public java.util.List<Blog> getLastModifiedBlogsList​(int nLimit)
        Load the data of nLimit last modified Blog objects and returns them as a list
        Parameters:
        nLimit - number of Blog to load
        Returns:
        The list which contains the data of of nLimit last modified Blog objects
      • fireCreateBlogEvent

        public void fireCreateBlogEvent​(int blogId)
      • fireUpdateBlogEvent

        public void fireUpdateBlogEvent​(int blogId)
      • fireDeleteBlogEvent

        public void fireDeleteBlogEvent​(int blogId)