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"
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>
Sonia Zorba
committed
<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">
Sonia Zorba
committed
<f:event listener="#{loggedInChecker.checkFromNonIndex()}" type="preRenderView" />
Sonia Zorba
committed
<h:form id="main">
Sonia Zorba
committed
<tsm_components:user_navbar />
<h1 class="text-center">
Editing #{tapSchemaEditing.tapSchema.name}
</h1>
Sonia Zorba
committed
<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">
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()}" onclick="showWaiting()">
<span class="glyphicon glyphicon-refresh"></span>
Reload all
<f:ajax execute="@form" render="@form" onevent="TSM.asyncLoader.reloadClicked" />
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=" " />
</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 #{schema.name eq tapSchemaEditing.tapSchema.name ? '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>
Sonia Zorba
committed
<f:ajax execute="@form" render="@form" />
<h:commandButton class="remove-btn" rendered="#{!tapSchemaEditing.toRemove(schema) and schema.name ne tapSchemaEditing.tapSchema.name}" 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.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" />
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.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" />
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 #{table.parent.name eq tapSchemaEditing.tapSchema.name ? '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 table.parent.name ne tapSchemaEditing.tapSchema.name}" 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.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" />
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.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" />
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) or column.parent.parent.name eq tapSchemaEditing.tapSchema.name}" value="×" onclick="TSM.stopPropagation(event)" id="column-remover">
<f:ajax execute="@form" render=":main:tables_wrapper" listener="#{tapSchemaEditing.removeColumn(column.name)}" />
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:tables_wrapper" />
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:tables_wrapper" />
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.getProperty('datatype').value}</span>
Sonia Zorba
committed
</div>
</div>
<div class="col-xs-6">
<h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('arraysize') eq null}">
Sonia Zorba
committed
<label for="size" class="control-label">Size:</label>
<span>#{tapSchemaEditing.selectedColumn.getProperty('size').value}</span>
</h:panelGroup>
<h:panelGroup class="form-group" layout="block" rendered="#{tapSchemaEditing.selectedColumn.getProperty('arraysize') ne null}">
<label for="arraysize" class="control-label">Arraysize:</label>
<span>#{tapSchemaEditing.selectedColumn.getProperty('arraysize').value}</span>
</h:panelGroup>
Sonia Zorba
committed
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="checkbox">
<label>
<h:selectBooleanCheckbox
value="#{tapSchemaEditing.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.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.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" />
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.getProperty('UCD').value}
<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.getProperty('unit').value}"
<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" />
Sonia Zorba
committed
</h:inputText>
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<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>
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.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" />
Sonia Zorba
committed
</h:inputText>
<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" listener="#{tapSchemaEditing.textInputChanged(tapSchemaEditing.selectedColumn, 'xtype')}" onevent="TSM.textInputChanged" />
</h:inputText>
</h:panelGroup>
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 modal-lg">
<h:panelGroup class="modal-content" id="addables_modal_content" layout="block">
Sonia Zorba
committed
<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="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>
Sonia Zorba
committed
</h:panelGroup>
</div>
</div>
Sonia Zorba
committed
<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>
Sonia Zorba
committed
<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>
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
</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>
Sonia Zorba
committed
</div>
Sonia Zorba
committed
<tsm_components:ucd_editor id="ucd-editor" />
Sonia Zorba
committed
</h:form>
Sonia Zorba
committed
<div class="modal fade" tabindex="-1" role="dialog" id="searchUCDModal">
Sonia Zorba
committed
<div class="modal-dialog modal-lg">
Sonia Zorba
committed
<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">
Sonia Zorba
committed
<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">
Sonia Zorba
committed
<h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.UCDServiceErrorMessage ne null}">
<div class="alert alert-danger">
<strong>Error while communicating with UCD web service:</strong>
Sonia Zorba
committed
#{tapSchemaEditing.searchUCDDialog.UCDServiceErrorMessage}
Sonia Zorba
committed
</div>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.manualInsertion}">
<div class="form-group">
<h:outputLabel for="ucd_text_manual" class="control-label">UCD:</h:outputLabel>
Sonia Zorba
committed
<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">
Sonia Zorba
committed
<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>
Sonia Zorba
committed
<h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.valid}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.valid}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
<td>
Sonia Zorba
committed
<h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.recognised}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.recognised}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
<td>
Sonia Zorba
committed
<h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.recommended}">
<span class="text-success"><span class="glyphicon glyphicon-ok"></span></span>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="${!tapSchemaEditing.searchUCDDialog.parsedUCD.recommended}">
<span class="text-danger"><span class="glyphicon glyphicon-remove"></span></span>
</h:panelGroup>
</td>
</tr>
</tbody>
</table>
Sonia Zorba
committed
<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>
Sonia Zorba
committed
<h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.advices.size() gt 0}">
<h5 class="text-info"><strong>Advices:</strong></h5>
<ul>
Sonia Zorba
committed
<ui:repeat value="${tapSchemaEditing.searchUCDDialog.parsedUCD.advices}" var="advice">
<li class="text-info">${advice}</li>
</ui:repeat>
</ul>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="${tapSchemaEditing.searchUCDDialog.parsedUCD.errors.size() gt 0}">
<h5 class="text-danger"><strong>Errors:</strong></h5>
<ul>
Sonia Zorba
committed
<ui:repeat value="${tapSchemaEditing.searchUCDDialog.parsedUCD.errors}" var="error">
<li class="text-danger">${error}</li>
</ui:repeat>
</ul>
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
Sonia Zorba
committed
</div>
</h:panelGroup>
Sonia Zorba
committed
<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">
Sonia Zorba
committed
<h:inputText id="ucd_dialog_description" class="form-control" value="#{tapSchemaEditing.searchUCDDialog.description}" onkeydown="TSM.ucdTextKeyDown(event)" />
<span class="input-group-btn">
Sonia Zorba
committed
<h:commandLink class="btn btn-default" action="#{tapSchemaEditing.searchUCDDialog.search()}" id="search_UCD_btn">
<span class="glyphicon glyphicon-search"></span>
Sonia Zorba
committed
</h:commandLink>
</span>
</div>
Sonia Zorba
committed
<h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.UCDnotFound}">
<div class="alert alert-danger" role="alert">
No UCD found for this description!
</div>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="#{tapSchemaEditing.searchUCDDialog.selectedUCD ne null}">
<div class="alert alert-info" role="alert">
Sonia Zorba
committed
<strong>Selected UCD: </strong>
<h:panelGroup id="selected-ucd">#{tapSchemaEditing.searchUCDDialog.selectedUCD}</h:panelGroup>
</div>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup layout="block" class="form-group" rendered="false">
<label class="control-label">Suggested complete UCD:</label>
Sonia Zorba
committed
<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>
Sonia Zorba
committed
<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>
Sonia Zorba
committed
<h:panelGroup class="vpadding" layout="block" rendered="#{tapSchemaEditing.searchUCDDialog.suggestedUCDs.size() gt 0}">
<label class="control-label">Other suggested UCD:</label>
Sonia Zorba
committed
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
<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>
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>
Sonia Zorba
committed
<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" />
Sonia Zorba
committed
</h:commandButton>
Sonia Zorba
committed
</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>
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
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
<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>