| net.jforum.dao.KarmaDAO
All known Subclasses: net.jforum.dao.generic.GenericKarmaDAO,
KarmaDAO | public interface KarmaDAO (Code) | | author: Rafael Steil version: $Id: KarmaDAO.java,v 1.7 2007/08/01 22:30:04 rafaelsteil Exp $ |
addKarma | public void addKarma(Karma karma)(Code) | | Insert a new Karma.
Parameters: karma - The karma to add. The instance should atleast have set the karma status, the user who is receivingthe karma and the user which is setting the karme. |
getMostRatedUserByPeriod | public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField)(Code) | | Total points received, grouped by user and filtered by a range of dates.
Parameters: firstPeriod - Date Parameters: lastPeriod - Date Parameters: start - int Parameters: orderField - orderField Returns a List of users ant your total votes. |
getPostKarma | public KarmaStatus getPostKarma(int postId)(Code) | | Gets the karma status of some post.
Parameters: postId - The post id to get the karma status A net.jforum.entities.KarmaStatus instance |
getUserKarma | public KarmaStatus getUserKarma(int userId)(Code) | | Gets the karma status of some user.
Parameters: userId - The user id to get the karma status A net.jforum.entities.KarmaStatus instance |
getUserTotalKarma | public void getUserTotalKarma(User user)(Code) | | Parameters: user - User |
getUserVotes | public Map getUserVotes(int topicId, int userId)(Code) | | Gets the votes the user made on some topic.
Parameters: topicId - The topic id. Parameters: userId - A java.util.Map , where the key is the post id and thevalue id the rate made by the user. |
update | public void update(Karma karma)(Code) | | Updates a karma
Parameters: karma - The karma instance to update |
updateUserKarma | public void updateUserKarma(int userId)(Code) | | Updates the karma status for some user.
This method will store the user's karme in the
users table.
Parameters: userId - The id of the user to update |
userCanAddKarma | public boolean userCanAddKarma(int userId, int postId)(Code) | | Checks if the user can add the karma.
The method will search for existing entries in
the karma table associated with the user id and post id
passed as argument. If found, it means that the user
already has voted, so we cannot allow him to vote one
more time.
Parameters: userId - The user id to check Parameters: postId - The post id to chekc true if the user hasn't voted on thepost yet, or false otherwise. |
|
|