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

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

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

TicketProductService


Method Summary
 java.lang.String doCreateProduct(Product product, javax.servlet.http.HttpServletRequest request)
          Create the product
 void doDeleteProduct(int nIdProduct)
          Delete the product
 java.lang.String doModifyProduct(Product product, javax.servlet.http.HttpServletRequest request)
          Modify the product
 java.util.List<Product> findByFilter(ProductFilter filter)
          Return a filtered list of product
 java.lang.String getCreateTemplate()
          Return create template url for a product
 java.lang.String getDeleteJsp()
          Return the jsp for deleting a product
 ICategoryHome getHomeCategory()
          Get the ICategoryHome object
 ITicketProductHome<TicketProduct,TicketProductFilter> getHomeTicketProduct()
          Get the ITicketProductHome object
static TicketProductService getInstance()
          
 java.lang.String getMessageNotAuthorizedForCreate()
          Get the message when a user is not authorized to create a product
 java.lang.String getMessageNotAuthorizedForDelete()
          Get the message when a user is not authorized to delete a product
 java.lang.String getMessageNotAuthorizedForModification()
          Get the message when a user is not authorized to modify a product
 java.lang.String getModifyTemplate()
          Return modify template url for a product
 ObjectDefinition getObjectDefinition()
          Return the object definition
 java.lang.String getOrderTemplate()
          Return template url for ordering a product
 Product getProduct(int nIdProduct)
          Return the product object
 java.lang.String getProductClass()
          Return the class of the product
 void init()
          Init the product service and register it in the global product service
 void initModelForModification(int nIdProduct, java.util.Map<java.lang.String,java.lang.Object> model, javax.servlet.http.HttpServletRequest request)
          Insert the needed tag by the product for modification into the model
 void initModelForOrder(int nIdProduct, java.util.Map<java.lang.String,java.lang.Object> model, javax.servlet.http.HttpServletRequest request)
          Insert the needed tag by the product for ordering into the model
 boolean isAuthorizedToCreate(fr.paris.lutece.portal.business.user.AdminUser user)
          Checks if if the given user is authorized to create a product
 boolean isAuthorizedToDelete(fr.paris.lutece.portal.business.user.AdminUser user)
          Checks if if the given user is authorized to delete a product
 boolean isAuthorizedToModify(fr.paris.lutece.portal.business.user.AdminUser user)
          Checks if if the given user is authorized to modify a product
 void setHomeCategory(ICategoryHome homeCategory)
          Set the the ICategoryHome object
 void setHomeTicketProduct(ITicketProductHome<TicketProduct,TicketProductFilter> homeTicketProduct)
          Set the ITicketProductHome object
 void updateProduct(Product product)
          Update a product in the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHomeTicketProduct

public ITicketProductHome<TicketProduct,TicketProductFilter> getHomeTicketProduct()
Get the ITicketProductHome object

Returns:
the ITicketProductHome object

setHomeTicketProduct

public void setHomeTicketProduct(ITicketProductHome<TicketProduct,TicketProductFilter> homeTicketProduct)
Set the ITicketProductHome object

Parameters:
homeTicketProduct - the new ITicketProductHome object

getHomeCategory

public ICategoryHome getHomeCategory()
Get the ICategoryHome object

Returns:
the ICategoryHome object

setHomeCategory

public void setHomeCategory(ICategoryHome homeCategory)
Set the the ICategoryHome object

Parameters:
homeCategory - the new the ICategoryHome object

getProductClass

public java.lang.String getProductClass()
Return the class of the product

Specified by:
getProductClass in interface IProductService
Returns:
the class

getCreateTemplate

public java.lang.String getCreateTemplate()
Return create template url for a product

Specified by:
getCreateTemplate in interface IProductService
Returns:
create template url

getModifyTemplate

public java.lang.String getModifyTemplate()
Return modify template url for a product

Specified by:
getModifyTemplate in interface IProductService
Returns:
modify template url

getOrderTemplate

public java.lang.String getOrderTemplate()
Return template url for ordering a product

Specified by:
getOrderTemplate in interface IProductService
Returns:
template url

getDeleteJsp

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

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

init

public void init()
Init the product service and register it in the global product service

Specified by:
init in interface IProductService

getInstance

public static TicketProductService getInstance()


doCreateProduct

@Transactional
public java.lang.String doCreateProduct(Product product,
                                                      javax.servlet.http.HttpServletRequest request)
Create the product

Specified by:
doCreateProduct in interface IProductService
Parameters:
product - the product to create
request - the request
Returns:
error if occurs

doModifyProduct

@Transactional
public java.lang.String doModifyProduct(Product product,
                                                      javax.servlet.http.HttpServletRequest request)
Modify the product

Specified by:
doModifyProduct in interface IProductService
Parameters:
product - the product to modify
request - the request
Returns:
error if occurs

doDeleteProduct

@Transactional
public void doDeleteProduct(int nIdProduct)
Delete the product

Specified by:
doDeleteProduct in interface IProductService
Parameters:
nIdProduct - the id of the product to delete

initModelForModification

public void initModelForModification(int nIdProduct,
                                     java.util.Map<java.lang.String,java.lang.Object> model,
                                     javax.servlet.http.HttpServletRequest request)
Insert the needed tag by the product for modification into the model

Specified by:
initModelForModification in interface IProductService
Parameters:
nIdProduct - the product id
model - the model
request - The Http request

initModelForOrder

public void initModelForOrder(int nIdProduct,
                              java.util.Map<java.lang.String,java.lang.Object> model,
                              javax.servlet.http.HttpServletRequest request)
Insert the needed tag by the product for ordering into the model

Specified by:
initModelForOrder in interface IProductService
Parameters:
nIdProduct - the product id
model - the model
request - The Http request

getProduct

public Product getProduct(int nIdProduct)
Return the product object

Specified by:
getProduct in interface IProductService
Parameters:
nIdProduct - the product id
Returns:
the product

findByFilter

public java.util.List<Product> findByFilter(ProductFilter filter)
Return a filtered list of product

Specified by:
findByFilter in interface IProductService
Parameters:
filter - the product filter
Returns:
list of product

getObjectDefinition

public ObjectDefinition getObjectDefinition()
Return the object definition

Specified by:
getObjectDefinition in interface IProductService
Returns:
the object definition

isAuthorizedToCreate

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

Specified by:
isAuthorizedToCreate in interface IProductService
Parameters:
user - The user who wants to create a product
Returns:
True if the given user is authorized to create a product. False otherwise.

isAuthorizedToModify

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

Specified by:
isAuthorizedToModify in interface IProductService
Parameters:
user - The user who wants to modify a product
Returns:
True if the given user is authorized to modify a product. False otherwise.

isAuthorizedToDelete

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

Specified by:
isAuthorizedToDelete in interface IProductService
Parameters:
user - The user who wants to delete a product
Returns:
True if the given user is authorized to delete a product. False otherwise.

getMessageNotAuthorizedForCreate

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

Specified by:
getMessageNotAuthorizedForCreate in interface IProductService
Returns:
The message

getMessageNotAuthorizedForDelete

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

Specified by:
getMessageNotAuthorizedForDelete in interface IProductService
Returns:
The message

getMessageNotAuthorizedForModification

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

Specified by:
getMessageNotAuthorizedForModification in interface IProductService
Returns:
The message

updateProduct

public void updateProduct(Product product)
Update a product in the database

Specified by:
updateProduct in interface IProductService
Parameters:
product - the product to update in the database


Copyright © 2011 Mairie de Paris. All Rights Reserved.