Class BaseWizardHandler
- java.lang.Object
-
- net.anotheria.anosite.wizard.handler.BaseWizardHandler
-
- All Implemented Interfaces:
WizardHandler
public class BaseWizardHandler extends Object implements WizardHandler
BaseWizardHandler as main class for Wizard handlers. Used as Default WizardHandler for wizards where handler is not specified. Can be simply extended.- Author:
- h3ll
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseWizardHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.slf4j.LoggergetLogger()Returns logger.WizardAPIgetWizardAPI()ReturnWizardAPI.protected WizardHandlerResponsehandleIncomingCommand(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO currentStep, boolean isSubmit)Handle incoming command method.protected booleanisCancellationAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can cancel wizard.protected booleanisFinishAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can finish wizard.protected booleanisNextStepAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can be forwarded to next step.protected booleanisPreviousStepAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can be forwarded to previous step.WizardHandlerResponsepreProcess(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard)Method called before wizard process execution.WizardHandlerResponseprocess(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard)Process request to wizard.WizardHandlerResponsesubmit(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard)ProcessSubmit request to wizard.
-
-
-
Method Detail
-
preProcess
public WizardHandlerResponse preProcess(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard) throws WizardHandlerPreProcessException
Description copied from interface:WizardHandlerMethod called before wizard process execution.- Specified by:
preProcessin interfaceWizardHandler- Parameters:
req-HttpServletRequest}res-HttpServletResponsewizard-WizardDef- Returns:
WizardHandlerResponse- Throws:
WizardHandlerPreProcessException- on errors
-
process
public WizardHandlerResponse process(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard) throws WizardHandlerProcessException
Description copied from interface:WizardHandlerProcess request to wizard.- Specified by:
processin interfaceWizardHandler- Parameters:
req-HttpServletRequest}res-HttpServletResponsewizard-WizardDef- Returns:
WizardHandlerResponse- Throws:
WizardHandlerProcessException- on process errors
-
submit
public WizardHandlerResponse submit(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, WizardDef wizard) throws WizardHandlerSubmitException
Description copied from interface:WizardHandlerProcessSubmit request to wizard.- Specified by:
submitin interfaceWizardHandler- Parameters:
req-HttpServletRequest}res-HttpServletResponsewizard-WizardDef- Returns:
WizardHandlerResponse- Throws:
WizardHandlerSubmitException- on submit errors
-
isNextStepAllowed
protected boolean isNextStepAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can be forwarded to next step. False otherwise.- Parameters:
req-HttpServletRequestwizard-WizardAOstep-WizardStepAOisSubmit- boolean value - true if called from submit- Returns:
- boolean value
-
isPreviousStepAllowed
protected boolean isPreviousStepAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can be forwarded to previous step. False otherwise.- Parameters:
req-HttpServletRequestwizard-WizardAOstep-WizardStepAOisSubmit- boolean value - true if called from submit- Returns:
- boolean value
-
isFinishAllowed
protected boolean isFinishAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can finish wizard.- Parameters:
req-HttpServletRequestwizard-WizardAOstep-WizardStepAOisSubmit- boolean value - true if called from submit- Returns:
- boolean value
-
isCancellationAllowed
protected boolean isCancellationAllowed(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO step, boolean isSubmit)Returns true if we can cancel wizard.- Parameters:
req-HttpServletRequestwizard-WizardAOstep-WizardStepAOisSubmit- boolean value - true if called from submit- Returns:
- boolean value
-
handleIncomingCommand
protected WizardHandlerResponse handleIncomingCommand(jakarta.servlet.http.HttpServletRequest req, WizardAO wizard, WizardStepAO currentStep, boolean isSubmit) throws WizardHandlerException
Handle incoming command method. Checks which command should be executed, and execute it.- Parameters:
req-HttpServletRequestwizard-WizardDefcurrentStep-WizardStepAOisSubmit- boolean value - true if called from submit- Returns:
WizardHandlerResponse- Throws:
WizardHandlerException- on errors
-
getLogger
protected org.slf4j.Logger getLogger()
Returns logger.- Returns:
Logger
-
-