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"/>
</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="global.stopPropagation(event)">
<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="global.openAddablesModal" />
</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="global.textInputChanged" />
</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="global.textInputChanged" />
</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="global.stopPropagation(event)">
<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="global.openAddablesModal" />
</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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
</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="global.textInputChanged" />
</h:inputText>
</div>
</div>
<div class="form-group col-lg-6">
<h:outputLabel for="table_description" class="col-sm-3 control-label">Table description</h:outputLabel>
<div class="col-sm-9">
<h:inputText
id="table_description"
class="form-control #{tapSchema.selectedTable.isChanged('description') ? 'changed' : ''}"
value="#{tapSchema.selectedTable.description}">
<f:ajax event="keyup" execute="@form" listener="#{tapSchemaEditing.textInputChanged(tapSchema.selectedTable, 'description')}" onevent="global.textInputChanged" />
</h:inputText>
</div>
</div>
</div>
</div>
Sonia Zorba
committed
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<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="global.openAddablesModal" />
</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="global.stopPropagation(event)" id="column-remover">
<f:ajax execute="@form" render="main:column_wrapper main:columns_header" listener="#{tapSchemaEditing.removeColumn(column.name)}" onevent="global.columnRemoved" />
</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="global.columnChanged" />
</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="global.columnRemovalUndo" />
</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="global.textInputChanged" />
</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">
#{tapSchemaEditing.tapSchema.selectedColumn.ucd}
<f:ajax execute="@form" render="ucd_search_form:search_UCD_modal_content" onevent="global.openSearchUCDModal"/>
</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="global.textInputChanged" />
</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="global.textInputChanged" />
</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="global.entitiesAdded" />
</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">
Sonia Zorba
committed
<h:inputText id="ucd_dialog_description" class="form-control" value="#{UCDDialog.description}" onkeydown="global.ucdTextKeyDown(event)">
<f:ajax execute="@form" render="@form" />
</h:inputText>
<span class="input-group-btn">
Sonia Zorba
committed
<h:commandLink class="btn btn-default" action="#{UCDDialog.search(UCDDialog.description)}" id="search_UCD_btn">
<span class="glyphicon glyphicon-search"></span>
Sonia Zorba
committed
<f:ajax execute="@form" render="@form" />
</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="global.closeSearchUCDModal" />
</h:commandButton>
</div>
Sonia Zorba
committed
</h:panelGroup>
</h:form>
</div>
</div>
</div>
</ui:define>
</ui:composition>