Class BlogHome

java.lang.Object
fr.paris.lutece.plugins.blog.business.BlogHome

public final class BlogHome extends Object
This class provides instances management methods (create, find, ...) for Blog objects
  • Method Details

    • create

      public static Blog create(Blog blog)
      Create an instance of the blog class
      Parameters:
      blog - The instance of the blog which contains the informations to store
      Returns:
      The instance of blog which has been created with its primary key.
    • createVersion

      public static Blog createVersion(Blog blog)
      Create an instance of the blog class
      Parameters:
      blog - The instance of the blog which contains the informations to store
      Returns:
      The instance of blog which has been created with its primary key.
    • update

      public static Blog update(Blog blog)
      Update of the blog which is specified in parameter
      Parameters:
      blog - The instance of the blog which contains the data to store
      Returns:
      The instance of the blog which has been updated
    • remove

      public static void remove(int nKey)
      Remove the blog whose identifier is specified in parameter
      Parameters:
      nKey - The blog Id
    • removeVersions

      public static void removeVersions(int nKey)
      Remove the blog's versions whose identifier is specified in parameter
      Parameters:
      nKey - The blog Id
    • removeSpecificVersion

      public static void removeSpecificVersion(int nIdBlog, int nVersion)
      Remove a specific version from a blog
      Parameters:
      nIdBlog - The id of the blog to modify
      nIdVersion - The value of the version to remove
    • findByPrimaryKey

      public static Blog findByPrimaryKey(int nKey)
      Returns an instance of a blog whose identifier is specified in parameter
      Parameters:
      nKey - The blog primary key
      Returns:
      an instance of blog
    • findByName

      public static Blog findByName(String strName)
      Returns an instance of a blog whose identifier is specified in parameter
      Parameters:
      nKey - The blog primary key
      Returns:
      an instance of blog
    • findVersion

      public static Blog findVersion(int nId, int nVersion)
      Returns an instance of a blog whose identifier is specified in parameter
      Parameters:
      nId - The blog primary key
      nVersion -
      Returns:
      an instance of blog
    • getBlogsList

      public static List<Blog> getBlogsList()
      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
    • getLastModifiedBlogsList

      public static List<Blog> getLastModifiedBlogsList(int nLimit)
      Load the data of nLimit last modified Blog objects and returns them as a list
      Parameters:
      nLimit - number of Blogument
      Returns:
      The list which contains the data of of nLimit last modified Blog objects
    • getLastBlogVersionsList

      public static List<Blog> getLastBlogVersionsList(int nId, int nLimit)
      Load the data of nLimit last versions of a specific blog and returns them as a list
      Parameters:
      nId - The blog's primary key
      nLimit - Maximum amount of Blog Object versions to return
      Returns:
      The list which contains the data of nLimit last versions of the blog
    • getBlogsVersionsList

      public static List<Blog> getBlogsVersionsList(int nId)
      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
    • getUsersEditedBlogVersions

      public static List<String> getUsersEditedBlogVersions(int nId)
      Load the data of all users edited the Blog objects and returns them as a list
      Parameters:
      nId - The Id
      Returns:
      the list which contains the data of all users edited the Blog objects
    • getIdBlogsList

      public static List<Integer> getIdBlogsList()
      Load the id of all the Blog objects and returns them as a list
      Returns:
      the list which contains the id of all the Blog objects
    • getBlogsReferenceList

      public static fr.paris.lutece.util.ReferenceList getBlogsReferenceList()
      Load the data of all the Blog objects and returns them as a referenceList
      Returns:
      the referenceList which contains the data of all the Blog objects
    • addInitialVersion

      public static Blog addInitialVersion(Blog blog)
      Create an initial version of an Blog
      Parameters:
      blog - The instance of the Blog which contains the informations to store
      Returns:
      The instance of Blog which has been created with its primary key.
    • addNewVersion

      public static Blog addNewVersion(Blog blog)
      Adds a new version of an Blog
      Parameters:
      blog - The instance of the blog which contains the informations to store
      Returns:
      The instance of the blog which has been updated
    • findByFilter

      public static List<Blog> findByFilter(BlogFilter filter)
      Returns a collection of blog objects
      Parameters:
      filter - The filter
      Returns:
      A collection of Blogs
    • getBlogByTag

      public static List<Blog> getBlogByTag(int nIdTag)
      Load the data of Blog objects and returns them as a list
      Parameters:
      nIdTag - Tag Id
      Returns:
      The list which contains the data of Blog objects
    • selectWithoutBinaries

      public static List<Blog> selectWithoutBinaries()
      Returns a collection of blog objects
      Returns:
    • getActualVersionNumber

      public static int getActualVersionNumber(Timestamp strUpdateDate, int nId)
      Returns the actual version number of a blog It get the version number witch has is the closest to the update date
      Parameters:
      strUpdateDate - the update date
      nId - the blog id
      Returns:
      the version number
    • updateBlogArchiveId

      public static void updateBlogArchiveId(boolean isArchived, int blogId)
      Archive a blog
      Parameters:
      blogId - The id of the blog to archive
    • selectByArchiveStatus

      public static List<Blog> selectByArchiveStatus(boolean isArchived)
      Select the list of blogs by archive status
      Parameters:
      isArchived - The archive status
      Returns:
      The list of blogs