org.telscenter.sail.webapp.domain.brainstorm.impl
Class BrainstormImpl

java.lang.Object
  extended by org.telscenter.sail.webapp.domain.brainstorm.impl.BrainstormImpl
All Implemented Interfaces:
Serializable, Persistable, Brainstorm

public class BrainstormImpl
extends Object
implements Brainstorm

Simple brainstorm implementation.

Version:
$Id$
Author:
Hiroki Terashima
See Also:
Serialized Form

Field Summary
static String ANSWERS_JOIN_COLUMN_NAME
           
static String ANSWERS_JOIN_TABLE_NAME
           
static String BRAINSTORMS_JOIN_COLUMN_NAME
           
static String COLUMN_NAME_RUN_FK
           
static String DATA_STORE_NAME
           
static String QUESTIONS_JOIN_COLUMN_NAME
           
 
Constructor Summary
BrainstormImpl()
           
 
Method Summary
 void addAnswer(Answer answer)
          Adds an Answer to this brainstorm.
 void addWorkgroupThatRequestHelp(WISEWorkgroup workgroup)
          Indicate that the specified workgroup is requesting help to this brainstorm.
 boolean canWorkgroupSeeResponses(WISEWorkgroup workgroup)
          Returns whether the specified workgroup can see other students' responses.
 Set<Answer> getAnswers()
          Returns a list of Answer for this brainstorm, filtered by the subgroups of the logged-in user, if such subgroup exists.
 Brainstorm getCopy()
          Returns a copy of this Brainstorm object.
 DisplayNameOption getDisplayNameOption()
          Returns how the students' responses should be labeled.
 Long getId()
          Primary identifier that is unique for each different object instance.
 Long getParentBrainstormId()
          Returns this Brainstorm's parent brainstormId.
 Set<PreparedAnswer> getPreparedAnswers()
          Returns a set of PreparedAnswer for this brainstorm.
 Project getProject()
          Returns the Project that has this brainstorm.
 Question getQuestion()
          Returns the Question for this brainstorm.
 Questiontype getQuestiontype()
          Returns the type of Question for this brainstorm
 Run getRun()
          Return the Run that this Brainstorm is for
 Date getStarttime()
           
 Map<WISEWorkgroup,Date> getWorkgroupLastVisitedMap()
          Returns an association of workgroup and their last visited timestamp on this brainstorm step.
 Set<WISEWorkgroup> getWorkgroupsThatRequestHelp()
          Returns a Set of Workgroups that has requested for help on this Brainstorm.
 boolean hasWorkgroupPosted(WISEWorkgroup workgroup)
          Returns whether the specified workgroup has posted an answer to this brainstorm yet.
 boolean isAnonymousAllowed()
          Indicates whether the students posts to this brainstorm anonymously
 boolean isGated()
          Returns whether the students need to submit a post before seeing responses from other students or if they can see responses from others without first posting a response.
 boolean isInstantPollActive()
           
 boolean isPollEnded()
           
 boolean isRichTextEditorAllowed()
          Indicates whether the students can use the RichTextEditor
 boolean isSessionStarted()
          Returns when this brainstorm step session has started.
 void removeWorkgroupThatRequestHelp(WISEWorkgroup workgroup)
          Indicates that the specified workgroup is no longer seeking help on this brainstorm.
 void setAnonymousAllowed(boolean isAnonymousAllowed)
          Indicates whether the students posts to this brainstorm anonymously
 void setAnswers(Set<Answer> answers)
          Sets a list of Answer for this brainstorm.
 void setDisplayNameOption(DisplayNameOption displayNameOption)
          Sets how the students' responses should be labeled.
 void setGated(boolean isGated)
           
 void setInstantPollActive(boolean isInstantPollActive)
          Sets whether this instant poll is currently active
 void setParentBrainstormId(Long parentBrainstormId)
          Sets this Brainstorm's parent brainstormId.
 void setPollEnded(boolean isPollEnded)
          Allows students to then view feedback, graphs, charts, etc.
 void setPreparedAnswers(Set<PreparedAnswer> preparedAnswers)
          Sets a set of PreparedAnswer for this brainstorm.
 void setProject(Project project)
          Sets the Project that has this brainstorm.
 void setQuestion(Question question)
          Set the Question for this brainstorm.
 void setQuestiontype(Questiontype questiontype)
          Sets the type of Question for this brainstorm
 void setRichTextEditorAllowed(boolean isRichTextEditorAllowed)
          Indicates whether the students can use the RichTextEditor
 void setRun(Run run)
          Set the Run that this Brainstorm is for
 void setSessionStarted(boolean sessionStarted)
          Sets when this brainstorm step session has started.
 void setStarttime(Date starttime)
           
 void setWorkgroupsThatRequestHelp(Set<WISEWorkgroup> workgroupsThatRequestHelp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_STORE_NAME

public static final String DATA_STORE_NAME
See Also:
Constant Field Values

ANSWERS_JOIN_TABLE_NAME

public static final String ANSWERS_JOIN_TABLE_NAME
See Also:
Constant Field Values

BRAINSTORMS_JOIN_COLUMN_NAME

public static final String BRAINSTORMS_JOIN_COLUMN_NAME
See Also:
Constant Field Values

ANSWERS_JOIN_COLUMN_NAME

public static final String ANSWERS_JOIN_COLUMN_NAME
See Also:
Constant Field Values

QUESTIONS_JOIN_COLUMN_NAME

public static final String QUESTIONS_JOIN_COLUMN_NAME
See Also:
Constant Field Values

COLUMN_NAME_RUN_FK

public static final String COLUMN_NAME_RUN_FK
See Also:
Constant Field Values
Constructor Detail

BrainstormImpl

public BrainstormImpl()
Method Detail

getAnswers

public Set<Answer> getAnswers()
Description copied from interface: Brainstorm
Returns a list of Answer for this brainstorm, filtered by the subgroups of the logged-in user, if such subgroup exists.

Specified by:
getAnswers in interface Brainstorm
Returns:
a List of Answer
See Also:
Brainstorm.getAnswers()

getQuestion

public Question getQuestion()
Description copied from interface: Brainstorm
Returns the Question for this brainstorm.

Specified by:
getQuestion in interface Brainstorm
Returns:
Question this Brainstorm's question.
See Also:
Brainstorm.getQuestion()

getRun

public Run getRun()
Description copied from interface: Brainstorm
Return the Run that this Brainstorm is for

Specified by:
getRun in interface Brainstorm
Returns:
Run that this Brainstorm has been set up in.
See Also:
Brainstorm.getRun()

getId

public Long getId()
Description copied from interface: Persistable
Primary identifier that is unique for each different object instance.

Specified by:
getId in interface Persistable
Returns:
the id

setRun

public void setRun(Run run)
Description copied from interface: Brainstorm
Set the Run that this Brainstorm is for

Specified by:
setRun in interface Brainstorm
See Also:
Brainstorm.setRun(org.telscenter.sail.webapp.domain.Run)

setAnswers

public void setAnswers(Set<Answer> answers)
Description copied from interface: Brainstorm
Sets a list of Answer for this brainstorm.

Specified by:
setAnswers in interface Brainstorm
See Also:
Brainstorm.setAnswers(java.util.Set)

addAnswer

public void addAnswer(Answer answer)
Description copied from interface: Brainstorm
Adds an Answer to this brainstorm.

Specified by:
addAnswer in interface Brainstorm
Parameters:
answer - Add this Answer to this Brainstorm.
See Also:
Brainstorm.addAnswer(org.telscenter.sail.webapp.domain.brainstorm.answer.Answer)

getPreparedAnswers

public Set<PreparedAnswer> getPreparedAnswers()
Description copied from interface: Brainstorm
Returns a set of PreparedAnswer for this brainstorm.

Specified by:
getPreparedAnswers in interface Brainstorm
Returns:
the preparedAnswers

setPreparedAnswers

public void setPreparedAnswers(Set<PreparedAnswer> preparedAnswers)
Description copied from interface: Brainstorm
Sets a set of PreparedAnswer for this brainstorm.

Specified by:
setPreparedAnswers in interface Brainstorm
Parameters:
preparedAnswers - the preparedAnswers to set

setQuestion

public void setQuestion(Question question)
Description copied from interface: Brainstorm
Set the Question for this brainstorm.

Specified by:
setQuestion in interface Brainstorm
See Also:
Brainstorm.setQuestion(org.telscenter.sail.webapp.domain.brainstorm.question.Question)

getParentBrainstormId

public Long getParentBrainstormId()
Description copied from interface: Brainstorm
Returns this Brainstorm's parent brainstormId. If this Brainstorm does not have a parent, return null.

Specified by:
getParentBrainstormId in interface Brainstorm
Returns:
the parentBrainstormId

setParentBrainstormId

public void setParentBrainstormId(Long parentBrainstormId)
Description copied from interface: Brainstorm
Sets this Brainstorm's parent brainstormId.

Specified by:
setParentBrainstormId in interface Brainstorm
Parameters:
parentBrainstormId - the parentBrainstormId to set

isAnonymousAllowed

public boolean isAnonymousAllowed()
Description copied from interface: Brainstorm
Indicates whether the students posts to this brainstorm anonymously

Specified by:
isAnonymousAllowed in interface Brainstorm
Returns:
the isAnonymousAllowed

setAnonymousAllowed

public void setAnonymousAllowed(boolean isAnonymousAllowed)
Description copied from interface: Brainstorm
Indicates whether the students posts to this brainstorm anonymously

Specified by:
setAnonymousAllowed in interface Brainstorm
Parameters:
isAnonymousAllowed - the isAnonymousAllowed to set

getWorkgroupLastVisitedMap

public Map<WISEWorkgroup,Date> getWorkgroupLastVisitedMap()
Description copied from interface: Brainstorm
Returns an association of workgroup and their last visited timestamp on this brainstorm step.

Specified by:
getWorkgroupLastVisitedMap in interface Brainstorm
Returns:
Map of WISEWorkgroup and Date

getWorkgroupsThatRequestHelp

public Set<WISEWorkgroup> getWorkgroupsThatRequestHelp()
Description copied from interface: Brainstorm
Returns a Set of Workgroups that has requested for help on this Brainstorm.

Specified by:
getWorkgroupsThatRequestHelp in interface Brainstorm
Returns:
Set of WISEWorkgroup.
See Also:
Brainstorm.getWorkgroupsThatRequestHelp()

setWorkgroupsThatRequestHelp

public void setWorkgroupsThatRequestHelp(Set<WISEWorkgroup> workgroupsThatRequestHelp)
Parameters:
workgroupsThatRequestHelp - the workgroupsThatRequestHelp to set

addWorkgroupThatRequestHelp

public void addWorkgroupThatRequestHelp(WISEWorkgroup workgroup)
Description copied from interface: Brainstorm
Indicate that the specified workgroup is requesting help to this brainstorm.

Specified by:
addWorkgroupThatRequestHelp in interface Brainstorm
See Also:
Brainstorm.addWorkgroupThatRequestHelp(org.telscenter.sail.webapp.domain.workgroup.WISEWorkgroup)

removeWorkgroupThatRequestHelp

public void removeWorkgroupThatRequestHelp(WISEWorkgroup workgroup)
Description copied from interface: Brainstorm
Indicates that the specified workgroup is no longer seeking help on this brainstorm.

Specified by:
removeWorkgroupThatRequestHelp in interface Brainstorm
See Also:
Brainstorm.removeWorkgroupThatRequestHelp(org.telscenter.sail.webapp.domain.workgroup.WISEWorkgroup)

isGated

public boolean isGated()
Description copied from interface: Brainstorm
Returns whether the students need to submit a post before seeing responses from other students or if they can see responses from others without first posting a response.

Specified by:
isGated in interface Brainstorm
Returns:
true iff students need to post a response before seeing others' posts.
See Also:
Brainstorm.isGated()

setGated

public void setGated(boolean isGated)
Specified by:
setGated in interface Brainstorm
Parameters:
isGated - the isGated to set

isSessionStarted

public boolean isSessionStarted()
Description copied from interface: Brainstorm
Returns when this brainstorm step session has started. If it has, students will be able to post.

Specified by:
isSessionStarted in interface Brainstorm
Returns:
true iff this brainstorm session has started.
See Also:
Brainstorm.isSessionStarted()

setSessionStarted

public void setSessionStarted(boolean sessionStarted)
Description copied from interface: Brainstorm
Sets when this brainstorm step session has started. If it has, students will be able to post.

Specified by:
setSessionStarted in interface Brainstorm
See Also:
Brainstorm.setSessionStarted(boolean)

hasWorkgroupPosted

public boolean hasWorkgroupPosted(WISEWorkgroup workgroup)
Description copied from interface: Brainstorm
Returns whether the specified workgroup has posted an answer to this brainstorm yet.

Specified by:
hasWorkgroupPosted in interface Brainstorm
Returns:
true iff the workgroup has posted a response to this workgroup.
See Also:
Brainstorm.hasWorkgroupPosted(org.telscenter.sail.webapp.domain.workgroup.WISEWorkgroup)

canWorkgroupSeeResponses

public boolean canWorkgroupSeeResponses(WISEWorkgroup workgroup)
Description copied from interface: Brainstorm
Returns whether the specified workgroup can see other students' responses.

Specified by:
canWorkgroupSeeResponses in interface Brainstorm
Returns:
See Also:
Brainstorm.canWorkgroupSeeResponses(org.telscenter.sail.webapp.domain.workgroup.WISEWorkgroup)

getStarttime

public Date getStarttime()
Returns:
the starttime

setStarttime

public void setStarttime(Date starttime)
Parameters:
starttime - the starttime to set

getProject

public Project getProject()
Description copied from interface: Brainstorm
Returns the Project that has this brainstorm.

Specified by:
getProject in interface Brainstorm
Returns:
the project

setProject

public void setProject(Project project)
Description copied from interface: Brainstorm
Sets the Project that has this brainstorm.

Specified by:
setProject in interface Brainstorm
Parameters:
project - the project to set

getDisplayNameOption

public DisplayNameOption getDisplayNameOption()
Description copied from interface: Brainstorm
Returns how the students' responses should be labeled.

Specified by:
getDisplayNameOption in interface Brainstorm
Returns:
the displayNameOption

setDisplayNameOption

public void setDisplayNameOption(DisplayNameOption displayNameOption)
Description copied from interface: Brainstorm
Sets how the students' responses should be labeled.

Specified by:
setDisplayNameOption in interface Brainstorm
Parameters:
displayNameOption - the displayNameOption to set

isRichTextEditorAllowed

public boolean isRichTextEditorAllowed()
Description copied from interface: Brainstorm
Indicates whether the students can use the RichTextEditor

Specified by:
isRichTextEditorAllowed in interface Brainstorm
Returns:
the isRichTextEditorAllowed

setRichTextEditorAllowed

public void setRichTextEditorAllowed(boolean isRichTextEditorAllowed)
Description copied from interface: Brainstorm
Indicates whether the students can use the RichTextEditor

Specified by:
setRichTextEditorAllowed in interface Brainstorm
Parameters:
isRichTextEditorAllowed - the isRichTextEditorAllowed to set

getCopy

public Brainstorm getCopy()
Description copied from interface: Brainstorm
Returns a copy of this Brainstorm object. Does not save in datastore but only instantiates a new copy of this object.

Specified by:
getCopy in interface Brainstorm
Returns:
a new instance of this project with same attributes except id and version.
See Also:
Brainstorm.getCopy()

getQuestiontype

public Questiontype getQuestiontype()
Description copied from interface: Brainstorm
Returns the type of Question for this brainstorm

Specified by:
getQuestiontype in interface Brainstorm
Returns:
the questiontype

setQuestiontype

public void setQuestiontype(Questiontype questiontype)
Description copied from interface: Brainstorm
Sets the type of Question for this brainstorm

Specified by:
setQuestiontype in interface Brainstorm
Parameters:
questiontype - the questiontype to set

isPollEnded

public boolean isPollEnded()
Specified by:
isPollEnded in interface Brainstorm
Returns:
the isPollEnded

setPollEnded

public void setPollEnded(boolean isPollEnded)
Description copied from interface: Brainstorm
Allows students to then view feedback, graphs, charts, etc. of the results of a poll.

Specified by:
setPollEnded in interface Brainstorm
Parameters:
isPollEnded - the isPollEnded to set

isInstantPollActive

public boolean isInstantPollActive()
Specified by:
isInstantPollActive in interface Brainstorm
Returns:
the isInstantPollActive

setInstantPollActive

public void setInstantPollActive(boolean isInstantPollActive)
Description copied from interface: Brainstorm
Sets whether this instant poll is currently active

Specified by:
setInstantPollActive in interface Brainstorm
Parameters:
isInstantPollActive - the isInstantPollActive to set


Copyright © 2012. All Rights Reserved.