throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
ObjectType objectType = (ObjectType) command;
boolean isNew = (objectType.getObjectTypeId() == null);
Locale locale = request.getLocale();
if (request.getParameter("delete") != null) {
objectTypeManager.removeObjectType(objectType.getObjectTypeId().toString());
saveMessage(request, getText("objectType.deleted", locale));
} else {
objectTypeManager.saveObjectType(objectType);
String key = (isNew) ? "objectType.added" : "objectType.updated";
saveMessage(request, getText(key, locale));
if (objectType.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + objectType.getObjectTypeId() + "&fieldId=" + request.getParameter("fieldId"));
}
}
return new ModelAndView("redirect:" + objectType.getDocLocation());
}