Package com.xwiki.xpoll.script
Class XPollScriptService
- java.lang.Object
-
- com.xwiki.xpoll.script.XPollScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("xpoll") @Singleton public class XPollScriptService extends Object implements org.xwiki.script.service.ScriptService- Since:
- 2.1
- Version:
- $Id$
-
-
Constructor Summary
Constructors Constructor Description XPollScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Integer>getVoteResults(org.xwiki.model.reference.DocumentReference documentReference)Stringurl(org.xwiki.model.reference.DocumentReference documentReference)
-
-
-
Method Detail
-
url
public String url(org.xwiki.model.reference.DocumentReference documentReference)
- Parameters:
documentReference- the document that we want to get the URL for- Returns:
- the REST URL of the XPoll associated with the specific document
-
getVoteResults
public Map<String,Integer> getVoteResults(org.xwiki.model.reference.DocumentReference documentReference)
- Parameters:
documentReference- the reference of the document that represents the poll (i.e. the document that holds the poll options and their votes)- Returns:
- a map that has the XPoll proposals as keys and the scores as values. The map is empty if the access requirements are not met or if any exception is thrown.
-
-