fr.paris.lutece.plugins.extend.modules.rating.service
Interface IRatingService

All Known Implementing Classes:
RatingService

public interface IRatingService

IRatingService.


Method Summary
 void create(Rating rating)
          Insert.
 void doVote(String strIdExtendableResource, String strExtendableResourceType, int nVoteValue, javax.servlet.http.HttpServletRequest request)
          Increment vote.
 Rating findByPrimaryKey(int nIdRating)
          Load.
 Rating findByResource(String strIdExtendableResource, String strExtendableResourceType)
          Select by resource.
 List<Integer> findIdMostRatedResources(String strExtendableResourceType, int nItemsOffset, int nMaxItemsNumber)
          Get the ids of resources ordered by their number of ratings
 void remove(int nIdRating)
          Delete.
 void removeByResource(String strIdExtendableResource, String strExtendableResourceType)
          Delete by resource
 void update(Rating rating)
          Store.
 

Method Detail

remove

@Transactional(value="extend-rating.transactionManager")
void remove(int nIdRating)
Delete.

Parameters:
nIdRating - the n id rating

removeByResource

@Transactional(value="extend-rating.transactionManager")
void removeByResource(String strIdExtendableResource,
                                    String strExtendableResourceType)
Delete by resource

Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type

create

@Transactional(value="extend-rating.transactionManager")
void create(Rating rating)
Insert.

Parameters:
rating - the rating

update

@Transactional(value="extend-rating.transactionManager")
void update(Rating rating)
Store.

Parameters:
rating - the rating

doVote

@Transactional(value="extend-rating.transactionManager")
void doVote(String strIdExtendableResource,
                          String strExtendableResourceType,
                          int nVoteValue,
                          javax.servlet.http.HttpServletRequest request)
Increment vote.

Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
nVoteValue - the n vote value
request - the request

findByPrimaryKey

Rating findByPrimaryKey(int nIdRating)
Load.

Parameters:
nIdRating - the n id rating
Returns:
the rating

findByResource

Rating findByResource(String strIdExtendableResource,
                      String strExtendableResourceType)
Select by resource.

Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
Returns:
the rating

findIdMostRatedResources

List<Integer> findIdMostRatedResources(String strExtendableResourceType,
                                       int nItemsOffset,
                                       int nMaxItemsNumber)
Get the ids of resources ordered by their number of ratings

Parameters:
strExtendableResourceType - The type of resources to consider
nItemsOffset - The offset of the items to get, or 0 to get items from the first one
nMaxItemsNumber - The maximum number of items to return, or 0 to get every items
Returns:
The list of ids of resources ordered by the number of associated comments


Copyright © 2013 Mairie de Paris. All Rights Reserved.