fr.paris.lutece.plugins.extend.modules.rating.service
Class RatingService

java.lang.Object
  extended by fr.paris.lutece.plugins.extend.modules.rating.service.RatingService
All Implemented Interfaces:
IRatingService

public class RatingService
extends Object
implements IRatingService

RatingService


Field Summary
static String BEAN_SERVICE
          The Constant BEAN_SERVICE.
 
Constructor Summary
RatingService()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_SERVICE

public static final String BEAN_SERVICE
The Constant BEAN_SERVICE.

See Also:
Constant Field Values
Constructor Detail

RatingService

public RatingService()
Method Detail

create

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

Specified by:
create in interface IRatingService
Parameters:
rating - the rating

update

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

Specified by:
update in interface IRatingService
Parameters:
rating - the rating

doVote

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

Specified by:
doVote in interface IRatingService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
nVoteValue - the n vote value
request - the request

remove

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

Specified by:
remove in interface IRatingService
Parameters:
nIdRating - the n id rating

removeByResource

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

Specified by:
removeByResource in interface IRatingService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type

findByPrimaryKey

public Rating findByPrimaryKey(int nIdRating)
Load.

Specified by:
findByPrimaryKey in interface IRatingService
Parameters:
nIdRating - the n id rating
Returns:
the rating

findByResource

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

Specified by:
findByResource in interface IRatingService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
Returns:
the rating

findIdMostRatedResources

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

Specified by:
findIdMostRatedResources in interface IRatingService
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.