modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 34 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java | 43 ++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java | 62 +++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java | 86 +++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertPortletDataSource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/GroupAlertHistoryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java | 4
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 71 ++++++++
9 files changed, 196 insertions(+), 110 deletions(-)
New commits:
commit fe23b660f2981ee678e8aded645fdeb53ec0f039
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Nov 18 13:05:28 2010 -0500
i18n for org.rhq.enterprise.gui.coregui.client.alert
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index d45eb59..5b58ab2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -76,28 +76,36 @@ public class AlertDataSource extends RPCDataSource<Alert> {
protected List<DataSourceField> addDataSourceFields() {
List<DataSourceField> fields = super.addDataSourceFields();
- DataSourceDateField ctimeField = new DataSourceDateField(AlertCriteria.SORT_FIELD_CTIME, "Creation Time");
+ DataSourceDateField ctimeField = new DataSourceDateField(AlertCriteria.SORT_FIELD_CTIME, MSG
+ .view_alerts_field_created_time());
addField(ctimeField);
- DataSourceIntegerField ackTimeField = new DataSourceIntegerField("acknowledgeTime", "Ack Time");
+ DataSourceIntegerField ackTimeField = new DataSourceIntegerField("acknowledgeTime", MSG
+ .view_alerts_field_ack_time());
addField(ackTimeField);
- DataSourceTextField ackSubjectField = new DataSourceTextField("acknowledgingSubject", "Ack Subject");
+ DataSourceTextField ackSubjectField = new DataSourceTextField("acknowledgingSubject", MSG
+ .view_alerts_field_ack_subject());
addField(ackSubjectField);
- DataSourceTextField nameField = new DataSourceTextField(AlertCriteria.SORT_FIELD_NAME, "Name");
+ DataSourceTextField nameField = new DataSourceTextField(AlertCriteria.SORT_FIELD_NAME, MSG
+ .view_alerts_field_name());
addField(nameField);
- DataSourceTextField conditionTextField = new DataSourceTextField("conditionText", "Condition Text");
+ DataSourceTextField conditionTextField = new DataSourceTextField("conditionText", MSG
+ .view_alerts_field_condition_text());
addField(conditionTextField);
- DataSourceTextField conditionValueField = new DataSourceTextField("conditionValue", "Condition Value");
+ DataSourceTextField conditionValueField = new DataSourceTextField("conditionValue", MSG
+ .view_alerts_field_condition_value());
addField(conditionValueField);
- DataSourceTextField resourceNameField = new DataSourceTextField("resourceName", "Resource");
+ DataSourceTextField resourceNameField = new DataSourceTextField("resourceName", MSG
+ .view_alerts_field_resource());
addField(resourceNameField);
- DataSourceTextField priorityField = new DataSourceTextField(AlertCriteria.SORT_FIELD_PRIORITY, "Priority", 15);
+ DataSourceTextField priorityField = new DataSourceTextField(AlertCriteria.SORT_FIELD_PRIORITY, MSG
+ .view_alerts_field_priority(), 15);
addField(priorityField);
return fields;
@@ -113,14 +121,14 @@ public class AlertDataSource extends RPCDataSource<Alert> {
this.alertService.findAlertsByCriteria(criteria, new AsyncCallback<PageList<Alert>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to fetch alerts data", caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alerts_loadFailed(), caught);
response.setStatus(RPCResponse.STATUS_FAILURE);
processResponse(request.getRequestId(), response);
}
public void onSuccess(PageList<Alert> result) {
long fetchTime = System.currentTimeMillis() - start;
- com.allen_sauer.gwt.log.client.Log.info(result.size() + " alerts fetched in: " + fetchTime + "ms");
+ Log.info(result.size() + " alerts fetched in: " + fetchTime + "ms");
response.setData(buildRecords(result));
// For paging to work, we have to specify size of full result set.
response.setTotalRows(result.getTotalSize());
@@ -171,7 +179,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
String conditionText;
String conditionValue;
if (conditionLogs.size() > 1) {
- conditionText = "Multiple Conditions";
+ conditionText = MSG.view_alerts_field_condition_text_many();
conditionValue = "--";
} else if (conditionLogs.size() == 1) {
AlertConditionLog conditionLog = conditionLogs.iterator().next();
@@ -183,7 +191,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
.getMeasurementDefinition().getUnits(), true);
}
} else {
- conditionText = "No Conditions";
+ conditionText = MSG.view_alerts_field_condition_text_none();
conditionValue = "--";
}
record.setAttribute("conditionText", conditionText);
@@ -225,7 +233,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
return record;
}
- protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
+ protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
// TODO
Window.alert(String.valueOf(recordToRemove.getAttributeAsInt("id")));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
index 47a97c9..256ee7e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
@@ -80,7 +80,7 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failure loading event details", caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alert_details_loadFailed(), caught);
}
});
}
@@ -91,7 +91,7 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
}
if (this.viewId != null) {
- viewId.getBreadcrumbs().get(0).setDisplayName("Details");
+ viewId.getBreadcrumbs().get(0).setDisplayName(MSG.view_alert_details_breadcrumb());
CoreGUI.refreshBreadCrumbTrail();
}
@@ -104,13 +104,13 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
private TabSet getDetailsTabSet(Record record) {
TabSet tabset = new TabSet();
- Tab generalTab = new Tab("General");
+ Tab generalTab = new Tab(MSG.view_alert_common_tab_general());
generalTab.setPane(getDetailsTableForAlert(record));
- Tab conditionsTab = new Tab("Conditions");
+ Tab conditionsTab = new Tab(MSG.view_alert_common_tab_conditions());
conditionsTab.setPane(getConditionsForAlert(record));
- Tab notificationsTab = new Tab("Notifications");
+ Tab notificationsTab = new Tab(MSG.view_alert_common_tab_notifications());
notificationsTab.setPane(getNotificationsForAlert(record));
tabset.addTab(generalTab);
@@ -129,36 +129,36 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
List<FormItem> items = new ArrayList<FormItem>();
- StaticTextItem nameTextItem = new StaticTextItem("name", "Name");
+ StaticTextItem nameTextItem = new StaticTextItem("name", MSG.common_title_name());
nameTextItem.setValue(record.getAttribute("name"));
nameTextItem.setTooltip("Id = " + record.getAttribute("id"));
items.add(nameTextItem);
- StaticTextItem descriptionTextItem = new StaticTextItem("description", "Description");
+ StaticTextItem descriptionTextItem = new StaticTextItem("description", MSG.common_title_description());
descriptionTextItem.setValue(record.getAttribute("description"));
items.add(descriptionTextItem);
- StaticTextItem prioTextItem = new StaticTextItem("priority", "Priority");
+ StaticTextItem prioTextItem = new StaticTextItem("priority", MSG.view_alerts_field_priority());
prioTextItem.setValue(record.getAttribute("priority"));
items.add(prioTextItem);
- StaticTextItem createdTextItem = new StaticTextItem("ctime", "Created at");
+ StaticTextItem createdTextItem = new StaticTextItem("ctime", MSG.view_alerts_field_created_time());
createdTextItem.setValue(record.getAttribute("ctime"));
items.add(createdTextItem);
- StaticTextItem ackByItem = new StaticTextItem("ack_by", "Acknowledged by");
+ StaticTextItem ackByItem = new StaticTextItem("ack_by", MSG.view_alert_details_field_ack_by());
if (record.getAttribute("ack_by") != null) {
ackByItem.setValue(record.getAttribute("ack_by"));
}
items.add(ackByItem);
- StaticTextItem ackTimeItem = new StaticTextItem("ack_time", "Acknowledged at");
+ StaticTextItem ackTimeItem = new StaticTextItem("ack_time", MSG.view_alert_details_field_ack_at());
if (record.getAttribute("ack_time") != null) {
ackTimeItem.setValue(record.getAttribute("ack_time"));
}
items.add(ackTimeItem);
- StaticTextItem recoveryItem = new StaticTextItem("recovery", "Recovery Info");
+ StaticTextItem recoveryItem = new StaticTextItem("recovery", MSG.view_alert_details_field_recovery_info());
recoveryItem.setValue(record.getAttribute("recoveryInfo"));
items.add(recoveryItem);
@@ -171,21 +171,21 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
DataClass[] input = record.getAttributeAsRecordArray("notificationLogs");
//Table notifTable = new Table(extendLocatorId("Notifications"), "Notifications", false);
- Table notifTable = new Table("AlertDetailsNotifications", "Notifications", false);
+ Table notifTable = new Table("AlertDetailsNotifications", MSG.view_alert_common_tab_notifications(), false);
notifTable.setHeight("35%");
notifTable.setWidth100();
ListGrid grid = notifTable.getListGrid();
grid.setData((Record[]) input);
- ListGridField sender = new ListGridField("sender", "Sender");
+ ListGridField sender = new ListGridField("sender", MSG.view_alert_common_tab_notifications_sender());
sender.setWidth("10%");
- ListGridField status = new ListGridField("status", "Result");
+ ListGridField status = new ListGridField("status", MSG.view_alert_common_tab_notifications_status());
status.setWidth("8%");
- ListGridField message = new ListGridField("message", "Message");
+ ListGridField message = new ListGridField("message", MSG.view_alert_common_tab_notifications_message());
message.setWidth("32%");
- ListGridField allEmails = new ListGridField("allEmails", "All Emails");
+ ListGridField allEmails = new ListGridField("allEmails", MSG.view_alert_common_tab_notifications_all_emails());
allEmails.setWidth("25%");
- ListGridField badEmails = new ListGridField("badEmails", "Bad Emails");
+ ListGridField badEmails = new ListGridField("badEmails", MSG.view_alert_common_tab_notifications_all_emails());
badEmails.setWidth("25%");
grid.setFields(sender, status, message, allEmails, badEmails);
@@ -198,15 +198,16 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
String mode = record.getAttribute("conditionExpression");
//Table table = new Table(extendLocatorId("ConditionLog"), "Conditions: match = " + mode, false);
- Table table = new Table("AlertDetailsConditionLog", "Conditions: match = " + mode, false);
+ Table table = new Table("AlertDetailsConditionLog", MSG.view_alert_common_tab_conditions() + ": match = "
+ + mode, false);
table.setHeight("35%");
table.setWidth100();
ListGrid grid = table.getListGrid();
grid.setData((Record[]) input);
- ListGridField condition = new ListGridField("text", "Matching condition");
+ ListGridField condition = new ListGridField("text", MSG.view_alert_common_tab_conditions_text());
condition.setWidth("60%");
- ListGridField value = new ListGridField("value", "Value");
+ ListGridField value = new ListGridField("value", MSG.view_alert_common_tab_conditions_value());
grid.setFields(condition, value);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
index 14cb2c2..bddd4b4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
@@ -28,6 +28,8 @@ import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.measurement.MeasurementConverterClient;
import org.rhq.core.domain.measurement.MeasurementUnits;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.Messages;
/**
* The methods in this class are ported from AlertDefUtil from portal-war and MeasurementFormatter from
@@ -37,6 +39,8 @@ import org.rhq.core.domain.measurement.MeasurementUnits;
* @author John Mazzitelli
*/
public class AlertFormatUtility {
+ static Messages MSG = CoreGUI.getMessages();
+
private AlertFormatUtility() {
}
@@ -46,10 +50,13 @@ public class AlertFormatUtility {
AlertConditionCategory category = condition.getCategory();
switch (category) {
case AVAILABILITY: {
- str.append("Availability Change");
+ str.append(MSG.view_alert_common_tab_conditions_type_availability());
str.append(" [");
- str.append("Going").append(' '); // to reinforce this is on the state transition
- str.append(condition.getOption());
+ if ("up".equalsIgnoreCase(condition.getOption())) {
+ str.append(MSG.view_alert_common_tab_conditions_type_availability_up());
+ } else {
+ str.append(MSG.view_alert_common_tab_conditions_type_availability_down());
+ }
str.append("]");
break;
}
@@ -59,7 +66,7 @@ public class AlertFormatUtility {
String formatted = MeasurementConverterClient.format(value, units, true);
if (condition.getOption() == null) {
- str.append("Metric Value Exceeds Threshold");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_threshold());
str.append(" [");
str.append(condition.getName());
str.append(" ");
@@ -72,7 +79,7 @@ public class AlertFormatUtility {
// the name of the metric is only obtainable by querying for the name from the meas def ID
// but since most times (all the time?) there is only one calltime metric per resource,
// not showing the metric name probably isn't detrimental
- str.append("Calltime Value Exceeds Threshold");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_calltime_threshold());
str.append(" [");
str.append(condition.getOption()); // MIN, MAX, AVG (never null)
str.append(" ");
@@ -82,7 +89,7 @@ public class AlertFormatUtility {
str.append("]");
if (condition.getName() != null && condition.getName().length() > 0) {
str.append(" ");
- str.append("with call destination matching");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_calltime_destination());
str.append(" '");
str.append(condition.getName());
str.append("'");
@@ -91,7 +98,7 @@ public class AlertFormatUtility {
break;
}
case BASELINE: {
- str.append("Metric Value Exceeds Baseline");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_baseline());
str.append(" [");
str.append(condition.getName());
str.append(" ");
@@ -103,14 +110,14 @@ public class AlertFormatUtility {
String formatted = MeasurementConverterClient.format(value, units, true);
str.append(formatted);
- str.append(" ").append("of").append(" ");
+ str.append(" ").append(MSG.view_alert_common_tab_conditions_type_metric_baseline_verb()).append(" ");
str.append(condition.getOption());
str.append("]");
break;
}
case CHANGE: {
if (condition.getOption() == null) {
- str.append("Metric Value Change");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_change());
str.append(" [");
str.append(condition.getName());
str.append("]");
@@ -119,13 +126,13 @@ public class AlertFormatUtility {
// the name of the metric is only obtainable by querying for the name from the meas def ID
// but since most times (all the time?) there is only one calltime metric per resource,
// not showing the metric name probably isn't detrimental
- str.append("Calltime Value Changes");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_calltime_change());
str.append(" [");
str.append(condition.getOption()); // MIN, MAX, AVG (never null)
str.append(" ");
str.append(getCalltimeChangeComparator(condition.getComparator())); // LO, HI, CH
str.append(" ");
- str.append("by at least");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_calltime_change_verb());
str.append(" ");
double value = condition.getThreshold();
@@ -136,7 +143,7 @@ public class AlertFormatUtility {
str.append("]");
if (condition.getName() != null && condition.getName().length() > 0) {
str.append(" ");
- str.append("with call destination matching");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_calltime_destination());
str.append(" '");
str.append(condition.getName());
str.append("'");
@@ -145,35 +152,35 @@ public class AlertFormatUtility {
break;
}
case TRAIT: {
- str.append("Trait Change");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_trait_change());
str.append(" [");
str.append(condition.getName());
str.append("]");
break;
}
case CONTROL: {
- str.append("Operation Execution");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_operation());
str.append(" [");
str.append(condition.getName());
str.append("] ");
- str.append("with result status");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_status());
str.append(" [");
str.append(condition.getOption());
str.append("]");
break;
}
case RESOURCE_CONFIG: {
- str.append("Resource Configuration Change");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_resource_configuration());
break;
}
case EVENT: {
- str.append("Event Detection");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_event());
str.append(" [");
str.append(condition.getName());
str.append("]");
if (condition.getOption() != null && condition.getOption().length() > 0) {
str.append(" ");
- str.append("matching");
+ str.append(MSG.view_alert_common_tab_conditions_type_metric_event_matching());
str.append(" '");
str.append(condition.getOption());
str.append("'");
@@ -181,7 +188,7 @@ public class AlertFormatUtility {
break;
}
default: {
- str.append("BAD CATEGORY: ").append(category.name());
+ str.append(MSG.view_alert_common_tab_conditions_type_invalid(category.name()));
break;
}
}
@@ -190,11 +197,11 @@ public class AlertFormatUtility {
private static String getCalltimeChangeComparator(String comparator) {
if ("HI".equals(comparator)) {
- return "Grows";
+ return MSG.view_alert_common_tab_conditions_type_metric_calltime_delta_grows();
} else if ("LO".equals(comparator)) {
- return "Shrinks";
+ return MSG.view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks();
} else { // CH
- return "Changes";
+ return MSG.view_alert_common_tab_conditions_type_metric_calltime_delta_other();
}
}
@@ -203,17 +210,16 @@ public class AlertFormatUtility {
AlertDefinition recoveryAlertDefinition = alert.getRecoveryAlertDefinition();
if (recoveryAlertDefinition != null && recoveryAlertDefinition.getId() != 0) {
int resourceId = alert.getAlertDefinition().getResource().getId();
- recoveryInfo = "Triggered '<a href=\"/alerts/Config.do?mode=viewRoles&id=" + resourceId + "&ad="
- + recoveryAlertDefinition.getId() + "\">" + recoveryAlertDefinition.getName()
- + "</a>' to be re-enabled.";
+ String otherAlertDef = "<a href=\"/alerts/Config.do?mode=viewRoles&id=" + resourceId + "&ad="
+ + recoveryAlertDefinition.getId() + "\">" + recoveryAlertDefinition.getName() + "</a>";
+ recoveryInfo = MSG.view_alert_common_tab_conditions_recovery_enabled(otherAlertDef);
} else if (alert.getWillRecover()) {
- recoveryInfo = "This alert caused its alert definition to be disabled.";
+ recoveryInfo = MSG.view_alert_common_tab_conditions_recovery_disabled();
} else {
- recoveryInfo = "N/A";
+ recoveryInfo = MSG.common_val_na();
}
return recoveryInfo;
}
-
/* THIS IS THE OLD CODE - IT HAS LOTS OF TODOs AND DIDN'T FULLY WORK
public static String formatAlertConditionForDisplay(AlertCondition condition) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
index b6f34ca..6aacb23 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
@@ -80,36 +80,37 @@ public class AlertHistoryView extends TableSection {
@Override
protected void configureTableFilters() {
- final EnumSelectItem priorityFilter = new EnumSelectItem("severities", "Priority Filter", AlertPriority.class);
+ final EnumSelectItem priorityFilter = new EnumSelectItem("severities", MSG.view_alerts_table_filter_priority(),
+ AlertPriority.class);
setFilterFormItems(priorityFilter);
}
@Override
protected void configureTable() {
- ListGridField ctimeField = new ListGridField("ctime", "Creation Time", 100);
+ ListGridField ctimeField = new ListGridField("ctime", MSG.view_alerts_field_created_time(), 100);
ctimeField.setCellFormatter(new TimestampCellFormatter());
- ListGridField nameField = new ListGridField("name", "Name", 100);
- ListGridField conditionTextField = new ListGridField("conditionText", "Details");
- ListGridField priorityField = new ListGridField("priority", "Priority", 50);
+ ListGridField nameField = new ListGridField("name", MSG.view_alerts_field_name(), 100);
+ ListGridField conditionTextField = new ListGridField("conditionText", MSG.view_alerts_field_condition_text());
+ ListGridField priorityField = new ListGridField("priority", MSG.view_alerts_field_priority(), 50);
- ListGridField statusField = new ListGridField("status", "Status", 175);
+ ListGridField statusField = new ListGridField("status", 175);
statusField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
String ackTime = listGridRecord.getAttribute("acknowledgeTime");
String ackSubject = listGridRecord.getAttribute("acknowledgingSubject");
if (ackSubject == null) {
- return "Not Yet Acknowledged";
+ return MSG.view_alerts_field_ack_status_empty();
} else {
String formattedTime = TimestampCellFormatter.DATE_TIME_FORMAT.format(new Date(Long
.parseLong(ackTime)));
- return " Acknowledged on " + formattedTime + "<br/>by " + ackSubject;
+ return MSG.view_alerts_field_ack_status_filled(ackSubject, formattedTime);
}
}
});
- ListGridField resourceNameField = new ListGridField("resourceName", "Resource", 125);
+ ListGridField resourceNameField = new ListGridField("resourceName", MSG.view_alerts_field_resource(), 125);
resourceNameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
Integer resourceId = listGridRecord.getAttributeAsInt("resourceId");
@@ -133,30 +134,30 @@ public class AlertHistoryView extends TableSection {
TableActionEnablement multipleTargetEnablement = hasWriteAccess ? TableActionEnablement.ALWAYS
: TableActionEnablement.NEVER;
- addTableAction("DeleteAlert", "Delete", "Delete the selected alert(s)?", new AbstractTableAction(
- singleTargetEnablement) {
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- delete(selection);
- }
- });
- addTableAction("DeleteAll", "Delete All", "Delete all alerts from this source?", new AbstractTableAction(
- multipleTargetEnablement) {
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- deleteAll();
- }
- });
- addTableAction("AcknowledgeAlert", "Ack", "Ack the selected alert(s)?", new AbstractTableAction(
- singleTargetEnablement) {
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- acknowledge(selection);
- }
- });
- addTableAction("AcknowledgeAll", "Ack All", "Ack all alerts from this source?", new AbstractTableAction(
- multipleTargetEnablement) {
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- acknowledgeAll();
- }
- });
+ addTableAction("DeleteAlert", MSG.common_button_delete(), MSG.view_alerts_delete_confirm(),
+ new AbstractTableAction(singleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ delete(selection);
+ }
+ });
+ addTableAction("DeleteAll", MSG.common_button_delete_all(), MSG.view_alerts_delete_confirm_all(),
+ new AbstractTableAction(multipleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ deleteAll();
+ }
+ });
+ addTableAction("AcknowledgeAlert", MSG.common_button_ack(), MSG.view_alerts_ack_confirm(),
+ new AbstractTableAction(singleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ acknowledge(selection);
+ }
+ });
+ addTableAction("AcknowledgeAll", MSG.common_button_ack_all(), MSG.view_alerts_ack_confirm_all(),
+ new AbstractTableAction(multipleTargetEnablement) {
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ acknowledgeAll();
+ }
+ });
}
void delete(ListGridRecord[] records) {
@@ -170,13 +171,13 @@ public class AlertHistoryView extends TableSection {
GWTServiceLookup.getAlertService().deleteAlerts(alertIds, new AsyncCallback<Integer>() {
public void onSuccess(Integer resultCount) {
CoreGUI.getMessageCenter().notify(
- new Message("Deleted [" + resultCount + "] alerts", Message.Severity.Info));
+ new Message(MSG.view_alerts_delete_success(String.valueOf(resultCount)), Message.Severity.Info));
refresh();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to delete alerts with id's: " + Arrays.toString(alertIds), caught);
+ CoreGUI.getErrorHandler()
+ .handleError(MSG.view_alerts_delete_failure(Arrays.toString(alertIds)), caught);
}
});
}
@@ -185,12 +186,12 @@ public class AlertHistoryView extends TableSection {
GWTServiceLookup.getAlertService().deleteAlertsByContext(context, new AsyncCallback<Integer>() {
public void onSuccess(Integer resultCount) {
CoreGUI.getMessageCenter().notify(
- new Message("Deleted [" + resultCount + "] alerts", Message.Severity.Info));
+ new Message(MSG.view_alerts_delete_success(String.valueOf(resultCount)), Message.Severity.Info));
refresh();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to delete all alerts from this source", caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alerts_delete_failure_all(), caught);
}
});
}
@@ -206,13 +207,12 @@ public class AlertHistoryView extends TableSection {
GWTServiceLookup.getAlertService().acknowledgeAlerts(alertIds, new AsyncCallback<Integer>() {
public void onSuccess(Integer resultCount) {
CoreGUI.getMessageCenter().notify(
- new Message("Acknowledged [" + resultCount + "] alerts", Message.Severity.Info));
+ new Message(MSG.view_alerts_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
refresh();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to acknowledge Alerts with id's: " + Arrays.toString(alertIds), caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alerts_ack_failure(Arrays.toString(alertIds)), caught);
}
});
}
@@ -221,12 +221,12 @@ public class AlertHistoryView extends TableSection {
GWTServiceLookup.getAlertService().acknowledgeAlertsByContext(context, new AsyncCallback<Integer>() {
public void onSuccess(Integer resultCount) {
CoreGUI.getMessageCenter().notify(
- new Message("Acknowledged [" + resultCount + "] alerts", Message.Severity.Info));
+ new Message(MSG.view_alerts_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
refresh();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to acknowledged all alerts from this source", caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alerts_ack_failure_all(), caught);
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertPortletDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertPortletDataSource.java
index d823c56..64306ca 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertPortletDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertPortletDataSource.java
@@ -92,7 +92,7 @@ public class AlertPortletDataSource extends AlertDataSource {
getAlertService().findAlertsByCriteria(criteria, new AsyncCallback<PageList<Alert>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to fetch alerts data", caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_alerts_loadFailed(), caught);
response.setStatus(RPCResponse.STATUS_FAILURE);
processResponse(request.getRequestId(), response);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/GroupAlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/GroupAlertHistoryView.java
index a0943c0..b9ca1a1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/GroupAlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/GroupAlertHistoryView.java
@@ -27,7 +27,7 @@ import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
*/
public class GroupAlertHistoryView extends AlertHistoryView {
public static GroupAlertHistoryView get(String locatorId, ResourceGroupComposite composite) {
- String tableTitle = "Group Alert History";
+ String tableTitle = MSG.view_alerts_table_title_group();
EntityContext context = EntityContext.forGroup(composite.getResourceGroup().getId());
boolean hasWriteAccess = composite.getResourcePermission().isAlert();
return new GroupAlertHistoryView(locatorId, tableTitle, context, hasWriteAccess);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
index daecace..af63ed7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/ResourceAlertHistoryView.java
@@ -27,7 +27,7 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
*/
public class ResourceAlertHistoryView extends AlertHistoryView {
public static ResourceAlertHistoryView get(String locatorId, ResourceComposite composite) {
- String tableTitle = "Resource Alert History";
+ String tableTitle = MSG.view_alerts_table_title_resource();
EntityContext context = EntityContext.forResource(composite.getResource().getId());
boolean hasWriteAccess = composite.getResourcePermission().isAlert();
return new ResourceAlertHistoryView(locatorId, tableTitle, context, hasWriteAccess);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java
index 4fd84c1..867f0ed 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java
@@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.alert;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
+
import org.rhq.core.domain.criteria.AlertCriteria;
/**
@@ -38,7 +39,8 @@ public class SubsystemResourceAlertDataSource extends AlertDataSource {
DataSourceField[] updatedFields = new DataSourceField[fields.length + 1];
// TODO: Replace 'Resource Id' column with 'Resource Name' and 'Resource Lineage' columns.
- DataSourceField resourceIdField = new DataSourceIntegerField(AlertCriteria.SORT_FIELD_RESOURCE_ID, "Resource Id");
+ DataSourceField resourceIdField = new DataSourceIntegerField(AlertCriteria.SORT_FIELD_RESOURCE_ID, MSG
+ .common_title_resource_id());
updatedFields[0] = resourceIdField;
System.arraycopy(fields, 0, updatedFields, 1, fields.length);
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 9c6f807..df253d2 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -13,6 +13,8 @@ common_buildInfo_gwtVersion = ${gwt.version}~
# Button Labels
#--------------
+common_button_ack = Ack~
+common_button_ack_all = Ack All~
common_button_advanced = Advanced...~
common_button_apply = Apply~
common_button_cancel = Cancel~
@@ -20,6 +22,7 @@ common_button_close = Close~
common_button_compare = Compare~
common_button_create_child = Create Child~
common_button_delete = Delete~
+common_button_delete_all = Delete All~
common_button_disable = Disable~
common_button_enable = Enable~
common_button_finish = Finish~
@@ -426,7 +429,6 @@ view_adminUsersDetails_dataTypeName = user~
# Administration/Security/Roles/#
#--------------------------------
-#jjj
view_adminRoles_assignedGroups = Assigned Resource Groups~
view_adminRoles_assignedSubjects = Assigned Subjects~
view_adminRoles_failLdap = Failed to determine if LDAP configured - assuming no LDAP.~
@@ -473,6 +475,73 @@ view_remoteAgentInstall_stopAgentResults = Agent stop results: [{0}]~
view_remoteAgentInstall_success = Agent installation complete~
view_remoteAgentInstall_updateStatus = Update Status~
+#==================== Alerts ======================
+view_alerts_table_title_group=Group Alert History~
+view_alerts_table_title_resource=Resource Alert History~
+view_alerts_table_filter_priority=Priority Filter~
+view_alerts_field_created_time=Creation Time~
+view_alerts_field_ack_time=Ack Time~
+view_alerts_field_ack_subject=Ack Subject~
+view_alerts_field_ack_status=Status~
+view_alerts_field_ack_status_empty=Not Yet Acknowledged~
+view_alerts_field_ack_status_filled={0} acknowledged on {1}~
+view_alerts_field_name=Name~
+view_alerts_field_condition_text=Condition Text~
+view_alerts_field_condition_text_none=No Conditions~
+view_alerts_field_condition_text_many=Multiple Conditions~
+view_alerts_field_condition_value=Condition Value~
+view_alerts_field_resource=Resource~
+view_alerts_field_priority=Priority~
+view_alerts_loadFailed=Failed to fetch alerts data~
+view_alerts_delete_confirm=Delete the selected alert(s)?~
+view_alerts_delete_confirm_all=Delete all alerts from this source?~
+view_alerts_delete_success=Successfully deleted {0} alerts~
+view_alerts_delete_failure=Failed to delete alerts with id''s: {0}~
+view_alerts_delete_failure_all=Failed to delete all alerts from this source~
+view_alerts_ack_confirm=Ack the selected alert(s)?~
+view_alerts_ack_confirm_all=Ack all alerts from this source?~
+view_alerts_ack_success=Successfully acknowledged {0} alerts~
+view_alerts_ack_failure=Failed to acknowledge alerts with id''s: {0}~
+view_alerts_ack_failure_all=Failed to acknowledge all alerts from this source~
+view_alert_details_loadFailed=Failed to fetch alert details~
+view_alert_details_breadcrumb=Details~
+view_alert_details_field_ack_by=Acknowledged by~
+view_alert_details_field_ack_at=Acknowledged at~
+view_alert_details_field_recovery_info=Recovery Info~
+view_alert_common_tab_general=General~
+view_alert_common_tab_conditions=Conditions~
+view_alert_common_tab_conditions_text=Matching Condition~
+view_alert_common_tab_conditions_value=Value~
+view_alert_common_tab_conditions_type_availability=Availability Change~
+view_alert_common_tab_conditions_type_availability_down=Went down
+view_alert_common_tab_conditions_type_availability_up=Came up
+view_alert_common_tab_conditions_type_metric_threshold=Metric Value Exceeds Threshold~
+view_alert_common_tab_conditions_type_metric_calltime_threshold=Call Time Value Exceeds Threshold~
+view_alert_common_tab_conditions_type_metric_calltime_destination=with call destination matching~
+view_alert_common_tab_conditions_type_metric_calltime_change=Call Time Value Changes~
+view_alert_common_tab_conditions_type_metric_calltime_change_verb=by at least~
+view_alert_common_tab_conditions_type_metric_calltime_delta_grows=Grows~
+view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks=Shrinks~
+view_alert_common_tab_conditions_type_metric_calltime_delta_other=Changes~
+view_alert_common_tab_conditions_type_metric_baseline=Metric Value Exceeds Baseline~
+view_alert_common_tab_conditions_type_metric_baseline_verb=of~
+view_alert_common_tab_conditions_type_metric_change=Metric Value Change~
+view_alert_common_tab_conditions_type_metric_trait_change=Trait Change~
+view_alert_common_tab_conditions_type_metric_operation=Operation Execution~
+view_alert_common_tab_conditions_type_metric_status=with result status~
+view_alert_common_tab_conditions_type_metric_resource_configuration=Resource Configuration Change~
+view_alert_common_tab_conditions_type_metric_event=Event Detection~
+view_alert_common_tab_conditions_type_metric_event_matching=with event source matching~
+view_alert_common_tab_conditions_type_invalid=Unsupported Category: {0}
+view_alert_common_tab_conditions_recovery_enabled=Triggered ''{0}'' to be re-enabled~
+view_alert_common_tab_conditions_recovery_disabled=This alert caused its alert definition to be disabled~
+view_alert_common_tab_notifications=Notifications~
+view_alert_common_tab_notifications_sender=Sender~
+view_alert_common_tab_notifications_status=Status~
+view_alert_common_tab_notifications_message=Message~
+view_alert_common_tab_notifications_all_emails=All Emails~
+view_alert_common_tab_notifications_bad_emails=Bad Emails~
+view_alert_common_tab_dampening=Dampening~
# Auto Discovery Queue
#----------------------------