} else {
// try to retrieve from current post-request
data = retrieveMultipartFormData(request);
}
// create TMLForm if data is available
TMLForm form = null;
if (data != null) {
// F00004936
// check if this request contains a tmlform ($forminfo is present)
// otherwise this is an standard multipart request and multipartData will be transported
// as raw data within the tmlvar "multipartData"
boolean isTMLForm = false;
Iterator multipartItems = data.iterator();
while (multipartItems.hasNext()) {
FileItem fi = (FileItem) multipartItems.next();
if (fi.getFieldName().equals("$forminfo")) {
isTMLForm = true;
}
}
if (isTMLForm) {
//create a tml form object
form = processTMLForm(request, data);
} else {
// put multipartdata in request for custom processing
// used by CM for multi file uploads
getTMLContext().setvar("multipartData", data);
}
}
// Process WebTML var parameters
String varParam = request.getParameter(URLPARAM_VARS);
if (varParam != null) {
try {
processVarParams(varParam);
}
catch (Exception e) {
log.error("Exception processing var params", e);
addWarning("Unable to process var params: " + e.getMessage());
}
}
// eventually execute action
boolean actioncalled = false;
try {
actioncalled = processAction(request, form, status._ajax);
}
catch (Exception e) {
log.error("Exception processing WebTML action", e);
addWarning("Unable to process WebTML action: " + e.getMessage());
}
// if an action was called
if (actioncalled) {
// if keepOnValidate is true and form was validated once and form was not validated
// in this request
if (form != null) {
FormInfo formInfo = form.getforminfo();
if (formInfo.isValidated() && formInfo.keepOnValidate() && !form.wasValidatedInThisRequest()) {
form.validate();
}
}
}
if (status._ajax) {