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

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.service.TicketCategoryService
All Implemented Interfaces:
ICategoryService

@Transactional(readOnly=true)
public final class TicketCategoryService
extends java.lang.Object
implements ICategoryService

TicketCategoryService


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 idCategory)
          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 product
 IProviderHome getHomeProvider()
          Get the provider home
 ITicketCategoryHome<TicketCategory> getHomeTicketCategory()
          Get the ITicketCategoryHome object
static TicketCategoryService getInstance()
          Get the single instance of this class
 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
 void setHomeProvider(IProviderHome homeProvider)
          Set the provider home
 void setHomeTicketCategory(ITicketCategoryHome<TicketCategory> homeTicketCategory)
          Set the ITicketCategoryHome object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHomeProvider

public IProviderHome getHomeProvider()
Get the provider home

Returns:
the provider home

setHomeProvider

public void setHomeProvider(IProviderHome homeProvider)
Set the provider home

Parameters:
homeProvider - the new provider home

getHomeTicketCategory

public ITicketCategoryHome<TicketCategory> getHomeTicketCategory()
Get the ITicketCategoryHome object

Returns:
the ITicketCategoryHome object

setHomeTicketCategory

public void setHomeTicketCategory(ITicketCategoryHome<TicketCategory> homeTicketCategory)
Set the ITicketCategoryHome object

Parameters:
homeTicketCategory - the new ITicketCategoryHome object

getInstance

public static TicketCategoryService getInstance()
Get the single instance of this class

Returns:
the single instance of this class

getCreateTemplate

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

Specified by:
getCreateTemplate in interface ICategoryService
Returns:
the relative path of the creation template

getModifyTemplate

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

Specified by:
getModifyTemplate in interface ICategoryService
Returns:
the relative path of the modification template

getDeleteJsp

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

Specified by:
getDeleteJsp in interface ICategoryService
Returns:
the jsp path

getCategoryClass

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

Specified by:
getCategoryClass in interface ICategoryService
Returns:
the class of the category object

init

public void init()
Init the object

Specified by:
init in interface ICategoryService

doCreateCategory

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

Specified by:
doCreateCategory in interface ICategoryService
Parameters:
category - The category to create in database
request - The HTTP request
Returns:
error if occurs

doModifyCategory

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

Specified by:
doModifyCategory in interface ICategoryService
Parameters:
category - The category to modify in database
request - The HTTP request
Returns:
error if occurs

doDeleteCategory

@Transactional
public void doDeleteCategory(int nIdCategory)
Deletes a category

Specified by:
doDeleteCategory in interface ICategoryService
Parameters:
nIdCategory - The category id to delete in database

initModelForModification

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

Specified by:
initModelForModification in interface ICategoryService
Parameters:
nIdCategory - The category id to modify
model - the model which will be passed in the modification template

initModelForCreation

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

Specified by:
initModelForCreation in interface ICategoryService
Parameters:
model - the model which will be passed in the modification template

getCategory

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

Specified by:
getCategory in interface ICategoryService
Parameters:
nIdCategory - The category id
Returns:
The category with the given id

getCategoryWithParent

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

Specified by:
getCategoryWithParent in interface ICategoryService
Parameters:
nIdCategory - the id of the searched category
Returns:
the category

getObjectDefinition

public ObjectDefinition getObjectDefinition()
Return the ObjectDefinition object of the service

Specified by:
getObjectDefinition in interface ICategoryService
Returns:
The ObjectDefintion object

getCategoryWithChildren

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

Specified by:
getCategoryWithChildren in interface ICategoryService
Parameters:
idCategory - the id of upper category
Returns:
the category

findByFilter

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

Specified by:
findByFilter in interface ICategoryService
Parameters:
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)
Checks if the given user is authorized to create a category

Specified by:
isAuthorizedToCreate in interface ICategoryService
Parameters:
user - the user
Returns:
true if the given user is authorized to create a category. False otherwise.

isAuthorizedToModify

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

Specified by:
isAuthorizedToModify in interface ICategoryService
Parameters:
user - the user
Returns:
true if the given user is authorized to modify a category. False otherwise.

isAuthorizedToDelete

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

Specified by:
isAuthorizedToDelete in interface ICategoryService
Parameters:
user - the user
Returns:
true if the given user is authorized to delete a category. False otherwise.

getMessageNotAuthorizedForCreate

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

Specified by:
getMessageNotAuthorizedForCreate in interface ICategoryService
Returns:
The message

getMessageNotAuthorizedForDelete

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

Specified by:
getMessageNotAuthorizedForDelete in interface ICategoryService
Returns:
The message

getMessageNotAuthorizedForModification

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

Specified by:
getMessageNotAuthorizedForModification in interface ICategoryService
Returns:
The message


Copyright © 2011 Mairie de Paris. All Rights Reserved.