|
|||||||||
| Home >> All >> com >> RuntimeCollective >> questionnaire >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.questionnaire.bean
Class ClusterSafeQuestionnaire

java.lang.Objectcom.RuntimeCollective.permission.bean.SimplePermissible
com.RuntimeCollective.sitemap.bean.SimplePublishable
com.RuntimeCollective.questionnaire.bean.Questionnaire
com.RuntimeCollective.questionnaire.bean.ClusterSafeQuestionnaire
- All Implemented Interfaces:
- com.RuntimeCollective.webapps.bean.EntityBean, com.RuntimeCollective.permission.bean.Permissible, com.RuntimeCollective.webapps.bean.PermissionBean, com.RuntimeCollective.sitemap.bean.Publishable, java.io.Serializable
- public class ClusterSafeQuestionnaire
- extends Questionnaire
An extension of Questionnaire that is (I really hope) cluster-safe (i.e. works with the SynchronizedEBS).
- Version:
- $Id: ClusterSafeQuestionnaire.java,v 1.5 2003/10/13 11:29:27 miles Exp $
| Field Summary | |
private java.util.List |
unsaved
A list of UserAnswers added to this Questionnaire since the last save. |
| Fields inherited from class com.RuntimeCollective.questionnaire.bean.Questionnaire |
AnonP, DATABASE_TABLE, Description, Name, QUESTION_TABLE, Questions, Secret, TheUserAnswers |
| Fields inherited from class com.RuntimeCollective.sitemap.bean.SimplePublishable |
AlwaysLive, AND_STATUS, ESC, GoDeadDate, GoLiveDate, IsNew, NeedApproval, ORDER_BY_LAST_MOD_DATE, SELECT_ID_FROM, Status, StatusLastModifiedDate, WHERE_ALWAYS_LIVE |
| Fields inherited from class com.RuntimeCollective.permission.bean.SimplePermissible |
DATABASE_PRULEMAP_TABLE, id, PermissionRuleIds |
| Fields inherited from interface com.RuntimeCollective.sitemap.bean.Publishable |
STATUS_APPROVED, STATUS_ARCHIVED, STATUS_EDITED, STATUS_TO_BE_APPROVED |
| Fields inherited from interface com.RuntimeCollective.permission.bean.Permissible |
EDIT_ACTION, VIEW_ACTION |
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
INTERFACE_BEAN, NULL_ID |
| Constructor Summary | |
ClusterSafeQuestionnaire()
|
|
ClusterSafeQuestionnaire(int id)
Get a current Questionnaire from the RuntimeDataSource, given an id. |
|
| Method Summary | |
void |
addUserAnswers(UserAnswers userAnswers)
Add a UserAnswers to this Questionnaire |
java.util.Iterator |
getAllUserAnswers()
Get all UserAnswers from this Questionnaire |
java.util.Iterator |
getAllUserAnswers(boolean membersOnly)
Get all member UserAnswers OR anon UserAnswers |
protected java.util.List |
getAllUserAnswersAsList()
List version of getAllUserAnswers(). |
java.util.Iterator |
getAllUserAnswersForUser(com.RuntimeCollective.webapps.bean.User user)
Get all UserAnswers from a given User for this Questionnaire |
int |
getIndexOfUserAnswers(UserAnswers userAnswers)
Get the (first) index of a UserAnswers in this Questionnaire |
int |
getNumberOfAnonVotes()
Get the number of anonomous votes, ie the number of UsersAnswers where the userId is -1 |
int |
getNumberOfVotes()
Get the number of votes, ie the number of UserAnswers |
protected java.lang.Integer |
getProvisionalPosition()
Gets the next possible position for a UserAnswer, by examining the database |
UserAnswers |
getUserAnswers(int position)
Get a UserAnswers from this Questionnaire |
protected java.lang.Integer |
idFromUA(java.lang.Object o)
Returns the ID of a UserAnswers object, if indeed this object is a UserAnswers |
protected void |
init()
Initialise this object. |
void |
removeUserAnswers(UserAnswers userAnswers)
Remove a UserAnswers from this Questionnaire |
void |
save()
Save this bean to the database. |
void |
setUserAnswers(int position,
UserAnswers userAnswers)
Set a UserAnswers in this Questionnaire. |
protected UserAnswers |
uaFromId(java.lang.Object o)
Returns a UserAnswers from an Integer object , if indeed this object is an Integer |
protected int |
updateProvisionalPosition(int unsavedIndex)
Check the provisional position for the UserAnswer stored at position unsavedIndex in the unsaved
List, to make sure it hasn't been used by another UserAnswer
in the meantime. |
| Methods inherited from class com.RuntimeCollective.questionnaire.bean.Questionnaire |
addQuestion, delete, getAnonP, getDescription, getIndexOfQuestion, getName, getNotPolls, getNotPollsAsList, getNumberOfLoggedOnVotes, getPolls, getPollsAsList, getQuestion, getQuestions, getSecret, isAnonP, isSecret, removeQuestion, setAnonP, setDescription, setName, setQuestion, setSecret |
| Methods inherited from class com.RuntimeCollective.sitemap.bean.SimplePublishable |
checkStillApproved, getAlwaysLive, getGoDeadDate, getGoLiveDate, getIsNew, getNeedApproval, getStatus, getStatusLastModifiedDate, getToBeApprovedPublishables, isAlwaysLive, isApproved, isArchived, isEdited, isLive, isNew, isToBeApproved, markAsApproved, markAsArchived, markAsEdited, markAsToBeApproved, needsApproval, publish, saveArchivedData, setAlwaysLive, setGoDeadDate, setGoLiveDate, setIsNew, setNeedApproval, setStatus, setStatusLastModifiedDate |
| Methods inherited from class com.RuntimeCollective.permission.bean.SimplePermissible |
canEdit, canPerformAction, canView, getActionPermissionRule, getActions, getAuthorisationPathForAction, getAuthorisationPathForAction, getId, loadRules, removeActionPermissionRule, saveRules, setActionPermissionRule, setId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.RuntimeCollective.sitemap.bean.Publishable |
getAlwaysLive, getGoDeadDate, getGoLiveDate, getIsNew, getNeedApproval, getStatus, getStatusLastModifiedDate, isAlwaysLive, isApproved, isArchived, isEdited, isLive, isNew, isToBeApproved, markAsApproved, markAsArchived, markAsEdited, markAsToBeApproved, needsApproval, publish, saveArchivedData, setAlwaysLive, setGoDeadDate, setGoLiveDate, setIsNew, setNeedApproval, setStatus, setStatusLastModifiedDate |
| Methods inherited from interface com.RuntimeCollective.permission.bean.Permissible |
canEdit, canPerformAction, canView, getActionPermissionRule, getActions, getAuthorisationPathForAction, getAuthorisationPathForAction, getId, setActionPermissionRule, setId |
| Field Detail |
unsaved
private java.util.List unsaved
- A list of UserAnswers added to this Questionnaire since the last save.
| Constructor Detail |
ClusterSafeQuestionnaire
public ClusterSafeQuestionnaire()
ClusterSafeQuestionnaire
public ClusterSafeQuestionnaire(int id)
- Get a current Questionnaire from the RuntimeDataSource, given an id.
| Method Detail |
save
public void save()
- Save this bean to the database.
- Specified by:
savein interfacecom.RuntimeCollective.permission.bean.Permissible- Overrides:
savein classQuestionnaire
addUserAnswers
public void addUserAnswers(UserAnswers userAnswers)
- Add a UserAnswers to this Questionnaire
- Overrides:
addUserAnswersin classQuestionnaire
removeUserAnswers
public void removeUserAnswers(UserAnswers userAnswers)
- Remove a UserAnswers from this Questionnaire
- Overrides:
removeUserAnswersin classQuestionnaire
getUserAnswers
public UserAnswers getUserAnswers(int position)
- Get a UserAnswers from this Questionnaire
- Overrides:
getUserAnswersin classQuestionnaire
setUserAnswers
public void setUserAnswers(int position,
UserAnswers userAnswers)
- Set a UserAnswers in this Questionnaire.
(This adds it to the "unsaved" list.)
- Overrides:
setUserAnswersin classQuestionnaire
getIndexOfUserAnswers
public int getIndexOfUserAnswers(UserAnswers userAnswers)
- Get the (first) index of a UserAnswers in this Questionnaire
- Overrides:
getIndexOfUserAnswersin classQuestionnaire
getAllUserAnswers
public java.util.Iterator getAllUserAnswers()
- Get all UserAnswers from this Questionnaire
- Overrides:
getAllUserAnswersin classQuestionnaire
getAllUserAnswersAsList
protected java.util.List getAllUserAnswersAsList()
- List version of getAllUserAnswers().
Adding to / removing from this list will have no effect on the underlying Questionnaire. It is a throwaway list.
getAllUserAnswers
public java.util.Iterator getAllUserAnswers(boolean membersOnly)
- Get all member UserAnswers OR anon UserAnswers
- Overrides:
getAllUserAnswersin classQuestionnaire
getAllUserAnswersForUser
public java.util.Iterator getAllUserAnswersForUser(com.RuntimeCollective.webapps.bean.User user)
- Get all UserAnswers from a given User for this Questionnaire
- Overrides:
getAllUserAnswersForUserin classQuestionnaire
getNumberOfVotes
public int getNumberOfVotes()
- Get the number of votes, ie the number of UserAnswers
- Overrides:
getNumberOfVotesin classQuestionnaire
getNumberOfAnonVotes
public int getNumberOfAnonVotes()
- Get the number of anonomous votes, ie the number of UsersAnswers where the userId is -1
- Overrides:
getNumberOfAnonVotesin classQuestionnaire
init
protected void init()
- Initialise this object.
getProvisionalPosition
protected java.lang.Integer getProvisionalPosition()
- Gets the next possible position for a UserAnswer,
by examining the database
updateProvisionalPosition
protected int updateProvisionalPosition(int unsavedIndex)
- Check the provisional position for the UserAnswer stored
at position
unsavedIndexin theunsavedList, to make sure it hasn't been used by another UserAnswer in the meantime. If it has, refresh it, and return it.
idFromUA
protected java.lang.Integer idFromUA(java.lang.Object o) throws java.lang.ClassCastException
- Returns the ID of a UserAnswers object, if indeed this object is a UserAnswers
uaFromId
protected UserAnswers uaFromId(java.lang.Object o) throws java.lang.ClassCastException
- Returns a UserAnswers from an Integer object , if indeed this object is an Integer
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> questionnaire >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC