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

All Known Implementing Classes:
ProductService, TicketProductService

public interface IProductService

IProductService


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
 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 updateProduct(Product product)
          Update a product in the database
 

Method Detail

getCreateTemplate

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

Returns:
create template url

getModifyTemplate

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

Returns:
modify template url

getOrderTemplate

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

Returns:
template url

getDeleteJsp

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

Returns:
the jsp path

getProductClass

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

Returns:
the class

init

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


doCreateProduct

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

Parameters:
product - the product to create
request - the request
Returns:
error if occurs

doModifyProduct

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

Parameters:
product - the product to modify
request - the request
Returns:
error if occurs

doDeleteProduct

void doDeleteProduct(int nIdProduct)
Delete the product

Parameters:
nIdProduct - the id of the product to delete

initModelForModification

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

Parameters:
nIdProduct - the product id
model - the model
request - The Http request

initModelForOrder

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

Parameters:
nIdProduct - the product id
model - the model
request - The Http request

getProduct

Product getProduct(int nIdProduct)
Return the product object

Parameters:
nIdProduct - the product id
Returns:
the product

findByFilter

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

Parameters:
filter - the product filter
Returns:
list of product

getObjectDefinition

ObjectDefinition getObjectDefinition()
Return the object definition

Returns:
the object definition

isAuthorizedToCreate

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

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

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

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

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

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

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

Returns:
The message

getMessageNotAuthorizedForModification

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

Returns:
The message

getMessageNotAuthorizedForDelete

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

Returns:
The message

updateProduct

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

Parameters:
product - the product to update in the database


Copyright © 2011 Mairie de Paris. All Rights Reserved.