org.sakaiproject.component.legacy.assignment
Class BaseAssignmentService.BaseAssignmentContent

java.lang.Object
  extended byorg.sakaiproject.component.legacy.assignment.BaseAssignmentService.BaseAssignmentContent
All Implemented Interfaces:
AssignmentContent, AttachmentContainer, Entity
Direct Known Subclasses:
BaseAssignmentService.BaseAssignmentContentEdit
Enclosing class:
BaseAssignmentService

public class BaseAssignmentService.BaseAssignmentContent
extends Object
implements AssignmentContent

AssignmentContent Implementation


Field Summary
protected  boolean m_allowAttachments
           
protected  List m_attachments
           
protected  List m_authors
           
protected  String m_context
           
protected  boolean m_groupProject
           
protected  int m_honorPledge
           
protected  String m_id
           
protected  boolean m_individuallyGraded
           
protected  String m_instructions
           
protected  int m_maxGradePoint
           
protected  ResourcePropertiesEdit m_properties
           
protected  boolean m_releaseGrades
           
protected  Time m_timeCreated
           
protected  Time m_timeLastModified
           
protected  String m_title
           
protected  int m_typeOfGrade
           
protected  int m_typeOfSubmission
           
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseAssignmentService.BaseAssignmentContent(AssignmentContent content)
          Copy constructor.
BaseAssignmentService.BaseAssignmentContent(Element el)
          Reads the AssignmentContent's attribute values from xml.
BaseAssignmentService.BaseAssignmentContent(String id, String context)
          Constructor used in addAssignmentContent.
 
Method Summary
 int compareTo(Object obj)
          Compare this object with the specified object for order.
 boolean equals(Object obj)
          Are these objects equal?
 boolean getAllowAttachments()
          Does this Assignment allow attachments?
 List getAttachments()
          Access the attachments.
 String getAuthorLastModified()
          Access the person of last modificaiton
 List getAuthors()
          Access the list of authors.
 String getContext()
          Access the AssignmentContent's context at the time of creation.
 String getCreator()
          Access the creator of this object.
 boolean getGroupProject()
          Get whether this project can be a group project.
 int getHonorPledge()
          Get the Honor Pledge type; values are NONE and ENGINEERING_HONOR_PLEDGE.
 String getId()
          Access the id of the entity.
 String getInstructions()
          Access the instructions.
 int getMaxGradePoint()
          Get the maximum grade for grade type = SCORE_GRADE_TYPE(3)
 String getMaxGradePointDisplay()
          Get the maximum grade for grade type = SCORE_GRADE_TYPE(3) Formated to show one decimal place
 ResourceProperties getProperties()
          Access the resource's properties.
 String getReference()
          Access the internal reference which can be used to access the resource from within the system.
 String getReference(String rootProperty)
          Access the alternate internal reference which can be used to access the entity from within the system.
 Time getTimeCreated()
          Access the time that this object was created.
 Time getTimeLastModified()
          Access the time of last modificaiton.
 String getTitle()
          Access the title.
 int getTypeOfGrade()
          Get the grade type.
 String getTypeOfGradeString(int type)
          Access a string describing the type of grade.
 int getTypeOfSubmission()
          Get the type of valid submission.
 String getUrl()
          Access the URL which can be used to access the resource.
 String getUrl(String rootProperty)
          Access the alternate URL which can be used to access the entity.
 int hashCode()
          Make a hash code that reflects the equals() logic as well.
 boolean individuallyGraded()
          Get whether group projects should be individually graded.
 boolean inUse()
          Is this AssignmentContent selected for use by an Assignment ?
 boolean releaseGrades()
          Gets whether grades can be released once submissions are graded.
protected  void setAll(AssignmentContent content)
           
 Element toXml(Document doc, Stack stack)
          Takes the AssignmentContent's attribute values and puts them into the xml document.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_properties

protected ResourcePropertiesEdit m_properties

m_id

protected String m_id

m_context

protected String m_context

m_attachments

protected List m_attachments

m_authors

protected List m_authors

m_title

protected String m_title

m_instructions

protected String m_instructions

m_honorPledge

protected int m_honorPledge

m_typeOfSubmission

protected int m_typeOfSubmission

m_typeOfGrade

protected int m_typeOfGrade

m_maxGradePoint

protected int m_maxGradePoint

m_groupProject

protected boolean m_groupProject

m_individuallyGraded

protected boolean m_individuallyGraded

m_releaseGrades

protected boolean m_releaseGrades

m_allowAttachments

protected boolean m_allowAttachments

m_timeCreated

protected Time m_timeCreated

m_timeLastModified

protected Time m_timeLastModified
Constructor Detail

BaseAssignmentService.BaseAssignmentContent

public BaseAssignmentService.BaseAssignmentContent(AssignmentContent content)
Copy constructor.


BaseAssignmentService.BaseAssignmentContent

public BaseAssignmentService.BaseAssignmentContent(String id,
                                                   String context)
Constructor used in addAssignmentContent.


BaseAssignmentService.BaseAssignmentContent

public BaseAssignmentService.BaseAssignmentContent(Element el)
Reads the AssignmentContent's attribute values from xml.

Method Detail

toXml

public Element toXml(Document doc,
                     Stack stack)
Takes the AssignmentContent's attribute values and puts them into the xml document.

Specified by:
toXml in interface Entity
Parameters:
doc - - The xml document.
stack - The DOM elements, the top of which is the containing element of the new "entity" element.
Returns:
The newly added element.

setAll

protected void setAll(AssignmentContent content)

getId

public String getId()
Description copied from interface: Entity
Access the id of the entity.

Specified by:
getId in interface Entity
Returns:
The id.

getUrl

public String getUrl()
Access the URL which can be used to access the resource.

Specified by:
getUrl in interface Entity
Returns:
The URL which can be used to access the resource.

getReference

public String getReference()
Access the internal reference which can be used to access the resource from within the system.

Specified by:
getReference in interface Entity
Returns:
The the internal reference which can be used to access the resource from within the system.

getReference

public String getReference(String rootProperty)
Description copied from interface: Entity
Access the alternate internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference is requested. If null, the native 'raw' reference is requested.
Returns:
The the alternate internal reference which can be used to access the entity from within the system.

getUrl

public String getUrl(String rootProperty)
Description copied from interface: Entity
Access the alternate URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested.
Returns:
The alternate URL which can be used to access the entity.

getProperties

public ResourceProperties getProperties()
Access the resource's properties.

Specified by:
getProperties in interface Entity
Returns:
The resource's properties.

getAttachments

public List getAttachments()
Access the attachments.

Specified by:
getAttachments in interface AttachmentContainer
Returns:
The set of attachments (a ReferenceVector containing Reference objects) (may be empty).

getContext

public String getContext()
Access the AssignmentContent's context at the time of creation.

Specified by:
getContext in interface AssignmentContent
Returns:
String - the context string.

getAuthors

public List getAuthors()
Access the list of authors.

Specified by:
getAuthors in interface AssignmentContent
Returns:
FlexStringArray of user ids.

getCreator

public String getCreator()
Access the creator of this object.

Specified by:
getCreator in interface AssignmentContent
Returns:
The User object representing the creator.

getAuthorLastModified

public String getAuthorLastModified()
Access the person of last modificaiton

Specified by:
getAuthorLastModified in interface AssignmentContent
Returns:
the User

getTitle

public String getTitle()
Access the title.

Specified by:
getTitle in interface AssignmentContent
Returns:
The Assignment's title.

getInstructions

public String getInstructions()
Access the instructions.

Specified by:
getInstructions in interface AssignmentContent
Returns:
The Assignment Content's instructions.

getTypeOfSubmission

public int getTypeOfSubmission()
Get the type of valid submission.

Specified by:
getTypeOfSubmission in interface AssignmentContent
Returns:
int - Type of Submission.

getTypeOfGradeString

public String getTypeOfGradeString(int type)
Access a string describing the type of grade.

Specified by:
getTypeOfGradeString in interface AssignmentContent
Parameters:
type - - The integer representing the type of grade.
Returns:
Description of the type of grade.

getTypeOfGrade

public int getTypeOfGrade()
Get the grade type.

Specified by:
getTypeOfGrade in interface AssignmentContent
Returns:
gradeType - The type of grade.

getMaxGradePoint

public int getMaxGradePoint()
Get the maximum grade for grade type = SCORE_GRADE_TYPE(3)

Specified by:
getMaxGradePoint in interface AssignmentContent
Returns:
The maximum grade score.

getMaxGradePointDisplay

public String getMaxGradePointDisplay()
Get the maximum grade for grade type = SCORE_GRADE_TYPE(3) Formated to show one decimal place

Specified by:
getMaxGradePointDisplay in interface AssignmentContent
Returns:
The maximum grade score.

getGroupProject

public boolean getGroupProject()
Get whether this project can be a group project.

Specified by:
getGroupProject in interface AssignmentContent
Returns:
True if this can be a group project, false otherwise.

individuallyGraded

public boolean individuallyGraded()
Get whether group projects should be individually graded.

Specified by:
individuallyGraded in interface AssignmentContent
Returns:
individGraded - true if projects are individually graded, false if grades are given to the group.

releaseGrades

public boolean releaseGrades()
Gets whether grades can be released once submissions are graded.

Specified by:
releaseGrades in interface AssignmentContent
Returns:
true if grades can be released once submission are graded, false if they must be released manually.

getHonorPledge

public int getHonorPledge()
Get the Honor Pledge type; values are NONE and ENGINEERING_HONOR_PLEDGE.

Specified by:
getHonorPledge in interface AssignmentContent
Returns:
the Honor Pledge value.

getAllowAttachments

public boolean getAllowAttachments()
Does this Assignment allow attachments?

Specified by:
getAllowAttachments in interface AssignmentContent
Returns:
true if the Assignment allows attachments, false otherwise?

getTimeCreated

public Time getTimeCreated()
Access the time that this object was created.

Specified by:
getTimeCreated in interface AssignmentContent
Returns:
The Time object representing the time of creation.

getTimeLastModified

public Time getTimeLastModified()
Access the time of last modificaiton.

Specified by:
getTimeLastModified in interface AssignmentContent
Returns:
The Time of last modification.

inUse

public boolean inUse()
Is this AssignmentContent selected for use by an Assignment ?

Specified by:
inUse in interface AssignmentContent
Returns:
boolean - Is this AssignmentContent used by an Assignment.

equals

public boolean equals(Object obj)
Are these objects equal? If they are both AssignmentContent objects, and they have matching id's, they are.

Returns:
true if they are equal, false if not.

hashCode

public int hashCode()
Make a hash code that reflects the equals() logic as well. We want two objects, even if different instances, if they have the same id to hash the same.


compareTo

public int compareTo(Object obj)
Compare this object with the specified object for order.

Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.