Class BlogService
- java.lang.Object
-
- fr.paris.lutece.plugins.blog.service.BlogService
-
public class BlogService extends java.lang.ObjectThis Service manages document actions (create, update, delete, validate ...) .
-
-
Constructor Summary
Constructors Constructor Description BlogService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateBlog(Blog blog)Create an blogvoidcreateBlog(Blog blog, java.util.List<DocContent> docContent)Create an blogvoiddeleteBlog(int nId)Remove an blogvoiddeleteBlogVersion(int nIdBlog, int nVersion)Delete the specified version from a blog's historyjava.util.List<Blog>findByFilter(BlogFilter filter)Returns a collection of blog objectsBlogfindByPrimaryKeyWithoutBinaries(int nIdDocument)Returns an instance of a blog without binairie file whose identifier is specified in parametervoidfireCreateBlogEvent(int blogId)voidfireDeleteBlogEvent(int blogId)voidfireUpdateBlogEvent(int blogId)static BlogServicegetInstance()Get the unique instance of the servicejava.util.List<Blog>getLastBlogVersionsList(int nIdBlog, int nLimit)Retrieve the last nLimit versions of a specific blog and returns them as a listjava.util.List<Blog>getLastModifiedBlogsList(int nLimit)Load the data of nLimit last modified Blog objects and returns them as a listjava.util.List<Blog>getListBlogWhithBinaries()Load the data of all the blog objects and returns them as a listjava.util.List<Blog>getListBlogWithoutBinaries()Returns a list of a blog without binairie file whose identifier is specified in parameterBlogloadBlog(int nIdDocument)Returns an instance of a blog whose identifier is specified in parameterBlogloadBlogByVersion(int nIdDocument, int nVersion)Returns an instance of a blog whose identifier and version is specified in parametervoidrevertBlogToPreviousVersion(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)java.util.List<Blog>searchListBlogByTag(int nIdTag)Load the data of all the blog objects whose tag is specified in parametervoidupdateBlog(Blog blog)Update an BlogvoidupdateBlog(Blog blog, java.util.List<DocContent> docContent)Update an BlogvoidupdateBlogWithoutVersion(Blog blog, java.util.List<DocContent> docContent)Update an Blog
-
-
-
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 processnIdVersion- 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 processnLimit- 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 BlogdocContent- The Doc content
-
updateBlog
public void updateBlog(Blog blog, java.util.List<DocContent> docContent)
Update an Blog- Parameters:
blog- The BlogdocContent- The Doc Content
-
updateBlogWithoutVersion
public void updateBlogWithoutVersion(Blog blog, java.util.List<DocContent> docContent)
Update an Blog- Parameters:
blog- The blogdocContent- 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 keynIdDocument- 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)
-
-