edu.pdx.cs399J.grader
Class SubmitTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by edu.pdx.cs399J.grader.SubmitTask
All Implemented Interfaces:
Cloneable

public class SubmitTask
extends org.apache.tools.ant.Task

An Ant task for submitting projects. This class follows the JavaBean pattern that is required by Ant: public, zero-argument constructor and setter methods for each of the task's attributes.

Submit

Description

Submits project files to the Grader for grading. A receipt email is sent to the submitter. Because this Ant task sends email, the JavaMail libraries must be available to the task:

     <taskdef name="submit" classname="edu.pdx.cs399J.grader.SubmitTask">
       <classpath>
         <pathelement location="${daves.jars.dir}/grader.jar"/>
         <pathelement location="${daves.jars.dir}/mail.jar"/>
         <pathelement location="${daves.jars.dir}/activation.jar"/>
       </classpath>
    </taskdef>
 

Parameters

Attribute Description Required
project The name of the project to be submitted Yes
username The name of the submitter Yes
userid The login id of the submitter. All submitted files must reside in a directory with this name. Yes
email The email address of the submitter Yes
comment Information about the project that the submitter wants the grader to know. A longer comment can be specified with a nexted <comment> element. No
server The name of the SMTP server used to send email No
debug Enabled verbose logging? ("true" or "false") No
savejar Should the temporary jar file containing the submitted files be saved? ("true" or "false") No

Parameters specified as nested elements

fileset (required)

An Ant FileSet that specifies the files to be submitted.

comment

A longer comment that communicates some information from the submitter to the grader. Multiple nested <comment> elements can be specified. Each nested <comment> has a value attribute that specifies the text of the comment:

 <comment value="GUI file browser"/>
 

Examples

Submit files for a project

     <submit project="Project 4" username="David Whitlock"
             userid="whitlock" email="whitlock@cs.pdx.edu">
      <comment value="Fixed command line parsing bug"/>
      <fileset dir="${src.dir}">
        <include name="edu/pdx/cs399J/whitlock/*.java"/>
      </fileset>
    </submit>
 

Since:
Spring 2006
Author:
David Whitlock

Nested Class Summary
static class SubmitTask.Comment
          A little class that holds a comment.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
SubmitTask()
          Ant requires that all Tasks have a public, zero-argument constructor.
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet files)
          Adds set of files to this submission
 SubmitTask.Comment createComment()
          Creates a new comment for this submission
 void execute()
          Performs the submission using the configuration specified in this Ant task.
 void setComment(String value)
          Sets the comment for this submission
 void setDebug(boolean debug)
          Sets whether or not the progress of the submission should be logged.
 void setEmail(String email)
          Sets the email address of the user who is submitting the project
 void setProject(String projName)
          Sets the name of project being submitted
 void setSavejar(boolean saveJar)
          Sets whether or not the jar file generated by the submission should be saved.
 void setServer(String serverName)
          Sets the name of the SMTP server that is used to send emails
 void setUserid(String userId)
          Sets the id of the user who is submitting the project
 void setUserName(String userName)
          Sets the name of the user who is submitting the project
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmitTask

public SubmitTask()
Ant requires that all Tasks have a public, zero-argument constructor. This constructor is invoked reflectively when the ant build file is parsed.

Method Detail

setServer

public void setServer(String serverName)
Sets the name of the SMTP server that is used to send emails


setDebug

public void setDebug(boolean debug)
Sets whether or not the progress of the submission should be logged.


setSavejar

public void setSavejar(boolean saveJar)
Sets whether or not the jar file generated by the submission should be saved.


setComment

public void setComment(String value)
Sets the comment for this submission


setProject

public void setProject(String projName)
Sets the name of project being submitted


setUserName

public void setUserName(String userName)
Sets the name of the user who is submitting the project


setUserid

public void setUserid(String userId)
Sets the id of the user who is submitting the project


setEmail

public void setEmail(String email)
Sets the email address of the user who is submitting the project


createComment

public SubmitTask.Comment createComment()
Creates a new comment for this submission


addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet files)
Adds set of files to this submission


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Performs the submission using the configuration specified in this Ant task.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException


Copyright © 2000-2009 Portland State University. All Rights Reserved.