Class CategoryService
java.lang.Object
fr.paris.lutece.plugins.document.service.category.CategoryService
- All Implemented Interfaces:
fr.paris.lutece.portal.service.image.ImageResourceProvider
@ApplicationScoped
@Named("document.CategoryService")
public class CategoryService
extends Object
implements fr.paris.lutece.portal.service.image.ImageResourceProvider
This class provides services for Category
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class defines a CategoryDisplay object intended to be used in freemarker templates. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllCategoriesDisplay(int[] arrayIdCategory, fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objects and tagged with the assigned value when lists of categories matchedgetAllCategoriesDisplay(fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objectsgetAllCategoriesDisplay(List<Category> listCategory, fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objects and tagged with the assigned value when lists of categories matchedgetCategoryDisplay(int nIdCategory) Return a CategoryDisplay object for a specified Categoryfr.paris.lutece.portal.service.image.ImageResourcegetImageResource(int nIdCategory) Get the resource for imagestatic CategoryServiceDeprecated, for removal: This API element is subject to removal in a future version.getResourceImageCategory(int nCategoryId) Management of the image associated to the CategoryGet the type of resourcevoidinit()Initialize the service - register as image providerMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.service.image.ImageResourceProvider
addImageResource
-
Constructor Details
-
CategoryService
public CategoryService()
-
-
Method Details
-
init
@PostConstruct public void init()Initialize the service - register as image provider -
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theCategoryServiceinstance. This method will be removed in future versions.Returns the unique instance of theCategoryServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theCategoryServiceinstance instead.- Returns:
- The unique instance of
CategoryService.
-
getImageResource
public fr.paris.lutece.portal.service.image.ImageResource getImageResource(int nIdCategory) Get the resource for image- Specified by:
getImageResourcein interfacefr.paris.lutece.portal.service.image.ImageResourceProvider- Parameters:
nIdCategory- The identifier of Category object- Returns:
- The ImageResource
-
getResourceTypeId
Get the type of resource- Specified by:
getResourceTypeIdin interfacefr.paris.lutece.portal.service.image.ImageResourceProvider- Returns:
- The type of resource
-
getAllCategoriesDisplay
public Collection<CategoryService.CategoryDisplay> getAllCategoriesDisplay(fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objects- Parameters:
user- The current user- Returns:
- The Collection of CategoryDisplay
-
getAllCategoriesDisplay
public Collection<CategoryService.CategoryDisplay> getAllCategoriesDisplay(int[] arrayIdCategory, fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objects and tagged with the assigned value when lists of categories matched- Parameters:
arrayIdCategory- The array of Id categoriesuser- The current user- Returns:
- The Collection of CategoryDisplay
-
getAllCategoriesDisplay
public Collection<CategoryService.CategoryDisplay> getAllCategoriesDisplay(List<Category> listCategory, fr.paris.lutece.portal.business.user.AdminUser user) Get all Category converted to CategoryDisplay objects and tagged with the assigned value when lists of categories matched- Parameters:
listCategory- The list of categoriesuser- The current user- Returns:
- A Collection of CategoryDisplay object
-
getCategoryDisplay
Return a CategoryDisplay object for a specified Category- Parameters:
nIdCategory- The id of Category- Returns:
- The CategoryDisplay object
-
getResourceImageCategory
Management of the image associated to the Category- Parameters:
nCategoryId- The Category identifier- Returns:
- The url of the resource
-
@Injectto obtain theCategoryServiceinstance.