<?xml version="1.0" encoding="UTF-8" ?> <ui:composition template="/WEB-INF/templates/master.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:tsm_components="http://xmlns.jcp.org/jsf/composite/tsm_components"> <ui:define name="title">TASMAN - Editing #{tapSchemaEditing.tapSchema.name}</ui:define> <ui:define name="scripts"> <h:outputScript library="js" name="edit-tapschema.js"></h:outputScript> <h:outputScript library="js" name="ucd-editor.js"></h:outputScript> <h:outputScript library="js" name="async-loader.js"></h:outputScript> <script>TSM.asyncLoader.init(#{tapSchemaLoader.loading});</script> </ui:define> <ui:define name="content"> <f:event listener="#{loggedInChecker.checkFromNonIndex()}" type="preRenderView" /> <h:form id="main"> <tsm_components:user_navbar /> <h1 class="text-center"> Editing #{tapSchemaEditing.tapSchema.name} </h1> <div class="col-sm-6 vpadding text-center"> <div class="btn-group"> <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="glyphicon glyphicon-info-sign"></span> Show <span class="caret"></span> </button> <ul class="dropdown-menu"> <li> <h:commandLink action="#{tapSchemaEditing.displayUpdateOperations()}"> <span class="glyphicon glyphicon-cog"></span> Update operations <f:ajax execute="@form" render="update-operations-form" onevent="TSM.displayUpdateOperations"/> </h:commandLink> </li> <li> <h:commandLink> <span class="icon-key"></span> Keys <ui:remove> <!-- Very important: execute="@this", otherwise wrong values will be updated --> </ui:remove> <f:ajax execute="@this" render="keys-panel" onevent="TSM.displayKeysModal"/> </h:commandLink> </li> </ul> </div>   <h:commandLink class="btn btn-success" action="#{tapSchemaEditing.update()}" id="update-btn"> <span class="icon-save"></span> Update <f:ajax execute="@form" render="@form" onevent="TSM.notifyUpdate"/> </h:commandLink>   <h:commandLink class="btn btn-info" action="#{tapSchemaEditing.reload()}" onclick="showWaiting()"> <span class="glyphicon glyphicon-refresh"></span> Reload all <f:ajax execute="@form" render="@form" onevent="TSM.asyncLoader.reloadClicked" /> </h:commandLink> </div> <div class="col-sm-6 vpadding text-right"> <h:commandLink class="btn btn-info" action="#{tapSchemaEditing.back()}"> <span class="glyphicon glyphicon-arrow-left"></span> Back </h:commandLink> <h:outputText value=" " /> </div> <div class="clearfix"></div> <br/> <h:panelGroup id="main_panel"> <ul class="nav nav-tabs" id="schemas" role="tablist"> <ui:repeat value="#{tapSchemaEditing.tapSchema.addedOrRemovedChildren}" var="schema"> <li role="presentation" class="removable-tab #{tapSchemaEditing.isSchemaRemovable(schema) ? '': 'unremovable-tab'} #{tapSchemaEditing.selectedSchema.name eq schema.name ? 'active': ''} #{tapSchemaEditing.toRemove(schema) ? 'to-remove' : ''}"> <h:commandLink role="tab" action="#{tapSchemaEditing.setSelectedSchema(schema)}"> <span class="#{tapSchemaEditing.toRemove(schema) ? 'strikeout':''}">#{schema.name}</span> <h:panelGroup rendered="#{schema.name eq tapSchemaEditing.tapSchema.name and tapSchemaEditing.tapSchema.DBName ne null}"> <small>(#{tapSchemaEditing.tapSchema.DBName})</small> </h:panelGroup> <h:panelGroup rendered="#{schema.name eq tapSchemaEditing.tapSchema.ivoaSchemaName and tapSchemaEditing.tapSchema.ivoaSchemaDBName ne null}"> <small>(#{tapSchemaEditing.tapSchema.ivoaSchemaDBName})</small> </h:panelGroup> <f:ajax execute="@form" render="@form" /> <h:commandButton class="remove-btn" rendered="#{!tapSchemaEditing.toRemove(schema) and tapSchemaEditing.isSchemaRemovable(schema)}" action="#{tapSchemaEditing.tapSchema.removeChild(schema.name)}" value="×" onclick="TSM.stopPropagation(event)"> <f:ajax execute="@form" render="@form" /> </h:commandButton> </h:commandLink> </li> </ui:repeat> <h:panelGroup rendered="#{tapSchemaEditing.tapSchema.addableChildrenNames.size() gt 0}"> <li> <h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchemaEditing.tapSchema)}"> <span class="glyphicon glyphicon-plus-sign"></span> <f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" /> </h:commandLink> </li> </h:panelGroup> </ul> <div role="tabpanel" class="tab-content"> <h:panelGroup rendered="#{tapSchemaEditing.selectedSchema ne null and tapSchemaEditing.toRemove(tapSchemaEditing.selectedSchema)}"> <div class="col-xs-12 vpadding"> <div class="alert alert-info clearfix"> <span class="glyphicon glyphicon-info-sign"></span> This schema will be removed on TAP Schema Update. <h:commandLink class="btn btn-primary pull-right" action="#{tapSchemaEditing.undoRemove(tapSchemaEditing.selectedSchema)}"> Undo <f:ajax execute="@form" render="@form" /> </h:commandLink> </div> </div> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.selectedSchema ne null and !tapSchemaEditing.toRemove(tapSchemaEditing.selectedSchema)}"> <div class="schema-info clearfix"> <div class="form-horizontal" id="schemaValues"> <div class="form-group col-lg-6"> <h:outputLabel for="schema_utype" class="col-sm-3 control-label">Schema utype</h:outputLabel> <div class="col-sm-9"> <h:inputText id="schema_utype" class="form-control #{tapSchemaEditing.selectedSchema.isChanged('utype') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedSchema.getProperty('utype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedSchema, 'utype')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> </div> <div class="form-group col-lg-6"> <h:outputLabel for="schema_description" class="col-sm-3 control-label">Schema description</h:outputLabel> <div class="col-sm-9"> <h:inputText id="schema_description" class="form-control #{tapSchemaEditing.selectedSchema.isChanged('description') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedSchema.getProperty('description').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedSchema, 'description')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> </div> </div> </div> <h:panelGroup id="tables_wrapper"> <ul class="nav nav-tabs" id="tables" role="tablist"> <ui:repeat value="#{tapSchemaEditing.selectedSchema.addedOrRemovedChildren}" var="table"> <li role="presentation" class="removable-tab #{tapSchemaEditing.isSchemaRemovable(table.parent) ? '': 'unremovable-tab'} #{tapSchemaEditing.selectedTable.name eq table.name ? 'active':''} #{tapSchemaEditing.toRemove(table) ? 'to-remove':''}"> <h:commandLink role="tab" action="#{tapSchemaEditing.setSelectedTable(table)}"> <span class="#{tapSchemaEditing.toRemove(table) ? 'strikeout':''}">#{table.name}</span> <f:ajax execute="@form" render=":main:tables_wrapper" /> <h:commandButton class="remove-btn" rendered="#{!tapSchemaEditing.toRemove(table) and tapSchemaEditing.isSchemaRemovable(table.parent)}" action="#{tapSchemaEditing.selectedSchema.removeChild(table.name)}" value="×" onclick="TSM.stopPropagation(event)"> <f:ajax execute="@form" render=":main:tables_wrapper" /> </h:commandButton> </h:commandLink> </li> </ui:repeat> <h:panelGroup rendered="#{tapSchemaEditing.selectedSchema.addableChildrenNames.size() gt 0}"> <li> <h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchemaEditing.selectedSchema)}"> <span class="glyphicon glyphicon-plus-sign"></span> <f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" /> </h:commandLink> </li> </h:panelGroup> </ul> <h:panelGroup rendered="#{tapSchemaEditing.selectedTable ne null}"> <div role="tabpanel"> <h:panelGroup rendered="#{tapSchemaEditing.toRemove(tapSchemaEditing.selectedTable)}"> <div class="col-xs-12 vpadding"> <div class="alert alert-info clearfix"> <span class="glyphicon glyphicon-info-sign"></span> This table will be removed on TAP Schema Update. <h:commandLink class="btn btn-primary pull-right" action="#{tapSchemaEditing.undoRemove(tapSchemaEditing.selectedTable)}"> Undo <f:ajax execute="@form" render="@form" /> </h:commandLink> </div> </div> </h:panelGroup> <h:panelGroup rendered="#{!tapSchemaEditing.toRemove(tapSchemaEditing.selectedTable)}"> <div class="table-info clearfix"> <div class="form-horizontal" id="tableValues"> <div class="form-group col-lg-6"> <h:outputLabel for="table_utype" class="col-sm-3 control-label">Table utype</h:outputLabel> <div class="col-sm-9"> <h:inputText id="table_utype" class="form-control #{tapSchemaEditing.selectedTable.isChanged('utype') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedTable.getProperty('utype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedTable, 'utype')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> </div> <div class="form-group col-lg-6"> <h:outputLabel for="table_description" class="col-sm-3 control-label">Table description</h:outputLabel> <div class="col-sm-9"> <h:inputText id="table_description" class="form-control #{tapSchemaEditing.selectedTable.isChanged('description') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedTable.getProperty('description').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedTable, 'description')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> </div> </div> </div> <h:panelGroup layout="block" class="columns-header" id="columns_header"> <div class="columns-header-name"> Columns<h:outputText value=" " /> <h:commandLink class="btn btn-success" rendered="#{tapSchemaEditing.selectedTable.addableChildrenNames.size() gt 0}" action="#{tapSchemaEditing.openAddablesModal(tapSchemaEditing.selectedTable)}"> <span class="glyphicon glyphicon-plus-sign"></span> <f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" /> </h:commandLink> <h:commandLink rendered="#{tapSchemaEditing.hasColumnsSorter}" id="columns_sorter" action="#{columnsSorter.openModal(tapSchemaEditing.selectedTable)}"> <span class="glyphicon glyphicon-sort-by-attributes"></span> <f:ajax execute="@form" render="@this" onevent="TSM.openColumnsSorter" /> </h:commandLink> </div> <h:panelGroup rendered="#{tapSchemaEditing.selectedColumn ne null}" layout="block" class="columns-header-properties"> #{tapSchemaEditing.selectedColumn.name} <h:panelGroup rendered="#{tapSchemaEditing.selectedColumn.primaryKey}"> <span class="icon-key text-danger" title="Primary key"></span> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.getForeignKeyString(tapSchemaEditing.selectedColumn) ne null}"> <span class="icon-key text-success" title="Foreign key: #{tapSchemaEditing.getForeignKeyString(tapSchemaEditing.selectedColumn)}"></span> </h:panelGroup> <h:panelGroup rendered="#{!(tapSchemaEditing.selectedColumn.primaryKey or tapSchemaEditing.getForeignKeyString(tapSchemaEditing.selectedColumn) ne null) and tapSchemaEditing.selectedColumn.indexed}"> <span class="icon-index text-warning" title="Indexed"></span> </h:panelGroup> </h:panelGroup> </h:panelGroup> <div class="columns-wrapper"> <div class="columns-selector"> <ul class="nav nav-pills"> <ui:repeat value="#{tapSchemaEditing.columns}" var="column" id="columns-list"> <li role="presentation" class="#{tapSchemaEditing.selectedColumn.name eq column.name ? 'active': ''}"> <h:commandLink role="tab" action="#{tapSchemaEditing.setSelectedColumn(column)}" id="column-selector"> <h:commandButton class="btn btn-link remove-btn" disabled="#{!tapSchemaEditing.isColumnRemovable(column)}" value="×" onclick="TSM.stopPropagation(event)" id="column-remover"> <f:ajax execute="@form" render=":main:tables_wrapper" listener="#{tapSchemaEditing.removeColumn(column.name)}" /> </h:commandButton> <h:panelGroup rendered="#{column.primaryKey}"> <span class="icon-key text-danger" title="Primary key"></span> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.getForeignKeyString(column) ne null}"> <span class="icon-key text-success" title="Foreign key: #{tapSchemaEditing.getForeignKeyString(column)}"></span> </h:panelGroup> <h:panelGroup rendered="#{!(column.primaryKey or (tapSchemaEditing.getForeignKeyString(column) ne null)) and column.indexed}"> <span class="icon-index text-warning" title="Indexed"></span> </h:panelGroup> <span class="#{tapSchemaEditing.toRemove(column) ? 'strikeout':''}">#{column.name}</span> <f:ajax execute="@form" render=":main:tables_wrapper" /> </h:commandLink> </li> </ui:repeat> </ul> </div> <h:panelGroup id="column_wrapper"> <h:panelGroup class="column-info" layout="block" rendered="#{tapSchemaEditing.selectedColumn ne null}"> <h:panelGroup rendered="#{tapSchemaEditing.toRemove(tapSchemaEditing.selectedColumn)}"> <div class="alert alert-info clearfix"> <span class="glyphicon glyphicon-info-sign"></span> This column will be removed on TAP Schema Update. <h:commandLink class="btn btn-primary pull-right" action="#{tapSchemaEditing.undoRemoveColumn()}"> Undo <f:ajax execute="@form" render=":main:tables_wrapper" /> </h:commandLink> </div> </h:panelGroup> <h:panelGroup rendered="#{!tapSchemaEditing.toRemove(tapSchemaEditing.selectedColumn)}"> <div class="row"> <div class="col-xs-4"> <div class="checkbox"> <label> <h:selectBooleanCheckbox value="#{tapSchemaEditing.std}" class="#{tapSchemaEditing.selectedColumn.isChanged('std') ? 'changed' : ''}"> <f:ajax execute="@form" render="@this" /> </h:selectBooleanCheckbox> STD </label> </div> </div> <div class="col-xs-4"> <div class="checkbox"> <label> <h:selectBooleanCheckbox value="#{tapSchemaEditing.principal}" class="#{tapSchemaEditing.selectedColumn.isChanged('principal') ? 'changed' : ''}"> <f:ajax execute="@form" render="@this" /> </h:selectBooleanCheckbox> Principal </label> </div> </div> <div class="col-xs-4"> <div class="checkbox"> <h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('arraysize') eq null}"> <strong>Size:</strong> <span>#{tapSchemaEditing.selectedColumn.getProperty('size').value}</span> </h:panelGroup> <h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('arraysize') ne null}"> <strong>Arraysize:</strong> <span>#{tapSchemaEditing.selectedColumn.getProperty('arraysize').value}</span> </h:panelGroup> </div> </div> </div> <div class="form-group"> <h:outputLabel for="datatype" class="control-label">Datatype:</h:outputLabel> <h:inputText id="datatype" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('datatype') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('datatype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" render=":main:datatype-warning" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'datatype')}" onevent="TSM.textInputChanged" /> </h:inputText> <h:panelGroup id="datatype-warning"> <h:panelGroup class="text-warning" rendered="#{tapSchemaEditing.isShowWarning('datatype')}"> <small> <span class="glyphicon glyphicon-warning-sign"></span> Suggested value: #{tapSchemaEditing.selectedColumn.getProperty('datatype').defaultValue} </small> </h:panelGroup> </h:panelGroup> </div> <div class="form-group"> <h:outputLabel for="column_utype" class="control-label">UType:</h:outputLabel> <h:inputText id="column_utype" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('utype') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('utype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'utype')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> <div class="form-group"> <label for=":main:column_ucd" class="control-label">UCD:</label> <h:commandLink action="#{tapSchemaEditing.openUCDDialog()}" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('ucd') ? 'changed' : ''}" id="column_ucd"> #{tapSchemaEditing.selectedColumn.getProperty('ucd').value} <f:ajax execute="@form" render=":ucd_search_form:search_UCD_modal_content" onevent="TSM.openSearchUCDModal"/> </h:commandLink> </div> <div class="form-group"> <h:outputLabel for="column_unit" class="control-label">Unit:</h:outputLabel> <h:inputText id="column_unit" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('unit') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('unit').value}" autocomplete="off"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'unit')}" onevent="TSM.textInputChanged" render="vounit-validator" /> </h:inputText> <h:panelGroup id="vounit-validator"> <h:panelGroup rendered="#{!tapSchemaEditing.voUnitValidator.unset}"> <h:panelGroup rendered="#{tapSchemaEditing.voUnitValidator.parsable}"> <ul> <li> all units recognised <span class="#{tapSchemaEditing.voUnitValidator.allUnitsRecognised ? 'text-success' : 'text-danger'}"> <span class="glyphicon glyphicon-#{tapSchemaEditing.voUnitValidator.allUnitsRecognised ? 'ok' : 'remove'}"></span> </span> </li> <li> all units recommended <span class="#{tapSchemaEditing.voUnitValidator.allUnitsRecommended ? 'text-success' : 'text-danger'}"> <span class="glyphicon glyphicon-#{tapSchemaEditing.voUnitValidator.allUnitsRecommended ? 'ok' : 'remove'}"></span> </span> </li> <li> all constraints satisfied <span class="#{tapSchemaEditing.voUnitValidator.allUsageConstraintsSatisfied ? 'text-success' : 'text-danger'}"> <span class="glyphicon glyphicon-#{tapSchemaEditing.voUnitValidator.allUsageConstraintsSatisfied ? 'ok' : 'remove'}"></span> </span> </li> </ul> </h:panelGroup> <h:panelGroup rendered="#{!tapSchemaEditing.voUnitValidator.parsable}"> <p class="text-danger"> <span class="glyphicon glyphicon-remove"></span> <strong>Invalid VOUnit</strong>: #{tapSchemaEditing.voUnitValidator.exceptionMessage} </p> </h:panelGroup> </h:panelGroup> </h:panelGroup> </div> <div class="form-group"> <h:outputLabel for="column_description" class="control-label">Description:</h:outputLabel> <h:inputText id="column_description" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('description') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('description').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'description')}" onevent="TSM.textInputChanged" /> </h:inputText> </div> <h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('column_index') ne null}"> <h:outputLabel for="column_index" class="control-label">Column index:</h:outputLabel> <h:inputText id="column_index" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('column_index') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('column_index').value}"> <f:converter converterId="javax.faces.Integer" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'column_index')}" onevent="TSM.textInputChanged" /> </h:inputText> </h:panelGroup> <h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('xtype') ne null}"> <h:outputLabel for="column_xtype" class="control-label">Xtype:</h:outputLabel> <h:inputText id="column_xtype" class="form-control #{tapSchemaEditing.selectedColumn.isChanged('xtype') ? 'changed' : ''}" value="#{tapSchemaEditing.selectedColumn.getProperty('xtype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" render=":main:xtype-warning" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'xtype')}" onevent="TSM.textInputChanged" /> </h:inputText> <h:panelGroup id="xtype-warning"> <h:panelGroup class="text-warning" rendered="#{tapSchemaEditing.isShowWarning('xtype')}"> <small> <span class="glyphicon glyphicon-warning-sign"></span> Suggested value: #{tapSchemaEditing.selectedColumn.getProperty('xtype').defaultValue} </small> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:panelGroup> </div> </h:panelGroup> </div> </h:panelGroup> </h:panelGroup> </h:panelGroup> </div> </h:panelGroup> <div class="modal fade" tabindex="-1" role="dialog" id="addablesModal"> <div class="modal-dialog modal-lg"> <h:panelGroup class="modal-content" id="addables_modal_content" layout="block"> <div class="modal-header"> <div class="pull-right"> <h:commandLink class="btn btn-default btn-sm" action="#{tapSchemaEditing.checkAllEntities(false)}"> <span class="glyphicon glyphicon-remove"></span> Deselect all <f:ajax execute="@form" render=":main:addables_modal_content" /> </h:commandLink> </div> <div class="hpadding pull-right"> <h:commandLink class="btn btn-default btn-sm" action="#{tapSchemaEditing.checkAllEntities(true)}"> <span class="glyphicon glyphicon-ok"></span> Select all <f:ajax execute="@form" render=":main:addables_modal_content" /> </h:commandLink> </div> <h4 class="modal-title">Add</h4> </div> <div class="modal-body"> <div class="addables"> <h:panelGroup rendered="#{tapSchemaEditing.currentAddingContainer ne null}"> <ui:repeat value="#{tapSchemaEditing.currentAddables}" var="item"> <div class="checkbox"> <label> <h:selectBooleanCheckbox value="#{item.selected}"/> #{item.name} </label> </div> </ui:repeat> </h:panelGroup> </div> </div> <div class="modal-footer"> <h:panelGroup class="checkbox pull-left" layout="block" rendered="#{tapSchemaEditing.canAddChildren}"> <label> <h:selectBooleanCheckbox value="#{tapSchemaEditing.addAlsoAllChildren}" /> Add also all children </label> </h:panelGroup> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <h:commandLink class="btn btn-primary" action="#{tapSchemaEditing.addSelected}"> Add <f:ajax execute="@form" render=":main:main_panel" onevent="TSM.entitiesAdded" /> </h:commandLink> </div> </h:panelGroup> </div> </div> <div class="modal fade" tabindex="-1" role="dialog" id="keysModal"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Keys</h4> </div> <h:panelGroup class="modal-body" layout="block" id="keys-panel"> <table class="table table-striped"> <thead> <tr> <th>Id</th> <th>From table</th> <th>From columns</th> <th>Target table</th> <th>Target columns</th> <th>Utype</th> <th>Description</th> </tr> </thead> <tbody> <ui:repeat value="#{tapSchemaEditing.visibleKeys}" var="key"> <tr> <td>#{key.id}</td> <td>#{key.fromTableCompleteName}</td> <td>#{tapSchemaEditing.formatFromColumns(key)}</td> <td>#{key.targetTableCompleteName}</td> <td>#{tapSchemaEditing.formatTargetColumns(key)}</td> <td> <h:inputText id="key_utype" class="form-control #{key.isChanged('utype') ? 'changed' : ''}" value="#{key.getProperty('utype').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(key, 'utype')}" onevent="TSM.textInputChanged" /> </h:inputText> </td> <td> <h:inputText id="key_description" class="form-control #{key.isChanged('description') ? 'changed' : ''}" value="#{key.getProperty('description').value}"> <f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" /> <f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(key, 'description')}" onevent="TSM.textInputChanged" /> </h:inputText> </td> </tr> </ui:repeat> </tbody> </table> </h:panelGroup> </div> </div> </div> <tsm_components:ucd_editor id="ucd-editor" /> <ui:include src="WEB-INF/include/colum_sorting_modal.xhtml" rendered="#{tapSchemaEditing.hasColumnsSorter}" /> </h:form> <div class="modal fade" tabindex="-1" role="dialog" id="searchUCDModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <h:form id="ucd_search_form"> <h:panelGroup id="search_UCD_modal_content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button> <h4 class="modal-title">UCD Search Dialog</h4> </div> <div class="modal-body"> <div class="form-group"> <h:selectOneRadio value="#{tapSchemaEditing.searchUCDDialog.manualInsertion}"> <f:selectItem itemValue="#{false}" itemLabel="Search by description" /> <f:selectItem itemValue="#{true}" itemLabel="Manual insertion" /> <f:ajax execute="@this" render=":ucd_search_form:UCDDialogBodyMainContent :ucd_search_form:ucdDialogFooter" /> </h:selectOneRadio> </div> <h:panelGroup layout="block" id="UCDDialogBodyMainContent"> <h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.UCDServiceErrorMessage ne null}"> <div class="alert alert-danger"> <strong>Error while communicating with UCD web service:</strong> #{tapSchemaEditing.searchUCDDialog.UCDServiceErrorMessage} </div> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.manualInsertion}"> <div class="form-group"> <h:outputLabel for="ucd_text_manual" class="control-label">UCD:</h:outputLabel> <h:inputText id="ucd_text_manual" class="form-control" value="#{tapSchemaEditing.searchUCDDialog.UCDManualText}" autocomplete="off"> <f:ajax execute="@form" render=":ucd_search_form:ucd_validation_result :ucd_search_form:save_ucd" event="keyup" listener="#{tapSchemaEditing.searchUCDDialog.validateManualUCD}" /> </h:inputText> <h:panelGroup id="ucd_validation_result"> <h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.UCDManualText ne null}"> <table class="table"> <thead> <tr> <th>Valid:</th> <th>Recognized:</th> <th>Recommended:</th> </tr> </thead> <tbody> <tr> <td> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.valid}"> <span class="text-success"><span class="glyphicon glyphicon-ok"></span></span> </h:panelGroup> <h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.valid}"> <span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span> </h:panelGroup> </td> <td> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.recognised}"> <span class="text-success"><span class="glyphicon glyphicon-ok"></span></span> </h:panelGroup> <h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.recognised}"> <span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span> </h:panelGroup> </td> <td> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.recommended}"> <span class="text-success"><span class="glyphicon glyphicon-ok"></span></span> </h:panelGroup> <h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.recommended}"> <span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span> </h:panelGroup> </td> </tr> </tbody> </table> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD ne null}"> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.suggestedUCD ne null}"> Suggested UCD: ${tapSchemaEditing.searchUCDDialog.parsedUCD.suggestedUCD} </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.advices.size() gt 0}"> <h5 class="text-info"><strong>Advices:</strong></h5> <ul> <ui:repeat value="${tapSchemaEditing.searchUCDDialog.parsedUCD.advices}" var="advice"> <li class="text-info">${advice}</li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.errors.size() gt 0}"> <h5 class="text-danger"><strong>Errors:</strong></h5> <ul> <ui:repeat value="${tapSchemaEditing.searchUCDDialog.parsedUCD.errors}" var="error"> <li class="text-danger">${error}</li> </ui:repeat> </ul> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:panelGroup> </div> </h:panelGroup> <h:panelGroup rendered="#{!tapSchemaEditing.searchUCDDialog.manualInsertion}"> <div class="form-group"> <h:outputLabel for="ucd_dialog_description" class="control-label">Description:</h:outputLabel> <div class="input-group"> <h:inputText id="ucd_dialog_description" class="form-control" value="#{tapSchemaEditing.searchUCDDialog.description}" onkeydown="TSM.ucdTextKeyDown(event)" /> <span class="input-group-btn"> <h:commandLink class="btn btn-default" action="#{tapSchemaEditing.searchUCDDialog.search()}" id="search_UCD_btn"> <span class="glyphicon glyphicon-search"></span> <f:ajax execute="@form" render="@form" /> </h:commandLink> </span> </div> </div> <h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.UCDnotFound}"> <div class="alert alert-danger" role="alert"> No UCD found for this description! </div> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.selectedUCD ne null}"> <div class="alert alert-info" role="alert"> <strong>Selected UCD: </strong> <h:panelGroup id="selected-ucd">#{tapSchemaEditing.searchUCDDialog.selectedUCD}</h:panelGroup> </div> </h:panelGroup> <h:panelGroup layout="block" class="form-group" rendered="false"> <label class="control-label">Suggested complete UCD:</label> <h:commandLink class="btn-default text-left form-control" action="#{tapSchemaEditing.searchUCDDialog.selectUCD(tapSchemaEditing.searchUCDDialog.suggestedUCD)}"> #{tapSchemaEditing.searchUCDDialog.suggestedUCD} <f:ajax execute="@form" render=":ucd_search_form:selected-ucd" /> </h:commandLink> </h:panelGroup> <h:panelGroup layout="block" class="form-group" rendered="#{tapSchemaEditing.searchUCDDialog.selectableUCDs.size() gt 0}"> <label class="control-label">Selectable UCDs:</label> <ui:repeat value="#{tapSchemaEditing.searchUCDDialog.selectableUCDs}" var="ucd"> <h:commandLink class="btn-default text-left form-control" action="#{tapSchemaEditing.searchUCDDialog.selectUCD(ucd)}"> #{ucd} <f:ajax execute="@form" render=":ucd_search_form:selected-ucd" /> </h:commandLink> </ui:repeat> </h:panelGroup> <h:panelGroup class="vpadding" layout="block" rendered="#{tapSchemaEditing.searchUCDDialog.suggestedUCDs.size() gt 0}"> <label class="control-label">Other suggested UCD:</label> <table class="table table-bordered"> <thead> <tr> <th>Word</th> <th>Definition</th> <th>Flag</th> </tr> </thead> <tbody> <ui:remove> <h:panelGroup class="input-group ucd-selector-group" layout="block" id="ucd-selector-group"> <span class="input-group-addon">#{ucdInfo.score}</span> <span class="input-group-addon flag#{ucdInfo.flag}">#{ucdInfo.flag}</span> <h:commandLink class="form-control text-left btn-default selectUCD" action="#{tapSchemaEditing.searchUCDDialog.selectUCD(ucdInfo.word)}"> <span class="resultWord">#{ucdInfo.word}</span> <f:ajax execute="@form" render=":ucd_search_form:selected-ucd" /> </h:commandLink> <h:panelGroup class="input-group-btn" rendered="#{ucdInfo.definition eq null}"> <h:commandLink class="btn btn-default" action="#{tapSchemaEditing.searchUCDDialog.explain(ucdInfo)}"> <span class="glyphicon glyphicon-question-sign"></span> <f:ajax execute="@form" render="@this udc-definition ucd-selector-group" onevent="function (event) { TSM.UCDDescriptionAdded(event, #{loop.index}); }" /> </h:commandLink> </h:panelGroup> <h:panelGroup class="input-group-btn" rendered="#{ucdInfo.definition ne null}"> <a class="btn btn-default" role="button" onclick="TSM.showUCDDescription(event)"> <span class="glyphicon glyphicon-question-sign"></span> </a> </h:panelGroup> </h:panelGroup> <div class="resultDefinition collapse"> <h:panelGroup class="help-block" id="udc-definition">#{ucdInfo.definition}</h:panelGroup> </div> </ui:remove> <ui:repeat value="#{tapSchemaEditing.searchUCDDialog.suggestedUCDs}" var="ucdInfo" varStatus="loop"> <tr class="flag#{ucdInfo.flag}"> <td> <label> <h:selectBooleanCheckbox value="#{ucdInfo.selected}" /> #{ucdInfo.word} </label> </td> <td> #{ucdInfo.definition} </td> <td title="#{ucdInfo.flagExplanation}"> #{ucdInfo.flag} </td> </tr> </ui:repeat> </tbody> </table> <div class="text-center"> <h:commandLink class="btn btn-primary" action="#{tapSchemaEditing.searchUCDDialog.rebuildUCD()}"> Rebuild UCDs <f:ajax execute="@form" render=":ucd_search_form:search_UCD_modal_content" /> </h:commandLink> </div> </h:panelGroup> </h:panelGroup> </h:panelGroup> </div> <h:panelGroup class="modal-footer" id="ucdDialogFooter" layout="block"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <h:commandButton id="save_ucd" class="btn btn-primary" disabled="#{(!tapSchemaEditing.searchUCDDialog.manualInsertion and tapSchemaEditing.searchUCDDialog.selectedUCD eq null) or (tapSchemaEditing.searchUCDDialog.manualInsertion and (tapSchemaEditing.searchUCDDialog.parsedUCD ne null and !tapSchemaEditing.searchUCDDialog.parsedUCD.valid))}" action="#{tapSchemaEditing.saveUCD()}" value="Save changes"> <f:ajax execute="@form" render="@form :main:column_ucd" onevent="TSM.saveUCDCalled" /> </h:commandButton> </h:panelGroup> </h:panelGroup> </h:form> </div> </div> </div> <div class="modal fade" tabindex="-1" role="dialog" id="updateSuccessModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <div class="alert alert-success" role="alert"> <p> <span class="glyphicon glyphicon-info-sign"></span> TAP_SCHEMA successfully updated! </p> </div> <div class="text-center"> <button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button> </div> </div> </div> </div> </div> <div class="modal fade" tabindex="-1" role="dialog" id="updateOperationsModal"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h3 class="modal-title">Update operations</h3> </div> <div class="modal-body"> <h:form id="update-operations-form"> <h:panelGroup rendered="#{tapSchemaEditing.updateOperations ne null}"> <h:panelGroup rendered="#{!tapSchemaEditing.updateOperations.hasOperations}"> <p>No changes detected</p> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.updateOperations.hasOperations}"> <h:panelGroup rendered="#{tapSchemaEditing.updateOperations.hasEntitiesToRemove}"> <h4>Entities that will be removed</h4> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.keysToRemove.size() gt 0}"> <p>Keys:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.keysToRemove}" var="key"> <li> ${key} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.columnsToRemove.size() gt 0}"> <p>Columns:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.columnsToRemove}" var="column"> <li> ${column.tableCompleteName}.${column.name} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.tablesToRemove.size() gt 0}"> <p>Tables:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.tablesToRemove}" var="table"> <li> ${table.completeName} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.schemasToRemove.size() gt 0}"> <p>Schemas:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.schemasToRemove}" var="schema"> <li> ${schema.name} </li> </ui:repeat> </ul> </h:panelGroup> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.updateOperations.hasEntitiesToAdd}"> <h4>Entities that will be added</h4> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.keysToAdd.size() gt 0}"> <p>Keys:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.keysToAdd}" var="key"> <li> ${key} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.columnsToAdd.size() gt 0}"> <p>Columns:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.columnsToAdd}" var="column"> <li> ${column.tableCompleteName}.${column.name} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.tablesToAdd.size() gt 0}"> <p>Tables:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.tablesToAdd}" var="table"> <li> ${table.completeName} </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.schemasToAdd.size() gt 0}"> <p>Schemas:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.schemasToAdd}" var="schema"> <li> ${schema.name} </li> </ui:repeat> </ul> </h:panelGroup> </h:panelGroup> <h:panelGroup rendered="#{tapSchemaEditing.updateOperations.hasEntitiesToUpdate}"> <h4>Entities that will be updated</h4> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.keysToUpdate.size() gt 0}"> <p>Keys:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.keysToUpdate}" var="key"> <li> ${key} <ul> <li> ${tapSchemaEditing.getUpdatedValues(key)} </li> </ul> </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.columnsToUpdate.size() gt 0}"> <p>Columns:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.columnsToUpdate}" var="column"> <li> ${column.tableCompleteName}.${column.name} <ul> <li> ${tapSchemaEditing.getUpdatedValues(column)} </li> </ul> </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.tablesToUpdate.size() gt 0}"> <p>Tables:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.tablesToUpdate}" var="table"> <li> ${table.completeName} <ul> <li> ${tapSchemaEditing.getUpdatedValues(table)} </li> </ul> </li> </ui:repeat> </ul> </h:panelGroup> <h:panelGroup rendered="${tapSchemaEditing.updateOperations.schemasToUpdate.size() gt 0}"> <p>Schemas:</p> <ul> <ui:repeat value="#{tapSchemaEditing.updateOperations.schemasToUpdate}" var="schema"> <li> ${schema.name} <ul> <li> ${tapSchemaEditing.getUpdatedValues(schema)} </li> </ul> </li> </ui:repeat> </ul> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:panelGroup> </h:form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-success" onclick="TSM.updateFromModal()"> <span class="icon-save"></span>Update </button> </div> </div> </div> </div> <h:form id="async-loader" class="hide"> <h:commandButton action="#{tapSchemaLoader.openLoaded()}" id="open-loaded" /> </h:form> </ui:define> </ui:composition>