Newer
Older
<?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"
Nils Christian Ehmke
committed
xmlns:p="http://primefaces.org/ui"
Nils Christian Ehmke
committed
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
Nils Christian Ehmke
committed
<h:head/>
Nils Christian Ehmke
committed
<h:body>
<ui:composition template="/templates/PagesTemplate.xhtml">
Nils Christian Ehmke
committed
Nils Christian Ehmke
committed
<ui:param name="unsavedModifications" value="#{currentAnalysisEditorBean.unsavedModification}"/>
Nils Christian Ehmke
committed
<ui:param name="projectName" value="#{currentAnalysisEditorBean.projectName}"/>
<ui:param name="pagename" value="analysisEditor"/>
<ui:param name="showProjectName" value="true"/>
Nils Christian Ehmke
committed
<ui:define name="metaData">
<f:metadata>
<f:viewParam id="projectNameParam" name="projectName" value="#{currentAnalysisEditorBean.projectName}"/>
<f:event type="preRenderView" listener="#{currentAnalysisEditorBean.initialize()}" />
</f:metadata>
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="bundleIncludes">
<f:loadBundle var="localizedAnalysisEditorPageMessages" basename="lang.AnalysisEditorPage"/>
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="cssIncludes">
Nils Christian Ehmke
committed
<link rel="stylesheet" type="text/css" href="#{root}/css/FlowEditor.css" />
<link rel="stylesheet" type="text/css" href="#{root}/css/AnalysisEditorPage.css" />
Nils Christian Ehmke
committed
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="jsIncludes">
Nils Christian Ehmke
committed
<script language="javascript" type="text/javascript" src="#{root}/js/jit.js"></script>
<script language="javascript" type="text/javascript" src="#{root}/js/flowEditor.js"></script>
Nils Christian Ehmke
committed
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="js">
<script>
nodeClickListener = function(node, info, e) {
nodeClickCommand([{name : 'ID', value : node.id}]);
markNode(node, '#FF0000');
Nils Christian Ehmke
committed
}
nodeRemoveListener = function(node) {
nodeRemoveCommand([{name : 'ID', value : node.id}]);
}
edgeCreateListener = function(sourceNode, targetNode, sourcePort, targetPort) {
edgeCreateCommand([{name : 'sourcePortID', value : sourcePort.id},{name : 'targetPortID', value : targetPort.id}]);
}
edgeRemoveListener = function(sourceNode, targetNode, sourcePort, targetPort) {
edgeRemoveCommand([{name : 'sourcePortID', value : sourcePort.id},{name : 'targetPortID', value : targetPort.id}]);
}
autoLayoutListener = function(nodes, edges) {
autoLayoutCommand([{name : 'nodes', value : nodes}, {name : 'edges', value : edges}]);
}
Nils Christian Ehmke
committed
function preSaveProject(overwriteNewerProject) {
Nils Christian Ehmke
committed
var layoutString = graph.savePositions();
saveProjectCommand([{name : 'layoutString', value : layoutString}, {name : 'overwriteNewerProject', value : overwriteNewerProject}]);
Nils Christian Ehmke
committed
}
// "Overwrite" the function in the template
function bodyLoaded() {
Nils Christian Ehmke
committed
</script>
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="furtherForms">
<h:form id="hidden" style="display:none">
<p:remoteCommand autoRun="true" name="init" action="#{currentAnalysisEditorBean.initializeGraph()}" />
<p:remoteCommand name="postInit" action="#{currentAnalysisEditorGraphBean.scaleToFit()}" />
Nils Christian Ehmke
committed
</h:form>
<h:form id="hiddenNodeProperties" style="display:none">
<p:remoteCommand name="nodeClickCommand" action="#{currentAnalysisEditorGraphBean.nodeClicked()}" update=":propertiesForm"/>
<p:remoteCommand name="nodeRemoveCommand" action="#{currentAnalysisEditorGraphBean.nodeRemoved()}" update=":propertiesForm"/>
<p:remoteCommand name="edgeCreateCommand" action="#{currentAnalysisEditorGraphBean.edgeCreated()}"/>
<p:remoteCommand name="edgeRemoveCommand" action="#{currentAnalysisEditorGraphBean.edgeRemoved()}"/>
<p:remoteCommand name="autoLayoutCommand" action="#{currentAnalysisEditorGraphBean.autoLayout()}"/>
<p:remoteCommand name="saveProjectCommand" action="#{currentAnalysisEditorBean.saveProject()}" update=":messages"/>
Nils Christian Ehmke
committed
</h:form>
</ui:define>
Nils Christian Ehmke
committed
<!-- Those are the menu bar entries left from the help-submenu. -->
<ui:define name="furtherMenuBarEntries">
<p:submenu label="#{localizedMessages.file}">
Nils Christian Ehmke
committed
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-save" value=" #{localizedMessages.saveProject}" ajax="true" onstart="preSaveProject(false)" disabled="#{empty currentAnalysisEditorBean.project}"/>
Nils Christian Ehmke
committed
<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>
Nils Christian Ehmke
committed
<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/>
Nils Christian Ehmke
committed
<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>
Nils Christian Ehmke
committed
<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>
Nils Christian Ehmke
committed
<p:submenu label="Graph">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-scaleToFitSmall" value=" #{localizedAnalysisEditorPageMessages.analysisEditorScaleToFit}" ajax="true" action="#{currentAnalysisEditorGraphBean.scaleToFit()}" />
<p:separator/>
<p:menuitem styleClass="element-with-whitespace" icon="#{currentAnalysisEditorGraphBean.gridEnabled ? 'ui-icon-gridEnabledSmall' : 'ui-icon-gridDisabledSmall'}" value=" #{localizedAnalysisEditorPageMessages.grid} #{currentAnalysisEditorGraphBean.gridEnabled ? localizedAnalysisEditorPageMessages.disable : localizedAnalysisEditorPageMessages.enable}" ajax="true" action="#{currentAnalysisEditorGraphBean.switchGrid()}" update=":menuForm"/>
<p:menuitem styleClass="element-with-whitespace" icon="#{currentAnalysisEditorGraphBean.snapEnabled ? 'ui-icon-snapEnabledSmall' : 'ui-icon-snapDisabledSmall'}" value=" #{localizedAnalysisEditorPageMessages.snap} #{currentAnalysisEditorGraphBean.snapEnabled ? localizedAnalysisEditorPageMessages.disable: localizedAnalysisEditorPageMessages.enable}" ajax="true" action="#{currentAnalysisEditorGraphBean.switchSnap()}" update=":menuForm"/>
<p:separator/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-autoLayoutSmall" value=" #{localizedAnalysisEditorPageMessages.autoLayout}" ajax="true" />
</p:submenu>
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="furtherMenuBar">
<p:spacer height="5"/>
<p:menubar>
<p:menuitem id="btnScaleToFit" styleClass="element-with-whitespace" icon="ui-icon-scaleToFit" ajax="true" action="#{currentAnalysisEditorGraphBean.scaleToFit()}"/>
<p:menuitem id="btnGrid" styleClass="element-with-whitespace" icon="#{currentAnalysisEditorGraphBean.gridEnabled ? 'ui-icon-gridEnabled' : 'ui-icon-gridDisabled'}" ajax="true" action="#{currentAnalysisEditorGraphBean.switchGrid()}" update=":menuForm"/>
<p:menuitem id="btnSnap" styleClass="element-with-whitespace" icon="#{currentAnalysisEditorGraphBean.snapEnabled ? 'ui-icon-snapEnabled' : 'ui-icon-snapDisabled'}" ajax="true" action="#{currentAnalysisEditorGraphBean.switchSnap()}" update=":menuForm"/>
<p:menuitem id="btnAutoLayout" styleClass="element-with-whitespace" icon="ui-icon-autoLayout" ajax="true" action="#{currentAnalysisEditorGraphBean.startAutoLayout()}" />
Nils Christian Ehmke
committed
</p:menubar>
<p:tooltip for="btnScaleToFit" value="#{localizedAnalysisEditorPageMessages.analysisEditorScaleToFit}"/>
<p:tooltip for="btnGrid" value="#{localizedAnalysisEditorPageMessages.grid}"/>
<p:tooltip for="btnSnap" value="#{localizedAnalysisEditorPageMessages.snap}"/>
Nils Christian Ehmke
committed
<p:tooltip for="btnAutoLayout" value="#{localizedAnalysisEditorPageMessages.autoLayout}"/>
Nils Christian Ehmke
committed
</ui:define>
<ui:define name="centerContent">
<div id="center-container" style="width: 100%;height: 100%">
<div id="infovis"/>
</div>
Nils Christian Ehmke
committed
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="furtherLayoutUnits">
Nils Christian Ehmke
committed
<p:ajax event="resize" onstart="graph.updateCanvasSize();"/>
Nils Christian Ehmke
committed
<!-- This is the component presenting the available properties. -->
<p:layoutUnit style="font-size: 12px" position="south" size="150" header="#{localizedMessages.properties}" resizable="true" collapsible="true">
<h:form id="propertiesForm" >
<p:dataTable editable="true" value="#{currentAnalysisEditorBean.advancedPluginProperties}" var="property" rowIndexVar="rowIndex" emptyMessage="#{localizedMessages.noPropertiesAvailable}" rendered="#{not empty currentAnalysisEditorBean.selectedPlugin}">
<p:column headerText="#{localizedMessages.property}" style="width:125px">
<!-- The first property is always the classname, the second one always the normal name. After that, other properties can follow. -->
<h:outputText id="classNameProperty" value="#{localizedAnalysisEditorPageMessages.className}" rendered="#{rowIndex == 0}"/>
<h:outputText id="nameProperty" value="#{localizedAnalysisEditorPageMessages.name}" rendered="#{rowIndex == 1}"/>
<h:outputText id="normalProperty" value="#{property.name}" rendered="#{rowIndex > 1}"/>
Nils Christian Ehmke
committed
<p:tooltip for="classNameProperty" value="#{localizedAnalysisEditorPageMessages.tooltipClassName}" rendered="#{rowIndex == 0}"/>
Nils Christian Ehmke
committed
<p:tooltip for="nameProperty" value="#{localizedAnalysisEditorPageMessages.tooltipName}" rendered="#{rowIndex == 1}"/>
<p:tooltip for="normalProperty" value="#{currentAnalysisEditorBean.getDescription(currentAnalysisEditorBean.selectedPlugin, property.name)}" rendered="#{rowIndex > 1}"/>
</p:column>
Nils Christian Ehmke
committed
<!-- 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}"/>
Nils Christian Ehmke
committed
<p:inplace id="nameEditor" editor="true" rendered="#{rowIndex == 1}" disabled="#{not sec:areAnyGranted('User, Administrator')}" >
Nils Christian Ehmke
committed
<p:inputText value="#{currentAnalysisEditorBean.selectedPlugin.name}" />
<p:ajax event="save" listener="#{currentAnalysisEditorGraphBean.renameNode(currentAnalysisEditorBean.selectedPlugin, currentAnalysisEditorBean.selectedPlugin.name)}" />
</p:inplace>
Nils Christian Ehmke
committed
<p:inplace id="normalEditor" editor="true" rendered="#{rowIndex > 1}" disabled="#{not sec:areAnyGranted('User, Administrator')}">
Nils Christian Ehmke
committed
<p:inputText value="#{property.value}" />
</p:inplace>
<p:tooltip for="className" value="#{localizedAnalysisEditorPageMessages.tooltipClassName}" rendered="#{rowIndex == 0}"/>
Nils Christian Ehmke
committed
<p:tooltip for="nameEditor" value="#{localizedAnalysisEditorPageMessages.tooltipName}" rendered="#{rowIndex == 1}"/>
<p:tooltip for="normalEditor" value="#{currentAnalysisEditorBean.getDescription(currentAnalysisEditorBean.selectedPlugin, property.name)}" rendered="#{rowIndex > 1}"/>
Nils Christian Ehmke
committed
</p:column>
</p:dataTable>
</h:form>
</p:layoutUnit>
Nils Christian Ehmke
committed
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<!-- The following is the toolpalette, presenting the available plugins etc. -->
Nils Christian Ehmke
committed
<p:layoutUnit position="west" size="300" header="#{localizedAnalysisEditorPageMessages.availablePlugins}" resizable="true" collapsible="true">
Nils Christian Ehmke
committed
<h:form id="toolpalette">
<p:accordionPanel multiple="true" activeIndex="0,1,2">
<p:tab title="#{localizedAnalysisEditorPageMessages.reader}">
<ui:repeat value="#{currentAnalysisEditorBean.availableComponents.readers}" var="reader">
<p:commandLink id="readerLink" value="#{reader.plugin.name}" action="#{currentAnalysisEditorBean.addPlugin(reader)}" update=":messages" disabled="#{not reader.fullyInitialized}" /><br/>
<p:tooltip for="readerLink">
Nils Christian Ehmke
committed
<b>
<div align="center">
<h:outputText value="#{reader.plugin.name}"/><br/>
<h:outputText value="(#{reader.plugin.classname})"/>
</div>
</b>
Nils Christian Ehmke
committed
<br/>
Nils Christian Ehmke
committed
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.description}:"/></b><br/>
<ul>
<li><h:outputText value="#{reader.description}"/></li>
</ul>
Nils Christian Ehmke
committed
<ui:fragment rendered="#{not empty reader.plugin.outputPorts}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.outputPorts}:"/></b>
<p:dataList value="#{reader.plugin.outputPorts}" var="port">
#{port.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty reader.plugin.repositories}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.repositoryPorts}:" /></b>
<p:dataList value="#{reader.plugin.repositories}" var="port">
#{port.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty reader.plugin.properties}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b>
<p:dataList value="#{reader.plugin.properties}" var="property">
#{property.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty reader.dependency}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.dependencies}:"/></b>
Nils Christian Ehmke
committed
<ul>
<h:outputText value="#{reader.dependency}"/>
</ul>
Nils Christian Ehmke
committed
</ui:fragment>
</p:tooltip>
</ui:repeat>
</p:tab>
<p:tab title="#{localizedAnalysisEditorPageMessages.filter}">
<ui:repeat value="#{currentAnalysisEditorBean.availableComponents.filters}" var="filter">
<p:commandLink id="filterLink" value="#{filter.plugin.name}" action="#{currentAnalysisEditorBean.addPlugin(filter)}" update=":messages"/><br/>
Nils Christian Ehmke
committed
<p:tooltip for="filterLink" >
<b>
<div align="center">
<h:outputText value="#{filter.plugin.name}"/><br/>
<h:outputText value="(#{filter.plugin.classname})"/>
</div>
</b>
Nils Christian Ehmke
committed
<br/>
Nils Christian Ehmke
committed
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.description}:"/></b><br/>
<ul>
<li><h:outputText value="#{filter.description}"/></li>
</ul>
Nils Christian Ehmke
committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<ui:fragment rendered="#{not empty filter.plugin.inputPorts}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.inputPorts}:"/></b>
<p:dataList value="#{filter.plugin.inputPorts}" var="port">
#{port.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty filter.plugin.outputPorts}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.outputPorts}:"/></b>
<p:dataList value="#{filter.plugin.outputPorts}" var="port">
#{port.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty filter.plugin.repositories}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.repositoryPorts}:"/></b>
<p:dataList value="#{filter.plugin.repositories}" var="port">
#{port.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty filter.plugin.properties}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b>
<p:dataList value="#{filter.plugin.properties}" var="property">
#{property.name}
</p:dataList>
</ui:fragment>
<ui:fragment rendered="#{not empty filter.dependency}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.dependencies}:"/></b>
Nils Christian Ehmke
committed
<ul>
<h:outputText value="#{filter.dependency}"/>
</ul>
Nils Christian Ehmke
committed
</ui:fragment>
</p:tooltip>
</ui:repeat>
</p:tab>
<p:tab title="#{localizedAnalysisEditorPageMessages.repositories}">
<ui:repeat value="#{currentAnalysisEditorBean.availableComponents.repositories}" var="repository">
<p:commandLink id="repositoryLink" value="#{repository.repository.name}" action="#{currentAnalysisEditorBean.addRepository(repository)}" update=":messages"/><br/>
<p:tooltip for="repositoryLink">
Nils Christian Ehmke
committed
<b>
<div align="center">
<h:outputText value="#{repository.repository.name}"/><br/>
<h:outputText value="(#{repository.repository.classname})"/>
</div>
</b>
Nils Christian Ehmke
committed
<br/>
Nils Christian Ehmke
committed
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.description}:"/></b><br/>
<ul>
<li><h:outputText value="#{repository.description}"/></li>
</ul>
Nils Christian Ehmke
committed
<ui:fragment rendered="#{not empty repository.repository.properties}">
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.configuration}:"/></b>
<p:dataList value="#{repository.repository.properties}" var="property">
#{property.name}
</p:dataList>
</ui:fragment>
Nils Christian Ehmke
committed
<ui:fragment rendered="#{not empty filter.dependency}">
Nils Christian Ehmke
committed
<b><h:outputText value="#{localizedAnalysisEditorPageMessages.dependencies}:"/></b>
Nils Christian Ehmke
committed
<ul>
<h:outputText value="#{repository.dependency}"/>
</ul>
Nils Christian Ehmke
committed
</ui:fragment>
</p:tooltip>
</ui:repeat>
</p:tab>
</p:accordionPanel>
</h:form>
</p:layoutUnit>
</c:if>
Nils Christian Ehmke
committed
</ui:define>
Nils Christian Ehmke
committed
<ui:define name="furtherDialogIncludes">
Nils Christian Ehmke
committed
<c:if test="#{sec:areAnyGranted('User, Administrator')}">
<ui:include src="../dialogs/AnalysisEditorPageDialogs.xhtml" />
</c:if>
Nils Christian Ehmke
committed
</ui:define>
Nils Christian Ehmke
committed
</ui:composition>
Nils Christian Ehmke
committed