Author: ips
Date: 2009-05-18 18:22:54 -0400 (Mon, 18 May 2009)
New Revision: 441
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java
trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
trunk/core/src/main/webapp/include/tabMenu.xhtml
trunk/core/src/main/webapp/secure/resourceInstanceMetrics.xhtml
trunk/core/src/main/webapp/secure/resourceInstanceSummary.xhtml
Log:
fix for
https://jira.jboss.org/jira/browse/JOPR-146
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java 2009-05-18
17:24:15 UTC (rev 440)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationAction.java 2009-05-18
22:22:54 UTC (rev 441)
@@ -24,6 +24,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
import javax.faces.component.UIComponent;
@@ -43,7 +45,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
-import org.jboss.on.embedded.ResourceTypes;
import org.jboss.on.embedded.manager.ResourceManager;
import org.jboss.on.embedded.manager.ResourceManagerFactory;
import org.jboss.on.embedded.ui.nav.BaseTreeNode;
@@ -107,7 +108,6 @@
return ResourceManagerFactory.resourceManager();
}
-
@In(value = "rootNode", create = true)
private JONTreeNode rootNode;
@@ -264,21 +264,21 @@
// @TODO if isAvailable is moved to CommonActionUtil, the methods below for enabling
tabs should
// probably move there too or just move it to a Tab related class
- public List<String> getEnabledTabs()
+ public Map<String, Boolean> getEnabledTabs()
{
- List<String> enabledTabs = new ArrayList<String>(4);
+ Map<String, Boolean> enabledTabs = new HashMap<String, Boolean>(4);
JONTreeNode currentNode = getSelectedNode();
if (currentNode instanceof TreeNodeWithResource)
{
Resource resource = ((TreeNodeWithResource)currentNode).getResource();
if (hasConfiguration(resource))
- enabledTabs.add(Tabs.CONFIGURATION);
+ enabledTabs.put(Tabs.CONFIGURATION, true);
if (hasMetrics(resource))
- enabledTabs.add(Tabs.METRIC);
+ enabledTabs.put(Tabs.METRIC, true);
if (resource.getResourceType().getCategory() != ResourceCategory.PLATFORM
&& hasOperations(resource))
- enabledTabs.add(Tabs.OPERATION);
+ enabledTabs.put(Tabs.OPERATION, true);
if (isContentBacked(resource))
- enabledTabs.add(Tabs.CONTENT);
+ enabledTabs.put(Tabs.CONTENT, true);
}
return enabledTabs;
}
Modified: trunk/core/src/main/webapp/WEB-INF/classes/messages.properties
===================================================================
--- trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2009-05-18 17:24:15 UTC
(rev 440)
+++ trunk/core/src/main/webapp/WEB-INF/classes/messages.properties 2009-05-18 22:22:54 UTC
(rev 441)
@@ -90,8 +90,8 @@
summary.resourceInstance.configuration.name=Name:
summary.resourceInstance.configuration.version=Version:
summary.resourceInstance.configuration.description=Description:
-summary.resourceInstance.traits=Resource Traits
-summary.resourceInstance.metrics=Metrics Summary
+summary.resourceInstance.traits=Traits
+summary.resourceInstance.metrics=Numeric Metrics
summary.resourceInstance.metrics.name=Name
summary.resourceInstance.metrics.value=Value
@@ -108,8 +108,8 @@
#Messages for resourceInstanceMetrics.xhtml
metrics.resourceInstance.title=Metrics
-metrics.resourceInstance.numericMetricValues=Numeric Metric Values
-metrics.resourceInstance.traitValues=Trait Values
+metrics.resourceInstance.numericMetricValues=Numeric Metrics
+metrics.resourceInstance.traitValues=Traits
metrics.resourceInstance.category=Category
metrics.resourceInstance.name=Name
metrics.resourceInstance.value=Value
Modified: trunk/core/src/main/webapp/include/tabMenu.xhtml
===================================================================
--- trunk/core/src/main/webapp/include/tabMenu.xhtml 2009-05-18 17:24:15 UTC (rev 440)
+++ trunk/core/src/main/webapp/include/tabMenu.xhtml 2009-05-18 22:22:54 UTC (rev 441)
@@ -70,7 +70,7 @@
</h:panelGroup>
<!-- ENABLED panel (can be viewed) -->
<h:panelGroup layout="block"
- rendered="#{activeTab ne 'configuration' and
navigationAction.enabledTabs.contains('configuration')}">
+ rendered="#{activeTab ne 'configuration' and
navigationAction.enabledTabs['configuration']}">
<li>
<s:link id="configurationTab"
styleClass=""
action="#{resourceConfigurationUIBean.resourceConfiguration()}"
propagation="end">
@@ -79,7 +79,7 @@
</li>
</h:panelGroup>
<!-- DISABLED panel (can not be viewed) -->
- <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs.contains('configuration')}">
+ <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs['configuration']}">
<li>
<span id="configurationTab"
class="disabled">#{messages['tab.menu.configuration']}</span>
</li>
@@ -96,7 +96,7 @@
</h:panelGroup>
<!-- ENABLED panel (can be viewed) -->
<h:panelGroup layout="block"
- rendered="#{activeTab ne 'metric' and
navigationAction.enabledTabs.contains('metric')}">
+ rendered="#{activeTab ne 'metric' and
navigationAction.enabledTabs['metric']}">
<li>
<s:link id="metricsTab" styleClass=""
view="/secure/resourceInstanceMetrics.xhtml"
propagation="end">
@@ -105,7 +105,7 @@
</li>
</h:panelGroup>
<!-- DISABLED panel (can not be viewed) -->
- <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs.contains('metric')}">
+ <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs['metric']}">
<li>
<span id="metricsTab"
class="disabled">#{messages['tab.menu.metrics']}</span>
</li>
@@ -122,7 +122,7 @@
</h:panelGroup>
<!-- ENABLED panel (can be viewed) -->
<h:panelGroup layout="block"
- rendered="#{activeTab ne 'operation' and
navigationAction.enabledTabs.contains('operation')}">
+ rendered="#{activeTab ne 'operation' and
navigationAction.enabledTabs['operation']}">
<li>
<s:link id="controlTab" styleClass=""
view="/secure/resourceInstanceOperation.xhtml"
propagation="end">
@@ -131,7 +131,7 @@
</li>
</h:panelGroup>
<!-- DISABLED panel (can not be viewed) -->
- <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs.contains('operation')}">
+ <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs['operation']}">
<li>
<span id="controlTab"
class="disabled">#{messages['tab.menu.control']}</span>
</li>
@@ -148,7 +148,7 @@
</h:panelGroup>
<!-- ENABLED panel (can be viewed) -->
<h:panelGroup layout="block"
- rendered="#{activeTab ne 'content' and
navigationAction.enabledTabs.contains('content')}">
+ rendered="#{activeTab ne 'content' and
navigationAction.enabledTabs['content']}">
<li>
<s:link id="contentTab" styleClass=""
view="/secure/resourceInstanceContent.xhtml"
propagation="end">
@@ -157,7 +157,7 @@
</li>
</h:panelGroup>
<!-- DISABLED panel (can not be viewed) -->
- <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs.contains('content')}">
+ <h:panelGroup layout="block"
rendered="#{!navigationAction.enabledTabs['content']}">
<li>
<span id="contentTab"
class="disabled">#{messages['tab.menu.content']}</span>
</li>
Modified: trunk/core/src/main/webapp/secure/resourceInstanceMetrics.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceInstanceMetrics.xhtml 2009-05-18 17:24:15
UTC (rev 440)
+++ trunk/core/src/main/webapp/secure/resourceInstanceMetrics.xhtml 2009-05-18 22:22:54
UTC (rev 441)
@@ -53,6 +53,7 @@
<h2>#{messages['metrics.resourceInstance.traitValues']}</h2>
<rich:dataTable value="#{traitDisplayList}"
+ rendered="#{not empty traitDisplayList}"
id="metricsTraitsTable"
var="trait"
columnClasses="standard-traitscolumn"
width="100%">
@@ -70,12 +71,16 @@
</rich:column>
</rich:dataTable>
+ <h:panelGroup layout="block" rendered="#{empty
traitDisplayList}">
+ There are currently no traits available.
+ </h:panelGroup>
+
<h2>#{messages['metrics.resourceInstance.numericMetricValues']}</h2>
<rich:dataTable
id="dataTable"
value="#{measurementCategoryList}"
var="category"
- rendered="#{measurementCategoryList ne null}"
+ rendered="#{not empty measurementCategoryList}"
styleClass="controlTable"
rowClasses="categoryRow">
<f:facet name="header">
@@ -100,7 +105,11 @@
</f:facet>
</rich:dataTable>
- <h:form rendered="#{(measurementCategoryList ne null and
measurementCategoryList.size gt 0) or (traitDisplayList ne null and traitDisplayList.size
gt 0)}"
+ <h:panelGroup layout="block" rendered="#{empty
measurementCategoryList}">
+ There are currently no numeric metrics available.
+ </h:panelGroup>
+
+ <h:form rendered="#{(not empty traitDisplayList) or (not empty
measurementCategoryList)}"
style="text-align: left;">
<s:button style="margin-top: 6px;"
action="#{metricAction.view()}"
value="#{messages['metrics.resourceInstance.refresh']}"
styleClass="buttonmed">
Modified: trunk/core/src/main/webapp/secure/resourceInstanceSummary.xhtml
===================================================================
--- trunk/core/src/main/webapp/secure/resourceInstanceSummary.xhtml 2009-05-18 17:24:15
UTC (rev 440)
+++ trunk/core/src/main/webapp/secure/resourceInstanceSummary.xhtml 2009-05-18 22:22:54
UTC (rev 441)
@@ -65,24 +65,26 @@
</tr>
</table>
- <h:panelGroup
rendered="#{navigationAction.enabledTabs.contains('metric')}">
+ <h:panelGroup
rendered="#{navigationAction.enabledTabs['metric']}">
<h2>#{messages['summary.resourceInstance.traits']}</h2>
<h:dataTable value="#{summaryTraitDisplayList}"
+ rendered="#{not empty
summaryTraitDisplayList}"
var="trait"
columnClasses="standard-traitscolumn">
<h:column>
<strong>#{
summaryMeasurementDefinitionMap[trait.measurementData.name].displayName}:</strong>
- #{ trait.measurementValueAndUnits}
+ #{trait.measurementValueAndUnits}
</h:column>
</h:dataTable>
</h:panelGroup>
- <h:panelGroup
rendered="#{navigationAction.enabledTabs.contains('metric')}">
+ <h:panelGroup
rendered="#{navigationAction.enabledTabs['metric']}">
<h2>#{messages['summary.resourceInstance.metrics']}</h2>
<rich:dataTable id="dataTable"
value="#{summaryMeasurementDisplayList}"
+ rendered="#{not empty
summaryMeasurementDisplayList}"
var="md"
rowClasses="oddRow,evenRow"
columnClasses="rich-table-cell, rich-table-cell,
rich-table-cell-action">