|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.forms.responder.Responder
public abstract class Responder
A responder is created for each form and stored internally, to respond when the form is submitted. To reduce memory space, identical responders are stored only once
Field Summary | |
---|---|
protected String |
addField
the field on which the add operation is made |
protected String |
afterHandler
the business logic after handler, for all types of forms |
static String |
basePointerName
the name of the CGI parameter that passes the base pointer, see basePointerType , "__makumba__base__" |
protected String |
basePointerType
edit, add and delete makumba operations have a special pointer called the base pointer |
protected String |
clientSideValidation
Stores whether we shall do client-side validation, i.e. with javascript for a FormResponder |
protected Object |
controller
the controller object, on which the handler method that performs the operation is invoked |
protected String |
controllerClassname
store the name of the controller class |
protected String |
database
the database in which the operation takes place |
protected HashMap<String,String> |
defaultMatchModes
|
static String |
defaultMessageSearchForm
the default response message for search forms, "Search done!" |
protected ResponderFactory |
factory
|
protected static String |
FORM_RESULTS
|
protected String |
formId
HTML ID of the form |
protected String |
formName
the name of the form we operate on (only needed for search forms). |
protected ArrayList<String> |
formOrder
order of the forms in the page * |
protected static String |
formSessionName
prevents multiple submission of the same form (bug #190), computes as responder+sessionID, "__makumba__formSession__" |
(package private) int |
groupCounter
the form counter, 0 for the root form, one increment for each subform of this form |
protected String |
handler
the business logic handler, for all types of forms |
protected int |
identity
the responder key, as computed from the other fields |
protected String |
message
a response message to be shown in the response page |
protected String |
multipleSubmitErrorMsg
a response message to be shown when multiple submit occur |
protected String |
newType
the type where the new operation is made |
protected ResponderOperation |
op
the operation handler, computed from the operation |
protected String |
operation
the operation name: add, edit, delete, new, simple |
protected String |
originatingPageName
|
protected boolean |
reloadFormOnError
Stores whether we shall reload this form on a validation error or not. |
static String |
responderName
the name of the CGI parameter that passes the responder key, so the responder can be retrieved from the cache, "__makumba__responder__" |
protected String |
resultAttribute
new and add responders set their result to a result attribute |
protected String |
resultLabel
the name of the resultLabel used in the resultList of a search form |
protected String |
searchType
the type where the search operation is made |
protected String |
storedParentSuffix
|
protected String |
storedSuffix
the form suffix, "" for the root form, _+increment for subforms |
protected static char |
suffixSeparator
|
protected String |
triggerEvent
the event to be fired when the responder responds |
Constructor Summary | |
---|---|
Responder()
|
Method Summary | |
---|---|
void |
addMultiFieldSearchMapping(String name,
String[] allFieldNames)
|
static String |
errorMessage(Throwable t)
formats an error message |
static String |
errorMessageFormatter(String message)
formats an error message |
String |
getAddField()
|
String |
getAfterHandler()
|
String |
getBasePointerType()
|
Object |
getController()
|
String |
getDatabase()
|
String |
getDefaultMatchMode(String inputName)
|
ResponderFactory |
getFactory()
|
String |
getFormName()
|
ArrayList<String> |
getFormOrder()
|
String |
getHandler()
|
Pointer |
getHttpBasePointer(HttpServletRequest req,
String suffix)
reads the HTTP base pointer |
abstract Dictionary<String,Object> |
getHttpData(HttpServletRequest req,
String suffix)
Reads the data needed for the logic operation, from the http request. |
String[] |
getMultiFieldSearchCriterion(String name)
|
String |
getNewType()
|
String |
getOriginatingPageName()
|
int |
getPrototype()
get the integer key of this form, and register it if not already registered |
boolean |
getReloadFormOnError()
|
String |
getResultLabel()
|
String |
getSearchType()
|
boolean |
getShowFormAnnotated()
|
String |
getSuffix()
|
String |
getTriggerEvent()
|
abstract ArrayList<InvalidValueException> |
getUnassignedExceptions(CompositeValidationException e,
ArrayList<InvalidValueException> unassignedExceptions,
String suffix)
|
protected abstract void |
postDeserializaton()
|
String |
responderKey()
a key that should identify this responder among all |
void |
saveResponderToDisc()
Save this responder instance as a binary object to the disc; persist it so it can be read from the disc into the cache on a server reload / restart. |
void |
setAddField(String s)
pass the field to which the add operation is made |
void |
setAfterHandler(String afterHandler)
pass the response afterHandler, if other than the default one |
void |
setBasePointerType(String basePointerType)
pass the base pointer type, needed for the response |
void |
setClientSideValidation(String clientSideValidation)
|
void |
setDefaultMatchMode(String inputName,
String matchMode)
|
void |
setFactory(ResponderFactory factory)
|
void |
setFormId(String id)
passes the HTML ID of the form, either generated or provided by the user, enriched with form iteration |
void |
setFormName(String formName)
|
void |
setHandler(String handler)
pass the response handler, if other than the default one |
void |
setHttpRequest(HttpServletRequest req)
pass the http request, so the responder computes its default controller and database |
void |
setMessage(String message)
pass the form response message |
void |
setMultipleSubmitErrorMsg(String multipleSubmitErrorMsg)
pass the multiple submit response message |
void |
setNewType(DataDefinition dd)
pass the type on which the new operation is made |
void |
setOperation(String operation,
ResponderOperation op)
pass the operation * |
void |
setOriginatingPageName(String originatingPageName)
|
void |
setParentResponder(Responder resp,
Responder root)
pass the parent responder |
void |
setReloadFormOnError(boolean reloadFormOnError)
|
void |
setResponderOrder(ArrayList<String> formOrder)
|
void |
setResultAttribute(String resultAttribute)
pass the name of the result attribute |
void |
setResultLabel(String resultLabel)
set the name of the resultLabel used in the resultList of a search form |
void |
setSearchType(DataDefinition dd)
pass the type on which the new operation is made |
void |
setShowFormAnnotated(boolean showFormAnnotated)
|
void |
setTriggerEvent(String e)
pass the event to be fired after form submission |
static String |
successFulMessageFormatter(String message)
formats a successful message |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String responderName
protected static final String formSessionName
protected static final String FORM_RESULTS
public static final String defaultMessageSearchForm
public static final String basePointerName
basePointerType
, "__makumba__base__"
protected transient ResponderFactory factory
protected int identity
protected transient Object controller
protected String controllerClassname
protected String database
protected String message
protected String multipleSubmitErrorMsg
protected String clientSideValidation
FormResponder
protected boolean reloadFormOnError
ControllerFilter
to decide
on the action.
protected String originatingPageName
protected String resultAttribute
protected String resultLabel
protected String formId
protected String handler
protected String afterHandler
protected String basePointerType
protected String searchType
protected String formName
protected String newType
protected String addField
protected String operation
protected String triggerEvent
protected ResponderOperation op
protected ArrayList<String> formOrder
protected HashMap<String,String> defaultMatchModes
transient int groupCounter
protected transient String storedSuffix
protected transient String storedParentSuffix
protected static final char suffixSeparator
Constructor Detail |
---|
public Responder()
Method Detail |
---|
public String getDefaultMatchMode(String inputName)
public void setDefaultMatchMode(String inputName, String matchMode)
public String getHandler()
public String getAfterHandler()
public String getAddField()
public String getBasePointerType()
public Object getController()
public String getDatabase()
public String getNewType()
public String getSearchType()
public String getResultLabel()
public String getFormName()
public ArrayList<String> getFormOrder()
public void setHttpRequest(HttpServletRequest req) throws LogicException
LogicException
public void setOperation(String operation, ResponderOperation op)
public void setMessage(String message)
public void setTriggerEvent(String e)
public void setMultipleSubmitErrorMsg(String multipleSubmitErrorMsg)
public void setReloadFormOnError(boolean reloadFormOnError)
public boolean getReloadFormOnError()
public void setOriginatingPageName(String originatingPageName)
public String getOriginatingPageName()
public void setShowFormAnnotated(boolean showFormAnnotated)
public boolean getShowFormAnnotated()
public String getTriggerEvent()
public void setClientSideValidation(String clientSideValidation)
public void setHandler(String handler)
public void setAfterHandler(String afterHandler)
public void setBasePointerType(String basePointerType)
public void setResultAttribute(String resultAttribute)
public void setResultLabel(String resultLabel)
public void setFormId(String id)
public void setAddField(String s)
public void setNewType(DataDefinition dd)
public void setSearchType(DataDefinition dd)
public void setFormName(String formName)
public void setResponderOrder(ArrayList<String> formOrder)
protected abstract void postDeserializaton()
public String responderKey()
public int getPrototype()
public void setParentResponder(Responder resp, Responder root)
public String getSuffix()
public static String errorMessage(Throwable t)
public static String errorMessageFormatter(String message)
public static String successFulMessageFormatter(String message)
public Pointer getHttpBasePointer(HttpServletRequest req, String suffix)
public abstract Dictionary<String,Object> getHttpData(HttpServletRequest req, String suffix)
FormResponder
provides an
implementation
req
- the request corresponding to the current pagesuffix
- the responder / form suffix
public abstract ArrayList<InvalidValueException> getUnassignedExceptions(CompositeValidationException e, ArrayList<InvalidValueException> unassignedExceptions, String suffix)
public ResponderFactory getFactory()
public void setFactory(ResponderFactory factory)
public void addMultiFieldSearchMapping(String name, String[] allFieldNames)
public String[] getMultiFieldSearchCriterion(String name)
public void saveResponderToDisc()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |