Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Class WSPoll

java.lang.Object
  extended by com.jivesoftware.community.webservices.WSJiveObject
      extended by com.jivesoftware.community.webservices.WSPoll

public class WSPoll
extends WSJiveObject

Poll webervices object.


Field Summary
static long ALLOW_ANONYMOUS_VOTE_MODIFICATION
          Mode to allow guests to change their vote after casting the vote.
static long ALLOW_USER_VOTE_MODIFICATION
          Mode to allow users to change their vote after casting the vote.
static long MULTIPLE_SELECTIONS_ALLOWED
          Mode to allow users to select multiple options in a poll.
 
Fields inherited from class com.jivesoftware.community.webservices.WSJiveObject
id, objectType
 
Constructor Summary
WSPoll()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getCommentStatus()
          Returns the comment status of this poll which may be any one of the following: NONE -- no comments allowed OPEN -- comments are permitted CLOSED -- comments were permitted but are not allowed now Defaults to OPEN.
 long getContainerObjectID()
          Returns the object ID of the container that 'contains' the poll.
 int getContainerObjectType()
          Returns the object type of the container that 'contains' the poll.
 java.util.Date getCreationDate()
          Returns the date the poll was created.
 java.lang.String getDescription()
          Returns a brief description of the poll.
 java.util.Date getEndDate()
          Returns the date voting for the poll should end.
 java.util.Date getExpirationDate()
          Returns the date the poll should expire.
 long getMode()
           
 java.util.Date getModificationDate()
          Returns the date the poll was last modified.
 java.lang.String getName()
          Returns the name of the poll.
 java.lang.String getOption(int index)
          Returns the text of the option at the specified index.
 int getOptionCount()
          Returns the number of options available in the poll.
 java.lang.String[] getOptions()
           
 java.util.Date getStartDate()
          Returns the date voting for the poll is set to start.
 WSUser getUser()
          Returns the user who created the poll or null if the poll was created anonymously.
 int getVoteCount()
          Returns a count of all votes (both guest and user votes) for all options in the poll.
 int hashCode()
           
 void setCommentStatus(int status)
           
 void setContainerObjectID(long containerObjectID)
           
 void setContainerObjectType(int containerObjectType)
           
 void setCreationDate(java.util.Date creationDate)
           
 void setDescription(java.lang.String description)
          Sets the description of the poll.
 void setEndDate(java.util.Date endDate)
          Sets the date the poll should end.
 void setExpirationDate(java.util.Date expireDate)
          Sets the date the poll should expire.
 void setMode(long mode)
           
 void setModificationDate(java.util.Date modificationDate)
           
 void setName(java.lang.String name)
          Sets the name of the poll.
 void setOptionCount(int ct)
           
 void setOptions(java.lang.String[] options)
           
 void setStartDate(java.util.Date startDate)
          Sets the date voting for the poll should start.
 void setUser(WSUser user)
           
 void setVoteCount(int voteCount)
           
 java.lang.String toString()
           
 
Methods inherited from class com.jivesoftware.community.webservices.WSJiveObject
getID, getObjectType, setID, setObjectType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ALLOW_USER_VOTE_MODIFICATION

public static final long ALLOW_USER_VOTE_MODIFICATION
Mode to allow users to change their vote after casting the vote. Not set by default.

See Also:
Constant Field Values

ALLOW_ANONYMOUS_VOTE_MODIFICATION

public static final long ALLOW_ANONYMOUS_VOTE_MODIFICATION
Mode to allow guests to change their vote after casting the vote. Not set by default.

See Also:
Constant Field Values

MULTIPLE_SELECTIONS_ALLOWED

public static final long MULTIPLE_SELECTIONS_ALLOWED
Mode to allow users to select multiple options in a poll. Not set by default.

See Also:
Constant Field Values
Constructor Detail

WSPoll

public WSPoll()
Method Detail

getUser

public WSUser getUser()
Returns the user who created the poll or null if the poll was created anonymously.

Returns:
the user who created the poll or null if the poll was created anonymously.

getContainerObjectType

public int getContainerObjectType()
Returns the object type of the container that 'contains' the poll. The container type returned wiill be a value in JiveConstants (e.g. JiveConstants.COMMUNITY).

Returns:
the object type of the container that 'contains' the poll.

getContainerObjectID

public long getContainerObjectID()
Returns the object ID of the container that 'contains' the poll.

Returns:
the object ID of the container that 'contains' the poll.

getName

public java.lang.String getName()
Returns the name of the poll.

Returns:
the name of the poll.

setName

public void setName(java.lang.String name)
             throws UnauthorizedException
Sets the name of the poll. If the name passed in is null, an IllegalArguementException will be thrown.

Parameters:
name - the new name of the poll.
Throws:
UnauthorizedException - if the user does not have permissions to administer the poll.

getDescription

public java.lang.String getDescription()
Returns a brief description of the poll.

Returns:
a brief description of the poll.

setDescription

public void setDescription(java.lang.String description)
                    throws UnauthorizedException
Sets the description of the poll.

Parameters:
description - the description of the poll.
Throws:
UnauthorizedException - if the user does not have permissions to administer the poll.

getCreationDate

public java.util.Date getCreationDate()
Returns the date the poll was created.

Returns:
the date the poll was created.

getModificationDate

public java.util.Date getModificationDate()
Returns the date the poll was last modified. The last modified date only applies to the poll itself, it does not take into account votes for options in the poll.

Returns:
the date the poll was last modified.

getStartDate

public java.util.Date getStartDate()
Returns the date voting for the poll is set to start.

Returns:
the date voting for the poll is set to start.

setStartDate

public void setStartDate(java.util.Date startDate)
                  throws UnauthorizedException
Sets the date voting for the poll should start.

Parameters:
startDate - the date voting for the poll should start.
Throws:
UnauthorizedException - if the user does not have permissions to administer the poll.

getEndDate

public java.util.Date getEndDate()
Returns the date voting for the poll should end.

Returns:
the date voting for the poll should end.

setEndDate

public void setEndDate(java.util.Date endDate)
                throws UnauthorizedException
Sets the date the poll should end.

Parameters:
endDate - the date the poll should end.
Throws:
UnauthorizedException - if the user does not have permissions to administer the poll.

getExpirationDate

public java.util.Date getExpirationDate()
Returns the date the poll should expire. The expire date is different from the end date in that users will be able to see the poll but not vote between the end date and the expire date.

Returns:
the date the poll should expire.

setExpirationDate

public void setExpirationDate(java.util.Date expireDate)
                       throws UnauthorizedException
Sets the date the poll should expire. This date must be on or after the end date. This date is automatically set to the end date by default.

Parameters:
expireDate - the date the poll should expire.
Throws:
UnauthorizedException - if the user does not have permissions to administer the poll.

getOptionCount

public int getOptionCount()
Returns the number of options available in the poll.

Returns:
the number of options available in the poll.

getOption

public java.lang.String getOption(int index)
Returns the text of the option at the specified index.

Parameters:
index - the index of the option to return the text for.
Returns:
the text of the option at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if 0 > index > getOptionCount() - 1

getVoteCount

public int getVoteCount()
                 throws PollException
Returns a count of all votes (both guest and user votes) for all options in the poll.

Returns:
a count of all votes for all options in the poll.
Throws:
com.jivesoftware.community.PollException - reserved for future changes.
PollException

getCommentStatus

public int getCommentStatus()
Returns the comment status of this poll which may be any one of the following: Defaults to OPEN.

Returns:
status the comment status of this poll

setVoteCount

public void setVoteCount(int voteCount)

setUser

public void setUser(WSUser user)

setContainerObjectType

public void setContainerObjectType(int containerObjectType)

setContainerObjectID

public void setContainerObjectID(long containerObjectID)

setCreationDate

public void setCreationDate(java.util.Date creationDate)

setModificationDate

public void setModificationDate(java.util.Date modificationDate)

setOptions

public void setOptions(java.lang.String[] options)

getOptions

public java.lang.String[] getOptions()

setCommentStatus

public void setCommentStatus(int status)

setOptionCount

public void setOptionCount(int ct)

getMode

public long getMode()

setMode

public void setMode(long mode)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class WSJiveObject

hashCode

public int hashCode()
Overrides:
hashCode in class WSJiveObject

toString

public java.lang.String toString()
Overrides:
toString in class WSJiveObject

Clearspace Project Page

Copyright © 1999-2007 Jive Software.