String passwrd = aReq.getParam(mParams.A_PASSWORD);
String passwrdVerify = aReq.getParam(mParams.A_PASSWORDRE);
// Create template
AccountTemplateHandler tAccountTH = new AccountTemplateHandler(
mServletProps.TemplateDir,
"Person_New",
mServletProps.DefaultStylesheet,
"footer-url-not-needed-here");
tAccountTH.startWithLanguage(
language.equals(Language.GERMAN)
? Language.German
: Language.English);
// Remove the HTML params which will be edited in this form.
removeParams(aReq);
aReq.replaceParam(mParams.EXECUTE, mEvents.Subscribe_Person_Store);
// Setup the form.
tAccountTH.setAllFormOpentag(
"<form action=\"" + aReq.getContextAndServletPath() + "\" method=\"POST\">",
aReq.toHiddenParams());
tAccountTH.setEditView(execute.equals(mEvents.Subscribe_Person_Store)); // Set new or edit view.
// Add errors.
if(! errors.isEmpty()) {
Enumeration enu = errors.elements();
while(enu.hasMoreElements()) {
String[] tmp = (String[]) enu.nextElement();
tAccountTH.addError(tmp[0], tmp[1]);
}
}
// Add information.
tAccountTH.setPersonTitleInput("50", title, true);
tAccountTH.setPersonFirstNameInput("50", firstname, true);
tAccountTH.setPersonSecondNameInput("50", secondname, true);
tAccountTH.setPersonLastNameInput("50", lastname, true);
tAccountTH.setPersonPhoneStateInput("50", phonestate, true);
tAccountTH.setPersonPhoneTownInput("50", phonetown, true);
tAccountTH.setPersonPhoneLocationInput("50", phonelocation, true);
tAccountTH.setPersonPhoneDirectInput("50", phonedirect, true);
tAccountTH.setPersonFaxDirectInput("50", faxdirect, true);
tAccountTH.setPersonEmailInput("50", email, true);
tAccountTH.setPersonHomepageInput("255", homepage, true);
tAccountTH.setDepartmentInput("50", department, true);
tAccountTH.setDepartmentLocationInput("50", location, true);
tAccountTH.setDepartmentCompanyInput("50", company, true);
tAccountTH.setPersonPasswordInput("50", passwrd,true);
tAccountTH.setPersonPasswordVerifyInput("50", passwrdVerify, true);
// Output.
tAccountTH.execute();
aWriter.println(tAccountTH.writeToString());
// autocommitted
}