/**
* gets the doc type name from the request string if present
*/
@Override
protected TransactionalDocumentFormBase createInitialForm(HttpServletRequest request) {
TransactionalDocumentFormBase form = new MatterTxForm();
String docTypeName = request.getParameter(KRADConstants.DOCUMENT_TYPE_NAME);
if (docTypeName == null) {
// lookups supply the form key
UifFormManager uifFormManager = (UifFormManager) request.getSession().getAttribute(UifParameters.FORM_MANAGER);
if (uifFormManager != null && request.getParameter(UifParameters.FORM_KEY) != null) {
UifFormBase sessionForm = uifFormManager.getSessionForm(request.getParameter(UifParameters.FORM_KEY));
docTypeName = ((DocumentFormBase) sessionForm).getDocTypeName();
log.debug("retrieved doc type name from session form");
}
}
if (docTypeName == null) {
throw new RiceRuntimeException("expected parameter " + KRADConstants.DOCUMENT_TYPE_NAME + " for use in form.setDocTypeName()");
} else {
form.setDocTypeName(docTypeName);
}
return form;
}