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>
</ui:define>
<ui:define name="content">
Sonia Zorba
committed
<c:set var="tapSchema" value="#{tapSchemaEditing.tapSchema}" />
<c:set var="UCDDialog" value="#{tapSchemaEditing.searchUCDDialog}" />
Sonia Zorba
committed
<h:form id="main">
<h1 class="text-center">Editing #{tapSchemaEditing.tapSchema.name}</h1>
<div class="col-sm-6 vpadding text-center">
<h:commandLink class="btn btn-success btn-lg" action="#{tapSchemaEditing.update()}">
<span class="icon-save"></span>
Update
<f:ajax execute="@form" render="@form" onevent="TSM.notifyUpdate"/>
Sonia Zorba
committed
</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=" " />
<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">
Sonia Zorba
committed
<ui:repeat value="#{tapSchema.allEntityWrappers}" var="schema">
<li role="presentation" class="removable-tab #{tapSchema.selectedEntity.name eq schema.name ? 'active': ''} #{schema.toRemove ? 'to-remove' : ''}">
<h:commandLink role="tab" action="#{tapSchema.selectEntity(schema.name)}">
<span class="#{schema.toRemove ? 'strikeout':''}">#{schema.name}</span>
<f:ajax execute="@form" render="@form" />
<h:commandButton class="remove-btn" rendered="#{!schema.toRemove}" action="#{tapSchema.removeEntityWrapper(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="#{tapSchema.addables.size() gt 0}">
<li>
<h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchema)}">
<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="#{tapSchema.selectedEntity.toRemove}">
<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(tapSchema)}">
Undo
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</div>
</div>
</h:panelGroup>
Sonia Zorba
committed
<h:panelGroup rendered="#{!tapSchema.selectedEntity.toRemove}">
<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 #{tapSchema.selectedEntity.isChanged('utype') ? 'changed' : ''}"
value="#{tapSchema.selectedEntity.utype}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.selectedEntity, '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 #{tapSchema.selectedEntity.isChanged('description') ? 'changed' : ''}"
value="#{tapSchema.selectedEntity.description}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.selectedEntity, '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.tapSchema.selectedEntity.allEntityWrappers}" var="table">
<li role="presentation" class="removable-tab #{tapSchema.selectedTable.name eq table.name ? 'active':''} #{table.toRemove? 'to-remove':''}">
<h:commandLink role="tab" action="#{tapSchema.selectedEntity.selectEntity(table.name)}">
<span class="#{table.toRemove ? 'strikeout':''}">#{table.name}</span>
<f:ajax execute="@form" render="main:tables_wrapper" />
<h:commandButton class="remove-btn" rendered="#{!table.toRemove}" action="#{tapSchema.selectedEntity.removeEntityWrapper(table.name)}" value="×" onclick="TSM.stopPropagation(event)">
Sonia Zorba
committed
<f:ajax execute="@form" render="main:tables_wrapper" />
</h:commandButton>
</h:commandLink>
</li>
</ui:repeat>
<h:panelGroup rendered="#{tapSchema.selectedEntity.addables.size() gt 0}">
<li>
<h:commandLink role="tab" class="plus-tab" action="#{tapSchemaEditing.openAddablesModal(tapSchema.selectedEntity)}">
<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>
Sonia Zorba
committed
<h:panelGroup rendered="#{tapSchema.selectedTable ne null}">
<div role="tabpanel">
<h:panelGroup rendered="#{tapSchema.selectedTable.toRemove}">
<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(tapSchema.selectedEntity)}">
Undo
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</div>
</div>
Sonia Zorba
committed
</h:panelGroup>
<h:panelGroup rendered="#{!tapSchema.selectedTable.toRemove}">
<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 #{tapSchema.selectedTable.isChanged('utype') ? 'changed' : ''}"
value="#{tapSchema.selectedTable.utype}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.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 #{tapSchema.selectedTable.isChanged('description') ? 'changed' : ''}"
value="#{tapSchema.selectedTable.description}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.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="#{tapSchema.selectedTable.addables.size() gt 0}" action="#{tapSchemaEditing.openAddablesModal(tapSchema.selectedTable)}">
<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="#{tapSchema.selectedColumn ne null}" layout="block" class="columns-header-properties">
#{tapSchema.selectedColumn.name}
<h:panelGroup rendered="#{tapSchema.selectedColumn.primaryKey}">
<span class="icon-key text-danger" title="Primary key"></span>
</h:panelGroup>
<h:panelGroup rendered="#{tapSchema.selectedColumn.foreignKey ne null}">
<span class="icon-key text-success" title="Foreign key: #{tapSchema.selectedColumn.foreignKey}"></span>
</h:panelGroup>
<h:panelGroup rendered="#{!(tapSchema.selectedColumn.primaryKey or tapSchema.selectedColumn.foreignKey ne null) and tapSchema.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="#{tapSchema.selectedTable.allEntityWrappers}" var="column" id="columns-list">
<li role="presentation" class="#{tapSchema.selectedColumn.name eq column.name ? 'active': ''}">
<h:commandLink role="tab" action="#{tapSchema.selectedTable.selectEntity(column.name)}" class="#{column.toRemove ? 'strikeout' : ''}" id="column-selector">
<h:commandButton class="btn btn-link remove-btn" disabled="#{column.toRemove}" 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="#{column.foreignKey ne null}">
<span class="icon-key text-success" title="Foreign key: #{column.foreignKey}"></span>
</h:panelGroup>
<h:panelGroup rendered="#{!(column.primaryKey or column.foreignKey ne null) and column.indexed}">
<span class="icon-index text-warning" title="Indexed"></span>
</h:panelGroup>
<span class="#{column.toRemove ? '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="#{tapSchema.selectedColumn ne null}">
<h:panelGroup rendered="#{tapSchema.selectedColumn.toRemove}">
<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>
Sonia Zorba
committed
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<h:panelGroup rendered="#{!tapSchema.selectedColumn.toRemove}">
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label for="datatype" class="control-label">Datatype:</label>
<span>#{tapSchema.selectedColumn.datatype}</span>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label for="size" class="control-label">Size:</label>
<span>#{tapSchema.selectedColumn.size}</span>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="checkbox">
<label>
<h:selectBooleanCheckbox
value="#{tapSchemaEditing.tapSchema.selectedColumn.std}"
class="#{tapSchema.selectedColumn.isChanged('std') ? 'changed' : ''}">
<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.tapSchema.selectedColumn.principal}"
class="#{tapSchema.selectedColumn.isChanged('principal') ? 'changed' : ''}">
<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 #{tapSchema.selectedColumn.isChanged('utype') ? 'changed' : ''}"
value="#{tapSchema.selectedColumn.utype}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.selectedColumn, 'utype')}" onevent="TSM.textInputChanged" />
Sonia Zorba
committed
</h:inputText>
</div>
<div class="form-group">
Sonia Zorba
committed
<label for="main:column_ucd" class="control-label">UCD:</label>
<h:commandLink action="#{tapSchemaEditing.openUCDDialog()}" class="form-control #{tapSchemaEditing.tapSchema.selectedColumn.isChanged('ucd') ? 'changed' : ''}" id="column_ucd" onclick="TSM.showLoading()">
Sonia Zorba
committed
#{tapSchemaEditing.tapSchema.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 #{tapSchema.selectedColumn.isChanged('unit') ? 'changed' : ''}"
value="#{tapSchema.selectedColumn.unit}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.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 #{tapSchema.selectedColumn.isChanged('description') ? 'changed' : ''}"
value="#{tapSchema.selectedColumn.description}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.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="addables_modal_content" />
</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="addables_modal_content" />
</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_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>
<div class="form-group">
Sonia Zorba
committed
<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" onclick="TSM.showLoading()">
<span class="glyphicon glyphicon-search"></span>
<f:ajax execute="@form" render="@form" onevent="TSM.hideLoading" />
Sonia Zorba
committed
</h:commandLink>
</span>
</div>
</div>
Sonia Zorba
committed
<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>
<span>#{UCDDialog.selectedUCD}</span>
</div>
</h:panelGroup>
<h:panelGroup layout="block" class="form-group" rendered="#{UCDDialog.suggestedUCD ne null}">
<label class="control-label">Suggested complete UCD:</label>
Sonia Zorba
committed
<h:commandLink class="btn-default text-left form-control" action="#{UCDDialog.selectUCD(UCDDialog.suggestedUCD)}">
#{UCDDialog.suggestedUCD}
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</h:panelGroup>
<h:panelGroup class="vpadding" layout="block" rendered="#{UCDDialog.suggestedUCDs.size() gt 0}">
<label class="control-label">Other suggested UCD:</label>
Sonia Zorba
committed
<ui:repeat value="#{UCDDialog.suggestedUCDs}" var="ucdInfo">
<div class="input-group">
Sonia Zorba
committed
<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="@form" />
</h:commandLink>
<span class="input-group-btn">
Sonia Zorba
committed
<h:commandLink class="btn btn-default" action="#{UCDDialog.explain(ucdInfo)}">
<span class="glyphicon glyphicon-question-sign"></span>
Sonia Zorba
committed
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</span>
</div>
Sonia Zorba
committed
<h:panelGroup class="resultDefinition" layout="block" rendered="#{ucdInfo.definition ne null}">
<span class="help-block">#{ucdInfo.definition}</span>
</h:panelGroup>
</ui:repeat>
</h:panelGroup>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
Sonia Zorba
committed
<h:commandButton class="btn btn-primary" disabled="#{UCDDialog.selectedUCD eq null}" action="#{tapSchemaEditing.saveUCD()}" value="Save changes">
<f:ajax execute="@form" render="@form main:column_ucd" onevent="TSM.closeSearchUCDModal" />
Sonia Zorba
committed
</h:commandButton>
</div>
Sonia Zorba
committed
</h:panelGroup>
</h:form>
</div>
</div>
</div>
450
451
452
453
454
455
456
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
<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>
<div class="loading hide">
<div class="icon-wrapper">
<span class="glyphicon glyphicon-refresh animate-spin"></span>
</div>
</div>
</ui:define>
</ui:composition>