fr.paris.lutece.plugins.myportal.service
Class CategoryService

java.lang.Object
  extended by fr.paris.lutece.plugins.myportal.service.CategoryService

public final class CategoryService
extends java.lang.Object

CategoryService


Method Summary
 Category createCategory(Category category)
          Create an instance of the category class
 Category findByPrimaryKey(int nCategoryId)
          Returns an instance of a category whose identifier is specified in parameter
 Category findFirstCategory()
          Find the first category (order by the ID category)
 fr.paris.lutece.util.ReferenceList getCategories()
          Load the data of all the category objects and returns them in form of a ReferenceList
 java.util.Collection<Category> getCategoriesList()
          Load the data of all the category objects and returns them in form of a collection
static CategoryService getInstance()
          Get the instance of CategoryService
 boolean removeCategory(int nCategoryId)
          Remove the category whose identifier is specified in parameter.
 Category updateCategory(Category category)
          Update of the category which is specified in parameter
 
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 the instance of CategoryService

Returns:
an instance of CategoryService

getCategoriesList

public java.util.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()
Load the data of all the category objects and returns them in form of a ReferenceList

Returns:
the ReferenceList which contains the data of all the category objects

findByPrimaryKey

public Category findByPrimaryKey(int nCategoryId)
Returns an instance of a category whose identifier is specified in parameter

Parameters:
nCategoryId - The category primary key
Returns:
an instance of Category

createCategory

public Category 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 boolean removeCategory(int nCategoryId)
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:
nCategoryId - The category Id
Returns:
true if the category is linked to a widget, false otherwise

updateCategory

public Category 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
Returns:
The instance of the category which has been updated

findFirstCategory

public Category findFirstCategory()
Find the first category (order by the ID category)

Returns:
a Category


Copyright © 2012 Mairie de Paris. All Rights Reserved.