diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java index 307cc46b67cb167b9350a15b82a9b52bf16e433a..619566abf2a8752416e83de519b3690418f90500 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ProjectsBean.java @@ -107,7 +107,7 @@ public class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectCreated()); // Update the list of the "calling" bean - currentProjectOverviewBean.updateLists(); + currentProjectOverviewBean.updateAvailableProjects(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while creating the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while creating the project."); @@ -129,7 +129,7 @@ public class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectDeleted()); // Update the list of the "calling" bean - currentProjectOverviewBean.updateLists(); + currentProjectOverviewBean.updateAvailableProjects(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while removing the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while removing the project."); @@ -162,7 +162,7 @@ public class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectCreated()); // Update the list of the "calling" bean - currentProjectOverviewBean.updateLists(); + currentProjectOverviewBean.updateAvailableProjects(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while creating the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while creating the project."); @@ -198,7 +198,7 @@ public class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, "Project imported."); // Update the list of the "calling" bean - currentProjectOverviewBean.updateLists(); + currentProjectOverviewBean.updateAvailableProjects(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while importing the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while importing the project."); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java index b1054eaaa5262649216d332a0e4e619282e6f7cc..33c53437c808aa95455a58dd34f895ac89849340 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentControllerBean.java @@ -17,9 +17,6 @@ package kieker.webgui.web.beans.view; import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -38,7 +35,6 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * /** * The {@link CurrentControllerBean} contains the necessary data behind an instance of the analysis controller. The class is a Spring managed bean with view scope to * make sure that one user (even in one session) can open multiple projects at a time without causing any problems. * @@ -51,11 +47,11 @@ public class CurrentControllerBean { private static final Log LOG = LogFactory.getLog(CurrentControllerBean.class); private final List<String> logEntries = new ArrayList<String>(); + private String projectName; + @Autowired private IProjectService projectService; - private String projectName; - /** * Creates a new instance of this class. <b>Do not use this constructor. This bean is Spring managed.</b> */ @@ -82,10 +78,10 @@ public class CurrentControllerBean { this.projectService.startAnalysis(this.projectName); } catch (final InvalidAnalysisStateException ex) { CurrentControllerBean.LOG.info("The analysis has already been started.", ex); - this.addLogEntry(ex); + this.addLogEntry("The analysis has already been started."); } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); - this.addLogEntry(ex); + this.addLogEntry("The project does not exist."); } } @@ -101,10 +97,10 @@ public class CurrentControllerBean { } } catch (final InvalidAnalysisStateException ex) { CurrentControllerBean.LOG.info("The analysis has not been started yet.", ex); - this.addLogEntry(ex); + this.addLogEntry("The analysis has not been started yet."); } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); - this.addLogEntry(ex); + this.addLogEntry("The project does not exist."); } } @@ -117,16 +113,16 @@ public class CurrentControllerBean { this.projectService.initializeAnalysis(this.projectName, this.projectService.getClassLoader(this.projectName, this)); // NOPMD (ClassLoader) } catch (final InvalidAnalysisStateException ex) { CurrentControllerBean.LOG.error("The analysis has already been instantiated.", ex); - this.addLogEntry(ex); + this.addLogEntry("The analysis has already been instantiated."); } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); - this.addLogEntry(ex); + this.addLogEntry("The project does not exist."); } catch (final IOException ex) { CurrentControllerBean.LOG.info("An error occured during the initialization.", ex); - this.addLogEntry(ex); + this.addLogEntry("An error occured during the initialization."); } catch (final AnalysisInitializationException ex) { CurrentControllerBean.LOG.info("An error occured during the initialization.", ex); - this.addLogEntry(ex); + this.addLogEntry("An error occured during the initialization."); } } @@ -139,10 +135,10 @@ public class CurrentControllerBean { this.projectService.cleanAnalysis(this.projectName); } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); - this.addLogEntry(ex); + this.addLogEntry("The project does not exist."); } catch (final InvalidAnalysisStateException ex) { CurrentControllerBean.LOG.error("The analysis has not been instantiated yet.", ex); - this.addLogEntry(ex); + this.addLogEntry("The analysis has not been instantiated yet."); } } @@ -247,19 +243,6 @@ public class CurrentControllerBean { return this.logEntries; } - /** - * Adds the element to the log. - * - * @param cause - * The element to be added. - */ - private void addLogEntry(final Throwable cause) { - final Writer result = new StringWriter(); - final PrintWriter printWriter = new PrintWriter(result); - cause.printStackTrace(printWriter); - this.addLogEntry(result.toString()); - } - /** * Adds the element (with the current time) to the log. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java index 96f138d5f7d2b68f1b2cfc5b97e3c6f0ba448f97..a1cd3a0adce546c23aa764876d2bba5df91f8247 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentProjectOverviewBean.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.List; import javax.annotation.PostConstruct; +import javax.faces.context.FacesContext; import kieker.webgui.web.beans.application.ProjectsBean; @@ -41,54 +42,56 @@ import org.springframework.stereotype.Component; @Scope("view") public class CurrentProjectOverviewBean { - private List<String> projects = Collections.emptyList(); - private String projectName; + private List<String> availableProjects; + private String selectedProjectName; @Autowired private ProjectsBean projectsBean; /** - * Default constructor. <b>Do not call this constructor manually. It will only be accessed by Spring.</b> + * Creates a new instance of this class. <b>Do not use this constructor. This bean is Spring managed.</b> */ public CurrentProjectOverviewBean() { - // No code necessary + this.availableProjects = Collections.emptyList(); } /** - * This method should only be called automatically by Spring to update the projects list. + * This method initializes the bean. <b>Do not call this method manually. It will only be accessed by Spring.</b> */ @PostConstruct protected void initialialize() { - this.updateLists(); + // Make sure that the initialization will only be done for the init request. + if (!FacesContext.getCurrentInstance().isPostback()) { + this.updateAvailableProjects(); + } } /** - * This is the event listener used to select a row instantaneously. + * This is the event handler used to select a row instantaneously. * * @param event * The select event. */ - public void onRowSelect(final SelectEvent event) { + public void rowSelectHandler(final SelectEvent event) { this.setProjectName((String) event.getObject()); } /** - * Updates the list containing the available projects name. + * Updates the list with the available availableProjects. */ - public void updateLists() { - this.projects = this.projectsBean.getProjects(); + public void updateAvailableProjects() { + this.availableProjects = this.projectsBean.getProjects(); } - public String getProjectName() { - return this.projectName; + public List<String> getProjects() { + return this.availableProjects; } - public void setProjectName(final String projectName) { - this.projectName = projectName; + public String getProjectName() { + return this.selectedProjectName; } - public List<String> getProjects() { - return this.projects; + public void setProjectName(final String projectName) { + this.selectedProjectName = projectName; } - } diff --git a/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css b/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css index 03bb3631661a3c2107c4c280efcb29ad6c7410fa..ddd37537549625c94d29f7b710093b15892a5e90 100644 --- a/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css @@ -1 +1,14 @@ -@charset "UTF-8"; \ No newline at end of file +@charset "UTF-8"; + +/* This is necessary to remove the border from the datalist */ +.ui-datalist * { + border : 0px !important; +} + +.col1 { + width: 50% !important; +} + +.col2 { + width: 50% !important; +} \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml index fe1a2d7202d54997ed85d9e0195e323c8591bcf6..57ea0dc808eb828f80dbe9beb5e115eb2922ea1d 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml @@ -26,7 +26,7 @@ <p:tab title="#{localizedMessages.analysisEditor}"> <h:panelGrid columns="2" cellpadding="10" columnClasses="rightAlignedColumn, normalColumn"> <h:outputText value="#{localizedMessages.toolPalette}:"/> - <p:selectOneMenu style="width: 100%"> + <p:selectOneMenu style="width: 100%" disabled="true"> <f:selectItem itemLabel="#{localizedMessages.lists}"/> </p:selectOneMenu> diff --git a/Kieker.WebGUI/src/main/webapp/pages/ControllerPage.xhtml b/Kieker.WebGUI/src/main/webapp/pages/ControllerPage.xhtml index f1ec74599d4e120a1495f740b758a784393eb098..2561ee44419a95601ad335ba83369a0707aef63a 100644 --- a/Kieker.WebGUI/src/main/webapp/pages/ControllerPage.xhtml +++ b/Kieker.WebGUI/src/main/webapp/pages/ControllerPage.xhtml @@ -42,22 +42,25 @@ <ui:define name="centerContent"> - <p:tabView id="tabView" style="height: 99%" > - <p:tab title="#{localizedControllerPageMessages.personalLog}" > - <h:form id="currentViewLog"> - <ui:repeat value="#{currentControllerBean.viewLog}" var="entry" varStatus="stat"> - <h:outputText value="#{entry}"/><ui:fragment rendered="#{not stat.last}"><br/><br/></ui:fragment> - </ui:repeat> + <h:panelGrid columns="2" columnClasses="col1 , col2" cellpadding="5" style="width: 99%; height: 100%"> + + <p:panel style="width: 100%; height:100%" header="#{localizedControllerPageMessages.personalLog}" > + <h:form id="currentViewLog" style="width: 100%"> + <p:dataList value="#{currentControllerBean.viewLog}" var="logEntry"> + #{logEntry} + </p:dataList> </h:form> - </p:tab> - <p:tab title="#{localizedControllerPageMessages.analysisControllerLog}"> - <h:form id="analysisControllerLog"> - <ui:repeat value="#{currentControllerBean.analysisLog}" var="entry" varStatus="stat"> - <h:outputText value="#{entry}"/><ui:fragment rendered="#{not stat.last}"><br/><br/></ui:fragment> - </ui:repeat> + </p:panel> + + <p:panel style="width: 100%; height:100%" header="#{localizedControllerPageMessages.analysisControllerLog}" collapsed="true"> + <h:form id="analysisControllerLog" style="width: 100%"> + <p:dataList value="#{currentControllerBean.analysisLog}" var="logEntry"> + #{logEntry} + </p:dataList> </h:form> - </p:tab> - </p:tabView> + </p:panel> + </h:panelGrid> + </ui:define> <ui:define name="furtherLayoutUnits"> @@ -66,16 +69,16 @@ <h:form id="controllerForm"> <div align="center"> <h:panelGrid columns="4" cellpadding="15"> - <p:commandButton value="#{localizedControllerPageMessages.analysisControllerInstantiateAnalysisController}" action="#{currentControllerBean.instantiateAnalysis()}" update=":messages :tabView:currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> + <p:commandButton value="#{localizedControllerPageMessages.analysisControllerInstantiateAnalysisController}" action="#{currentControllerBean.instantiateAnalysis()}" update=":messages :currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> - <p:commandButton value="#{localizedControllerPageMessages.analysisControllerCleaAnalysisController}" action="#{currentControllerBean.cleanAnalysis()}" update=":messages :tabView:currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> + <p:commandButton value="#{localizedControllerPageMessages.analysisControllerCleaAnalysisController}" action="#{currentControllerBean.cleanAnalysis()}" update=":messages :currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> - <p:commandButton value="#{localizedControllerPageMessages.analysisControllerStartAnalysis}" action="#{currentControllerBean.startAnalysis()}" update=":messages :tabView:currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> + <p:commandButton value="#{localizedControllerPageMessages.analysisControllerStartAnalysis}" action="#{currentControllerBean.startAnalysis()}" update=":messages :currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> - <p:commandButton value="#{localizedControllerPageMessages.analysisControllerStopAnalysis}" action="#{currentControllerBean.stopAnalysis()}" update=":messages :tabView:currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> + <p:commandButton value="#{localizedControllerPageMessages.analysisControllerStopAnalysis}" action="#{currentControllerBean.stopAnalysis()}" update=":messages :currentViewLog" disabled="#{empty currentControllerBean.projectName}"/> </h:panelGrid> - <p:poll interval="1" update=":ledsForm :tabView:analysisControllerLog"/> + <p:poll interval="1" update=":ledsForm :analysisControllerLog"/> </div> </h:form> </p:layoutUnit> diff --git a/Kieker.WebGUI/src/main/webapp/pages/ProjectOverviewPage.xhtml b/Kieker.WebGUI/src/main/webapp/pages/ProjectOverviewPage.xhtml index 2715d9dc26fd71ce2b54da3d7a98806544422a67..fe10ce65233cba6e9574835cc695637cfa3c8466 100644 --- a/Kieker.WebGUI/src/main/webapp/pages/ProjectOverviewPage.xhtml +++ b/Kieker.WebGUI/src/main/webapp/pages/ProjectOverviewPage.xhtml @@ -33,7 +33,7 @@ <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-importProject" value=" #{localizedProjectOverviewMessages.importProject}" onclick="importProjectDialog.show()" ajax="true"/> <p:separator/> </c:if> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-reload" value=" #{localizedProjectOverviewMessages.refreshProjectsList}" update=":projectsListForm" action="#{currentProjectOverviewBean.updateLists()}" ajax="true"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-reload" value=" #{localizedProjectOverviewMessages.refreshProjectsList}" update=":projectsListForm" action="#{currentProjectOverviewBean.updateAvailableProjects()}" ajax="true"/> <p:separator/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-settings" value=" #{localizedMessages.settings}" onclick="settingsDlg.show()" ajax="true"/> </p:submenu> @@ -43,7 +43,7 @@ <h:form id="projectsListForm"> <p:dataTable emptyMessage="#{localizedMessages.noRecordsFound}" rows="15" paginator="true" paginatorPosition="both" var="project" rowsPerPageTemplate="5,10,15,25,50" value="#{currentProjectOverviewBean.projects}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" selection="#{currentProjectOverviewBean.projectName}" rowKey="#{project}" selectionMode="single"> <!-- Makes sure that rows are selected instantaneously. --> - <p:ajax event="rowSelect" listener="#{currentProjectOverviewBean.onRowSelect}" update=":menuForm" /> + <p:ajax event="rowSelect" listener="#{currentProjectOverviewBean.rowSelectHandler}" update=":menuForm" /> <p:column headerText="#{localizedProjectOverviewMessages.projectName}" id="modelHeader" sortBy="#{project}"> <p:commandLink id="dynaButton" value="#{project}"/>