modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java | 97 ++++------ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java | 41 ++-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 86 ++++---- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTitleBar.java | 33 ++- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java | 25 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 69 +++---- modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 64 ++++++ 7 files changed, 259 insertions(+), 156 deletions(-)
New commits: commit 5f319735a944cf7c9e8b078af2705a75d7116d15 Author: Joseph Marques joseph@redhat.com Date: Wed Nov 17 17:09:11 2010 -0500
i18n for org.rhq.enterprise.gui.coregui.client.inventory.resource.detail
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java index ddda348..db193e1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map;
+import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; @@ -48,6 +49,7 @@ import org.rhq.core.domain.resource.ResourceSubCategory; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.Messages; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; @@ -60,6 +62,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp @Deprecated public class NewResourceTreeDataSource extends DataSource {
+ Messages MSG = CoreGUI.getMessages(); + int rootId;
private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); @@ -69,22 +73,23 @@ public class NewResourceTreeDataSource extends DataSource { setDataProtocol(DSProtocol.CLIENTCUSTOM); setDataFormat(DSDataFormat.CUSTOM);
- this.rootId = rootId;
- DataSourceField idDataField = new DataSourceTextField("id", "ID"); + DataSourceField idDataField = new DataSourceTextField("id", MSG.common_title_id()); idDataField.setPrimaryKey(true);
- DataSourceTextField nameDataField = new DataSourceTextField("name", "Name"); + DataSourceTextField nameDataField = new DataSourceTextField("name", MSG.common_title_name()); nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); + DataSourceTextField descriptionDataField = new DataSourceTextField("description", MSG + .common_title_description()); descriptionDataField.setCanEdit(false);
- DataSourceImageField availabilityDataField = new DataSourceImageField("currentAvailability", "Availability"); + DataSourceImageField availabilityDataField = new DataSourceImageField("currentAvailability", MSG + .common_title_availability()); descriptionDataField.setCanEdit(false);
- DataSourceTextField parentIdField = new DataSourceTextField("parentId", "Parent ID"); + DataSourceTextField parentIdField = new DataSourceTextField("parentId", MSG.common_title_id_parent()); parentIdField.setForeignKey("id"); // parentIdField.setRootValue(rootId);
@@ -107,27 +112,26 @@ public class NewResourceTreeDataSource extends DataSource { // Asume success response.setStatus(0); switch (request.getOperationType()) { - case ADD: - //executeAdd(request, response); - break; - case FETCH: - executeFetch(requestId, request, response); - break; - case REMOVE: - //executeRemove(lstRec); - break; - case UPDATE: - //executeAdd(lstRec, false); - break; - - default: - break; + case ADD: + //executeAdd(request, response); + break; + case FETCH: + executeFetch(requestId, request, response); + break; + case REMOVE: + //executeRemove(lstRec); + break; + case UPDATE: + //executeAdd(lstRec, false); + break; + + default: + break; }
return request.getData(); }
- public void executeFetch(final String requestId, final DSRequest request, final DSResponse response) { final long start = System.currentTimeMillis();
@@ -136,12 +140,12 @@ public class NewResourceTreeDataSource extends DataSource { ResourceCriteria criteria = new ResourceCriteria();
if (p == null) { - com.allen_sauer.gwt.log.client.Log.info("DataSourceTree: Loading initial data"); + Log.info("DataSourceTree: Loading initial data");
criteria.addFilterId(rootId);
} else { - com.allen_sauer.gwt.log.client.Log.info("DataSourceTree: Loading " + p); + Log.info("DataSourceTree: Loading " + p);
criteria.addFilterParentResourceId(Integer.parseInt(p)); } @@ -151,7 +155,7 @@ public class NewResourceTreeDataSource extends DataSource {
resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource data for tree", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_generic(), caught); response.setStatus(RPCResponse.STATUS_FAILURE); processResponse(requestId, response); } @@ -164,15 +168,17 @@ public class NewResourceTreeDataSource extends DataSource {
private void processIncomingData(List<Resource> result, final DSResponse response, final String requestId) {
- ResourceTypeRepository.Cache.getInstance().loadResourceTypes(result, - EnumSet.of(ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.children, ResourceTypeRepository.MetadataType.subCategory), - new ResourceTypeRepository.ResourceTypeLoadedCallback() { - public void onResourceTypeLoaded(List<Resource> result) { -// response.setData(buildNodes(result)); - processResponse(requestId, response); + ResourceTypeRepository.Cache.getInstance().loadResourceTypes( + result, + EnumSet.of(ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.children, + ResourceTypeRepository.MetadataType.subCategory), + new ResourceTypeRepository.ResourceTypeLoadedCallback() { + public void onResourceTypeLoaded(List<Resource> result) { + // response.setData(buildNodes(result)); + processResponse(requestId, response);
- } - }); + } + }); }
/** @@ -196,20 +202,19 @@ public class NewResourceTreeDataSource extends DataSource { }
return rootNode; -// return introduceTypeFolders(records); + // return introduceTypeFolders(records); }
private static void buildTree(TreeNode parent, Resource parentResource, Map<Integer, Resource> resources) {
HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType, TypeTreeNode>();
- ArrayList<ResourceTreeNode> childNodes = new ArrayList<ResourceTreeNode>();
for (Resource res : resources.values()) { if (res.getParentResource() != null && res.getParentResource().getId() == parentResource.getId()) {
-// parent.setChildren(); + // parent.setChildren();
ResourceTreeNode child = new ResourceTreeNode(res);
@@ -224,20 +229,16 @@ public class NewResourceTreeDataSource extends DataSource {
}
- - - private static TreeNode[] introduceTypeFolders(ResourceTreeNode[] nodes) { ArrayList<TreeNode> built = new ArrayList<TreeNode>(); HashMap<ResourceSubCategory, CategoryTreeNode> categories = new HashMap<ResourceSubCategory, CategoryTreeNode>(); HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType, TypeTreeNode>();
- for (ResourceTreeNode node : nodes) { built.add(node);
if (!types.containsKey(node.getResourceType()) - && node.getResourceType().getCategory() != ResourceCategory.PLATFORM) { + && node.getResourceType().getCategory() != ResourceCategory.PLATFORM) {
String parentResourceId = String.valueOf(node.getResource().getParentResource().getId());
@@ -296,7 +297,6 @@ public class NewResourceTreeDataSource extends DataSource { } }
- public static class TypeTreeNode extends TreeNode {
private TypeTreeNode(String parentId, String parentResourceId, String type) { @@ -320,28 +320,27 @@ public class NewResourceTreeDataSource extends DataSource {
String id = String.valueOf(resource.getId()); String parentId = resource.getParentResource() == null ? null - : (resource.getParentResource().getId() + "_" + resource.getResourceType().getName()); + : (resource.getParentResource().getId() + "_" + resource.getResourceType().getName());
// com.allen_sauer.gwt.log.client.Log.info(id + " / " + parentId);
setID(id); setParentID(parentId);
- setAttribute("id", id); setAttribute("parentId", parentId);
// setAttribute("parentKey", resource.getParentResource() == null ? 0 : (resource.getParentResource().getId() + resource.getResourceType().getName()));
setAttribute("name", resource.getName()); -// setAttribute("description", resource.getDescription()); + // setAttribute("description", resource.getDescription()); setAttribute( - "currentAvailability", - resource.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP ? "/images/icons/availability_green_16.png" - : "/images/icons/availability_red_16.png"); + "currentAvailability", + resource.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP ? "/images/icons/availability_green_16.png" + : "/images/icons/availability_red_16.png");
setIsFolder((resource.getResourceType().getChildResourceTypes() != null && !resource.getResourceType() - .getChildResourceTypes().isEmpty())); + .getChildResourceTypes().isEmpty())); }
public Resource getResource() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java index 6fef545..9ce25ab 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java @@ -23,6 +23,7 @@ import java.util.EnumSet; import java.util.HashMap; import java.util.List;
+import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.SelectionStyle; @@ -127,7 +128,7 @@ public class NewResourceTreeView extends LocatableVLayout { if (treeGrid.getSelectedRecord() instanceof ResourceTreeDatasource.ResourceTreeNode) { ResourceTreeDatasource.ResourceTreeNode node = (ResourceTreeDatasource.ResourceTreeNode) treeGrid .getSelectedRecord(); - com.allen_sauer.gwt.log.client.Log.info("Resource selected in tree: " + node.getResource()); + Log.info("Resource selected in tree: " + node.getResource());
String newToken = "Resource/" + node.getResource().getId(); String currentToken = History.getToken(); @@ -187,16 +188,16 @@ public class NewResourceTreeView extends LocatableVLayout { private void buildResourceContextMenu(final Resource resource, final ResourceType resourceType) { contextMenu.setItems(new MenuItem(resource.getName()));
- contextMenu.addItem(new MenuItem("Type: " + resourceType.getName())); + contextMenu.addItem(new MenuItem(MSG.view_tree_common_contextMenu_type_name_label(resourceType.getName())));
- MenuItem editPluginConfiguration = new MenuItem("Plugin Configuration"); + MenuItem editPluginConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_pluginConfiguration()); editPluginConfiguration.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { int resourceId = resource.getId(); int resourceTypeId = resourceType.getId();
Window configEditor = new Window(); - configEditor.setTitle("Edit " + resource.getName() + " plugin configuration"); + configEditor.setTitle(MSG.view_tree_common_contextMenu_editPluginConfiguration(resource.getName())); configEditor.setWidth(800); configEditor.setHeight(800); configEditor.setIsModal(true); @@ -212,14 +213,14 @@ public class NewResourceTreeView extends LocatableVLayout { editPluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() != null); contextMenu.addItem(editPluginConfiguration);
- MenuItem editResourceConfiguration = new MenuItem("Resource Configuration"); + MenuItem editResourceConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_resourceConfiguration()); editResourceConfiguration.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { int resourceId = resource.getId(); int resourceTypeId = resourceType.getId();
final Window configEditor = new Window(); - configEditor.setTitle("Edit " + resource.getName() + " resource configuration"); + configEditor.setTitle(MSG.view_tree_common_contextMenu_editResourceConfiguration(resource.getName())); configEditor.setWidth(800); configEditor.setHeight(800); configEditor.setIsModal(true); @@ -244,7 +245,7 @@ public class NewResourceTreeView extends LocatableVLayout { contextMenu.addItem(new MenuItemSeparator());
// Operations Menu - MenuItem operations = new MenuItem("Operations"); + MenuItem operations = new MenuItem(MSG.view_tree_common_contextMenu_operations()); Menu opSubMenu = new Menu(); for (final OperationDefinition operationDefinition : resourceType.getOperationDefinitions()) { MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName()); @@ -263,7 +264,7 @@ public class NewResourceTreeView extends LocatableVLayout { contextMenu.addItem(buildMetricsMenu(resourceType));
// Create Menu - MenuItem createChildMenu = new MenuItem("Create Child"); + MenuItem createChildMenu = new MenuItem(MSG.common_button_create_child()); Menu createChildSubMenu = new Menu(); for (final ResourceType childType : resourceType.getChildResourceTypes()) { if (childType.isCreatable()) { @@ -282,7 +283,7 @@ public class NewResourceTreeView extends LocatableVLayout { contextMenu.addItem(createChildMenu);
// Manually Add Menu - MenuItem importChildMenu = new MenuItem("Import"); + MenuItem importChildMenu = new MenuItem(MSG.common_button_import()); Menu importChildSubMenu = new Menu(); for (ResourceType childType : resourceType.getChildResourceTypes()) { if (childType.isSupportsManualAdd()) { @@ -306,7 +307,8 @@ public class NewResourceTreeView extends LocatableVLayout { criteria.fetchParentResourceTypes(true); rts.findResourceTypesByCriteria(criteria, new AsyncCallback<PageList<ResourceType>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load platform manual add children", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFailed_manualAddChildren(), + caught); }
public void onSuccess(PageList<ResourceType> result) { @@ -326,7 +328,7 @@ public class NewResourceTreeView extends LocatableVLayout {
GWTServiceLookup.getDashboardService().findDashboardsForSubject(new AsyncCallback<List<Dashboard>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load user dashboards", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFailed_dashboard(), caught); }
public void onSuccess(List<Dashboard> result) { @@ -339,7 +341,8 @@ public class NewResourceTreeView extends LocatableVLayout { defItem.setSubmenu(defSubItem);
for (final Dashboard d : result) { - MenuItem addToDBItem = new MenuItem("Add chart to Dashboard: " + d.getName()); + MenuItem addToDBItem = new MenuItem(MSG.view_tree_common_contextMenu_addChartToDashboard(d + .getName())); defSubItem.addItem(addToDBItem);
addToDBItem.addClickHandler(new ClickHandler() { @@ -357,14 +360,15 @@ public class NewResourceTreeView extends LocatableVLayout { GWTServiceLookup.getDashboardService().storeDashboard(d, new AsyncCallback<Dashboard>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server", - caught); + CoreGUI.getErrorHandler().handleError( + MSG.view_tree_common_contextMenu_saveChartToDashboardFailure(), caught); }
public void onSuccess(Dashboard result) { CoreGUI.getMessageCenter().notify( - new Message("Saved dashboard " + result.getName() + " to server", - Message.Severity.Info)); + new Message(MSG + .view_tree_common_contextMenu_saveChartToDashboardSuccessful(result + .getName()), Message.Severity.Info)); } });
@@ -431,7 +435,7 @@ public class NewResourceTreeView extends LocatableVLayout {
resourceService.getPlatformForResource(selectedResource.getId(), new AsyncCallback<Resource>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("adasdf", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_root(), caught); }
public void onSuccess(Resource result) { @@ -443,7 +447,8 @@ public class NewResourceTreeView extends LocatableVLayout {
resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("lkasldf", caught); + CoreGUI.getErrorHandler() + .handleError(MSG.view_tree_common_loadFailed_descendants(), caught); }
public void onSuccess(PageList<Resource> result) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 356aa5b..29647f1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -121,70 +121,80 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo protected List<TwoLevelTab> createTabs() { List<TwoLevelTab> tabs = new ArrayList<TwoLevelTab>();
- summaryTab = new TwoLevelTab(getTabSet().extendLocatorId("Summary"), "Summary", + summaryTab = new TwoLevelTab(getTabSet().extendLocatorId("Summary"), MSG.view_tabs_common_summary(), "/images/icons/Service_up_16.png"); - summaryOverview = new SubTab(summaryTab.extendLocatorId("Overview"), "Overview", null); - summaryDashboard = new SubTab(summaryTab.extendLocatorId("Dashboard"), "Dashboard", null); - summaryTimeline = new SubTab(summaryTab.extendLocatorId("Timeline"), "Timeline", null); + summaryOverview = new SubTab(summaryTab.extendLocatorId("Overview"), MSG.view_tabs_common_overview(), null); + summaryDashboard = new SubTab(summaryTab.extendLocatorId("Dashboard"), MSG.view_tabs_common_dashboard(), null); + summaryTimeline = new SubTab(summaryTab.extendLocatorId("Timeline"), MSG.view_tabs_common_timeline(), null); summaryTab.registerSubTabs(summaryOverview, summaryDashboard, summaryTimeline); tabs.add(summaryTab);
- monitoringTab = new TwoLevelTab(getTabSet().extendLocatorId("Monitoring"), "Monitoring", + monitoringTab = new TwoLevelTab(getTabSet().extendLocatorId("Monitoring"), MSG.view_tabs_common_monitoring(), "/images/icons/Monitor_grey_16.png"); - monitorGraphs = new SubTab(monitoringTab.extendLocatorId("Graphs"), "Graphs", null); - monitorTables = new SubTab(monitoringTab.extendLocatorId("Tables"), "Tables", null); - monitorTraits = new SubTab(monitoringTab.extendLocatorId("Traits"), "Traits", null); - monitorAvail = new SubTab(monitoringTab.extendLocatorId("Availability"), "Availability", null); - monitorSched = new SubTab(monitoringTab.extendLocatorId("Schedules"), "Schedules", null); - monitorCallTime = new SubTab(monitoringTab.extendLocatorId("CallTime"), "Call Time", null); + monitorGraphs = new SubTab(monitoringTab.extendLocatorId("Graphs"), MSG.view_tabs_common_graphs(), null); + monitorTables = new SubTab(monitoringTab.extendLocatorId("Tables"), MSG.view_tabs_common_tables(), null); + monitorTraits = new SubTab(monitoringTab.extendLocatorId("Traits"), MSG.view_tabs_common_traits(), null); + monitorAvail = new SubTab(monitoringTab.extendLocatorId("Availability"), MSG.view_tabs_common_availability(), + null); + monitorSched = new SubTab(monitoringTab.extendLocatorId("Schedules"), MSG.view_tabs_common_schedules(), null); + monitorCallTime = new SubTab(monitoringTab.extendLocatorId("CallTime"), MSG.view_tabs_common_calltime(), null); monitoringTab.registerSubTabs(monitorGraphs, monitorTables, monitorTraits, monitorAvail, monitorSched, monitorCallTime); tabs.add(monitoringTab);
- inventoryTab = new TwoLevelTab(getTabSet().extendLocatorId("Inventory"), "Inventory", + inventoryTab = new TwoLevelTab(getTabSet().extendLocatorId("Inventory"), MSG.view_tabs_common_inventory(), "/images/icons/Inventory_grey_16.png"); - inventoryChildren = new SubTab(inventoryTab.extendLocatorId("Children"), "Child Resources", null); - inventoryChildHistory = new SubTab(inventoryTab.extendLocatorId("ChildHist"), "Child History", null); - inventoryConn = new SubTab(inventoryTab.extendLocatorId("ConnectionSettings"), "Connection Settings", null); - inventoryConnHistory = new SubTab(inventoryTab.extendLocatorId("ConnSetHist"), "Connection Settings History", - null); - inventoryGroups = new SubTab(inventoryTab.extendLocatorId("Groups"), "Groups", null); - inventoryGroupMembership = new SubTab(inventoryTab.extendLocatorId("GroupMembership"), "Group Membership", null); + inventoryChildren = new SubTab(inventoryTab.extendLocatorId("Children"), + MSG.view_tabs_common_child_resources(), null); + inventoryChildHistory = new SubTab(inventoryTab.extendLocatorId("ChildHist"), MSG + .view_tabs_common_child_history(), null); + inventoryConn = new SubTab(inventoryTab.extendLocatorId("ConnectionSettings"), MSG + .view_tabs_common_connectionSettings(), null); + inventoryConnHistory = new SubTab(inventoryTab.extendLocatorId("ConnSetHist"), MSG + .view_tabs_common_connectionSettingsHistory(), null); + inventoryGroups = new SubTab(inventoryTab.extendLocatorId("Groups"), MSG.view_tabs_common_groups(), null); + inventoryGroupMembership = new SubTab(inventoryTab.extendLocatorId("GroupMembership"), MSG + .view_tabs_common_group_membership(), null); inventoryTab.registerSubTabs(this.inventoryChildren, this.inventoryChildHistory, this.inventoryConn, this.inventoryConnHistory, this.inventoryGroups, this.inventoryGroupMembership); tabs.add(inventoryTab);
- operationsTab = new TwoLevelTab(getTabSet().extendLocatorId("Operations"), "Operations", + operationsTab = new TwoLevelTab(getTabSet().extendLocatorId("Operations"), MSG.view_tabs_common_operations(), "/images/icons/Operation_grey_16.png"); - this.opHistory = new SubTab(operationsTab.extendLocatorId("History"), "History", null); - this.opSched = new SubTab(operationsTab.extendLocatorId("Scheduled"), "Scheduled", null); + this.opHistory = new SubTab(operationsTab.extendLocatorId("History"), MSG.view_tabs_common_history(), null); + this.opSched = new SubTab(operationsTab.extendLocatorId("Scheduled"), MSG.view_tabs_common_scheduled(), null); operationsTab.registerSubTabs(this.opHistory, this.opSched); tabs.add(operationsTab);
- alertsTab = new TwoLevelTab(getTabSet().extendLocatorId("Alerts"), "Alerts", "/images/icons/Alert_grey_16.png"); - this.alertHistory = new SubTab(alertsTab.extendLocatorId("History"), "History", null); - this.alertDef = new SubTab(alertsTab.extendLocatorId("Definitions"), "Definitions", null); + alertsTab = new TwoLevelTab(getTabSet().extendLocatorId("Alerts"), MSG.view_tabs_common_alerts(), + "/images/icons/Alert_grey_16.png"); + this.alertHistory = new SubTab(alertsTab.extendLocatorId("History"), MSG.view_tabs_common_history(), null); + this.alertDef = new SubTab(alertsTab.extendLocatorId("Definitions"), MSG.view_tabs_common_definitions(), null); alertsTab.registerSubTabs(alertHistory, alertDef); tabs.add(alertsTab);
- configurationTab = new TwoLevelTab(getTabSet().extendLocatorId("Configuration"), "Configuration", - "/images/icons/Configure_grey_16.png"); - this.configCurrent = new SubTab(configurationTab.extendLocatorId("Current"), "Current", null); - this.configHistory = new SubTab(configurationTab.extendLocatorId("History"), "History", null); + configurationTab = new TwoLevelTab(getTabSet().extendLocatorId("Configuration"), MSG + .view_tabs_common_configuration(), "/images/icons/Configure_grey_16.png"); + this.configCurrent = new SubTab(configurationTab.extendLocatorId("Current"), MSG.view_tabs_common_current(), + null); + this.configHistory = new SubTab(configurationTab.extendLocatorId("History"), MSG.view_tabs_common_history(), + null); configurationTab.registerSubTabs(this.configCurrent, this.configHistory); tabs.add(configurationTab);
- eventsTab = new TwoLevelTab(getTabSet().extendLocatorId("Events"), "Events", "/images/icons/Events_grey_16.png"); - this.eventHistory = new SubTab(eventsTab.extendLocatorId("History"), "History", null); + eventsTab = new TwoLevelTab(getTabSet().extendLocatorId("Events"), MSG.view_tabs_common_events(), + "/images/icons/Events_grey_16.png"); + this.eventHistory = new SubTab(eventsTab.extendLocatorId("History"), MSG.view_tabs_common_history(), null); eventsTab.registerSubTabs(eventHistory); tabs.add(eventsTab);
- contentTab = new TwoLevelTab(getTabSet().extendLocatorId("Content"), "Content", + contentTab = new TwoLevelTab(getTabSet().extendLocatorId("Content"), MSG.view_tabs_common_content(), "/images/icons/Content_grey_16.png"); - this.contentDeployed = new SubTab(contentTab.extendLocatorId("Deployed"), "Deployed", null); - this.contentNew = new SubTab(contentTab.extendLocatorId("New"), "New", null); - this.contentSubscrip = new SubTab(contentTab.extendLocatorId("Subscriptions"), "Subscriptions", null); - this.contentHistory = new SubTab(contentTab.extendLocatorId("History"), "History", null); + this.contentDeployed = new SubTab(contentTab.extendLocatorId("Deployed"), MSG.view_tabs_common_deployed(), null); + this.contentNew = new SubTab(contentTab.extendLocatorId("New"), MSG.view_tabs_common_new(), null); + this.contentSubscrip = new SubTab(contentTab.extendLocatorId("Subscriptions"), MSG + .view_tabs_common_subscriptions(), null); + this.contentHistory = new SubTab(contentTab.extendLocatorId("History"), MSG.view_tabs_common_history(), null); contentTab.registerSubTabs(contentDeployed, contentNew, contentSubscrip, contentHistory); tabs.add(contentTab);
@@ -357,7 +367,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo new AsyncCallback<PageList<ResourceComposite>>() { public void onFailure(Throwable caught) { CoreGUI.getMessageCenter().notify( - new Message("Resource with id [" + resourceId + "] does not exist or is not accessible.", + new Message(MSG.view_inventory_resource_loadFailed(String.valueOf(resourceId)), Message.Severity.Warning));
CoreGUI.goToView(InventoryView.VIEW_ID); @@ -366,7 +376,7 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo public void onSuccess(PageList<ResourceComposite> result) { if (result.isEmpty()) { //noinspection ThrowableInstanceNeverThrown - onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); + onFailure(new Exception(MSG.view_inventory_resource_loadFailed(String.valueOf(resourceId)))); } else { final ResourceComposite resourceComposite = result.get(0); // First load the user's permissions for the Resource. diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTitleBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTitleBar.java index bc1e0b7..c025e46 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTitleBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTitleBar.java @@ -100,7 +100,8 @@ public class ResourceTitleBar extends LocatableHLayout {
public void onSuccess(Void result) { CoreGUI.getMessageCenter().notify( - new Message("Resource tags updated", Message.Severity.Info)); + new Message(MSG.view_titleBar_common_updateTagsSuccessful(resource.getName()), + Message.Severity.Info)); // update what is essentially our local cache resource.setTags(tags); } @@ -124,7 +125,8 @@ public class ResourceTitleBar extends LocatableHLayout { GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Could not load resource tags", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_titleBar_common_loadTagsFailure(resource.getName()), + caught); }
public void onSuccess(PageList<Resource> result) { @@ -164,7 +166,11 @@ public class ResourceTitleBar extends LocatableHLayout {
private void updateFavoriteButton() { this.favoriteButton.setSrc(favorite ? FAV_ICON : NOT_FAV_ICON); - this.favoriteButton.setTooltip("Click to " + (favorite ? "remove" : "add") + " this Resource as a favorite."); + if (favorite) { + this.favoriteButton.setTooltip(MSG.view_titleBar_common_clickToRemoveFav()); + } else { + this.favoriteButton.setTooltip(MSG.view_titleBar_common_clickToAddFav()); + } }
private Set<Integer> toggleFavoriteLocally() { @@ -181,16 +187,25 @@ public class ResourceTitleBar extends LocatableHLayout {
public class UpdateFavoritesCallback implements AsyncCallback<Subject> { public void onSuccess(Subject subject) { - CoreGUI.getMessageCenter().notify( - new Message((favorite ? "Added " : "Removed ") + " Resource " - + ResourceTitleBar.this.resource.getName() + " as a favorite.", Message.Severity.Info)); + String msg = null; + if (favorite) { + msg = MSG.view_titleBar_common_addedFav(resource.getName()); + } else { + msg = MSG.view_titleBar_common_removedFav(resource.getName()); + } + CoreGUI.getMessageCenter().notify(new Message(msg, Message.Severity.Info)); updateFavoriteButton(); }
public void onFailure(Throwable throwable) { - CoreGUI.getMessageCenter().notify( - new Message("Failed to " + (favorite ? "add " : "remove ") + " Resource " - + ResourceTitleBar.this.resource.getName() + " as a favorite.", Message.Severity.Error)); + String msg = null; + if (favorite) { + msg = MSG.view_titleBar_common_addedFavFailure(resource.getName()); + } else { + msg = MSG.view_titleBar_common_removedFavFailure(resource.getName()); + } + CoreGUI.getMessageCenter().notify(new Message(msg, Message.Severity.Info)); + // Revert back to our original favorite status, since the server update failed. toggleFavoriteLocally(); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java index 43d6b8c..2da1ce5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java @@ -24,6 +24,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set;
+import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; @@ -41,6 +42,7 @@ import org.rhq.core.domain.resource.ResourceSubCategory; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.Messages; import org.rhq.enterprise.gui.coregui.client.components.tree.EnhancedTreeNode; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; @@ -55,6 +57,9 @@ import org.rhq.enterprise.gui.coregui.client.util.StringUtility; * @author Ian Springer */ public class ResourceTreeDatasource extends DataSource { + + Messages MSG = CoreGUI.getMessages(); + private List<Resource> initialData; private List<Resource> lockedData;
@@ -68,16 +73,17 @@ public class ResourceTreeDatasource extends DataSource { this.initialData = initialData; this.lockedData = (null != lockedData) ? lockedData : new ArrayList<Resource>();
- DataSourceField idDataField = new DataSourceTextField("id", "ID"); + DataSourceField idDataField = new DataSourceTextField("id", MSG.common_title_id()); idDataField.setPrimaryKey(true);
- DataSourceTextField nameDataField = new DataSourceTextField("name", "Name"); + DataSourceTextField nameDataField = new DataSourceTextField("name", MSG.common_title_name()); nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); + DataSourceTextField descriptionDataField = new DataSourceTextField("description", MSG + .common_title_description()); descriptionDataField.setCanEdit(false);
- DataSourceTextField parentIdField = new DataSourceTextField("parentId", "Parent ID"); + DataSourceTextField parentIdField = new DataSourceTextField("parentId", MSG.common_title_id_parent()); parentIdField.setForeignKey("id");
this.setDropExtraFields(false); @@ -115,7 +121,7 @@ public class ResourceTreeDatasource extends DataSource { public void executeFetch(final String requestId, final DSRequest request, final DSResponse response) { //final long start = System.currentTimeMillis();
- String parentResourceId = request.getCriteria().getAttribute("parentId"); + final String parentResourceId = request.getCriteria().getAttribute("parentId"); //com.allen_sauer.gwt.log.client.Log.info("All attributes: " + Arrays.toString(request.getCriteria().getAttributes()));
ResourceCriteria criteria = new ResourceCriteria(); @@ -124,7 +130,7 @@ public class ResourceTreeDatasource extends DataSource { // If this gets called more than once it's a problem. Don't load initial data more than once. // Subsequent fetches should be due to parent node tree expansion if (null != this.initialData) { - com.allen_sauer.gwt.log.client.Log.debug("ResourceTreeDatasource: Loading initial data..."); + Log.debug("ResourceTreeDatasource: Loading initial data...");
processIncomingData(this.initialData, response, requestId); response.setStatus(DSResponse.STATUS_SUCCESS); @@ -135,14 +141,13 @@ public class ResourceTreeDatasource extends DataSource { }
} else { - com.allen_sauer.gwt.log.client.Log.debug("ResourceTreeDatasource: Loading Resource [" + parentResourceId - + "]..."); + Log.debug("ResourceTreeDatasource: Loading Resource [" + parentResourceId + "]...");
criteria.addFilterParentResourceId(Integer.parseInt(parentResourceId));
resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource data for tree", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_children(), caught); response.setStatus(RPCResponse.STATUS_FAILURE); processResponse(requestId, response); } @@ -204,7 +209,7 @@ public class ResourceTreeDatasource extends DataSource {
for (ResourceTreeNode resourceNode : resourceNodes) { if (allNodeIds.contains(resourceNode.getID())) { - com.allen_sauer.gwt.log.client.Log.debug("Duplicate ResourceTreeNode - Skipping: " + resourceNode); + Log.debug("Duplicate ResourceTreeNode - Skipping: " + resourceNode); continue; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 21476d3..bd8b9b0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map;
+import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSCallback; @@ -149,7 +150,7 @@ public class ResourceTreeView extends LocatableVLayout { ResourceTreeNode resourceNode = (ResourceTreeNode) selectedRecord;
if (!resourceNode.isLocked()) { - System.out.println("Resource Node selected in tree: " + selectedRecord); + Log.info("Resource Node selected in tree: " + selectedRecord);
selectedNodeId = resourceNode.getID(); String viewPath = "Resource/" + resourceNode.getResource().getId(); @@ -164,13 +165,14 @@ public class ResourceTreeView extends LocatableVLayout { } } } else if (selectedRecord instanceof AutoGroupTreeNode) { - com.allen_sauer.gwt.log.client.Log.info("AutoGroup Node selected in tree: " + selectedRecord); + Log.info("AutoGroup Node selected in tree: " + selectedRecord);
AutoGroupTreeNode agNode = (AutoGroupTreeNode) selectedRecord; selectedNodeId = agNode.getID(); getAutoGroupBackingGroup(agNode, new AsyncCallback<ResourceGroup>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to select autogroup node", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_selection(), + caught); }
public void onSuccess(ResourceGroup result) { @@ -231,7 +233,7 @@ public class ResourceTreeView extends LocatableVLayout { criteria.addFilterVisible(false); resourceGroupService.findResourceGroupsByCriteria(criteria, new AsyncCallback<PageList<ResourceGroup>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to fetch autogroup backing group", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_node(), caught); }
public void onSuccess(PageList<ResourceGroup> result) { @@ -246,7 +248,7 @@ public class ResourceTreeView extends LocatableVLayout { resourceGroupService.createPrivateResourceGroup(backingGroup, childIds, new AsyncCallback<ResourceGroup>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to create resource autogroup", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_create(), caught); }
public void onSuccess(ResourceGroup result) { @@ -268,8 +270,7 @@ public class ResourceTreeView extends LocatableVLayout { resourceGroupService.setAssignedResources(backingGroup.getId(), childIds, false, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - "Failed to set assigned members for autogroup backing group", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_update(), caught); }
public void onSuccess(Void result) { @@ -341,7 +342,7 @@ public class ResourceTreeView extends LocatableVLayout { private void showContextMenu(AutoGroupTreeNode agNode) { getAutoGroupBackingGroup(agNode, new AsyncCallback<ResourceGroup>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to select AutoGroup node", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_selection(), caught); }
public void onSuccess(ResourceGroup result) { @@ -369,16 +370,17 @@ public class ResourceTreeView extends LocatableVLayout { private void buildResourceContextMenu(final Resource resource, final ResourceType resourceType) { resourceContextMenu.setItems(new MenuItem(resource.getName()));
- resourceContextMenu.addItem(new MenuItem("Type: " + resourceType.getName())); + resourceContextMenu.addItem(new MenuItem(MSG.view_tree_common_contextMenu_type_name_label(resourceType + .getName())));
- MenuItem editPluginConfiguration = new MenuItem("Plugin Configuration"); + MenuItem editPluginConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_pluginConfiguration()); editPluginConfiguration.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { int resourceId = resource.getId(); int resourceTypeId = resourceType.getId();
Window configEditor = new Window(); - configEditor.setTitle("Edit " + resource.getName() + " plugin configuration"); + configEditor.setTitle(MSG.view_tree_common_contextMenu_editPluginConfiguration(resource.getName())); configEditor.setWidth(800); configEditor.setHeight(800); configEditor.setIsModal(true); @@ -394,14 +396,14 @@ public class ResourceTreeView extends LocatableVLayout { editPluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() != null); resourceContextMenu.addItem(editPluginConfiguration);
- MenuItem editResourceConfiguration = new MenuItem("Resource Configuration"); + MenuItem editResourceConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_resourceConfiguration()); editResourceConfiguration.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { int resourceId = resource.getId(); int resourceTypeId = resourceType.getId();
final Window configEditor = new Window(); - configEditor.setTitle("Edit " + resource.getName() + " resource configuration"); + configEditor.setTitle(MSG.view_tree_common_contextMenu_editResourceConfiguration(resource.getName())); configEditor.setWidth(800); configEditor.setHeight(800); configEditor.setIsModal(true); @@ -426,7 +428,7 @@ public class ResourceTreeView extends LocatableVLayout { resourceContextMenu.addItem(new MenuItemSeparator());
// Operations Menu - MenuItem operations = new MenuItem("Operations"); + MenuItem operations = new MenuItem(MSG.view_tree_common_contextMenu_operations()); Menu opSubMenu = new Menu(); for (final OperationDefinition operationDefinition : resourceType.getOperationDefinitions()) { MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName()); @@ -441,8 +443,8 @@ public class ResourceTreeView extends LocatableVLayout { GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler() - .handleError("Failed to get resource to run operation", caught); + CoreGUI.getErrorHandler().handleError( + MSG.view_tree_common_contextMenu_operations_loadFailed(), caught); }
public void onSuccess(PageList<Resource> result) { @@ -462,7 +464,7 @@ public class ResourceTreeView extends LocatableVLayout { resourceContextMenu.addItem(buildMetricsMenu(resourceType));
// Create Menu - MenuItem createChildMenu = new MenuItem("Create Child"); + MenuItem createChildMenu = new MenuItem(MSG.common_button_create_child()); Menu createChildSubMenu = new Menu(); for (final ResourceType childType : resourceType.getChildResourceTypes()) { if (childType.isCreatable()) { @@ -483,7 +485,7 @@ public class ResourceTreeView extends LocatableVLayout { resourceContextMenu.addItem(createChildMenu);
// Manually Add Menu - MenuItem importChildMenu = new MenuItem("Import"); + MenuItem importChildMenu = new MenuItem(MSG.common_button_import()); Menu importChildSubMenu = new Menu(); for (final ResourceType childType : resourceType.getChildResourceTypes()) { if (childType.isSupportsManualAdd()) { @@ -516,7 +518,8 @@ public class ResourceTreeView extends LocatableVLayout { criteria.fetchParentResourceTypes(true); rts.findResourceTypesByCriteria(criteria, new AsyncCallback<PageList<ResourceType>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load platform manual add children", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFailed_manualAddChildren(), + caught); }
public void onSuccess(PageList<ResourceType> result) { @@ -538,12 +541,12 @@ public class ResourceTreeView extends LocatableVLayout { }
private MenuItem buildMetricsMenu(final ResourceType type) { - MenuItem measurements = new MenuItem("Measurements"); + MenuItem measurements = new MenuItem(MSG.view_tree_common_contextMenu_measurements()); final Menu measurementsSubMenu = new Menu();
GWTServiceLookup.getDashboardService().findDashboardsForSubject(new AsyncCallback<List<Dashboard>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load user dashboards", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFailed_dashboard(), caught); }
public void onSuccess(List<Dashboard> result) { @@ -556,7 +559,8 @@ public class ResourceTreeView extends LocatableVLayout { defItem.setSubmenu(defSubItem);
for (final Dashboard d : result) { - MenuItem addToDBItem = new MenuItem("Add chart to Dashboard: " + d.getName()); + MenuItem addToDBItem = new MenuItem(MSG.view_tree_common_contextMenu_addChartToDashboard(d + .getName())); defSubItem.addItem(addToDBItem);
addToDBItem.addClickHandler(new ClickHandler() { @@ -575,14 +579,15 @@ public class ResourceTreeView extends LocatableVLayout { GWTServiceLookup.getDashboardService().storeDashboard(d, new AsyncCallback<Dashboard>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server", - caught); + CoreGUI.getErrorHandler().handleError( + MSG.view_tree_common_contextMenu_saveChartToDashboardFailure(), caught); }
public void onSuccess(Dashboard result) { CoreGUI.getMessageCenter().notify( - new Message("Saved dashboard " + result.getName() + " to server", - Message.Severity.Info)); + new Message(MSG + .view_tree_common_contextMenu_saveChartToDashboardSuccessful(result + .getName()), Message.Severity.Info)); } });
@@ -640,7 +645,7 @@ public class ResourceTreeView extends LocatableVLayout { new AsyncCallback<List<ResourceLineageComposite>>() {
public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to lookup platform for tree", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_root(), caught); }
public void onSuccess(List<ResourceLineageComposite> result) { @@ -673,7 +678,7 @@ public class ResourceTreeView extends LocatableVLayout {
treeGrid.fetchData(treeGrid.getCriteria(), new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { - System.out.println("Done fetching data for tree."); + Log.info("Done fetching data for tree."); updateSelection();
if (null != callback) { @@ -701,8 +706,8 @@ public class ResourceTreeView extends LocatableVLayout {
} else { CoreGUI.getMessageCenter().notify( - new Message("Failed to select Resource [" + selectedResourceId - + "] in tree.", Message.Severity.Warning)); + new Message(MSG.view_tree_common_loadFailed_selection(), + Message.Severity.Warning)); }
} @@ -732,7 +737,7 @@ public class ResourceTreeView extends LocatableVLayout { criteria.fetchResourceType(true); resourceGroupService.findResourceGroupsByCriteria(criteria, new AsyncCallback<PageList<ResourceGroup>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to fetch autogroup backing group", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_node(), caught); }
public void onSuccess(PageList<ResourceGroup> result) { @@ -742,7 +747,7 @@ public class ResourceTreeView extends LocatableVLayout {
@Override public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load tree", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_children(), caught); }
@Override 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 ed4b0c4..b548590 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 @@ -78,6 +78,7 @@ common_title_generalProp = General Properties~ common_title_group_def_total=Group Definition Total~ common_title_icon = icon~ common_title_id = ID~ +common_title_id_parent = Parent ID~ common_title_inventory = Inventory~ common_title_lastUpdated=Last Updated~ common_title_lastUpdatedBy=Last Updated By~ @@ -552,6 +553,7 @@ view_inventory_groups_descendants=Descendants~ view_inventory_groups_deleteSuccessful=You have successfully deleted the selected resource groups~ view_inventory_groups_deleteFailed=Failed to delete the selected resource groups~ view_inventory_groups_loadFailed=Failed to load group composite data~ +view_inventory_resource_loadFailed=Resource with id [{0}] does not exist or is not accessible~ view_inventory_resources_deleteConfirm=Are you sure you want to delete the selected resources?~ view_inventory_resources_deleteSuccessful=You have successfully deleted the selected resources~ view_inventory_resources_deleteFailed=Failed to delete the selected resources~ @@ -559,6 +561,68 @@ view_inventory_resources_loadFailed=Failed to load resource composite data~ view_inventory_resources_title=Member Resources~ view_inventory_resources_title_children=Child Resources~ view_inventory_resources_title_members=Member Resources~ +view_tree_common_loadFailed_generic=Failed to load data for tree~ +view_tree_common_loadFailed_root=Failed to load root for tree~ +view_tree_common_loadFailed_descendants=Failed to load descendants for tree~ +view_tree_common_loadFailed_children=Failed to load children for node~ +view_tree_common_loadFailed_selection=Failed to select this node~ +view_tree_common_loadFailed_node=Failed to load data for this node~ +view_tree_common_loadFailed_create=Failed to create view for this node~ +view_tree_common_loadFailed_update=Failed to update view for this node~ +view_tree_common_contextMenu_type_name_label=Type: {0} +view_tree_common_contextMenu_pluginConfiguration=Plugin Configuration~ +view_tree_common_contextMenu_resourceConfiguration=Resource Configuration~ +view_tree_common_contextMenu_editPluginConfiguration=Edit [{0}] Plugin Configuration~ +view_tree_common_contextMenu_editResourceConfiguration=Edit [{0}] Resource Configuration~ +view_tree_common_contextMenu_operations=Operations~ +view_tree_common_contextMenu_operations_loadFailed=Failure to start wizard for running operations~ +view_tree_common_contextMenu_measurements=Measurements~ +view_tree_common_contextMenu_addChartToDashboard=Add chart to dashboard [{0}]~ +view_tree_common_contextMenu_chart=Chart~ +view_tree_common_contextMenu_saveChartToDashboardSuccessful=You have saved dashboard [{0}]~ +view_tree_common_contextMenu_saveChartToDashboardFailure=Failed to save the dashboard~ +view_tree_common_contextMenu_loadFailed_dashboard=Failed to load user dashboards +view_tree_common_contextMenu_loadFailed_manualAddChildren=Failed to load platform manual add children~ +view_tabs_common_summary=Summary~ +view_tabs_common_overview=Overview~ +view_tabs_common_dashboard=Dashboard~ +view_tabs_common_timeline=Timeline~ +view_tabs_common_monitoring=Monitoring~ +view_tabs_common_graphs=Graphs~ +view_tabs_common_tables=Tables~ +view_tabs_common_traits=Traits~ +view_tabs_common_availability=Availability~ +view_tabs_common_schedules=Schedules~ +view_tabs_common_calltime=Calltime~ +view_tabs_common_inventory=Inventory~ +view_tabs_common_groups=Groups~ +view_tabs_common_group_membership=Group Membership~ +view_tabs_common_members=Members~ +view_tabs_common_child_resources=Child Resources~ +view_tabs_common_child_history=Child History~ +view_tabs_common_connectionSettings=Connection Settings~ +view_tabs_common_connectionSettingsHistory=Connection Settings History~ +view_tabs_common_operations=Operations~ +view_tabs_common_history=History~ +view_tabs_common_scheduled=Scheduled~ +view_tabs_common_alerts=Alerts~ +view_tabs_common_definitions=Definitions~ +view_tabs_common_current=Current~ +view_tabs_common_events=Events~ +view_tabs_common_configuration=Configuration~ +view_tabs_common_content=Content~ +view_tabs_common_deployed=Deployed~ +view_tabs_common_new=New~ +view_tabs_common_subscriptions=Subscriptions~ +view_titleBar_common_updateTagsSuccessful=The tags for [{0}] have been updated~ +view_titleBar_common_updateTagsFailure=Failed to update the tags for [{0}]~ +view_titleBar_common_loadTagsFailure=Failed to load the tags for [{0}]~ +view_titleBar_common_clickToRemoveFav=Click to remove this as a favorite~ +view_titleBar_common_clickToAddFav=Click to add this as a favorite~ +view_titleBar_common_removedFav=You have removed [{0}] as one of your favorites~ +view_titleBar_common_addedFav=You have added [{0}] as a favorite~ +view_titleBar_common_removedFavFailure=Failed to remove [{0}] as one of your favorites~ +view_titleBar_common_addedFavFailure=Failed to add [{0}] as a favorite~ view_dynagroup_expressionSet=Expression Set~ view_dynagroup_recalculationInterval=Recalculation Interval~ view_dynagroup_lastCalculationTime=Last Calculation Time~
rhq-commits@lists.fedorahosted.org