fr.paris.lutece.plugins.stock.modules.tickets.service
Class CategoryService

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.modules.tickets.service.CategoryService
All Implemented Interfaces:
ICategoryService

@Transactional
public final class CategoryService
extends java.lang.Object
implements ICategoryService

CategoryService.


Method Summary
 java.lang.String doCreateCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
          Creates a category.
 void doDeleteCategory(int nIdCategory)
          Deletes a category.
 java.lang.String doModifyCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
          Modifies a category.
 void doSaveCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
          Modifies a category.
 java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAll()
          Returns all.
 java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAll(java.util.List<java.lang.String> orderList)
          Return all category.
 java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAllChildrenWithChildren(java.lang.Integer idCategory)
          Finds all category's children and fetch children.
 java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAllFirstLevelWithChildren()
          Finds all categories (first level) and fetch children.
 fr.paris.lutece.plugins.stock.commons.ResultList<fr.paris.lutece.plugins.stock.business.category.Category> findByFilter(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter, fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
          Finds by filter.
 java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findByFilterWithChildren(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter)
          Finds by filter and fetch children.
 fr.paris.lutece.plugins.stock.business.category.Category findById(java.lang.Integer nIdCategory)
          Find by id.
 fr.paris.lutece.plugins.stock.business.category.Category findByIdWithParent(java.lang.Integer nIdCategory)
          Finds a category and fetch parent.
 fr.paris.lutece.plugins.stock.business.category.Category findByIdWithProduct(java.lang.Integer nIdCategory)
          Finds a category and fetch product.
 fr.paris.lutece.plugins.stock.business.category.Category findByPrimarykeyWithChildren(java.lang.Integer nIdCategory)
          Finds a category and all his subcategories and fetch children.
 fr.paris.lutece.plugins.stock.business.category.Category getCategory(int nIdCategory)
          Get the category with the given id.
 fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithChildren(java.lang.Integer idCategory)
          Finds a category and all his subcategories and fetch children.
 fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithParent(int nIdCategory)
          Finds a category and fetch parent.
static CategoryService getInstance()
          Get an instance of CategoryService.
 void init()
          Init the object.
 void update(fr.paris.lutece.plugins.stock.business.category.Category category)
          Update the category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CategoryService getInstance()
Get an instance of CategoryService.

Returns:
An instance of CategoryService

init

public void init()
Init the object.

Specified by:
init in interface ICategoryService

doCreateCategory

@Transactional
public java.lang.String doCreateCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
Creates a category.

Specified by:
doCreateCategory in interface ICategoryService
Parameters:
category - The category to create in database
Returns:
error if occurs

doModifyCategory

@Transactional
public java.lang.String doModifyCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
Modifies a category.

Specified by:
doModifyCategory in interface ICategoryService
Parameters:
category - The category to modify in database
Returns:
error if occurs

doDeleteCategory

@Transactional
public void doDeleteCategory(int nIdCategory)
Deletes a category.

Specified by:
doDeleteCategory in interface ICategoryService
Parameters:
nIdCategory - The category id to delete in database

getCategory

public fr.paris.lutece.plugins.stock.business.category.Category getCategory(int nIdCategory)
Get the category with the given id.

Specified by:
getCategory in interface ICategoryService
Parameters:
nIdCategory - The category id
Returns:
The category with the given id

getCategoryWithParent

public fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithParent(int nIdCategory)
Finds a category and fetch parent.

Specified by:
getCategoryWithParent in interface ICategoryService
Parameters:
nIdCategory - the id of the searched category
Returns:
the category

getCategoryWithChildren

public fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithChildren(java.lang.Integer idCategory)
Finds a category and all his subcategories and fetch children.

Specified by:
getCategoryWithChildren in interface ICategoryService
Parameters:
idCategory - the id of upper category
Returns:
the category

findAllFirstLevelWithChildren

public java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAllFirstLevelWithChildren()
Finds all categories (first level) and fetch children.

Specified by:
findAllFirstLevelWithChildren in interface ICategoryService
Returns:
all first level categories

findAllChildrenWithChildren

public java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAllChildrenWithChildren(java.lang.Integer idCategory)
Finds all category's children and fetch children.

Specified by:
findAllChildrenWithChildren in interface ICategoryService
Parameters:
idCategory - the id of upper category
Returns:
all category's children

findByPrimarykeyWithChildren

public fr.paris.lutece.plugins.stock.business.category.Category findByPrimarykeyWithChildren(java.lang.Integer nIdCategory)
Finds a category and all his subcategories and fetch children.

Specified by:
findByPrimarykeyWithChildren in interface ICategoryService
Parameters:
nIdCategory - the id of upper category
Returns:
the category

findByIdWithParent

public fr.paris.lutece.plugins.stock.business.category.Category findByIdWithParent(java.lang.Integer nIdCategory)
Finds a category and fetch parent.

Specified by:
findByIdWithParent in interface ICategoryService
Parameters:
nIdCategory - the id of the searched category
Returns:
the category

findByIdWithProduct

public fr.paris.lutece.plugins.stock.business.category.Category findByIdWithProduct(java.lang.Integer nIdCategory)
Finds a category and fetch product.

Specified by:
findByIdWithProduct in interface ICategoryService
Parameters:
nIdCategory - the id of the searched category
Returns:
the category

findByFilterWithChildren

public java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findByFilterWithChildren(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter)
Finds by filter and fetch children.

Specified by:
findByFilterWithChildren in interface ICategoryService
Parameters:
filter - the filter
Returns:
the category list

findByFilter

public fr.paris.lutece.plugins.stock.commons.ResultList<fr.paris.lutece.plugins.stock.business.category.Category> findByFilter(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter,
                                                                                                                               fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Finds by filter.

Specified by:
findByFilter in interface ICategoryService
Parameters:
filter - the filter
paginationProperties - the pagination properties
Returns:
the category list

findAll

public java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAll()
Returns all.

Specified by:
findAll in interface ICategoryService
Returns:
the list

findById

public fr.paris.lutece.plugins.stock.business.category.Category findById(java.lang.Integer nIdCategory)
Find by id.

Specified by:
findById in interface ICategoryService
Parameters:
nIdCategory - the n id category
Returns:
the category

update

public void update(fr.paris.lutece.plugins.stock.business.category.Category category)
Update the category.

Specified by:
update in interface ICategoryService
Parameters:
category - the category

doSaveCategory

public void doSaveCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
                    throws fr.paris.lutece.plugins.stock.commons.exception.ValidationException
Modifies a category.

Specified by:
doSaveCategory in interface ICategoryService
Parameters:
category - The category to modify in database
Throws:
fr.paris.lutece.plugins.stock.commons.exception.ValidationException

findAll

public java.util.List<fr.paris.lutece.plugins.stock.business.category.Category> findAll(java.util.List<java.lang.String> orderList)
Return all category.

Specified by:
findAll in interface ICategoryService
Parameters:
orderList - list of order
Returns:
the list of provider


Copyright © 2012 Mairie de Paris. All Rights Reserved.