public class VotingServiceImpl extends Object implements VotingService
| Constructor and Description |
|---|
VotingServiceImpl(MultiLanguageService multiLangService) |
| Modifier and Type | Method and Description |
|---|---|
javax.jcr.Node |
getFileLangNode(javax.jcr.Node currentNode)
Getting node is "nt:file" node type.
|
long |
getVoteTotal(javax.jcr.Node node)
Gets total voting for all kind languages of this document is specified by node
|
double |
getVoteValueOfUser(javax.jcr.Node node,
String userName,
String language)
returns user's vote value on the given node
|
boolean |
isVoted(javax.jcr.Node node,
String userName,
String language)
Check if user had already voted on the given node or not
|
void |
vote(javax.jcr.Node node,
double rate,
String userName,
String language)
Voting the document is specified by the node by giving the rate, username, and language params
Any language belongs to this document can be voted.
|
public VotingServiceImpl(MultiLanguageService multiLangService)
public long getVoteTotal(javax.jcr.Node node)
throws Exception
getVoteTotal in interface VotingServicenode - The node document is specified to get total votingExceptionNodepublic javax.jcr.Node getFileLangNode(javax.jcr.Node currentNode)
throws Exception
currentNode - Exceptionpublic void vote(javax.jcr.Node node,
double rate,
String userName,
String language)
throws Exception
vote in interface VotingServicenode - The node document for votingrate - The number rate for votinguserName - The username of current user is voting.
Can not be nulllanguage - The language of this document for voting
Can not be nullExceptionNodepublic boolean isVoted(javax.jcr.Node node,
String userName,
String language)
throws Exception
VotingServiceisVoted in interface VotingServicenode - the node that will be voteduserName - the name of user had votedlanguage - language of to-be-voted nodeExceptionpublic double getVoteValueOfUser(javax.jcr.Node node,
String userName,
String language)
throws Exception
VotingServicegetVoteValueOfUser in interface VotingServicenode - the node that will be voteduserName - the name of user had votedlanguage - language of to-be-voted nodeExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.