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

java.lang.Object
  extended byorg.sakaiproject.component.legacy.assignment.BaseAssignmentService.BaseAssignment
All Implemented Interfaces:
Assignment, Comparable, Entity
Direct Known Subclasses:
BaseAssignmentService.BaseAssignmentEdit
Enclosing class:
BaseAssignmentService

public class BaseAssignmentService.BaseAssignment
extends Object
implements Assignment

Assignment Implementation


Field Summary
protected  String m_assignmentContent
           
protected  List m_authors
           
protected  Time m_closeTime
           
protected  String m_context
           
protected  boolean m_draft
           
protected  Time m_dropDeadTime
           
protected  Time m_dueTime
           
protected  String m_id
           
protected  Time m_openTime
           
protected  ResourcePropertiesEdit m_properties
           
protected  String m_section
           
protected  String m_title
           
 
Fields inherited from interface org.sakaiproject.service.legacy.assignment.Assignment
ASSIGNMENT_SUBMISSION_TYPE_NOT_SET, ATTACHMENT_ONLY_ASSIGNMENT_SUBMISSION, CHECK_GRADE_TYPE, CHECK_GRADE_TYPE_STRING, GRADE_TYPE_NOT_SET, HONOR_PLEDGE_ENGINEERING, HONOR_PLEDGE_NONE, HONOR_PLEDGE_NOT_SET, LETTER_GRADE_TYPE, LETTER_GRADE_TYPE_STRING, PASS_FAIL_GRADE_TYPE, PASS_FAIL_GRADE_TYPE_STRING, SCORE_GRADE_TYPE, SCORE_GRADE_TYPE_STRING, TEXT_AND_ATTACHMENT_ASSIGNMENT_SUBMISSION, TEXT_ONLY_ASSIGNMENT_SUBMISSION, UNGRADED_GRADE_TYPE, UNGRADED_GRADE_TYPE_STRING
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseAssignmentService.BaseAssignment(Assignment assignment)
          Copy constructor
BaseAssignmentService.BaseAssignment(Element el)
          Reads the Assignment's attribute values from xml.
BaseAssignmentService.BaseAssignment(String id, String context)
          Constructor used in addAssignment
 
Method Summary
 void addAuthor(User author)
          Add an author to the author list.
 int compareTo(Object obj)
          Compare this object with the specified object for order.
 boolean equals(Object obj)
          Are these objects equal?
 String getAuthorLastModified()
          Access the person of last modificaiton
 List getAuthors()
          Access the list of authors.
 Time getCloseTime()
          Access the close time after which this assignment can no longer be viewed, and after which submissions will not be accepted.
 AssignmentContent getContent()
          Access the AssignmentContent of this Assignment.
 String getContentReference()
          Access the reference of the AssignmentContent of this Assignment.
 String getContext()
          Access the id of the Assignment's group.
 String getCreator()
          Access the creator of this object.
 boolean getDraft()
          Get whether this is a draft or final copy.
 Time getDropDeadTime()
          Access the drop dead time after which responses to this assignment are considered late; may be null.
 Time getDueTime()
          Access the time at which the assignment is due; may be null.
 String getId()
          Access the id of the entity.
 Time getOpenTime()
          Access the first time at which the assignment can be viewed; may be null.
 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.
 String getSection()
          Access the section info
 Time getTimeCreated()
          Access the time that this object was created.
 Time getTimeLastModified()
          Access the time of last modificaiton.
 String getTitle()
          Access the title.
 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.
 void removeAuthor(User author)
          Remove an author from the author list.
protected  void setAll(Assignment assignment)
           
 Element toXml(Document doc, Stack stack)
          Takes the Assignment'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_assignmentContent

protected String m_assignmentContent

m_title

protected String m_title

m_context

protected String m_context

m_section

protected String m_section

m_openTime

protected Time m_openTime

m_dueTime

protected Time m_dueTime

m_closeTime

protected Time m_closeTime

m_dropDeadTime

protected Time m_dropDeadTime

m_authors

protected List m_authors

m_draft

protected boolean m_draft
Constructor Detail

BaseAssignmentService.BaseAssignment

public BaseAssignmentService.BaseAssignment(Assignment assignment)
Copy constructor


BaseAssignmentService.BaseAssignment

public BaseAssignmentService.BaseAssignment(String id,
                                            String context)
Constructor used in addAssignment


BaseAssignmentService.BaseAssignment

public BaseAssignmentService.BaseAssignment(Element el)
Reads the Assignment's attribute values from xml.

Method Detail

toXml

public Element toXml(Document doc,
                     Stack stack)
Takes the Assignment'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(Assignment assignment)

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.

getAuthors

public List getAuthors()
Access the list of authors.

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

addAuthor

public void addAuthor(User author)
Add an author to the author list.

Parameters:
author - - The User to add to the author list.

removeAuthor

public void removeAuthor(User author)
Remove an author from the author list.

Parameters:
author - - the User to remove from the author list.

getCreator

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

Specified by:
getCreator in interface Assignment
Returns:
String The creator's user id.

getAuthorLastModified

public String getAuthorLastModified()
Access the person of last modificaiton

Specified by:
getAuthorLastModified in interface Assignment
Returns:
the User's Id

getTitle

public String getTitle()
Access the title.

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

getTimeCreated

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

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

getTimeLastModified

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

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

getContent

public AssignmentContent getContent()
Access the AssignmentContent of this Assignment.

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

getContentReference

public String getContentReference()
Access the reference of the AssignmentContent of this Assignment.

Specified by:
getContentReference in interface Assignment
Returns:
The Assignment's reference.

getContext

public String getContext()
Access the id of the Assignment's group.

Specified by:
getContext in interface Assignment
Returns:
The id of the group for which this Assignment is designed.

getSection

public String getSection()
Access the section info

Specified by:
getSection in interface Assignment
Returns:
The section String

getOpenTime

public Time getOpenTime()
Access the first time at which the assignment can be viewed; may be null.

Specified by:
getOpenTime in interface Assignment
Returns:
The Time at which the assignment is due, or null if unspecified.

getDueTime

public Time getDueTime()
Access the time at which the assignment is due; may be null.

Specified by:
getDueTime in interface Assignment
Returns:
The Time at which the Assignment is due, or null if unspecified.

getDropDeadTime

public Time getDropDeadTime()
Access the drop dead time after which responses to this assignment are considered late; may be null.

Specified by:
getDropDeadTime in interface Assignment
Returns:
The Time object representing the drop dead time, or null if unspecified.

getCloseTime

public Time getCloseTime()
Access the close time after which this assignment can no longer be viewed, and after which submissions will not be accepted. May be null.

Specified by:
getCloseTime in interface Assignment
Returns:
The Time after which the Assignment is closed, or null if unspecified.

getDraft

public boolean getDraft()
Get whether this is a draft or final copy.

Specified by:
getDraft in interface Assignment
Returns:
True if this is a draft, false if it is a final copy.

equals

public boolean equals(Object obj)
Are these objects equal? If they are both Assignment 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.

Specified by:
compareTo in interface Comparable
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.