diff --git a/Kieker.WebGUI/lib/jsf-api-2.1.7.LICENSE b/Kieker.WebGUI/lib/jsf-api-2.1.22.LICENSE similarity index 100% rename from Kieker.WebGUI/lib/jsf-api-2.1.7.LICENSE rename to Kieker.WebGUI/lib/jsf-api-2.1.22.LICENSE diff --git a/Kieker.WebGUI/lib/jsf-impl-2.1.7.LICENSE b/Kieker.WebGUI/lib/jsf-impl-2.1.22.LICENSE similarity index 100% rename from Kieker.WebGUI/lib/jsf-impl-2.1.7.LICENSE rename to Kieker.WebGUI/lib/jsf-impl-2.1.22.LICENSE diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index 07a17f9b17565a1c4b39429f14cfc73fd0c0e89d..5a634ebbf2496e7b67caa702e53111ad7385ae3f 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -138,12 +138,12 @@ <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> - <version>2.1.7</version> + <version>2.1.22</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> - <version>2.1.7</version> + <version>2.1.22</version> </dependency> <dependency> <groupId>junit</groupId> diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java index cac899a96e29d175a17cd2aecb090f45a2c21305..4d72e91e9a23bedf684e0edd86607a4f44de36fa 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitBean.java @@ -25,10 +25,8 @@ import java.util.concurrent.atomic.AtomicLong; import javax.faces.application.Application; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; -import javax.faces.component.UISelectItem; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; -import javax.faces.model.SelectItem; import kieker.analysis.AnalysisController; import kieker.analysis.model.analysisMetaModel.MIDisplayConnector; @@ -50,7 +48,6 @@ import org.primefaces.component.chart.line.LineChart; import org.primefaces.component.chart.metergauge.MeterGaugeChart; import org.primefaces.component.dashboard.Dashboard; import org.primefaces.component.panel.Panel; -import org.primefaces.component.selectcheckboxmenu.SelectCheckboxMenu; import org.primefaces.component.tagcloud.TagCloud; import org.primefaces.model.DashboardColumn; import org.primefaces.model.DashboardModel; @@ -476,6 +473,7 @@ public class CurrentCockpitBean { // Add the corresponding model tagCloudModel = new DefaultTagCloudModel(); tagCloud.setModel(tagCloudModel); + tagCloud.setStyle("width: 100%; Height: 100%;"); component.getChildren().clear(); component.getChildren().add(tagCloud); @@ -485,7 +483,6 @@ public class CurrentCockpitBean { final Object displayObj = this.projectService.getDisplay(this.projectName, this.activeView.getName(), displayConnectorName); final Map<String, AtomicLong> counters = (Map<String, AtomicLong>) new Mirror().on(displayObj).invoke().method("getCounters").withoutArgs(); - System.out.println(counters); tagCloudModel.clear(); for (final Map.Entry<String, AtomicLong> counter : counters.entrySet()) { tagCloudModel.addTag(new DefaultTagCloudItem(counter.getKey(), (int) counter.getValue().get())); @@ -574,60 +571,54 @@ public class CurrentCockpitBean { private void updateXYPlotDisplay(final UIComponent component, final String displayConnectorName) { final boolean isAlreadyCorrectlyInitialized = (component.getChildCount() == 1) && (component.getChildren().get(0) instanceof LineChart); - final LineChartSeries lineChartSeries; - final SelectCheckboxMenu selectCheckboxMenu; + final LineChart lineChart; + final CartesianChartModel linearModel; // Avoid unnecessary component creation. Use the existing components if they are already existing and from the correct type. if (isAlreadyCorrectlyInitialized) { - final LineChart lineChart = (LineChart) component.getChildren().get(0); - lineChartSeries = (LineChartSeries) ((CartesianChartModel) lineChart.getValue()).getSeries().get(0); - selectCheckboxMenu = (SelectCheckboxMenu) component.getChildren().get(1); + lineChart = (LineChart) component.getChildren().get(0); + linearModel = (CartesianChartModel) lineChart.getValue(); } else { final FacesContext facesContext = FacesContext.getCurrentInstance(); final Application application = facesContext.getApplication(); // Create the Primefaces chart component - final LineChart lineChart = (LineChart) application.createComponent(facesContext, "org.primefaces.component.chart.LineChart", + lineChart = (LineChart) application.createComponent(facesContext, "org.primefaces.component.chart.LineChart", "org.primefaces.component.chart.LineChartRenderer"); lineChart.setTitle(displayConnectorName); + lineChart.setLegendPosition("e"); // Add the corresponding model - final CartesianChartModel linearModel = new CartesianChartModel(); - lineChartSeries = new LineChartSeries(); - lineChartSeries.setLabel("Series"); - - linearModel.addSeries(lineChartSeries); + linearModel = new CartesianChartModel(); lineChart.setValue(linearModel); - // Create the Primefaces drop box - selectCheckboxMenu = (SelectCheckboxMenu) application.createComponent(facesContext, "org.primefaces.component.SelectCheckboxMenu", - "org.primefaces.component.SelectCheckboxMenuRenderer"); - component.getChildren().clear(); component.getChildren().add(lineChart); - component.getChildren().add(selectCheckboxMenu); } try { final Object displayObj = this.projectService.getDisplay(this.projectName, this.activeView.getName(), displayConnectorName); final Set<String> keys = (Set<String>) new Mirror().on(displayObj).invoke().method("getKeys").withoutArgs(); - selectCheckboxMenu.getChildren().clear(); - for (final String key : keys) { - final UISelectItem item = new UISelectItem(); - item.setValue(new SelectItem(key)); - selectCheckboxMenu.getChildren().add(item); - } + lineChart.setLegendCols((int) (Math.ceil(keys.size() / 10.0))); + linearModel.clear(); if (keys.isEmpty()) { - lineChartSeries.set(0, 0); + final LineChartSeries series = new LineChartSeries(); + series.set(0, 0); + linearModel.addSeries(series); } else { - final Map<Object, Number> entries = (Map<Object, Number>) new Mirror().on(displayObj).invoke().method("getEntries").withArgs(keys.iterator().next()); + for (final String key : keys) { + final Map<Object, Number> entries = (Map<Object, Number>) new Mirror().on(displayObj).invoke().method("getEntries").withArgs(key); + final LineChartSeries lineChartSeries = new LineChartSeries(); + lineChartSeries.setLabel(key); - if (entries.isEmpty()) { - lineChartSeries.set(0, 0); - } else { - lineChartSeries.setData(entries); + if (entries.isEmpty()) { + lineChartSeries.set(0, 0); + } else { + lineChartSeries.setData(entries); + } + linearModel.addSeries(lineChartSeries); } } } catch (final DisplayNotFoundException ex) { diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml index 720357f19aa0b503e944cea6d8b9ee3d90cd593e..e71dd05d4d8617f1d929f33208557ca26bf3f187 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml @@ -13,7 +13,7 @@ <!-- This parameter determines the current stage of the project. --> <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> - <param-value>Development</param-value> + <param-value>Production</param-value> </context-param> <!-- This parameter makes sure that the primefaces theme chooser will work. --> diff --git a/Kieker.WebGUI/src/main/webapp/pages/CockpitPage.xhtml b/Kieker.WebGUI/src/main/webapp/pages/CockpitPage.xhtml index a82251cd3c32cea4aad9362ce8922ab88752aeee..8180cc7f7e21397eea77d0a7cc125b198364ba20 100644 --- a/Kieker.WebGUI/src/main/webapp/pages/CockpitPage.xhtml +++ b/Kieker.WebGUI/src/main/webapp/pages/CockpitPage.xhtml @@ -15,7 +15,7 @@ <ui:param name="projectName" value="#{currentCockpitBean.projectName}"/> <ui:param name="pagename" value="cockpit"/> <ui:param name="showProjectName" value="true"/> - + <ui:define name="metaData"> <f:metadata> <f:viewParam name="projectName" value="#{currentCockpitBean.projectName}"/> diff --git a/Kieker.WebGUI/src/test/java/kieker/webgui/web/utility/CockpitLayoutTest.java b/Kieker.WebGUI/src/test/java/kieker/webgui/web/utility/CockpitLayoutTest.java index fec1607d8db8d6de30d6ec2798d5204a0ab95de6..bb2ae998188f2a23af6395af39bd3cb656d5d4fd 100644 --- a/Kieker.WebGUI/src/test/java/kieker/webgui/web/utility/CockpitLayoutTest.java +++ b/Kieker.WebGUI/src/test/java/kieker/webgui/web/utility/CockpitLayoutTest.java @@ -367,6 +367,6 @@ public class CockpitLayoutTest { Assert.assertEquals("Invalid layout", displayConnector2, layout1.get(0).get(1)); Assert.assertEquals("Invalid layout", displayConnector3, layout1.get(0).get(2)); Assert.assertEquals("Invalid layout", displayConnector4, layout2.get(0).get(0)); - } + }