diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java index 43854f8d8f152667dc51f86f107a6c844759b6c3..f9a217b051d23c8b9a7367a668eeb706607ce951 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java @@ -186,21 +186,33 @@ public final class CurrentAnalysisEditorBean { public void setProjectName(final String newName) { synchronized (this) { // Remember the given parameters - this.project = ProjectsBean.getInstance().openProject(newName); this.projectName = newName; - this.getConnectionsFromProject(); + } + } - if (this.project != null) { - // Remember the current time! This is important for the later comparison of the time stamps. - this.resetTimeStamp(); - // Update the class loader - this.reloadClassLoader(); - // Add the libraries within the lib-folder to the current model - this.addLibrariesToModel(); - // Load the available readers, filters and repositories - this.loadToolPalette(); - // Load the hashmaps to get the plugins and ports - this.intializeHashMaps(); + /** + * This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by + * JSF.</b> + */ + public void initalize() { + synchronized (this) { + // Make sure that the initialization will only be done for the init request. + if (!FacesContext.getCurrentInstance().isPostback()) { + this.project = ProjectsBean.getInstance().openProject(this.projectName); + this.getConnectionsFromProject(); + + if (this.project != null) { + // Remember the current time! This is important for the later comparison of the time stamps. + this.resetTimeStamp(); + // Update the class loader + this.reloadClassLoader(); + // Add the libraries within the lib-folder to the current model + this.addLibrariesToModel(); + // Load the available readers, filters and repositories + this.loadToolPalette(); + // Load the hashmaps to get the plugins and ports + this.intializeHashMaps(); + } } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java index d0e935f59fb7f73fa542ce869fc9343ff33a2a44..fc39b6842bf5c0b0ddf92007e15fab137411af76 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java @@ -22,6 +22,7 @@ package kieker.webgui.beans.view; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; +import javax.faces.context.FacesContext; import kieker.analysis.display.AbstractDisplay; import kieker.analysis.display.HtmlText; @@ -86,11 +87,24 @@ public class CurrentCockpitBean { public void setProjectName(final String newName) { synchronized (this) { // Remember the given parameters - this.project = ProjectsBean.getInstance().openProject(newName); this.projectName = newName; } } + /** + * This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by + * JSF.</b> + */ + public void initalize() { + synchronized (this) { + // Make sure that the initialization will only be done for the init request. + if (!FacesContext.getCurrentInstance().isPostback()) { + // Remember the given parameters + this.project = ProjectsBean.getInstance().openProject(this.projectName); + } + } + } + /** * This method delivers the project name stored in this bean. * 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 c8795ae75ffd03e8155915a29473959e3345de73..7ea200d498a874971f9851988bc415e254609caf 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 @@ -95,6 +95,24 @@ public class CurrentCockpitEditorBean { // No code necessary } + /** + * This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by + * JSF.</b> + */ + public void initalize() { + synchronized (this) { + // Make sure that the initialization will only be done for the init request. + if (!FacesContext.getCurrentInstance().isPostback()) { + // Remember the given parameters + this.project = ProjectsBean.getInstance().openProject(this.projectName); + if (this.project != null) { + // Remember the current time! This is important for the later comparison of the time stamps. + this.resetTimeStamp(); + } + } + } + } + /** * This method delivers the project stored in this bean. * @@ -114,14 +132,7 @@ public class CurrentCockpitEditorBean { */ public void setProjectName(final String newName) { synchronized (this) { - // Remember the given parameters - this.project = ProjectsBean.getInstance().openProject(newName); this.projectName = newName; - - if (this.project != null) { - // Remember the current time! This is important for the later comparison of the time stamps. - this.resetTimeStamp(); - } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java index 6e54a55baa02977812033a1b66f25de9add0b096..2f430062a3e1c80cb05b7f13dc1ef42a90706695 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java @@ -82,11 +82,24 @@ public class CurrentControllerBean { public void setProjectName(final String newName) { synchronized (this) { // Remember the given parameters - this.project = ProjectsBean.getInstance().openProject(newName); this.projectName = newName; } } + /** + * This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by + * JSF.</b> + */ + public void initalize() { + synchronized (this) { + // Make sure that the initialization will only be done for the init request. + if (!FacesContext.getCurrentInstance().isPostback()) { + // Remember the given parameters + this.project = ProjectsBean.getInstance().openProject(this.projectName); + } + } + } + /** * This method delivers the project stored in this bean. * diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml index dda68a9400ab231ac5050834974e82abeda66154..e868bde99d1a95fea44449298d41cd649379a567 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml @@ -1,16 +1,17 @@ <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"> - <f:metadata> - <f:viewParam name="projectName" value="#{currentAnalysisEditorBean.projectName}"/> + <f:viewParam id="projectNameParam" name="projectName" value="#{currentAnalysisEditorBean.projectName}"/> + <f:event type="preRenderView" listener="#{currentAnalysisEditorBean.initalize()}" /> </f:metadata> - + <h:head> <title>Kieker.WebGUI</title> <link rel="stylesheet" type="text/css" href="../css/Common.css" /> @@ -36,7 +37,7 @@ <p:toolbarGroup align="left"> <h:outputText styleClass="kieker-title" value="Kieker » #{stringBean.shortenLongName(currentAnalysisEditorBean.projectName, 30)}"/> </p:toolbarGroup> - <p:toolbarGroup align="right"> + <p:toolbarGroup align="right"> <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="ProjectOverview.xhtml" /> <p:separator/> <p:button styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" disabled="true"/> @@ -135,7 +136,7 @@ </p:inplace> <p:inplace editor="true" rendered="#{stringBean.checkString(property)}" > <p:inputText value="#{currentAnalysisEditorBean.selectedPlugin.name}" /> - <p:ajax event="save" update=":centerForm" /> + <p:ajax event="save" update=":centerForm" /> </p:inplace> </p:column> </p:dataTable> diff --git a/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml b/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml index 81fc009fdfff25026f524abd2b42c535ca228f3c..9471e4890b2f24f9951096bd4b2e1fabb44a3dc1 100644 --- a/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml @@ -9,6 +9,7 @@ <f:metadata> <f:viewParam name="projectName" value="#{currentCockpitBean.projectName}"/> + <f:event type="preRenderView" listener="#{currentCockpitBean.initalize()}" /> </f:metadata> <h:head> diff --git a/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml b/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml index 0bc9097a47247e24a8abf70e9bd8f88a47106a01..76ff71d9bf613384b46dcb425ffafb9683e47b4d 100644 --- a/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml @@ -9,6 +9,7 @@ <f:metadata> <f:viewParam name="projectName" value="#{currentCockpitEditorBean.projectName}"/> + <f:event type="preRenderView" listener="#{currentCockpitEditorBean.initalize()}" /> </f:metadata> <h:head> @@ -48,7 +49,7 @@ <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="#{empty currentAnalysisEditorBean.project}"/> + <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{empty currentCockpitEditorBean.project}"/> <p:separator/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="true" disabled="#{empty currentCockpitEditorBean.project or true}"/> <p:separator/> diff --git a/Kieker.WebGUI/src/main/webapp/Controller.xhtml b/Kieker.WebGUI/src/main/webapp/Controller.xhtml index c77e44f28136b0db8f7fbbd8c788b970cbd63905..ea1132a68b24e1d840e8f99fb1274cac6cc726e0 100644 --- a/Kieker.WebGUI/src/main/webapp/Controller.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Controller.xhtml @@ -9,6 +9,7 @@ <f:metadata> <f:viewParam name="projectName" value="#{currentControllerBean.projectName}"/> + <f:event type="preRenderView" listener="#{currentControllerBean.initalize()}" /> </f:metadata> <h:head>