Package org.bardframework.flow
Class FlowHandlerAbstract<D extends FlowData>
java.lang.Object
org.bardframework.flow.FlowHandlerAbstract<D>
- All Implemented Interfaces:
FlowHandler
- Direct Known Subclasses:
FlowHandlerImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,List<FormProcessor>> protected final FlowDataRepository<D>protected final List<FlowFormTemplate>protected final org.slf4j.Loggerprotected List<FormProcessor>protected List<FormProcessor>Fields inherited from interface org.bardframework.flow.FlowHandler
TOKEN_HEADER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionFlowHandlerAbstract(FlowDataRepository<D> flowDataRepository, List<FlowFormTemplate> forms) -
Method Summary
Modifier and TypeMethodDescriptionvoidaction(String flowToken, String action, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected voidcleanFlowData(String flowToken) protected voidfillFlowData(Map<String, String> flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate) افزودن دیتاهای مورد نیاز در فرم به فلو دیتاgetActionProcessors(D flowData) org.bardframework.flow.FlowResponsegetCurrent(String flowToken, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) این متد فقط فرم جاری را برمیگرداند و پیش پردازش های آن را اجرا نمی کندprotected FlowFormTemplategetCurrentFormTemplate(D flowData) getPostProcessors(D flowData) getPreProcessors(D flowData) protected intgetStepsCounts(D flowData) protected abstract org.bardframework.flow.FlowResponsehandleException(String flowToken, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, Exception ex) protected org.bardframework.flow.FlowResponsehandleSubmitException(String flowToken, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, Exception ex) protected voidprotected voidonFinished(String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected booleanprocess(List<FormProcessor> processors, String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected booleanprocessAction(String flowToken, String action, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected org.bardframework.flow.FlowResponseprocessNextForm(String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) 1.voidsetActionProcessors(Map<String, List<FormProcessor>> actionProcessors) voidsetPostProcessors(List<FormProcessor> postProcessors) voidsetPreProcessors(List<FormProcessor> preProcessors) org.bardframework.flow.FlowResponsestart(Map<String, String> initValues, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) org.bardframework.flow.FlowResponsesubmit(String flowToken, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) protected org.bardframework.flow.FlowResponsetoResponse(String flowToken, FlowFormTemplate formTemplate, D flowData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) تبدیل به فرمprotected voidupdateFlowData(String flowToken, D flowData) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bardframework.flow.FlowHandler
generateFlowToken
-
Field Details
-
log
protected final org.slf4j.Logger log -
flowDataRepository
-
forms
-
preProcessors
-
postProcessors
-
actionProcessors
-
-
Constructor Details
-
FlowHandlerAbstract
-
-
Method Details
-
start
public org.bardframework.flow.FlowResponse start(Map<String, String> initValues, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Specified by:
startin interfaceFlowHandler- Throws:
Exception
-
submit
public org.bardframework.flow.FlowResponse submit(String flowToken, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Specified by:
submitin interfaceFlowHandler- Throws:
Exception
-
action
public void action(String flowToken, String action, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Specified by:
actionin interfaceFlowHandler- Throws:
Exception
-
getCurrent
public org.bardframework.flow.FlowResponse getCurrent(String flowToken, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception این متد فقط فرم جاری را برمیگرداند و پیش پردازش های آن را اجرا نمی کند- Specified by:
getCurrentin interfaceFlowHandler- Throws:
Exception
-
processAction
protected boolean processAction(String flowToken, String action, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Throws:
Exception
-
fillFlowData
protected void fillFlowData(Map<String, String> flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate) افزودن دیتاهای مورد نیاز در فرم به فلو دیتا -
processNextForm
protected org.bardframework.flow.FlowResponse processNextForm(String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception1. محاسبه فرم بعدی
2. اجرای پیش پردازش های فرم
3. ذخیره داده های فلو- Throws:
Exception
-
getCurrentFormTemplate
- Throws:
Exception
-
onFinished
protected void onFinished(String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Throws:
Exception
-
updateFlowData
-
invalidateFlow
-
toResponse
protected org.bardframework.flow.FlowResponse toResponse(String flowToken, FlowFormTemplate formTemplate, D flowData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception تبدیل به فرم- Throws:
Exception
-
handleSubmitException
protected org.bardframework.flow.FlowResponse handleSubmitException(String flowToken, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, Exception ex) throws Exception- Throws:
Exception
-
handleException
protected abstract org.bardframework.flow.FlowResponse handleException(String flowToken, D flowData, Map<String, String> formData, FlowFormTemplate currentFormTemplate, Exception ex) throws Exception- Throws:
Exception
-
getStepsCounts
-
cleanFlowData
-
process
protected boolean process(List<FormProcessor> processors, String flowToken, D flowData, Map<String, String> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception- Throws:
Exception
-
getPreProcessors
-
setPreProcessors
-
getPostProcessors
-
setPostProcessors
-
getActionProcessors
-
setActionProcessors
-