Skip to content
Snippets Groups Projects
Commit c6d9d226 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Added some comments; Continued with the dashboard issue; Advanced the...

Added some comments; Continued with the dashboard issue; Advanced the EnvironmentLoaderListener; Solved a logging issue
parent 8f83c1dc
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ import kieker.common.logging.LogFactory; ...@@ -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 * 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 * 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> * 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. * It is application-scoped as only one instance of this class is necessary.
* *
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
......
...@@ -31,7 +31,7 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; ...@@ -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> * 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 * @author Nils Christian Ehmke
*/ */
......
...@@ -26,7 +26,8 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; ...@@ -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 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 * @author Nils Christian Ehmke
*/ */
......
...@@ -85,10 +85,14 @@ public final class CurrentCockpitEditorBean { ...@@ -85,10 +85,14 @@ public final class CurrentCockpitEditorBean {
private MIView activeView; private MIView activeView;
private ClassLoader classLoader; private ClassLoader classLoader;
private Dashboard dashboard; private Dashboard dashboard;
private DashboardModel dashboardModel;
@ManagedProperty(value = "#{projectsBean}") @ManagedProperty(value = "#{projectsBean}")
private ProjectsBean 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> * 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 { ...@@ -105,12 +109,12 @@ public final class CurrentCockpitEditorBean {
this.dashboard.setId("dashboard"); this.dashboard.setId("dashboard");
// Create the model and add the columns // 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++) { for (int i = 0; i < CurrentCockpitEditorBean.NUMBER_COLUMNS; i++) {
final DashboardColumn column = new DefaultDashboardColumn(); final DashboardColumn column = new DefaultDashboardColumn();
model.addColumn(column); this.dashboardModel.addColumn(column);
} }
this.dashboard.setModel(model); this.dashboard.setModel(this.dashboardModel);
} }
private void fillDashboard() { private void fillDashboard() {
...@@ -310,7 +314,7 @@ public final class CurrentCockpitEditorBean { ...@@ -310,7 +314,7 @@ public final class CurrentCockpitEditorBean {
synchronized (this) { synchronized (this) {
try { try {
this.projectManagerFacade.saveProject(this.projectName, this.project, this.timeStamp, overwriteNewerProject); 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! // Update the time stamp!
this.resetTimeStamp(); this.resetTimeStamp();
} catch (final IOException ex) { } catch (final IOException ex) {
...@@ -432,7 +436,7 @@ public final class CurrentCockpitEditorBean { ...@@ -432,7 +436,7 @@ public final class CurrentCockpitEditorBean {
panel.setToggleable(false); panel.setToggleable(false);
this.getDashboard().getChildren().add(panel); 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()); column.addWidget(panel.getId());
final HtmlOutputText text = new HtmlOutputText(); final HtmlOutputText text = new HtmlOutputText();
text.setValue("N/A"); text.setValue("N/A");
...@@ -505,6 +509,26 @@ public final class CurrentCockpitEditorBean { ...@@ -505,6 +509,26 @@ public final class CurrentCockpitEditorBean {
public void setDashboard(final Dashboard dashboard) { public void setDashboard(final Dashboard dashboard) {
this.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;
} }
} }
...@@ -19,6 +19,9 @@ package kieker.webgui.common; ...@@ -19,6 +19,9 @@ package kieker.webgui.common;
import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener; 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 * 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. * environment properties for the webgui.
...@@ -27,6 +30,8 @@ import javax.servlet.ServletContextListener; ...@@ -27,6 +30,8 @@ import javax.servlet.ServletContextListener;
*/ */
public class EnvironmentLoaderListener implements 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> * 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 { ...@@ -41,8 +46,16 @@ public class EnvironmentLoaderListener implements ServletContextListener {
@Override @Override
public void contextInitialized(final ServletContextEvent event) { 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 // Set the system property to make sure that the webgui logger will be used
System.setProperty("kieker.common.logging.Log", "WEBGUI"); 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));
} }
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# FATAL, ERROR, WARN, INFO, DEBUG # FATAL, ERROR, WARN, INFO, DEBUG
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
log4j.rootCategory=WARN, S log4j.rootCategory=INFO, S
log4j.logger.com.dappit.Dapper.parser=ERROR log4j.logger.com.dappit.Dapper.parser=ERROR
log4j.logger.org.w3c.tidy=FATAL log4j.logger.org.w3c.tidy=FATAL
......
...@@ -33,42 +33,43 @@ ...@@ -33,42 +33,43 @@
<p:toolbarGroup align="right"> <p:toolbarGroup align="right">
<p:button styleClass="perspective-button" icon="ui-icon-home" outcome="projectOverview" /> <p:button styleClass="perspective-button" icon="ui-icon-home" outcome="projectOverview" />
<p:separator/> <p:separator/>
<p:button styleClass="perspective-button" icon="ui-icon-analysisEditor" value="#{localizedMessages.analysisEditor}" style="white-space: none" outcome="analysisEditor" > <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}"/> <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
</p:button> </p:button>
<p:button styleClass="perspective-button" icon="ui-icon-analysis" value="#{localizedMessages.analysis}" style="white-space: none" outcome="controller"> <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}"/> <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
</p:button> </p:button>
<p:separator/> <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"> <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}"/> <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
</p:button> </p:button>
</p:toolbarGroup> </p:toolbarGroup>
</p:toolbar> </p:toolbar>
<p:menubar>
<p:submenu label="File"> <!-- The following is the main menu. -->
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-document" value=" New View" onclick="newViewDialog.show()" ajax="true"/> <p:menubar>
<p:separator/> <p:submenu label="#{localizedMessages.file}">
<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-newProject" value=" Neues View" update=":messages" ajax="true" onclick="newViewDialog.show();" 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}"/>
<p:separator /> <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: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:separator/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-saveAs" value=" #{localizedMessages.saveProjectAs}" update=":messages" ajax="true" disabled="#{true or empty currentCockpitEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-gear" value=" Settings" onclick="settingsDlg.show()" ajax="true"/> <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: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>
<p:submenu label="Help"> <p:submenu label="#{localizedMessages.help}">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-help" value=" User Guide" ajax="true" disabled="true"/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-userGuide" value=" #{localizedMessages.userGuide}" ajax="true" disabled="true"/>
<p:separator/> <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:submenu>
<p:menuitem styleClass="logOutButton" icon="ui-icon-power" value="#{userBean.userName}" ajax="true" url="login"/> <p:menuitem styleClass="logOutButton element-with-whitespace" icon="ui-icon-logout" value=" #{userBean.userName}" ajax="true" url="login"/>
</p:menubar> </p:menubar>
</h:form> </h:form>
</p:layoutUnit> </p:layoutUnit>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment