Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

au.edu.educationau.belts.command.lesson.action
Class CreateLessonAction  view CreateLessonAction download CreateLessonAction.java

java.lang.Object
  extended byau.edu.educationau.belts.command.AbstractCommand
      extended byau.edu.educationau.belts.command.container.AbstractContainerCommand
          extended byau.edu.educationau.belts.command.container.AbstractBeltsContainerCommand
              extended byau.edu.educationau.belts.command.AbstractIdCommand
                  extended byau.edu.educationau.belts.command.lesson.action.CreateLessonAction
All Implemented Interfaces:
au.edu.educationau.belts.command.Action, au.edu.educationau.belts.command.Command, au.edu.educationau.belts.container.Containable, java.io.Serializable

public class CreateLessonAction
extends au.edu.educationau.belts.command.AbstractIdCommand
implements au.edu.educationau.belts.command.Action

This class performs the action of creating a Lesson, based on the minimal information required for a lesson. The lesson is created with the author and the owner set to the currently logged in user.

Required Roles:

A person creating a lesson must be a belts:teacher or a belts:advanced-student

Required Parameters:

id
the id (lesson login) for the lesson
name
the name of the lesson
description
the description of the lesson
instructions
the instructions for this lesson

Outcomes

OK
the lesson was created OK
ERROR
an error occurred during lesson creation
VALIDATION
a validation error occurred

The following errors may occur during lesson creation:

Duplicate Lesson
a lesson with that id already exists
Not Allowed to Create Lessons
the current user is not allowed to create lessons

Results

No results are returned from this action.

Version:
$Revision: 1.14 $ - $Date: 2003/05/22 05:22:02 $

Field Summary
private  java.lang.String _classid
           
private  java.lang.String _name
           
private  java.lang.String[] _resource
           
static java.lang.String CLASSID
           
static java.lang.String NAME
           
static java.lang.String RESOURCE
           
 
Fields inherited from class au.edu.educationau.belts.command.AbstractIdCommand
_id, ID
 
Fields inherited from class au.edu.educationau.belts.command.container.AbstractBeltsContainerCommand
_log
 
Fields inherited from class au.edu.educationau.belts.command.container.AbstractContainerCommand
 
Fields inherited from class au.edu.educationau.belts.command.AbstractCommand
_outcome, _result, ENTITY_NOT_FOUND_ERROR, SECURITY_ERROR, SYSTEM_ERROR, VALIDATION_ERROR
 
Constructor Summary
CreateLessonAction()
           
 
Method Summary
 void execute()
          Creates a new lesson.
 void setClassid(java.lang.String classid)
          Sets the classid.
 void setName(java.lang.String name)
          Sets the name.
 void setResource(java.lang.String[] resource)
          Sets the resources.
 boolean validate()
          Ensures that the name is a non empty String
 
Methods inherited from class au.edu.educationau.belts.command.AbstractIdCommand
setId
 
Methods inherited from class au.edu.educationau.belts.command.container.AbstractBeltsContainerCommand
beltsContainer, currentUser, currentUserIsMemberOfSchool, currentUsersSchool, isManager, isPermitted, isTeacher, permitted
 
Methods inherited from class au.edu.educationau.belts.command.container.AbstractContainerCommand
container, dispatchEvent, hasContainer, prepare, release
 
Methods inherited from class au.edu.educationau.belts.command.AbstractCommand
addDuplicateEntityFoundError, addEmailFieldValidationError, addEntityNotFoundError, addError, addError, addError, addFieldValidationError, addIdValidationError, addSecurityError, addSystemError, addValidationError, addWarning, result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface au.edu.educationau.belts.command.Command
result
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

_name

private java.lang.String _name

CLASSID

public static final java.lang.String CLASSID
See Also:
Constant Field Values

_classid

private java.lang.String _classid

RESOURCE

public static final java.lang.String RESOURCE
See Also:
Constant Field Values

_resource

private java.lang.String[] _resource
Constructor Detail

CreateLessonAction

public CreateLessonAction()
Method Detail

validate

public boolean validate()
Ensures that the name is a non empty String

Specified by:
validate in interface au.edu.educationau.belts.command.Command

execute

public void execute()
Creates a new lesson.

Specified by:
execute in interface au.edu.educationau.belts.command.Command

setName

public void setName(java.lang.String name)
Sets the name.


setClassid

public void setClassid(java.lang.String classid)
Sets the classid.


setResource

public void setResource(java.lang.String[] resource)
Sets the resources.