String name = record.getAttribute(getTitleFieldName());
Message message;
String conciseMessage;
String detailedMessage;
DSOperationType operationType = request.getOperationType();
if (Log.isDebugEnabled()) {
Object dataObject = dataSource.copyValues(record);
if (operationType == DSOperationType.ADD) {
Log.debug("Created: " + dataObject);
} else {
Log.debug("Updated: " + dataObject);
}
}
switch (operationType) {
case ADD:
conciseMessage = MSG.widget_recordEditor_info_recordCreatedConcise(dataTypeName);
detailedMessage = MSG.widget_recordEditor_info_recordCreatedDetailed(dataTypeName, name);
if (CoreGUI.isDebugMode()) {
conciseMessage += " (" + FIELD_ID + "=" + id + ")";
detailedMessage += " (" + FIELD_ID + "=" + id + ")";
}
break;
case UPDATE:
conciseMessage = MSG.widget_recordEditor_info_recordUpdatedConcise(dataTypeName);
detailedMessage = MSG.widget_recordEditor_info_recordUpdatedDetailed(dataTypeName, name);
break;
default:
throw new IllegalStateException(MSG
.widget_recordEditor_error_unsupportedOperationType(operationType.name()));
}
message = new Message(conciseMessage, detailedMessage);
// only refresh if no-refresh attribute is missing
boolean refresh = requestProperties.getAttribute(FIELD_NO_REFRESH) == null;