Class 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 Detail

      • XPollScriptService

        public XPollScriptService()
    • 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.