fr.paris.lutece.plugins.stock.service
Interface ICategoryService

All Known Implementing Classes:
CategoryService, TicketCategoryService

public interface ICategoryService

ICategoryService


Method Summary
 java.lang.String doCreateCategory(Category category, javax.servlet.http.HttpServletRequest request)
          Creates a category
 void doDeleteCategory(int nIdCategory)
          Deletes a category
 java.lang.String doModifyCategory(Category category, javax.servlet.http.HttpServletRequest request)
          Modifies a category
 java.util.List<Category> findByFilter(CategoryFilter filter)
          Finds all categories which match the given filter
 Category getCategory(int nIdCategory)
          Get the category with the given id
 java.lang.String getCategoryClass()
          Get the class of the category object
 Category getCategoryWithChildren(java.lang.Integer nIdCategory)
          Finds a category and all his subcategories and fetch children
 Category getCategoryWithParent(int nIdCategory)
          Finds a category and fetch parent
 java.lang.String getCreateTemplate()
          Get the creation template of a service
 java.lang.String getDeleteJsp()
          Return the jsp for deleting a category
 java.lang.String getMessageNotAuthorizedForCreate()
          Get the message when a user is not authorized to create a category
 java.lang.String getMessageNotAuthorizedForDelete()
          Get the message when a user is not authorized to delete a category
 java.lang.String getMessageNotAuthorizedForModification()
          Get the message when a user is not authorized to modify a category
 java.lang.String getModifyTemplate()
          Get the modification template of a service
 ObjectDefinition getObjectDefinition()
          Return the ObjectDefinition object of the service
 void init()
          Init the object
 void initModelForCreation(java.util.Map<java.lang.String,java.lang.Object> model)
          Initaliaze the model in parameter for a creation
 void initModelForModification(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)
          Checks if the given user is authorized to create a category
 boolean isAuthorizedToDelete(fr.paris.lutece.portal.business.user.AdminUser user)
          Checks if the given user is authorized to delete a category
 boolean isAuthorizedToModify(fr.paris.lutece.portal.business.user.AdminUser user)
          Checks if the given user is authorized to modify a category
 

Method Detail

getCreateTemplate

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

Returns:
the relative path of the creation template

getModifyTemplate

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

Returns:
the relative path of the modification template

getDeleteJsp

java.lang.String getDeleteJsp()
Return the jsp for deleting a category

Returns:
the jsp path

getCategoryClass

java.lang.String getCategoryClass()
Get the class of the category object

Returns:
the class of the category object

init

void init()
Init the object


doCreateCategory

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

Parameters:
category - The category to create in database
request - The HTTP request
Returns:
error if occurs

doModifyCategory

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

Parameters:
category - The category to modify in database
request - The HTTP request
Returns:
error if occurs

doDeleteCategory

void doDeleteCategory(int nIdCategory)
Deletes a category

Parameters:
nIdCategory - The category id to delete in database

initModelForModification

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

Parameters:
nIdCategory - The category id to modify
model - the model which will be passed in the modification template

initModelForCreation

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

Parameters:
model - the model which will be passed in the modification template

getCategory

Category getCategory(int nIdCategory)
Get the category with the given id

Parameters:
nIdCategory - The category id
Returns:
The category with the given id

getObjectDefinition

ObjectDefinition getObjectDefinition()
Return the ObjectDefinition object of the service

Returns:
The ObjectDefintion object

getCategoryWithParent

Category getCategoryWithParent(int nIdCategory)
Finds a category and fetch parent

Parameters:
nIdCategory - the id of the searched category
Returns:
the category

getCategoryWithChildren

Category getCategoryWithChildren(java.lang.Integer nIdCategory)
Finds a category and all his subcategories and fetch children

Parameters:
nIdCategory - the id of upper category
Returns:
the category

findByFilter

java.util.List<Category> findByFilter(CategoryFilter filter)
Finds all categories which match the given filter

Parameters:
filter - The filter
Returns:
A list of categories which match the given filter

isAuthorizedToCreate

boolean isAuthorizedToCreate(fr.paris.lutece.portal.business.user.AdminUser user)
Checks if the given user is authorized to create a category

Parameters:
user - the user
Returns:
true if the given user is authorized to create a category. False otherwise.

isAuthorizedToModify

boolean isAuthorizedToModify(fr.paris.lutece.portal.business.user.AdminUser user)
Checks if the given user is authorized to modify a category

Parameters:
user - the user
Returns:
true if the given user is authorized to modify a category. False otherwise.

isAuthorizedToDelete

boolean isAuthorizedToDelete(fr.paris.lutece.portal.business.user.AdminUser user)
Checks if the given user is authorized to delete a category

Parameters:
user - the user
Returns:
true if the given user is authorized to delete a category. False otherwise.

getMessageNotAuthorizedForCreate

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

Returns:
The message

getMessageNotAuthorizedForModification

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

Returns:
The message

getMessageNotAuthorizedForDelete

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

Returns:
The message


Copyright © 2011 Mairie de Paris. All Rights Reserved.