diff --git a/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml b/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml index 1a30548cfe22229ef6cbb2248da5327f9c844c8d..35fc0494b8f10f41a39e5aa4157f160a4d27bce9 100644 --- a/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml +++ b/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml @@ -1,162 +1,161 @@ -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jsp/jstl/core" - xmlns:cc="http://java.sun.com/jsf/composite/pfcomp" - xmlns:p="http://primefaces.org/ui"> - -<h:outputStylesheet library="css" name="layouts.css" /> - -<h:form id="layoutForm" class="layoutPanel"> -<p:scrollPanel mode="native" styleClass="bulletList"> - <div class="layoutSubPanel"> - <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> - - <h2 class="title">General overlays: </h2> - - <p:dataTable id="generalLayoutDataTable" rowIndexVar="rowId" var="layout" value="#{layoutMB.generalLayouts}" - rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}"> - <p:column sortBy="name" headerText="Name" styleClass="highlightedColumn"> - <h:outputText id="name" value="#{layout.name}" /> - </p:column> - - <p:column style="width:4%" headerText="View"> - <p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="" title="#{layout.description}" update="generalLayoutDataTable, :tabView:layoutForm:layoutDataTable" ajax="true" styleClass="ui-icon-search2" rendered="#{not layout.inputDataAvailable}"> - <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> - </p:commandButton> - <p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/> - </p:column> - <p:column style="width:4%" headerText="Data"> - <p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title="#{layout.inputDataAvailable?layout.description:'Not available'}" disabled="#{not layout.inputDataAvailable}" ajax="false"/> - </p:column> - </p:dataTable> - </div> - <div class="layoutSubPanel"> - <cc:helpButton helpText='Managing custom overlays and file format is described in the <a href="#{request.contextPath}/javax.faces.resource/user_guide.pdf.xhtml?ln=other" target="_user_manual_" >manual</a>.' style="float:right;" width="200px" my="right top" at="right bottom"/> - <h2 class="title">User-provided overlays:</h2> - <h:panelGroup layout="block" rendered="#{userMB.loggedUser.login=='anonymous'}"> - <center> - <h3 class="title"> You are not logged in. Please, log in to upload and view custom overlays</h3> - </center> - </h:panelGroup> - - <h:panelGroup layout="block" rendered="#{not (userMB.loggedUser.login=='anonymous')}"> - <p:dataTable id="layoutDataTable" rowIndexVar="rowId" var="layout" value="#{layoutMB.customLayouts}" - rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}"> - <p:column sortBy="name" headerText="Name" styleClass="highlightedColumn"> - <h:outputText id="name" value="#{layout.name}" /> - <h:outputText id="statusNotReady" value=" (status: #{layout.status} - #{layout.progress}%)" rendered="#{layout.status !='OK'}"/> - <h:outputText id="statusOk" value=" (status: #{layout.status})" rendered="#{layout.status =='OK'}"/> - </p:column> - <p:column style="width:4%" headerText="View"> - <p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="ui-icon-search" disabled="#{not (layout.status == 'OK')}" title="#{layout.description}" - update=":tabView:layoutForm:generalLayoutDataTable, layoutDataTable" rendered="#{not layout.inputDataAvailable}" > - <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> - </p:commandButton> - <p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/> - </p:column> - - <p:column style="width:4%" headerText="Data"> - <p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title='#{layout.inputDataAvailable?layout.description:"Not available"}' disabled="#{not layout.inputDataAvailable}" ajax="false"/> - </p:column> - - <p:column style="width:4%" headerText="Edit"> - <p:commandButton update=":#{p:component('layoutDlg')}" id="selectButton" oncomplete="PF('layoutDialog').show()" icon="ui-icon-document" title="Edit"> - <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> - </p:commandButton> - </p:column> - - </p:dataTable> - - <center> - <p:commandButton id="refreshLayoutsButton" actionListener="#{layoutMB.refreshCustomLayouts}" icon="ui-icon-refresh" oncomplete="updateConfig();" update="layoutDataTable :configurationForm:configurationGson"> - </p:commandButton> - </center> - - <h:panelGroup layout="block" rendered="#{not layoutMB.userHasAddLayoutPrivilege}"> - <center> - <br/> - <h3 class="title"> You cannot add overlays. To add overlays please contact with system administartors.</h3> - </center> - </h:panelGroup> - - <p:panel id="layoutAddComponent" header = "ADDING" layout="block" rendered="#{layoutMB.userHasAddLayoutPrivilege}"> - <h:panelGrid columns="2" cellpadding="0" width="100%"> - <h:outputText value="NAME: " styleClass="smallBoldText"/> - <p:inputText id="layoutName" value="#{layoutMB.layoutName}" style="width:180px !important"/> - - <h:outputText value="FILE: " styleClass="smallBoldText"/> - -<!-- <p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName,layoutType" width="100px"/> --> - <p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName" width="100px"/> - -<!-- <h:outputText value="TYPE: " styleClass="smallBoldText"/> - <h:selectOneRadio id="layoutType" value="#{layoutMB.layoutType}"> - <f:selectItems value="#{layoutMB.colorSchemaTypes}" var="type" - itemValue="#{type}" itemLabel="#{type}"/> - </h:selectOneRadio> --> - - <h:outputText value="AVAILABLE OVERLAYS: " styleClass="smallBoldText"/> - <h:outputText id="layoutNumberGreen" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{layoutMB.availableCustomLayoutNumber>0}" styleClass="greenText"/> - <h:outputText id="layoutNumberRed" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{not (layoutMB.availableCustomLayoutNumber>0)}" styleClass="redText"/> - </h:panelGrid> - <center> - <p:commandButton id="addLayoutButton" actionListener="#{layoutMB.addLayout}" update="layoutDataTable,layoutNumberGreen,layoutNumberRed" onclick="PF('layoutPanelBlock').show()" oncomplete="PF('layoutPanelBlock').hide()" disabled="#{not layoutMB.userHasAddLayoutPrivilege}" value="GENERATE" title="GENERATE" styleClass="mediumBoldText"/> - </center> - </p:panel> - - - <p:blockUI block="layoutAddComponent" widgetVar="layoutPanelBlock"> - UPLOADING<br /> - <p:graphicImage library="images" name="icons/ajax-loader.gif"/> - </p:blockUI> - - </h:panelGroup> - </div> -</p:scrollPanel> - <cc:helpButton helpText="Overlays tab allows to display or generate custom coloring of elements and interactions in the map. <p> General overlays are overlays accessible for every user viewing the content. <p> Custom overlays are user-provided overlays, this menu becomes available upon login (see below)." style="float:right;margin-top:53px;margin-right:29px;" at="right top"/> -</h:form> - -<h:form id="layoutForm2"> - <p:dialog header="Overlay Detail" widgetVar="layoutDialog" resizable="false" id="layoutDlg" - showEffect="fade" modal="true"> - <h:panelGrid columns="2" cellpadding="1"> - <h:outputText value="Id: " /> - <h:outputText id="layoutId" value="#{layoutMB.selectedLayout.idObject}"/> - - <h:outputText value="Name: " /> - <p:inputText id="layoutName" value="#{layoutMB.selectedLayout.name}"/> - - <h:outputText value="Description: " /> - <p:inputTextarea id="descriptionName" value="#{layoutMB.selectedLayout.description}"/> - - </h:panelGrid > - - <br/> - <p:commandButton update=":#{p:component('layoutDataTable')}" actionListener="#{layoutMB.updateLayout}" id="saveLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-disk" value="Save" title="Save"/> - <p:commandButton update=":#{p:component('layoutDataTable')}, :#{p:component('layoutNumberGreen')}, :#{p:component('layoutNumberRed')}" actionListener="#{layoutMB.removeLayout}" id="removeLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-trash" value="Remove" title="Remove"/> - <p:commandButton id="cancelUserButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-close" value="Cancel" title="Cancel"/> - </p:dialog> -</h:form> - -<h:form id="layoutForm3"> - <h:inputHidden id="hidden2" value="#{layoutMB.visualizedLayout.name}" /> - <h:inputHidden id="hidden_directory" value="#{layoutMB.visualizedLayout.directory}" /> - <h:inputHidden id="hidden_layout_id" value="#{layoutMB.visualizedLayout.idObject}" /> - <p:remoteCommand name="getVisualizedLayoutDetails" actionListener="#{layoutMB.getVisualizedLayoutDetails}" - oncomplete="updateConfig(); customMap.openLayoutById(document.getElementById('tabView:layoutForm3:hidden_layout_id').value);" update="hidden_layout_id,:configurationForm:configurationGson"/> -</h:form> - -<h:form id="layoutAccessAliasForm"> - <p:remoteCommand name="_retreiveActiveAliasesForLayout" actionListener="#{layoutMB.retreiveActiveAliasesForLayout}" /> -</h:form> -<h:form id="layoutAccessFullAliasForm"> - <p:remoteCommand name="_retreiveFullAliasesForLayout" actionListener="#{layoutMB.retreiveFullAliasesForLayout}" /> -</h:form> -<h:form id="layoutAccessReactionForm"> - <p:remoteCommand name="_retreiveActiveReactionsForLayout" actionListener="#{layoutMB.retreiveActiveReactionsForLayout}" /> -</h:form> - - -</html> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jsp/jstl/core" + xmlns:cc="http://java.sun.com/jsf/composite/pfcomp" + xmlns:p="http://primefaces.org/ui"> + +<h:outputStylesheet library="css" name="layouts.css" /> + +<h:form id="layoutForm" class="layoutPanel"> +<p:scrollPanel mode="native" styleClass="bulletList"> + <div class="layoutSubPanel"> + <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> + + <h2 class="title">General overlays: </h2> + + <p:dataTable id="generalLayoutDataTable" rowIndexVar="rowId" var="layout" value="#{layoutMB.generalLayouts}" + rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}"> + <p:column sortBy="name" headerText="Name" styleClass="highlightedColumn"> + <h:outputText id="name" value="#{layout.name}" /> + </p:column> + + <p:column style="width:4%" headerText="View"> + <p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="" title="#{layout.description}" update="generalLayoutDataTable, :tabView:layoutForm:layoutDataTable" ajax="true" styleClass="ui-icon-search2" rendered="#{not layout.inputDataAvailable}"> + <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> + </p:commandButton> + <p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/> + </p:column> + <p:column style="width:4%" headerText="Data"> + <p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title="#{layout.inputDataAvailable?layout.description:'Not available'}" disabled="#{not layout.inputDataAvailable}" ajax="false"/> + </p:column> + </p:dataTable> + </div> + <div class="layoutSubPanel"> + <cc:helpButton helpText='Managing custom overlays and file format is described in the <a href="#{request.contextPath}/javax.faces.resource/user_guide.pdf.xhtml?ln=other" target="_user_manual_" >manual</a>.' style="float:right;" width="200px" my="right top" at="right bottom"/> + <h2 class="title">User-provided overlays:</h2> + <h:panelGroup layout="block" rendered="#{userMB.loggedUser.login=='anonymous'}"> + <center> + <h3 class="title"> You are not logged in. Please, log in to upload and view custom overlays</h3> + </center> + </h:panelGroup> + + <h:panelGroup layout="block" rendered="#{not (userMB.loggedUser.login=='anonymous')}"> + <p:dataTable id="layoutDataTable" rowIndexVar="rowId" var="layout" value="#{layoutMB.customLayouts}" + rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}"> + <p:column sortBy="name" headerText="Name" styleClass="highlightedColumn"> + <h:outputText id="name" value="#{layout.name}" /> + <h:outputText id="statusNotReady" value=" (status: #{layout.status} - #{layout.progress}%)" rendered="#{layout.status !='OK'}"/> + </p:column> + <p:column style="width:4%" headerText="View"> + <p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="ui-icon-search" disabled="#{not (layout.status == 'OK')}" title="#{layout.description}" + update=":tabView:layoutForm:generalLayoutDataTable, layoutDataTable" rendered="#{not layout.inputDataAvailable}" > + <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> + </p:commandButton> + <p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/> + </p:column> + + <p:column style="width:4%" headerText="Data"> + <p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title='#{layout.inputDataAvailable?layout.description:"Not available"}' disabled="#{not layout.inputDataAvailable}" ajax="false"/> + </p:column> + + <p:column style="width:4%" headerText="Edit"> + <p:commandButton update=":#{p:component('layoutDlg')}" id="selectButton" oncomplete="PF('layoutDialog').show()" icon="ui-icon-document" title="Edit"> + <f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" /> + </p:commandButton> + </p:column> + + </p:dataTable> + + <center> + <p:commandButton id="refreshLayoutsButton" actionListener="#{layoutMB.refreshCustomLayouts}" icon="ui-icon-refresh" oncomplete="updateConfig();" update="layoutDataTable :configurationForm:configurationGson"> + </p:commandButton> + </center> + + <h:panelGroup layout="block" rendered="#{not layoutMB.userHasAddLayoutPrivilege}"> + <center> + <br/> + <h3 class="title"> You cannot add overlays. To add overlays please contact with system administartors.</h3> + </center> + </h:panelGroup> + + <p:panel id="layoutAddComponent" header = "ADDING" layout="block" rendered="#{layoutMB.userHasAddLayoutPrivilege}"> + <h:panelGrid columns="2" cellpadding="0" width="100%"> + <h:outputText value="NAME: " styleClass="smallBoldText"/> + <p:inputText id="layoutName" value="#{layoutMB.layoutName}" style="width:180px !important"/> + + <h:outputText value="FILE: " styleClass="smallBoldText"/> + +<!-- <p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName,layoutType" width="100px"/> --> + <p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName" width="100px"/> + +<!-- <h:outputText value="TYPE: " styleClass="smallBoldText"/> + <h:selectOneRadio id="layoutType" value="#{layoutMB.layoutType}"> + <f:selectItems value="#{layoutMB.colorSchemaTypes}" var="type" + itemValue="#{type}" itemLabel="#{type}"/> + </h:selectOneRadio> --> + + <h:outputText value="AVAILABLE OVERLAYS: " styleClass="smallBoldText"/> + <h:outputText id="layoutNumberGreen" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{layoutMB.availableCustomLayoutNumber>0}" styleClass="greenText"/> + <h:outputText id="layoutNumberRed" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{not (layoutMB.availableCustomLayoutNumber>0)}" styleClass="redText"/> + </h:panelGrid> + <center> + <p:commandButton id="addLayoutButton" actionListener="#{layoutMB.addLayout}" update="layoutDataTable,layoutNumberGreen,layoutNumberRed" onclick="PF('layoutPanelBlock').show()" oncomplete="PF('layoutPanelBlock').hide()" disabled="#{not layoutMB.userHasAddLayoutPrivilege}" value="GENERATE" title="GENERATE" styleClass="mediumBoldText"/> + </center> + </p:panel> + + + <p:blockUI block="layoutAddComponent" widgetVar="layoutPanelBlock"> + UPLOADING<br /> + <p:graphicImage library="images" name="icons/ajax-loader.gif"/> + </p:blockUI> + + </h:panelGroup> + </div> +</p:scrollPanel> + <cc:helpButton helpText="Overlays tab allows to display or generate custom coloring of elements and interactions in the map. <p> General overlays are overlays accessible for every user viewing the content. <p> Custom overlays are user-provided overlays, this menu becomes available upon login (see below)." style="float:right;margin-top:53px;margin-right:29px;" at="right top"/> +</h:form> + +<h:form id="layoutForm2"> + <p:dialog header="Overlay Detail" widgetVar="layoutDialog" resizable="false" id="layoutDlg" + showEffect="fade" modal="true"> + <h:panelGrid columns="2" cellpadding="1"> + <h:outputText value="Id: " /> + <h:outputText id="layoutId" value="#{layoutMB.selectedLayout.idObject}"/> + + <h:outputText value="Name: " /> + <p:inputText id="layoutName" value="#{layoutMB.selectedLayout.name}"/> + + <h:outputText value="Description: " /> + <p:inputTextarea id="descriptionName" value="#{layoutMB.selectedLayout.description}"/> + + </h:panelGrid > + + <br/> + <p:commandButton update=":#{p:component('layoutDataTable')}" actionListener="#{layoutMB.updateLayout}" id="saveLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-disk" value="Save" title="Save"/> + <p:commandButton update=":#{p:component('layoutDataTable')}, :#{p:component('layoutNumberGreen')}, :#{p:component('layoutNumberRed')}" actionListener="#{layoutMB.removeLayout}" id="removeLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-trash" value="Remove" title="Remove"/> + <p:commandButton id="cancelUserButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-close" value="Cancel" title="Cancel"/> + </p:dialog> +</h:form> + +<h:form id="layoutForm3"> + <h:inputHidden id="hidden2" value="#{layoutMB.visualizedLayout.name}" /> + <h:inputHidden id="hidden_directory" value="#{layoutMB.visualizedLayout.directory}" /> + <h:inputHidden id="hidden_layout_id" value="#{layoutMB.visualizedLayout.idObject}" /> + <p:remoteCommand name="getVisualizedLayoutDetails" actionListener="#{layoutMB.getVisualizedLayoutDetails}" + oncomplete="updateConfig(); customMap.openLayoutById(document.getElementById('tabView:layoutForm3:hidden_layout_id').value);" update="hidden_layout_id,:configurationForm:configurationGson"/> +</h:form> + +<h:form id="layoutAccessAliasForm"> + <p:remoteCommand name="_retreiveActiveAliasesForLayout" actionListener="#{layoutMB.retreiveActiveAliasesForLayout}" /> +</h:form> +<h:form id="layoutAccessFullAliasForm"> + <p:remoteCommand name="_retreiveFullAliasesForLayout" actionListener="#{layoutMB.retreiveFullAliasesForLayout}" /> +</h:form> +<h:form id="layoutAccessReactionForm"> + <p:remoteCommand name="_retreiveActiveReactionsForLayout" actionListener="#{layoutMB.retreiveActiveReactionsForLayout}" /> +</h:form> + + +</html>