diff --git a/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar b/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar index 86de508ca96ece11b8a490439eed5e1180b5f8d6..b16752b1b39943010cae9f23e9153028adba72d8 100644 Binary files a/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar and b/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar differ diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisViewWorkSpaceProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisViewWorkSpaceProjectBean.java index 0256a806b8f2da33623240c817b87b4c90dab452..a9003389fea8cdf4ecf32fce4ed2c4ac8dc3aaec 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisViewWorkSpaceProjectBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisViewWorkSpaceProjectBean.java @@ -33,6 +33,7 @@ import javax.faces.context.FacesContext; import kieker.analysis.display.annotation.Display; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; +import kieker.analysis.model.analysisMetaModel.MIDisplay; import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; @@ -283,8 +284,12 @@ public class CurrentAnalysisViewWorkSpaceProjectBean { } } - public void addDisplayToView(final Display display) { - // No code necessary + public void addDisplayToView(final MIDisplay display) { + synchronized (this) { + if (this.activeView != null) { + this.activeView.getDisplays().add(display); + } + } } public void onChange(final TabChangeEvent event) { diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java index 030d67cfc3d0ee518c9b5047ae8acfc1ff754ad5..188d906193d051b090e73690cdb8f27fda23634b 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java @@ -39,6 +39,7 @@ import javax.faces.context.FacesContext; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; +import kieker.analysis.model.analysisMetaModel.MIDisplay; import kieker.analysis.model.analysisMetaModel.MIFilter; import kieker.analysis.model.analysisMetaModel.MIInputPort; import kieker.analysis.model.analysisMetaModel.MIOutputPort; @@ -488,6 +489,39 @@ public final class CurrentWorkSpaceProjectBean { } } + /** + * This method fills the displays of the given plugin. In other words: It tries to instantiate the given class and to extract the displays. If the instantiation + * fails (for various reasons), the method informs the user and executes normally - without an exception. + * + * @param clazz + * The class to be used as a base. + * @param plugin + * The plugin to be filled. + */ + private void fillDisplays(final Class<AbstractPlugin> clazz, final MIPlugin plugin) { + synchronized (this) { + try { + // Try to instantiate the given class, using the special constructor of Kieker. + final AbstractPlugin pluginInstance = clazz.getConstructor(Configuration.class).newInstance(new Configuration()); + // Get the displays and convert them into model instances + final String[] displayNames = pluginInstance.getAllDisplayNames(); + for (final String displayName : displayNames) { + final MIDisplay mDisplay = this.factory.createDisplay(); + mDisplay.setName(displayName); + plugin.getDisplays().add(mDisplay); + } + } catch (final InstantiationException e) { + CurrentWorkSpaceProjectBean.showMessage(FacesMessage.SEVERITY_ERROR, "An errcor occured while loading the properties of the plugin."); + } catch (final IllegalAccessException e) { + CurrentWorkSpaceProjectBean.showMessage(FacesMessage.SEVERITY_ERROR, "An errcor occured while loading the properties of the plugin."); + } catch (final InvocationTargetException e) { + CurrentWorkSpaceProjectBean.showMessage(FacesMessage.SEVERITY_ERROR, "An errcor occured while loading the properties of the plugin."); + } catch (final NoSuchMethodException e) { + CurrentWorkSpaceProjectBean.showMessage(FacesMessage.SEVERITY_ERROR, "An errcor occured while loading the properties of the plugin."); + } + } + } + /** * This method fills the ports of the given plugin. In other words: It tries to instantiate the given class and to extract the ports. If the instantiation fails * (for various reasons), the method informs the user and executes normally - without an exception. @@ -513,6 +547,7 @@ public final class CurrentWorkSpaceProjectBean { for (final String inputPortName : inputPortNames) { final MIInputPort mInputPort = this.factory.createInputPort(); mInputPort.setName(inputPortName); + mInputPort.setParent((MIFilter) plugin); } } @@ -667,6 +702,7 @@ public final class CurrentWorkSpaceProjectBean { this.fillProperties(clazz, plugin); this.fillPorts(clazz, plugin); + this.fillDisplays(clazz, plugin); synchronized (this) { // Add it to the project and don't forget to add the ports. diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisCockpit.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisCockpit.xhtml index f623eccd6e4543ee5e55f3f86f1af3784f194c20..0819d08d575b55e746f5a9b622b126a929928e79 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisCockpit.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisCockpit.xhtml @@ -27,6 +27,16 @@ <p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/> </p:submenu> + <p:submenu label="View"> + <p:menuitem value="Project Overview"/> + <p:separator/> + <p:menuitem value="Analysis Editor"/> + <p:menuitem value="Cockpit Editor"/> + <p:separator/> + <p:menuitem value="Controller"/> + <p:menuitem value="Cockpit" disabled="true"/> + </p:submenu> + <p:submenu label="Help"> <p:menuitem value="User Guide" ajax="true" disabled="true"/> <p:separator/> @@ -56,7 +66,9 @@ <p:accordionPanel multiple="true" activeIndex="" value="#{currentAnalysisCockpitProjectBean.project.views}" var="currView"> <p:tab title="#{currView.name}"> <h:outputText value="#{currView.description}" rendered="#{not empty currView.description}"/> - <h:outputText value="No description available. Click here to activate this view." rendered="#{empty currView.description}"/> + <h:outputText value="No description available." rendered="#{empty currView.description}"/> + <hr/> + Click <h:commandLink value="here"/> to activate this view. </p:tab> </p:accordionPanel> </h:form> diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisController.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisController.xhtml index bcf86bf6fb73227a583cb33a2da7d3784a643491..4ee2df749671e1629340e1a8a91946995be322d3 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisController.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisController.xhtml @@ -18,7 +18,7 @@ <!-- This is the layout for the whole page. --> <p:layout id="layout" fullPage="true"> - <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - Analysis Controller (#{currentAnalysisControllerProjectBean.projectName})"> + <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - Controller (#{currentAnalysisControllerProjectBean.projectName})"> <h:form> <p:menubar> <p:submenu label="File"> @@ -27,6 +27,16 @@ <p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/> </p:submenu> + <p:submenu label="View"> + <p:menuitem value="Project Overview"/> + <p:separator/> + <p:menuitem value="Analysis Editor"/> + <p:menuitem value="Cockpit Editor"/> + <p:separator/> + <p:menuitem value="Controller" disabled="true"/> + <p:menuitem value="Cockpit"/> + </p:submenu> + <p:submenu label="Help"> <p:menuitem value="User Guide" ajax="true" disabled="true"/> <p:separator/> diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisViewWorkSpace.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisViewWorkSpace.xhtml index f97987e7cf15f66cbcf50bce6fd2d092155cf758..69a2f4e18dba06f1ada6457b60838674f17bdbb0 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisViewWorkSpace.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisViewWorkSpace.xhtml @@ -16,7 +16,7 @@ <h:body> <p:layout id="layout" fullPage="true"> - <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - View Work Space (#{currentAnalysisViewWorkSpaceProjectBean.projectName})"> + <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - Cockpit Editor (#{currentAnalysisViewWorkSpaceProjectBean.projectName})"> <h:form> <p:menubar> <p:submenu label="File"> @@ -34,6 +34,16 @@ <p:separator/> <p:menuitem value="Settings" onclick="settingsDlg.show()" ajax="true"/> </p:submenu> + + <p:submenu label="View"> + <p:menuitem value="Project Overview"/> + <p:separator/> + <p:menuitem value="Analysis Editor"/> + <p:menuitem value="Cockpit Editor" disabled="true"/> + <p:separator/> + <p:menuitem value="Controller"/> + <p:menuitem value="Cockpit"/> + </p:submenu> <p:submenu label="Help"> <p:menuitem value="User Guide" ajax="true" disabled="true"/> @@ -49,11 +59,10 @@ <p:layoutUnit size="300" position="west"> <h:form rendered="#{not empty currentAnalysisViewWorkSpaceProjectBean.project}"> - <p:accordionPanel activeIndex="-1" value="#{currentAnalysisViewWorkSpaceProjectBean.plugins}" var="pair"> - <p:tab title="#{pair.fst.name}"> - <ui:repeat value="#{currentAnalysisViewWorkSpaceProjectBean.getDisplays(pair.snd)}" var="display"> - <p:commandLink id="displayLink" value="#{display.name()}"/> - <p:tooltip style="font-size: 15px" for="displayLink" value="#{display.description()}"/> + <p:accordionPanel activeIndex="-1" value="#{currentAnalysisViewWorkSpaceProjectBean.project.plugins}" var="plugin"> + <p:tab title="#{plugin.name}"> + <ui:repeat value="#{plugin.displays}" var="display"> + <p:commandLink id="displayLink" value="#{display.name}" action="#{currentAnalysisViewWorkSpaceProjectBean.addDisplayToView(display)}" update=":viewsForm"/> </ui:repeat> </p:tab> </p:accordionPanel> @@ -64,9 +73,9 @@ <h:form id="viewsForm"> <p:accordionPanel value="#{currentAnalysisViewWorkSpaceProjectBean.project.views}" var="viewComp" activeIndex="-1"> <p:tab title="#{viewComp.name}" closable="true"> - <p:dashboard> - - </p:dashboard> + <p:dataList value="#{viewComp.displays}" var="disp"> + #{disp.name} + </p:dataList> </p:tab> <p:ajax event="tabChange" listener="#{currentAnalysisViewWorkSpaceProjectBean.onChange}" /> </p:accordionPanel> diff --git a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml index 915e694eb29900f6fc816e0b9e7212d2133a6c77..4020bd631811abd13f7ef0739b7dd52f3fe5c12a 100644 --- a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml +++ b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml @@ -35,13 +35,13 @@ <p:menuitem styleClass="logOutButton" disabled="true" value="#{userBean.userName} [Log Out]" ajax="true"/> </p:menubar> - + </h:form> </p:layoutUnit> <p:layoutUnit position="center"> <h:form id="projectsListForm"> - <p:toolbar> + <p:toolbar> <p:toolbarGroup style="font-size: 15px" align="left"> <p:commandButton icon="ui-icon-plus" value="Project" onclick="newProjectDialog.show()" ajax="true"/> </p:toolbarGroup> @@ -50,15 +50,16 @@ <p:column headerText="Project Name" id="modelHeader" sortBy="#{project}"> <p:commandLink id="dynaButton" value="#{project}"/> - <p:menu overlay="true" trigger="dynaButton" my="left top" at="left bottom" style="width:180px"> - <p:menuitem id="openButton" value="Open Project" ajax="false" action="#{currentWorkSpaceProjectBean.setProject(projectsBean.openProject(project), project)}"/> + <p:menu overlay="true" trigger="dynaButton" my="left top" at="left bottom" style="width:210px"> + <p:menuitem id="openButton" value="Open in Analysis Editor" style="white-space: none" ajax="false" action="#{currentWorkSpaceProjectBean.setProject(projectsBean.openProject(project), project)}"/> + <p:menuitem id="editAnalysisViews" value="Open in Cockpit Editor" ajax="false" action="#{currentAnalysisViewWorkSpaceProjectBean.setProject(projectsBean.openProject(project), project)}" /> + <p:separator/> <p:menuitem id="copyButton" value="Copy Project" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="copyProjectDialog.show()" disabled="true"/> <p:menuitem id="renameButton" value="Rename Project" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="renameProjectDialog.show()" disabled="true"/> <p:menuitem id="deleteButton" value="Delete Project" action="#{currentProjectOverviewBean.setProjectName(project)}" onclick="deleteProjectDialog.show()" disabled="true"/> <p:separator/> - <p:menuitem id="controlAnalysis" value="Open Analysis Control" ajax="false" action="#{currentAnalysisControllerProjectBean.setProject(project)}" /> - <p:menuitem id="editAnalysisViews" value="Edit Analysis Views" ajax="false" action="#{currentAnalysisViewWorkSpaceProjectBean.setProject(projectsBean.openProject(project), project)}" /> - <p:menuitem id="showAnalysis" value="View Running Analysis" ajax="false" action="#{currentAnalysisCockpitProjectBean.setProject(projectsBean.openProject(project), project)}" /> + <p:menuitem id="controlAnalysis" value="Open in Controller" ajax="false" action="#{currentAnalysisControllerProjectBean.setProject(project)}" /> + <p:menuitem id="showAnalysis" value="Open in Cockpit" ajax="false" action="#{currentAnalysisCockpitProjectBean.setProject(projectsBean.openProject(project), project)}" /> </p:menu> </p:column> <p:column headerText="State" style="text-align: center" sortBy="#{projectsBean.getAnalysisControllerState(project)}"> diff --git a/Kieker.WebGUI/src/main/webapp/ProjectWorkSpace.xhtml b/Kieker.WebGUI/src/main/webapp/ProjectWorkSpace.xhtml index dc20ff7031115e22ff739c4ba631af6edfbda76d..b18b78434766a0c6d9c622574d4c60cc44c92a08 100644 --- a/Kieker.WebGUI/src/main/webapp/ProjectWorkSpace.xhtml +++ b/Kieker.WebGUI/src/main/webapp/ProjectWorkSpace.xhtml @@ -26,7 +26,7 @@ <h:body onload="initPageObjects();"> <p:layout id="layout" fullPage="true"> - <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - Project Work Space (#{currentWorkSpaceProjectBean.projectName})"> + <p:layoutUnit position="north" collapsible="false" header="Kieker.WebGUI - Analysis Editor (#{currentWorkSpaceProjectBean.projectName})"> <h:form> <p:menubar> <p:submenu label="File"> @@ -47,11 +47,11 @@ <p:submenu label="View"> <p:menuitem value="Project Overview"/> <p:separator/> - <p:menuitem value="Project Work Space" disabled="true"/> + <p:menuitem value="Analysis Editor" disabled="true"/> + <p:menuitem value="Cockpit Editor"/> <p:separator/> - <p:menuitem value="Analysis Controller"/> - <p:menuitem value="Analysis View Work Space"/> - <p:menuitem value="Analysis Cockpit"/> + <p:menuitem value="Controller"/> + <p:menuitem value="Cockpit"/> </p:submenu> <p:submenu label="Help"> diff --git a/Kieker.WebGUI/src/main/webapp/css/Common.css b/Kieker.WebGUI/src/main/webapp/css/Common.css index 912a9f5efe1ca5f1484bbc588b3decb6a2e267af..d5c8f41d6297516dc6881c6081cf1a1fef49a1de 100644 --- a/Kieker.WebGUI/src/main/webapp/css/Common.css +++ b/Kieker.WebGUI/src/main/webapp/css/Common.css @@ -56,4 +56,8 @@ .logOutButton { position: absolute; right: 5px; +} + +.ui-menu .ui-menu-parent .ui-menu-child { + width: 250px; } \ No newline at end of file