Newer
Older
<?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"
Sonia Zorba
committed
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<ui:define name="title">Editing #{tapSchemaEditing.tapSchema.name}</ui:define>
<ui:define name="scripts">
<h:outputScript library="js" name="edit-tapschema.js"></h:outputScript>
<script>
TSM.initUCDValidator('#{tapSchemaEditing.searchUCDDialog.UCDRegExp}');
</script>
<h:outputScript library="js" name="keepalive.js"></h:outputScript>
<script>startKeepAlive('#{keepalive.restPath}', '#{keepalive.conversationId}');</script>
</ui:define>
<ui:define name="content">
Sonia Zorba
committed
<c:set var="UCDDialog" value="#{tapSchemaEditing.searchUCDDialog}" />
Sonia Zorba
committed
<h:form id="main">
<h1 class="text-center">
Editing #{tapSchemaEditing.tapSchema.name}
</h1>
Sonia Zorba
committed
<div class="col-sm-6 vpadding text-center">
<h:commandLink class="btn btn-info" action="#{tapSchemaEditing.displayUpdateOperations()}">
<span class="glyphicon glyphicon-info-sign"></span>
Display update operations
<f:ajax execute="@form" render="update-operations-form" onevent="TSM.displayUpdateOperations"/>
</h:commandLink>
 
<h:commandLink class="btn btn-success" action="#{tapSchemaEditing.update()}" id="update-btn">
Sonia Zorba
committed
<span class="icon-save"></span>
Update
<f:ajax execute="@form" render="@form" onevent="TSM.notifyUpdate"/>
Sonia Zorba
committed
</h:commandLink>
 
<h:commandLink class="btn btn-info" action="#{tapSchemaEditing.reload()}">
<span class="glyphicon glyphicon-refresh"></span>
Reload all
</h:commandLink>
Sonia Zorba
committed
</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=" " />
<h:commandLink class="btn btn-danger" action="#{tapSchemaEditing.logout()}">
<span class="glyphicon glyphicon-log-out"></span>
Close session
</h:commandLink>
</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.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>
Sonia Zorba
committed
<f:ajax execute="@form" render="@form" />
<h:commandButton class="remove-btn" rendered="#{!tapSchemaEditing.toRemove(schema)}" action="#{tapSchemaEditing.tapSchema.removeChild(schema.name)}" value="×" onclick="TSM.stopPropagation(event)">
Sonia Zorba
committed
<f:ajax execute="@form" render="@form" />
</h:commandButton>
</h:commandLink>
</li>
</ui:repeat>
<h:panelGroup rendered="#{tapSchemaEditing.tapSchema.addableChildrenNames.size() gt 0}">
Sonia Zorba
committed
<li>
<h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchemaEditing.tapSchema)}">
Sonia Zorba
committed
<span class="glyphicon glyphicon-plus-sign"></span>
<f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" />
Sonia Zorba
committed
</h:commandLink>
</li>
</h:panelGroup>
Sonia Zorba
committed
<div role="tabpanel" class="tab-content">
<h:panelGroup rendered="#{tapSchemaEditing.selectedSchema ne null and tapSchemaEditing.toRemove(tapSchemaEditing.selectedSchema)}">
Sonia Zorba
committed
<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)}">
Sonia Zorba
committed
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">
Sonia Zorba
committed
<h:outputLabel for="schema_utype" class="col-sm-3 control-label">Schema utype</h:outputLabel>
Sonia Zorba
committed
<h:inputText
id="schema_utype"
class="form-control #{tapSchemaEditing.selectedSchema.isChanged('utype') ? 'changed' : ''}"
value="#{tapSchemaEditing.selectedSchema.utype}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedSchema, 'utype')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
</div>
</div>
<div class="form-group col-lg-6">
Sonia Zorba
committed
<h:outputLabel for="schema_description" class="col-sm-3 control-label">Schema description</h:outputLabel>
<div class="col-sm-9">
Sonia Zorba
committed
<h:inputText
id="schema_description"
class="form-control #{tapSchemaEditing.selectedSchema.isChanged('description') ? 'changed' : ''}"
value="#{tapSchemaEditing.selectedSchema.description}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedSchema, 'description')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
</div>
</div>
</div>
</div>
Sonia Zorba
committed
<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.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)}" action="#{tapSchemaEditing.selectedSchema.removeChild(table.name)}" value="×" onclick="TSM.stopPropagation(event)">
<f:ajax execute="@form" render=":main:tables_wrapper" />
Sonia Zorba
committed
</h:commandButton>
</h:commandLink>
</li>
</ui:repeat>
<h:panelGroup rendered="#{tapSchemaEditing.selectedSchema.addableChildrenNames.size() gt 0}">
Sonia Zorba
committed
<li>
<h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchemaEditing.selectedSchema)}">
Sonia Zorba
committed
<span class="glyphicon glyphicon-plus-sign"></span>
<f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" />
Sonia Zorba
committed
</h:commandLink>
</li>
</h:panelGroup>
</ul>
<h:panelGroup rendered="#{tapSchemaEditing.selectedTable ne null}">
Sonia Zorba
committed
<div role="tabpanel">
<h:panelGroup rendered="#{tapSchemaEditing.toRemove(tapSchemaEditing.selectedTable)}">
Sonia Zorba
committed
<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)}">
Sonia Zorba
committed
Undo
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</div>
</div>
Sonia Zorba
committed
</h:panelGroup>
<h:panelGroup rendered="#{!tapSchemaEditing.toRemove(tapSchemaEditing.selectedTable)}">
Sonia Zorba
committed
<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.utype}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedTable, 'utype')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</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.description}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedTable, 'description')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
</div>
</div>
</div>
</div>
Sonia Zorba
committed
<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)}">
Sonia Zorba
committed
<span class="glyphicon glyphicon-plus-sign"></span>
<f:ajax execute="@form" render=":main:addables_modal_content" onevent="TSM.openAddablesModal" />
Sonia Zorba
committed
</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}">
Sonia Zorba
committed
<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>
Sonia Zorba
committed
</h:panelGroup>
<h:panelGroup rendered="#{!(tapSchemaEditing.selectedColumn.primaryKey or tapSchemaEditing.getForeignKeyString(tapSchemaEditing.selectedColumn) ne null) and tapSchemaEditing.selectedColumn.indexed}">
Sonia Zorba
committed
<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.selectedTable.addedOrRemovedChildren}" 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.toRemove(column)}" value="×" onclick="TSM.stopPropagation(event)" id="column-remover">
<f:ajax execute="@form" render=":main:column_wrapper :main:columns_header" listener="#{tapSchemaEditing.removeColumn(column.name)}" onevent="TSM.columnRemoved" />
Sonia Zorba
committed
</h:commandButton>
Sonia Zorba
committed
<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>
Sonia Zorba
committed
</h:panelGroup>
<h:panelGroup rendered="#{!(column.primaryKey or (tapSchemaEditing.getForeignKeyString(column) ne null)) and column.indexed}">
Sonia Zorba
committed
<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:column_wrapper :main:columns_header" onevent="TSM.columnChanged" />
Sonia Zorba
committed
</h:commandLink>
</li>
</ui:repeat>
</ul>
</div>
Sonia Zorba
committed
<h:panelGroup id="column_wrapper">
<h:panelGroup class="column-info" layout="block" rendered="#{tapSchemaEditing.selectedColumn ne null}">
<h:panelGroup rendered="#{tapSchemaEditing.toRemove(tapSchemaEditing.selectedColumn)}">
Sonia Zorba
committed
<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:column_wrapper :main:columns_header" onevent="TSM.columnRemovalUndo" />
Sonia Zorba
committed
</h:commandLink>
</div>
</h:panelGroup>
<h:panelGroup rendered="#{!tapSchemaEditing.toRemove(tapSchemaEditing.selectedColumn)}">
Sonia Zorba
committed
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label for="datatype" class="control-label">Datatype:</label>
<span>#{tapSchemaEditing.selectedColumn.datatype}</span>
Sonia Zorba
committed
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label for="size" class="control-label">Size:</label>
<span>#{tapSchemaEditing.selectedColumn.size}</span>
Sonia Zorba
committed
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="checkbox">
<label>
<h:selectBooleanCheckbox
value="#{tapSchemaEditing.selectedColumn.std}"
class="#{tapSchemaEditing.selectedColumn.isChanged('std') ? 'changed' : ''}">
Sonia Zorba
committed
<f:ajax execute="@form" render="@this" />
</h:selectBooleanCheckbox>
STD
</label>
</div>
</div>
<div class="col-xs-6">
<div class="checkbox">
<label>
<h:selectBooleanCheckbox
value="#{tapSchemaEditing.selectedColumn.principal}"
class="#{tapSchemaEditing.selectedColumn.isChanged('principal') ? 'changed' : ''}">
Sonia Zorba
committed
<f:ajax execute="@form" render="@this" />
</h:selectBooleanCheckbox>
Principal
</label>
</div>
</div>
</div>
<div class="form-group">
Sonia Zorba
committed
<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.utype}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'utype')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</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.UCD}
<f:ajax execute="@form" render=":ucd_search_form:search_UCD_modal_content" onevent="TSM.openSearchUCDModal"/>
Sonia Zorba
committed
</h:commandLink>
</div>
Sonia Zorba
committed
<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.unit}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'unit')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
Sonia Zorba
committed
<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.description}">
<f:converter converterId="it.inaf.ia2.NullOrEmptyConverter" />
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'description')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
Sonia Zorba
committed
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
</div>
Sonia Zorba
committed
</h:panelGroup>
</div>
Sonia Zorba
committed
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
</div>
Sonia Zorba
committed
</h:panelGroup>
Sonia Zorba
committed
<div class="modal fade" tabindex="-1" role="dialog" id="addablesModal">
<div class="modal-dialog">
<div class="modal-content">
<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" />
Sonia Zorba
committed
</h:commandLink>
</div>
Sonia Zorba
committed
<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" />
Sonia Zorba
committed
</h:commandLink>
</div>
<h4 class="modal-title">Add</h4>
</div>
<div class="modal-body">
<div class="clearfix">
</div>
Sonia Zorba
committed
<div class="addables">
<h:panelGroup id="addables_modal_content">
<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>
</h:panelGroup>
</div>
</div>
Sonia Zorba
committed
<div class="modal-footer">
<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" />
Sonia Zorba
committed
</h:commandLink>
</div>
</div>
</div>
Sonia Zorba
committed
</div>
</h:form>
Sonia Zorba
committed
<div class="modal fade" tabindex="-1" role="dialog" id="searchUCDModal">
<div class="modal-dialog">
<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">
Sonia Zorba
committed
<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="#{UCDDialog.manualInsertion}" valueChangeListener="#{UCDDialog.setDefault()}">
<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="#{UCDDialog.UCDServiceErrorMessage ne null}">
<div class="alert alert-danger">
<strong>Error while communicating with UCD web service:</strong>
#{UCDDialog.UCDServiceErrorMessage}
Sonia Zorba
committed
</div>
</h:panelGroup>
<h:panelGroup rendered="#{UCDDialog.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="#{UCDDialog.UCDManualText}" autocomplete="off">
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<f:ajax execute="@form" render=":ucd_search_form:ucd_validation_result :ucd_search_form:save_ucd" event="keyup" listener="#{UCDDialog.validateManualUCD}" />
</h:inputText>
<h:panelGroup id="ucd_validation_result">
<table class="table">
<thead>
<tr>
<th>Valid:</th>
<th>Recognized:</th>
<th>Recommended:</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h:panelGroup rendered="${UCDDialog.parsedUCD.valid}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
<h:panelGroup rendered="${!UCDDialog.parsedUCD.valid}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
<td>
<h:panelGroup rendered="${UCDDialog.parsedUCD.recognised}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
<h:panelGroup rendered="${!UCDDialog.parsedUCD.recognised}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
<td>
<h:panelGroup rendered="${UCDDialog.parsedUCD.recommended}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
<h:panelGroup rendered="${!UCDDialog.parsedUCD.recommended}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
</tr>
</tbody>
</table>
<h:panelGroup rendered="${UCDDialog.parsedUCD ne null}">
<h:panelGroup rendered="${UCDDialog.parsedUCD.suggestedUCD ne null}">
Suggested UCD: ${UCDDialog.parsedUCD.suggestedUCD}
</h:panelGroup>
<h:panelGroup rendered="${UCDDialog.parsedUCD.advices.size() gt 0}">
<h5 class="text-info"><strong>Advices:</strong></h5>
<ul>
<ui:repeat value="${UCDDialog.parsedUCD.advices}" var="advice">
<li class="text-info">${advice}</li>
</ui:repeat>
</ul>
</h:panelGroup>
<h:panelGroup rendered="${UCDDialog.parsedUCD.errors.size() gt 0}">
<h5 class="text-danger"><strong>Errors:</strong></h5>
<ul>
<ui:repeat value="${UCDDialog.parsedUCD.errors}" var="error">
<li class="text-danger">${error}</li>
</ui:repeat>
</ul>
</h:panelGroup>
</h:panelGroup>
Sonia Zorba
committed
</div>
</h:panelGroup>
<h:panelGroup rendered="#{!UCDDialog.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="#{UCDDialog.description}" onkeydown="TSM.ucdTextKeyDown(event)" />
<span class="input-group-btn">
<h:commandLink class="btn btn-default" action="#{UCDDialog.search(UCDDialog.description)}" id="search_UCD_btn">
<span class="glyphicon glyphicon-search"></span>
Sonia Zorba
committed
</h:commandLink>
</span>
</div>
</div>
<h:panelGroup rendered="#{UCDDialog.UCDnotFound}">
<div class="alert alert-danger" role="alert">
No UCD found for this description!
</div>
</h:panelGroup>
<h:panelGroup rendered="#{UCDDialog.selectedUCD ne null}">
<div class="alert alert-info" role="alert">
<strong>Selected UCD:</strong>
<h:panelGroup id="selected-ucd">#{UCDDialog.selectedUCD}</h:panelGroup>
</div>
</h:panelGroup>
<h:panelGroup layout="block" class="form-group" rendered="#{UCDDialog.suggestedUCD ne null}">
<label class="control-label">Suggested complete UCD:</label>
<h:commandLink class="btn-default text-left form-control" action="#{UCDDialog.selectUCD(UCDDialog.suggestedUCD)}">
#{UCDDialog.suggestedUCD}
<f:ajax execute="@form" render=":ucd_search_form:selected-ucd" />
</h:commandLink>
</h:panelGroup>
<h:panelGroup class="vpadding" layout="block" rendered="#{UCDDialog.suggestedUCDs.size() gt 0}">
<label class="control-label">Other suggested UCD:</label>
<ui:repeat value="#{UCDDialog.suggestedUCDs}" var="ucdInfo" varStatus="loop">
<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="#{UCDDialog.selectUCD(ucdInfo.word)}">
<span class="resultWord">#{ucdInfo.word}</span>
<f:ajax execute="@form" render=":ucd_search_form:selected-ucd" />
<h:panelGroup class="input-group-btn" rendered="#{ucdInfo.definition eq null}">
<h:commandLink class="btn btn-default" action="#{UCDDialog.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: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>
<div class="resultDefinition collapse">
<h:panelGroup class="help-block" id="udc-definition">#{ucdInfo.definition}</h:panelGroup>
</div>
</ui:repeat>
</h:panelGroup>
Sonia Zorba
committed
</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="#{(!UCDDialog.manualInsertion and UCDDialog.selectedUCD eq null) or (UCDDialog.manualInsertion and (UCDDialog.parsedUCD eq null or !UCDDialog.parsedUCD.valid))}" action="#{tapSchemaEditing.saveUCD()}" value="Save changes">
<f:ajax execute="@form" render="@form :main:column_ucd" onevent="TSM.saveUCDCalled" />
Sonia Zorba
committed
</h:commandButton>
Sonia Zorba
committed
</h:panelGroup>
</h:form>
</div>
</div>
</div>
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
<div class="modal fade" tabindex="-1" role="dialog" id="errorModal" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-danger">
<span class="glyphicon glyphicon-alert"></span>
Error
</h4>
</div>
<div class="modal-body">
<p>An error occurred. The page will be reloaded.</p>
<div class="alert alert-danger" role="alert">
<p><strong class="errorName"></strong></p>
<p class="errorMessage"></p>
</div>
</div>
<div class="modal-footer">
<h:form>
<h:commandLink class="btn btn-primary">Ok</h:commandLink>
</h:form>
</div>
</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>
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
<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>
<div class="loading hide">
<div class="icon-wrapper">
<span class="glyphicon glyphicon-refresh animate-spin"></span>
</div>
</div>
</ui:define>
</ui:composition>