fr.paris.lutece.plugins.stock.service
Class GlobalCategoryService

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.service.GlobalCategoryService

public final class GlobalCategoryService
extends java.lang.Object

This class provides generics methods for ICategoryService implementations


Method Summary
 java.lang.String doCreateCategory(java.lang.String strCategoryClassName, Category category, javax.servlet.http.HttpServletRequest request)
          Creates a category
 void doDeleteCategory(java.lang.String strCategoryClassName, int nIdCategory)
          Deletes a category
 java.lang.String doModifyCategory(java.lang.String strCategoryClassName, Category category, javax.servlet.http.HttpServletRequest request)
          Modifies a category
 java.util.List<Category> findByFilter(java.lang.String strCategoryClassName, CategoryFilter filter)
          Finds all categories which match the given filter
 java.util.List<ObjectDefinition> getAllRegisteredObjectDefinition()
          Get the ObjectDefinition objects of all the registered services
 java.util.List<ICategoryService> getAllRegisteredServices()
          Get all the registered services
 Category getCategory(java.lang.String strCategoryClassName, int nIdCategory)
          Get the category with the given id
 Category getCategoryWithChildren(java.lang.String strCategoryClassName, int nIdCategory)
          Finds a category and fetch children
 Category getCategoryWithParent(java.lang.String strCategoryClassName, int nIdCategory)
          Finds a category and fetch parent
 java.lang.String getCreateTemplate(java.lang.String strCategoryClassName)
          Get the creation template of a service
 java.lang.String getDeleteJsp(java.lang.String strCategoryClassName)
          Get the deletion jsp of a service
static GlobalCategoryService getInstance()
          Get the instance of this class
 java.lang.String getMessageNotAuthorizedForCreate(java.lang.String strCategoryClassName)
          Get the message when a user is not authorized to create a category
 java.lang.String getMessageNotAuthorizedForDelete(java.lang.String strCategoryClassName)
          Get the message when a user is not authorized to delete a category
 java.lang.String getMessageNotAuthorizedForModification(java.lang.String strCategoryClassName)
          Get the message when a user is not authorized to modify a category
 java.lang.String getModifyTemplate(java.lang.String strCategoryClassName)
          Get the modification template of a service
 ObjectDefinition getObjectDefinition(java.lang.String strCategoryClassName)
          Finds the ObjectDefinition objects of the given category entity name
 void initModelForCreation(java.lang.String strCategoryClassName, java.util.Map<java.lang.String,java.lang.Object> model)
          Initaliaze the model in parameter for a creation
 void initModelForModification(java.lang.String strCategoryClassName, int nIdCategory, java.util.Map<java.lang.String,java.lang.Object> model)
          Initaliaze the model in parameter for a modification
 boolean isAuthorizedToCreate(fr.paris.lutece.portal.business.user.AdminUser user, java.lang.String strCategoryClassName)
          Checks if a user is authorized to create the given category entity name
 boolean isAuthorizedToDelete(fr.paris.lutece.portal.business.user.AdminUser user, java.lang.String strCategoryClassName)
          Checks if a user is authorized to delete the given category entity name
 boolean isAuthorizedToModify(fr.paris.lutece.portal.business.user.AdminUser user, java.lang.String strCategoryClassName)
          Checks if a user is authorized to modify the given category entity name
 void register(ICategoryService service)
          Register a ICategoryService service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GlobalCategoryService getInstance()
Get the instance of this class

Returns:
the instance of this class

register

public void register(ICategoryService service)
Register a ICategoryService service

Parameters:
service - the service to be registered

getCreateTemplate

public java.lang.String getCreateTemplate(java.lang.String strCategoryClassName)
Get the creation template of a service

Parameters:
strCategoryClassName - The class name of the category entity to create
Returns:
the relative path of the creation template

getModifyTemplate

public java.lang.String getModifyTemplate(java.lang.String strCategoryClassName)
Get the modification template of a service

Parameters:
strCategoryClassName - The class name of the category entity to modify
Returns:
the relative path of the modification template

getDeleteJsp

public java.lang.String getDeleteJsp(java.lang.String strCategoryClassName)
Get the deletion jsp of a service

Parameters:
strCategoryClassName - The class name of the category entity to modify
Returns:
the relative path of the deletion jsp

doCreateCategory

public java.lang.String doCreateCategory(java.lang.String strCategoryClassName,
                                         Category category,
                                         javax.servlet.http.HttpServletRequest request)
Creates a category

Parameters:
strCategoryClassName - The class name of the category entity to create
category - The category to create in database
request - The HTTP request
Returns:
error if occurs

doModifyCategory

public java.lang.String doModifyCategory(java.lang.String strCategoryClassName,
                                         Category category,
                                         javax.servlet.http.HttpServletRequest request)
Modifies a category

Parameters:
strCategoryClassName - The class name of the category entity to modify
category - The category to modify in database
request - The HTTP request
Returns:
error if occurs

doDeleteCategory

public void doDeleteCategory(java.lang.String strCategoryClassName,
                             int nIdCategory)
Deletes a category

Parameters:
strCategoryClassName - The class name of the category entity to delete
nIdCategory - The category id to delete in database

initModelForModification

public void initModelForModification(java.lang.String strCategoryClassName,
                                     int nIdCategory,
                                     java.util.Map<java.lang.String,java.lang.Object> model)
Initaliaze the model in parameter for a modification

Parameters:
strCategoryClassName - The class name of the category entity to delete
nIdCategory - The category id to modify
model - the model which will be passed in the modification template

initModelForCreation

public void initModelForCreation(java.lang.String strCategoryClassName,
                                 java.util.Map<java.lang.String,java.lang.Object> model)
Initaliaze the model in parameter for a creation

Parameters:
strCategoryClassName - The class name of the category entity to create
model - the model which will be passed in the modification template

getCategory

public Category getCategory(java.lang.String strCategoryClassName,
                            int nIdCategory)
Get the category with the given id

Parameters:
strCategoryClassName - The class name of the category entity to delete
nIdCategory - The category id
Returns:
The category with the given id

getAllRegisteredServices

public java.util.List<ICategoryService> getAllRegisteredServices()
Get all the registered services

Returns:
The list of all the registered services

getAllRegisteredObjectDefinition

public java.util.List<ObjectDefinition> getAllRegisteredObjectDefinition()
Get the ObjectDefinition objects of all the registered services

Returns:
The ObjectDefinition objects of all the registered services

getCategoryWithParent

public Category getCategoryWithParent(java.lang.String strCategoryClassName,
                                      int nIdCategory)
Finds a category and fetch parent

Parameters:
strCategoryClassName - The class name of the category entity
nIdCategory - the id of the searched category
Returns:
the category

getObjectDefinition

public ObjectDefinition getObjectDefinition(java.lang.String strCategoryClassName)
Finds the ObjectDefinition objects of the given category entity name

Parameters:
strCategoryClassName - The class name of the category entity
Returns:
the ObjectDefinition objects of the given category class name

getCategoryWithChildren

public Category getCategoryWithChildren(java.lang.String strCategoryClassName,
                                        int nIdCategory)
Finds a category and fetch children

Parameters:
strCategoryClassName - The class name of the category entity
nIdCategory - the id of the searched category
Returns:
the category

findByFilter

public java.util.List<Category> findByFilter(java.lang.String strCategoryClassName,
                                             CategoryFilter filter)
Finds all categories which match the given filter

Parameters:
strCategoryClassName - The class name of the category entity
filter - The filter
Returns:
A list of categories which match the given filter

isAuthorizedToCreate

public boolean isAuthorizedToCreate(fr.paris.lutece.portal.business.user.AdminUser user,
                                    java.lang.String strCategoryClassName)
Checks if a user is authorized to create the given category entity name

Parameters:
user - the user
strCategoryClassName - The class name of the category entity
Returns:
true if the given user is authorized to create the given category entity. False otherwise.

isAuthorizedToModify

public boolean isAuthorizedToModify(fr.paris.lutece.portal.business.user.AdminUser user,
                                    java.lang.String strCategoryClassName)
Checks if a user is authorized to modify the given category entity name

Parameters:
user - the user
strCategoryClassName - The class name of the category entity
Returns:
true if the given user is authorized to modify the given category entity. False otherwise.

isAuthorizedToDelete

public boolean isAuthorizedToDelete(fr.paris.lutece.portal.business.user.AdminUser user,
                                    java.lang.String strCategoryClassName)
Checks if a user is authorized to delete the given category entity name

Parameters:
user - the user
strCategoryClassName - The class name of the category entity
Returns:
true if the given user is authorized to delete the given category entity. False otherwise.

getMessageNotAuthorizedForCreate

public java.lang.String getMessageNotAuthorizedForCreate(java.lang.String strCategoryClassName)
Get the message when a user is not authorized to create a category

Parameters:
strCategoryClassName - he class name of the category entity
Returns:
The message

getMessageNotAuthorizedForModification

public java.lang.String getMessageNotAuthorizedForModification(java.lang.String strCategoryClassName)
Get the message when a user is not authorized to modify a category

Parameters:
strCategoryClassName - he class name of the category entity
Returns:
The message

getMessageNotAuthorizedForDelete

public java.lang.String getMessageNotAuthorizedForDelete(java.lang.String strCategoryClassName)
Get the message when a user is not authorized to delete a category

Parameters:
strCategoryClassName - he class name of the category entity
Returns:
The message


Copyright © 2011 Mairie de Paris. All Rights Reserved.