com.xmlserv.app.poll
Class SimplePoll

java.lang.Object
  |
  +--com.xmlserv.app.poll.SimplePoll

public class SimplePoll
extends java.lang.Object

Simplified version of Poll. Supports only one userid with multiple options. Currently only the DB abstraction subclasses for options andanswers are ued by this subclass.

See Also:
Poll

Constructor Summary
SimplePoll(java.sql.Connection con, int id)
           
SimplePoll(int rolegroup)
           
 
Method Summary
 void delete(java.sql.Connection con, boolean force)
          Delete poll.
 java.lang.String getAnfang()
           
 java.lang.String getEnde()
           
 int getId()
           
 java.lang.String getName()
           
 int getRolegroup()
           
 boolean isActive()
           
 boolean isClosed()
           
static org.jdom.Element list(java.sql.Connection con, int rolegroup, int userid, boolean includeAnswers)
          List all entries.
static org.jdom.Element list(java.sql.Connection con, int rolegroup, int userid, boolean includeAnswers, boolean open)
          Show polls.
 void save(java.sql.Connection con)
           
 void setAnfang(java.lang.String anfang)
           
 void setEnde(java.lang.String ende)
           
 void setNamee(java.lang.String name)
           
 void setRolegroup(int rolegroup)
           
 org.jdom.Element toElement()
          Convert to an Element.
 org.jdom.Element toElement(java.sql.Connection con, boolean includeAnswers)
          Include questions and options.
 org.jdom.Element toElement(java.sql.Connection con, int userid, boolean includeAnswers)
          Include questions and options as well as an indication (attribute 'participated') whether the given user already took this poll.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePoll

public SimplePoll(int rolegroup)

SimplePoll

public SimplePoll(java.sql.Connection con,
                  int id)
           throws XMLServException
Method Detail

save

public void save(java.sql.Connection con)
          throws XMLServException

toElement

public org.jdom.Element toElement()
Convert to an Element.

toElement

public org.jdom.Element toElement(java.sql.Connection con,
                                  boolean includeAnswers)
                           throws XMLServException
Include questions and options.
Parameters:
includeAnswers - If true, answers are included.

toElement

public org.jdom.Element toElement(java.sql.Connection con,
                                  int userid,
                                  boolean includeAnswers)
                           throws XMLServException
Include questions and options as well as an indication (attribute 'participated') whether the given user already took this poll.
Parameters:
includeAnswers - If true, answers are included.

delete

public void delete(java.sql.Connection con,
                   boolean force)
            throws XMLServException
Delete poll.
Parameters:
force - If true, delete including answers.

list

public static org.jdom.Element list(java.sql.Connection con,
                                    int rolegroup,
                                    int userid,
                                    boolean includeAnswers)
                             throws XMLServException
List all entries.

list

public static org.jdom.Element list(java.sql.Connection con,
                                    int rolegroup,
                                    int userid,
                                    boolean includeAnswers,
                                    boolean open)
                             throws XMLServException
Show polls.
Parameters:
open - If true, show only polls that are still open for voting. Show all otherwise.

getId

public int getId()

getRolegroup

public int getRolegroup()

setRolegroup

public void setRolegroup(int rolegroup)

getName

public java.lang.String getName()

setNamee

public void setNamee(java.lang.String name)

getAnfang

public java.lang.String getAnfang()

setAnfang

public void setAnfang(java.lang.String anfang)

getEnde

public java.lang.String getEnde()

setEnde

public void setEnde(java.lang.String ende)

isClosed

public boolean isClosed()

isActive

public boolean isActive()