diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java index d1e559b43b895366646706ce12e2b270d91a2e80..69d6897ea82e83374325c970e71df6e14e66a2fd 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java @@ -34,6 +34,7 @@ import kieker.common.logging.LogFactory; * The class {@link GlobalPropertiesBean} is an application-scoped JSF bean, containing properties, constants and partially localized texts for the application. It * reads them from properties files and ressource bundles, making sure that those constants can be modified without a necessary recompiling of the whole * application.<br> + * It implements the {@link Serializable} interface to make sure that some session scoped beans can use this class.<br> * It is application-scoped as only one instance of this class is necessary. * * @author Nils Christian Ehmke diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java index b8afffb8a68273c727f4a613a2b593b794631cb4..f2c849497c35136ae34fa2aa8d0a2ebca649d954 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java @@ -31,7 +31,7 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; /** * The class {@link CurrentConfigurationBean} is a session-scoped JSF bean, containing the properties and configurations of the current (session) user.<br> - * It is session-scoped as only one instance per user is necessary. + * It is session-scoped as only one instance per user is necessary. This means also that is has to implement the {@link Serializable} interface. * * @author Nils Christian Ehmke */ diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index 29e93e85d8b48d0328a43d388d966148ac08b66b..b242dd68d94af7f790708d751829a1d4830f3519 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -26,7 +26,8 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; /** * This bean contains information about the user of this session (like user name and authorization). It provides methods to perform a login into the application.<br> - * This class is a JSF managed bean with session scope. This means also that it is possible to login the same user multiple times. + * This class is a JSF managed bean with session scope. This means also that it is possible to login the same user multiple times and that is has to implement the + * {@link Serializable} interface. * * @author Nils Christian Ehmke */ diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java index 40e78198a12854598d1b4ca699e84f9e7007d8b5..10028d2804638e708fe0b1df8b80942fdf442eef 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java @@ -85,10 +85,14 @@ public final class CurrentCockpitEditorBean { private MIView activeView; private ClassLoader classLoader; private Dashboard dashboard; + private DashboardModel dashboardModel; @ManagedProperty(value = "#{projectsBean}") private ProjectsBean projectsBean; + @ManagedProperty(value = "#{globalPropertiesBean}") + private GlobalPropertiesBean globalPropertiesBean; + /** * Creates a new instance of this class. <b>Do not call this constructor manually. It will only be accessed by JSF.</b> */ @@ -105,12 +109,12 @@ public final class CurrentCockpitEditorBean { this.dashboard.setId("dashboard"); // Create the model and add the columns - final DashboardModel model = new DefaultDashboardModel(); + this.dashboardModel = new DefaultDashboardModel(); for (int i = 0; i < CurrentCockpitEditorBean.NUMBER_COLUMNS; i++) { final DashboardColumn column = new DefaultDashboardColumn(); - model.addColumn(column); + this.dashboardModel.addColumn(column); } - this.dashboard.setModel(model); + this.dashboard.setModel(this.dashboardModel); } private void fillDashboard() { @@ -310,7 +314,7 @@ public final class CurrentCockpitEditorBean { synchronized (this) { try { this.projectManagerFacade.saveProject(this.projectName, this.project, this.timeStamp, overwriteNewerProject); - GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, "Project saved."); + GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectSaved()); // Update the time stamp! this.resetTimeStamp(); } catch (final IOException ex) { @@ -432,7 +436,7 @@ public final class CurrentCockpitEditorBean { panel.setToggleable(false); this.getDashboard().getChildren().add(panel); - final DashboardColumn column = this.dashboard.getModel().getColumn(CurrentCockpitEditorBean.NUMBER_COLUMNS - 1); + final DashboardColumn column = this.dashboardModel.getColumn(CurrentCockpitEditorBean.NUMBER_COLUMNS - 1); column.addWidget(panel.getId()); final HtmlOutputText text = new HtmlOutputText(); text.setValue("N/A"); @@ -505,6 +509,26 @@ public final class CurrentCockpitEditorBean { public void setDashboard(final Dashboard dashboard) { this.dashboard = dashboard; + this.dashboard.setModel(this.dashboardModel); + } + + /** + * The getter for the property {@link CurrentCockpitEditorBean#globalPropertiesBean}. + * + * @return The current value of the property. + */ + public GlobalPropertiesBean getGlobalPropertiesBean() { + return this.globalPropertiesBean; + } + + /** + * The setter for the property {@link CurrentCockpitEditorBean#globalPropertiesBean}. + * + * @param globalPropertiesBean + * The new value of the property. + */ + public void setGlobalPropertiesBean(final GlobalPropertiesBean globalPropertiesBean) { + this.globalPropertiesBean = globalPropertiesBean; } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java index 8ad0da88452ccfe8cff6bdc13645da5c928d3c9b..77ace76e3e418d60222ce94ea1bd0909257b315a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java @@ -19,6 +19,9 @@ package kieker.webgui.common; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; +import kieker.common.logging.Log; +import kieker.common.logging.LogFactory; + /** * The {@link EnvironmentLoaderListener} is a context listener, which will be activated during the initialization of the application. It is used to initialize some * environment properties for the webgui. @@ -27,6 +30,8 @@ import javax.servlet.ServletContextListener; */ public class EnvironmentLoaderListener implements ServletContextListener { + private static final Log LOG = LogFactory.getLog(EnvironmentLoaderListener.class); + /** * Creates a new instance of this class. <b>Do not call this constructor manually. It will only be accessed by the servlet container.</b> */ @@ -41,8 +46,16 @@ public class EnvironmentLoaderListener implements ServletContextListener { @Override public void contextInitialized(final ServletContextEvent event) { + // Before setting the logging property, use the log factory to make sure that the log entries of the WebGUI itself will be shown in the terminal + EnvironmentLoaderListener.LOG.info("Starting Kieker.WebGUI environment initialization."); + final long tin = System.currentTimeMillis(); + // Set the system property to make sure that the webgui logger will be used System.setProperty("kieker.common.logging.Log", "WEBGUI"); + + final long tout = System.currentTimeMillis(); + + EnvironmentLoaderListener.LOG.info(String.format("Kieker.WebGUI environment initialized in %d ms.", tout - tin)); } } diff --git a/Kieker.WebGUI/src/main/resources/log4j.properties b/Kieker.WebGUI/src/main/resources/log4j.properties index d0a89e6f6777f99eb4660ef3894cd8055c678e96..2c271ba16f9479b1fb05c569dac1ff68f6ac4d28 100644 --- a/Kieker.WebGUI/src/main/resources/log4j.properties +++ b/Kieker.WebGUI/src/main/resources/log4j.properties @@ -17,7 +17,7 @@ # FATAL, ERROR, WARN, INFO, DEBUG # #------------------------------------------------------------------------------ -log4j.rootCategory=WARN, S +log4j.rootCategory=INFO, S log4j.logger.com.dappit.Dapper.parser=ERROR log4j.logger.org.w3c.tidy=FATAL diff --git a/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml b/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml index c6b6908f4f36901a28fe2078ca932d2931a4e453..d54c29bdca57313f54378881192c5b7d9a1b2e88 100644 --- a/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml +++ b/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml @@ -33,42 +33,43 @@ <p:toolbarGroup align="right"> <p:button styleClass="perspective-button" icon="ui-icon-home" outcome="projectOverview" /> <p:separator/> - <p:button styleClass="perspective-button" icon="ui-icon-analysisEditor" value="#{localizedMessages.analysisEditor}" style="white-space: none" outcome="analysisEditor" > - <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/> + <p:button styleClass="perspective-button" icon="ui-icon-analysisEditor" value="#{localizedMessages.analysisEditor}" style="white-space: none" disabled="true"> + <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/> </p:button> <p:button styleClass="perspective-button" icon="ui-icon-analysis" value="#{localizedMessages.analysis}" style="white-space: none" outcome="controller"> <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/> </p:button> <p:separator/> - <p:button styleClass="perspective-button" icon="ui-icon-cockpitEditor" value="#{localizedMessages.cockpitEditor}" style="white-space: none" disabled="true"/> + <p:button styleClass="perspective-button" icon="ui-icon-cockpitEditor" value="#{localizedMessages.cockpitEditor}" style="white-space: none" outcome="cockpitEditor" disabled="true"/> <p:button styleClass="perspective-button" icon="ui-icon-cockpit" value="#{localizedMessages.cockpit}" style="white-space: none" outcome="cockpit"> <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/> </p:button> </p:toolbarGroup> </p:toolbar> - <p:menubar> - <p:submenu label="File"> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-document" value=" New View" onclick="newViewDialog.show()" ajax="true"/> - <p:separator/> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project" update=":messages" ajax="true" action="#{currentCockpitEditorBean.saveProject(false)}" disabled="#{empty currentCockpitEditorBean.project}"/> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{true or empty currentCockpitEditorBean.project}"/> + + <!-- The following is the main menu. --> + <p:menubar> + <p:submenu label="#{localizedMessages.file}"> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-newProject" value=" Neues View" update=":messages" ajax="true" onclick="newViewDialog.show();" disabled="#{empty currentCockpitEditorBean.project}"/> <p:separator /> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="false" url="cockpitEditor?projectName=#{currentCockpitEditorBean.projectName}" disabled="#{empty currentCockpitEditorBean.project}" /> - <p:separator/> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-gear" value=" Settings" onclick="settingsDlg.show()" ajax="true"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-save" value=" #{localizedMessages.saveProject}" update=":messages" ajax="true" action="#{currentCockpitEditorBean.saveProject(false)}" disabled="#{empty currentCockpitEditorBean.project}"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-saveAs" value=" #{localizedMessages.saveProjectAs}" update=":messages" ajax="true" disabled="#{true or empty currentCockpitEditorBean.project}"/> + <p:separator /> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-reload" value=" #{localizedMessages.reloadProject}" ajax="false" url="cockpitEditor?projectName=#{currentCockpitEditorBean.projectName}" disabled="#{empty currentCockpitEditorBean.project}" /> <p:separator/> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-circle-close" value=" Close Project" action="ProjectOverview.xhtml" ajax="false"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-settings" value=" #{localizedMessages.settings}" onclick="settingsDlg.show()" ajax="true"/> + <p:separator /> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-close" value=" #{localizedMessages.closeProject}" action="ProjectOverviewPage.xhtml?faces-redirect=true" ajax="false"/> </p:submenu> - <p:submenu label="Help"> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-help" value=" User Guide" ajax="true" disabled="true"/> + <p:submenu label="#{localizedMessages.help}"> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-userGuide" value=" #{localizedMessages.userGuide}" ajax="true" disabled="true"/> <p:separator/> - <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-comment" value=" About..." onclick="aboutDlg.show()" ajax="true"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-about" value=" #{localizedMessages.about}" onclick="aboutDlg.show()" ajax="true"/> </p:submenu> - <p:menuitem styleClass="logOutButton" icon="ui-icon-power" value="#{userBean.userName}" ajax="true" url="login"/> - </p:menubar> - + <p:menuitem styleClass="logOutButton element-with-whitespace" icon="ui-icon-logout" value=" #{userBean.userName}" ajax="true" url="login"/> + </p:menubar> </h:form> </p:layoutUnit>