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

Added synchronizations within session-beans; Repositories can now be removed;...

Added synchronizations within session-beans; Repositories can now be removed; Corrected some hash map bugs within CurrentWorkSpaceProjectBean; Made sure that the converters deliver a valid string in case of null; Renamed some xhtml-components; Started with the AnalysisViewWorkSpace
parent 2872596e
No related branches found
No related tags found
No related merge requests found
Showing
with 428 additions and 203 deletions
......@@ -28,6 +28,8 @@ import javax.faces.context.FacesContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import kieker.webgui.beans.application.ThemeSwitcherBean;
/**
* This bean can be used for a single session of a user and stores the currently used theme (look and feel) for this user. Currently the default value being used is
* the "glass-x"-theme, if none other value can be find within the
......@@ -97,15 +99,17 @@ public final class CurrentThemeBean {
* The new theme to be stored within this instance.
*/
public final void setTheme(final String theme) {
this.theme = theme;
synchronized (this) {
this.theme = theme;
// Set the theme cookie.
final Cookie cookie = new Cookie(CurrentThemeBean.KEY_COOKIE_THEME, theme);
// Try to save it for a year (maximum age)
cookie.setMaxAge(60 * 60 * 24 * 365);
// Set the theme cookie.
final Cookie cookie = new Cookie(CurrentThemeBean.KEY_COOKIE_THEME, theme);
// Try to save it for a year (maximum age)
cookie.setMaxAge(60 * 60 * 24 * 365);
// Deliver the cookie
final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addCookie(cookie);
// Deliver the cookie
final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addCookie(cookie);
}
}
}
......@@ -21,10 +21,13 @@
package kieker.webgui.common;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import kieker.analysis.AnalysisController;
import kieker.analysis.AnalysisController.STATE;
import kieker.analysis.display.AbstractDisplay;
import kieker.analysis.exception.AnalysisConfigurationException;
import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.webgui.common.exception.AnalysisNotInstantiatedException;
......@@ -225,4 +228,56 @@ public final class ACManager {
return controllerState;
}
/**
* This method delivers the current displays of the given project. They can be used to show the stored information but should <b>not</b> be modified.
*
* @param projectName
* The name of the project whose displays should be delivered.
* @return A list of pairs containing the displays and the name of them.
*/
public List<Pair<String, AbstractDisplay>> getCurrentDisplays(final String projectName) {
final List<Pair<String, AbstractDisplay>> result = new ArrayList<Pair<String, AbstractDisplay>>();
return result;
}
/**
* This helper thread is used to update the available displays of the ACManager at regular intervals. <b>Important:</b> If the interrupt-method of the thread is
* being called, it will be terminated.
*
* @author Nils Christian Ehmke
* @version 1.0
*/
@SuppressWarnings("unused")
private class DisplayUpdateThread extends Thread {
/**
* This is the time the thread waits between the updates.
*/
private static final long SLEEP_TIME_MS = 2 * 1000;
/**
* Default constructor.
*/
public DisplayUpdateThread() {
// No code necessary
}
@Override
public void run() {
// Run until we have been interrupted
while (!Thread.interrupted()) {
// TODO Implement
// Wait a little bit.
try {
Thread.sleep(DisplayUpdateThread.SLEEP_TIME_MS);
} catch (final InterruptedException ex) {
// We have been interrupted. Exit the thread
return;
}
}
}
}
}
......@@ -299,7 +299,7 @@ public final class FSManager {
* @param projectName
* The name of the project to be removed.
*/
private void deleteProject(final String projectName) {
public void deleteProject(final String projectName) {
// TODO Delete
}
......@@ -315,7 +315,7 @@ public final class FSManager {
* @throws IOException
* If something goes wrong during the copy procedure.
*/
private void copyProject(final String projectName, final String newName) throws ProjectAlreadyExistingException, IOException {
public void copyProject(final String projectName, final String newName) throws ProjectAlreadyExistingException, IOException {
if (projectName.equals(newName)) {
throw new ProjectAlreadyExistingException("A project with the name '" + newName + "' exists already.");
}
......
......@@ -60,6 +60,10 @@ public class MIPluginStringConverter implements Converter {
@Override
public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) {
return o.toString();
if (o == null) {
return "";
} else {
return o.toString();
}
}
}
......@@ -60,6 +60,10 @@ public class MIPortStringConverter implements Converter {
@Override
public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) {
return o.toString();
if (o == null) {
return "";
} else {
return o.toString();
}
}
}
......@@ -60,6 +60,10 @@ public class MIRepositoryStringConverter implements Converter {
@Override
public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) {
return o.toString();
if (o == null) {
return "";
} else {
return o.toString();
}
}
}
......@@ -24,13 +24,13 @@
<p:submenu label="File">
<p:menuitem value="Close Cockpit" action="#{currentAnalysisCockpitProjectBean.clearProject()}" ajax="false"/>
<p:separator/>
<p:menuitem value="Settings" onclick="settingsDialog.show()" ajax="true"/>
<p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/>
</p:submenu>
<p:submenu label="Help">
<p:menuitem value="User Guide" ajax="true"/>
<p:separator/>
<p:menuitem value="About..." onclick="aboutDialog.show()" ajax="true"/>
<p:menuitem value="About..." onclick="aboutDlg.show()" ajax="true"/>
</p:submenu>
<p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/>
......
......@@ -24,13 +24,13 @@
<p:submenu label="File">
<p:menuitem value="Close Controller" action="#{currentAnalysisControllerProjectBean.clearProject()}" ajax="false"/>
<p:separator/>
<p:menuitem value="Settings" onclick="settingsDialog.show()" ajax="true"/>
<p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/>
</p:submenu>
<p:submenu label="Help">
<p:menuitem value="User Guide" ajax="true"/>
<p:separator/>
<p:menuitem value="About..." onclick="aboutDialog.show()" ajax="true"/>
<p:menuitem value="About..." onclick="aboutDlg.show()" ajax="true"/>
</p:submenu>
<p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/>
......
......@@ -9,10 +9,90 @@
<h:head>
<title>Kieker.WebGUI</title>
<link rel="stylesheet" type="text/css" href="../css/Common.css" />
<link rel="stylesheet" type="text/css" href="../css/AnalysisViewWorkSpace.css" />
</h:head>
<h:body>
<p:layout id="layout" fullPage="true">
<p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI">
<h:form>
<p:menubar>
<p:submenu label="File">
<p:menuitem value="Save Project" update=":messages" ajax="true" action="#{currentWorkSpaceProjectBean.saveProject(false)}" disabled="#{empty currentWorkSpaceProjectBean.project}"/>
<p:menuitem value="Save Project As" update=":messages" ajax="true" disabled="#{empty currentWorkSpaceProjectBean.project}"/>
<p:menuitem styleClass="Force-Save-Project-Button" value="Force Save Project" update=":messages" ajax="true" action="#{currentWorkSpaceProjectBean.saveProject(true)}" disabled="#{empty currentWorkSpaceProjectBean.project}"/>
<p:separator/>
<p:menuitem value="Reset Project" ajax="true" disabled="#{empty currentWorkSpaceProjectBean.project}"/>
<p:separator/>
<p:menuitem value="New View" ajax="true"/>
<p:separator/>
<p:menuitem value="Close Project" action="#{currentWorkSpaceProjectBean.clearProject()}" ajax="false"/>
<p:separator/>
<p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/>
</p:submenu>
<p:submenu label="Help">
<p:menuitem value="User Guide" ajax="true"/>
<p:separator/>
<p:menuitem value="About..." onclick="aboutDlg.show()" ajax="true"/>
</p:submenu>
<p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/>
</p:menubar>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="west">
<p:accordionPanel>
<p:tab title="Plugin 001">
<p:panel id="display001" header="Display 001">
</p:panel>
<p:draggable helper="clone" revert="true" for="display001"/>
<br/>
<p:panel header="Display 002">
</p:panel>
</p:tab>
<p:tab title="Plugin 002">
<p:panel header="Display 001">
</p:panel>
<br/>
<p:panel header="Display 002">
</p:panel>
</p:tab>
</p:accordionPanel>
</p:layoutUnit>
<p:layoutUnit position="center">
<p:accordionPanel>
<p:tab title="View 1">
<p:dashboard>
</p:dashboard>
</p:tab>
<p:tab title="View 2">
<p:dashboard>
</p:dashboard>
</p:tab>
</p:accordionPanel>
</p:layoutUnit>
</p:layout>
<!-- Include the dialog for the configuration. -->
<ui:include src="dialogs/settingsDialog.xhtml" />
<!-- Include the about-dialog. -->
<ui:include src="dialogs/aboutDialog.xhtml" />
</h:body>
</html>
\ No newline at end of file
......@@ -14,7 +14,6 @@
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" header="Kieker.WebGUI">
<h:form id="menubarForm">
......@@ -25,13 +24,13 @@
<p:separator/>
<p:menuitem value="Refresh Projects List" update=":projectsListForm" ajax="true"/>
<p:separator/>
<p:menuitem value="Settings" onclick="settingsDialog.show()" ajax="true"/>
<p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/>
</p:submenu>
<p:submenu label="Help">
<p:menuitem value="User Guide" ajax="true"/>
<p:separator/>
<p:menuitem value="About..." onclick="aboutDialog.show()" ajax="true"/>
<p:menuitem value="About..." onclick="aboutDlg.show()" ajax="true"/>
</p:submenu>
<p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/>
......@@ -53,19 +52,19 @@
<p:column headerText="Last Modification" sortBy="#{projectsBean.getCurrTimeStamp(project)}" style="text-align: center">
<h:outputText value="#{projectsBean.getCurrTimeStamp(project)}" />
</p:column>
<p:column headerText="Analysis" style="text-align: center" sortBy="#{projectsBean.getAnalysisControllerState(project)}">
<h:outputText value="#{projectsBean.getAnalysisControllerState(project)}"/>
</p:column>
<p:column headerText="Options" style="text-align: center; width: 280px">
<p:column headerText="Options" style="text-align: center; width: 310px">
<p:commandButton id="openButton" ajax="false" action="#{currentWorkSpaceProjectBean.setProject(projectsBean.openProject(project), project)}" icon="ui-icon-folder-open"/>
<p:commandButton id="copyButton" icon="ui-icon-copy" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="copyProjectDialog.show()"/>
<p:commandButton id="renameButton" icon="ui-icon-pencil" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="renameProjectDialog.show()"/>
<p:commandButton id="deleteButton" icon="ui-icon-trash" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="deleteProjectDialog.show()"/>
<p:spacer height="0" width="10"/>
<p:commandButton id="controlAnalysis" ajax="false" action="#{currentAnalysisControllerProjectBean.setProject(project)}" icon="ui-icon-wrench"/>
<p:commandButton id="editAnalysisViews" icon="ui-icon-pencil"/>
<p:commandButton id="editAnalysisViews" ajax="false" action="#{currentAnalysisViewWorkSpaceProjectBean.setProject(project)}" icon="ui-icon-pencil" />
<p:commandButton id="showAnalysis" ajax="false" action="#{currentAnalysisCockpitProjectBean.setProject(project)}" icon="ui-icon-search"/>
<p:tooltip for="deleteButton" value="Delete Project"/>
......@@ -84,13 +83,12 @@
<p:growl id="messages" life="1500" showDetail="true" autoUpdate="false" sticky="false"/>
<!-- Include the dialogs for the project managment. -->
<!-- Include the about-dialog. -->
<ui:include src="dialogs/aboutDialog.xhtml" />
<!-- Include the dialogs for the project managment. -->
<ui:include src="dialogs/projectDialogs.xhtml" />
<!-- Include the dialog for the configuration. -->
<ui:include src="dialogs/settingsDialog.xhtml" />
<!-- Include the about-dialog. -->
<ui:include src="dialogs/aboutDialog.xhtml" />
</h:body>
</html>
\ No newline at end of file
......@@ -41,13 +41,13 @@
<p:separator/>
<p:menuitem value="Close Project" action="#{currentWorkSpaceProjectBean.clearProject()}" ajax="false"/>
<p:separator/>
<p:menuitem value="Settings" onclick="settingsDialog.show()" ajax="true"/>
<p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/>
</p:submenu>
<p:submenu label="Help">
<p:menuitem value="User Guide" ajax="true"/>
<p:separator/>
<p:menuitem value="About..." onclick="aboutDialog.show()" ajax="true"/>
<p:menuitem value="About..." onclick="aboutDlg.show()" ajax="true"/>
</p:submenu>
<p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/>
......@@ -77,8 +77,6 @@
<div class="ui-panel-titlebar ui-widget-header ui-corner-all">
<h:outputText style="font-weight: bold" value="#{repository.getName()}"/>
</div>
<p:commandLink ajax="true" value="Connections" update=":connectionDialogForm" onclick="connectionDialog.show();"/>
<br/>
<p:commandLink ajax="true" value="Remove" action="#{currentWorkSpaceProjectBean.removeRepository(repository)}" update=":propertiesForm :centerForm"/>
</div>
</ui:repeat>
......
......@@ -6,7 +6,7 @@
xmlns:p="http://primefaces.org/ui">
<p:dialog header="About..." resizable="false" modal="true"
widgetVar="aboutDialog" id="aboutDialog">
widgetVar="aboutDlg" id="aboutDialog">
<h:form>
<img src="../img/kieker-logo-transparent.png" style="opacity: 0.25" />
<hr/>
......@@ -21,7 +21,7 @@
<a href="http://www.kieker-monitoring.net/">http://www.kieker-monitoring.net/</a>
<hr/>
<div style="text-align: right">
<p:commandButton value="Ok" onclick="aboutDialog.hide()" />
<p:commandButton value="Ok" oncomplete="aboutDlg.hide()" />
</div>
</h:form>
</p:dialog>
......
......@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<p:dialog id="manageLibrariesDialog" header="Libraries" resizable="false"
<p:dialog id="manageLibrariesDlg" header="Libraries" resizable="false"
modal="true" widgetVar="manageLibrariesDialog">
<h:form id="dependenciesForm">
......
......@@ -8,7 +8,7 @@
<!-- ******************************************************************************** -->
<!-- This is the dialog to create a new project. -->
<p:dialog id="newProjectDialog" header="New Project" resizable="false" modal="true" widgetVar="newProjectDialog">
<p:dialog id="newProjectDlg" header="New Project" resizable="false" modal="true" widgetVar="newProjectDialog">
<!-- Make sure that closing of the dialog also clears the input field. -->
<p:ajax event="close" update="newProjectDialogForm:newProjectInputText" />
......@@ -28,7 +28,7 @@
</p:dialog>
<!-- ******************************************************************************** -->
<p:dialog id="renameProjectDialog" header="Rename Project" resizable="false" modal="true" widgetVar="renameProjectDialog">
<p:dialog id="renameProjectDlg" header="Rename Project" resizable="false" modal="true" widgetVar="renameProjectDialog">
<!-- Make sure that closing of the dialog also clears the input field. -->
<p:ajax event="close" update="renameProjectDialogForm:renameProjectInputText" />
......@@ -47,7 +47,7 @@
</h:form>
</p:dialog>
<p:dialog id="deleteProjectDialog" header="Delete Project" resizable="false" modal="true" widgetVar="deleteProjectDialog">
<p:dialog id="deleteProjectDlg" header="Delete Project" resizable="false" modal="true" widgetVar="deleteProjectDialog">
<h:form id="deleteProjectDialogForm">
<div style="text-align: center">
......@@ -63,7 +63,7 @@
</h:form>
</p:dialog>
<p:dialog id="copyProjectDialog" header="Copy Project" resizable="false" modal="true" widgetVar="copyProjectDialog">
<p:dialog id="copyProjectDlg" header="Copy Project" resizable="false" modal="true" widgetVar="copyProjectDialog">
<!-- Make sure that closing of the dialog also clears the input field. -->
<p:ajax event="close" update="copyProjectDialogForm:copyProjectDialogInputText" />
......
......@@ -6,7 +6,7 @@
xmlns:p="http://primefaces.org/ui">
<p:dialog id="settingsDialog" header="Settings" resizable="false"
modal="true" widgetVar="settingsDialog">
modal="true" widgetVar="settingsDlg">
<h:form>
<h:panelGrid columns="2" cellpadding="10">
<h:outputText value="Look and Feel:" />
......@@ -18,7 +18,7 @@
</h:panelGrid>
<hr/>
<div style="text-align: right">
<p:commandButton value="Ok" oncomplete="settingsDialog.hide();" />
<p:commandButton value="Ok" oncomplete="settingsDlg.hide();" />
</div>
</h:form>
</p:dialog>
......
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