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

Deactivated more components for guests; Initial auto layout will now be performed

parent d548f719
No related branches found
No related tags found
No related merge requests found
......@@ -503,6 +503,10 @@ public final class CurrentAnalysisEditorBean {
this.currentAnalysisEditorGraphBean.setGridColor(this.userBean.getGridColor());
this.currentAnalysisEditorGraphBean.setGridSize(this.userBean.getGridSize());
// Perform an initial auto layout
this.currentAnalysisEditorGraphBean.startAutoLayout();
this.currentAnalysisEditorGraphBean.checkReadOnlyForGuests();
// Repaint the graph
this.currentAnalysisEditorGraphBean.refreshGraph();
}
......
......@@ -38,6 +38,7 @@ import kieker.monitoring.core.registry.Registry;
import kieker.webgui.common.exception.InvalidInputSizeException;
import kieker.webgui.common.exception.UninitializedGraphException;
import kieker.webgui.service.IGraphLayoutService;
import kieker.webgui.web.beans.session.UserBean;
import org.primefaces.context.RequestContext;
......@@ -163,6 +164,8 @@ public final class CurrentAnalysisEditorGraphBean {
@Autowired
private IGraphLayoutService layouter;
@Autowired
private UserBean userBean;
/**
* This map contains all components (plugins, repositories and ports) within the graph to identify them with a unique ID.
......@@ -662,4 +665,13 @@ public final class CurrentAnalysisEditorGraphBean {
this.refreshGraph();
}
/**
* This method checks whether the current user is a guest and activates the read only mode if necessary.
*/
public void checkReadOnlyForGuests() {
if ("Guest".equals(this.userBean.getUserrole())) {
RequestContext.getCurrentInstance().execute("graph.setReadOnly('false', 'true');");
}
}
}
......@@ -4,7 +4,8 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core">
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head/>
......@@ -79,13 +80,17 @@
<!-- Those are the menu bar entries left from the help-submenu. -->
<ui:define name="furtherMenuBarEntries">
<p:submenu label="#{localizedMessages.file}">
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-save" value=" #{localizedMessages.saveProject}" update=":messages" ajax="true" action="#{currentAnalysisEditorBean.saveProject(false)}" disabled="#{empty currentAnalysisEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-saveAs" value=" #{localizedMessages.saveProjectAs}" update=":messages" ajax="true" disabled="#{true or empty currentAnalysisEditorBean.project}"/>
<p:separator />
</c:if>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-reload" value=" #{localizedMessages.reloadProject}" ajax="false" url="analysisEditor?projectName=#{currentAnalysisEditorBean.projectName}" disabled="#{empty currentAnalysisEditorBean.project}" />
<p:separator/>
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-manageLibraries" value=" #{localizedAnalysisEditorPageMessages.manageLibraries}" onclick="manageLibrariesDialog.show()" ajax="true" disabled="#{empty currentAnalysisEditorBean.project}"/>
<p:separator />
</c:if>
<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"/>
......@@ -139,11 +144,11 @@
<!-- The classname is not editable, the name is editable with a specific target, other properies are editable normally. -->
<p:column headerText="#{localizedMessages.value}" style="width:125px">
<h:outputText id="className" value="#{currentAnalysisEditorBean.selectedPlugin.classname}" rendered="#{rowIndex == 0}"/>
<p:inplace id="nameEditor" editor="true" rendered="#{rowIndex == 1}" >
<p:inplace id="nameEditor" editor="true" rendered="#{rowIndex == 1}" disabled="#{not sec:areAnyGranted('User, Administrator')}" >
<p:inputText value="#{currentAnalysisEditorBean.selectedPlugin.name}" />
<p:ajax event="save" listener="#{currentAnalysisEditorGraphBean.renameNode(currentAnalysisEditorBean.selectedPlugin, currentAnalysisEditorBean.selectedPlugin.name)}" />
</p:inplace>
<p:inplace id="normalEditor" editor="true" rendered="#{rowIndex > 1}">
<p:inplace id="normalEditor" editor="true" rendered="#{rowIndex > 1}" disabled="#{not sec:areAnyGranted('User, Administrator')}">
<p:inputText value="#{property.value}" />
</p:inplace>
<p:tooltip for="className" value="#{localizedAnalysisEditorPageMessages.tooltipClassName}" rendered="#{rowIndex == 0}"/>
......@@ -154,6 +159,7 @@
</h:form>
</p:layoutUnit>
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<!-- The following is the toolpalette, presenting the available plugins etc. -->
<p:layoutUnit position="east" size="300" header="#{localizedAnalysisEditorPageMessages.availablePlugins}" resizable="true" collapsible="true">
<h:form id="toolpalette">
......@@ -257,10 +263,13 @@
</p:accordionPanel>
</h:form>
</p:layoutUnit>
</c:if>
</ui:define>
<ui:define name="furtherDialogIncludes">
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<ui:include src="../dialogs/AnalysisEditorPageDialogs.xhtml" />
</c:if>
</ui:define>
</ui:composition>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment