Class AbstractFormCommand
java.lang.Object
org.deltava.commands.AbstractCommand
org.deltava.commands.AbstractFormCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
AbstractAuditFormCommand, ApplicantCommand, CertificationRequirementsCommand, ChartCommand, CharterRequestCommand, EventRoutesCommand, GalleryImageCommand, InstallerUploadCommand, InstructionFlightCommand, InstructionSessionCommand, JobPostingCommand, NominationCommand, PIREPCommand, ProfileCommand, ResponseTemplateCommand, RunwayMappingCommand, ScheduleEntryCommand, ServiceEntryCommand, TimeZoneCommand, UserFileCommand, VideoCommand
A class to support form editing/saving web site commands.
- Since:
- 1.0
- Version:
- 7.0
- Author:
- Luke
-
Nested Class Summary
Nested classes/interfaces inherited from interface Command
Command.Scope -
Field Summary
Fields inherited from interface Command
ID, OPERATION, PAGE, REQUEST, SESSIONModifier and TypeFieldDescriptionstatic final intstatic final intstatic final Command.Scopestatic final Command.Scopestatic final Command.Scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidexecEdit(CommandContext ctx) Method called when editing the form.protected abstract voidexecRead(CommandContext ctx) Method called when reading the form.protected abstract voidexecSave(CommandContext ctx) Method called when saving the form.final voidexecute(CommandContext ctx) Executes the command, and based on the operation calls an implementation method for the particular operation.Methods inherited from class AbstractCommand
forgottenException, getID, getName, getRoles, init, notFoundException, notFoundException, parseDateTime, parseDateTime, securityException, setRolesModifier and TypeMethodDescriptionprotected static CommandExceptionHelper method to generate a content blocked exception.final StringgetID()Return the ID of the command.final StringgetName()Return the name of the command.final Collection<String> getRoles()Return the roles authorized to execute this command.voidInitialize the Command.protected static CommandExceptionnotFoundException(String msg, int id) Helper method to generate an "item not found" exception for a given database ID.protected static CommandExceptionnotFoundException(String msg, Object id) Helper method to generate an "item not found" exception for a given ID.protected static InstantparseDateTime(CommandContext ctx, String paramHdr) Parses one or two HTTP request parameters into a date/time value, using the user's format patterns or the default format patterns if the user is not authenticated.protected static InstantparseDateTime(CommandContext ctx, String paramHdr, String dfmt, String tfmt) Parses one or two HTTP request parameters into a date/time value.protected static CommandExceptionsecurityException(String msg) Helper method to generate a security exception.final voidsetRoles(Collection<String> roles) Updates the roles authorized to execute this command.
-
Constructor Details
-
AbstractFormCommand
public AbstractFormCommand()
-
-
Method Details
-
execute
Executes the command, and based on the operation calls an implementation method for the particular operation.- Parameters:
ctx- the Command Context- Throws:
CommandException- if an unhandled error occurs
-
execSave
Method called when saving the form.- Parameters:
ctx- the Command Context- Throws:
CommandException- if an unhandled error occurs
-
execEdit
Method called when editing the form.- Parameters:
ctx- the Command Context- Throws:
CommandException- if an unhandled error occurs
-
execRead
Method called when reading the form.- Parameters:
ctx- the Command Context- Throws:
CommandException- if an unhandled error occurs
-