Class CategoryService
- java.lang.Object
-
- fr.paris.lutece.plugins.crm.service.category.CategoryService
-
public class CategoryService extends Object
CategoryService
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcreateCategory(Category category)Create an instance of the category classCategoryfindByCode(String strCode)CategoryfindByPrimaryKey(int nIdCategory)Returns an instance of a category whose identifier is specified in parameterCategoryfindFirstCategory()Find the first category (order by the ID category)fr.paris.lutece.util.ReferenceListgetCategories(Locale locale, boolean bAddAllCategory, boolean bIsDefaultChoiceTop)Load the data of all the category objects and returns them in form of a ReferenceListCollection<Category>getCategoriesList()Load the data of all the category objects and returns them in form of a collectionstatic CategoryServicegetService()Get the instance ofCategoryServiceStringremoveCategory(int nIdCategory, Locale locale)Remove the category whose identifier is specified in parameter.voidupdateCategory(Category category)Update of the category which is specified in parameter
-
-
-
Method Detail
-
getService
public static CategoryService getService()
Get the instance ofCategoryService- Returns:
- an instance of
CategoryService
-
getCategoriesList
public Collection<Category> getCategoriesList()
Load the data of all the category objects and returns them in form of a collection- Returns:
- the collection which contains the data of all the category objects
-
getCategories
public fr.paris.lutece.util.ReferenceList getCategories(Locale locale, boolean bAddAllCategory, boolean bIsDefaultChoiceTop)
Load the data of all the category objects and returns them in form of a ReferenceList- Parameters:
locale-LocalebAddAllCategory- true if the must contain all category, false otherwisebIsDefaultChoiceTop- true if the default choices are put at the top of the list, false otherwise- Returns:
- the ReferenceList which contains the data of all the category objects
-
findByPrimaryKey
public Category findByPrimaryKey(int nIdCategory)
Returns an instance of a category whose identifier is specified in parameter- Parameters:
nIdCategory- The category primary key- Returns:
- an instance of Category
-
createCategory
public int createCategory(Category category)
Create an instance of the category class- Parameters:
category- The instance of the Category which contains the informations to store- Returns:
- The instance of category which has been created with its primary key.
-
removeCategory
public String removeCategory(int nIdCategory, Locale locale)
Remove the category whose identifier is specified in parameter. The category is removed if and only if it is not linked to any widget.- Parameters:
nIdCategory- The category Idlocale-Locale- Returns:
- true if the category is linked to a widget, false otherwise
-
updateCategory
public void updateCategory(Category category)
Update of the category which is specified in parameter- Parameters:
category- The instance of the Category which contains the data to store
-
findFirstCategory
public Category findFirstCategory()
Find the first category (order by the ID category)- Returns:
- a
Category
-
-