Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?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" >
<ui:define name="title">TapSchema Manager - Schemata selection page</ui:define>
<ui:define name="content">
<f:event listener="#{schemaSelection.onPageLoad()}" type="preRenderView" />
<div class="container">
<h1 class="text-center">TapSchema Manager - Schemata selection page</h1>
<br/>
<h:form id="selectionForm">
<f:passThroughAttribute name="autocomplete" value="off" />
<div class="panel panel-default col-sm-10 col-sm-offset-1">
<div class="panel-body">
<div class="row">
<div class="col-sm-2 text-right">
<strong>Action:</strong>
</div>
<div class="form-inline col-sm-10">
<h:selectOneRadio value="#{schemaSelection.selectedRadioOption}">
<f:selectItem itemValue="edit" itemLabel="Edit existing" />
<f:selectItem itemValue="create" itemLabel="Create new" />
<f:ajax event="click" render="selectionForm:radioPanels"></f:ajax>
</h:selectOneRadio>
</div>
</div>
<br/>
<h:panelGroup id="radioPanels">
<!-- Edit -->
<h:panelGroup rendered="#{schemaSelection.selectedRadioOption eq 'edit'}">
<div id="editContainer">
<div class="form-group">
<h:outputLabel for="selectedTAPSchema">Tap Schema:</h:outputLabel>
<h:selectOneMenu value="#{schemaSelection.selectedTAPSchema}" id="selectedTAPSchema" class="form-control">
<f:selectItems value="#{schemaSelection.allTAPSchemas}"></f:selectItems>
<f:ajax event="change" render="selectionForm:exposedSchemas"></f:ajax>
</h:selectOneMenu>
</div>
<div class="form-group" id="exposedDatabasesWrapper">
<label class="control-label">Exposed databases:</label>
<p class="form-control-static" id="exposed-schemas">
<h:panelGroup id="exposedSchemas">#{schemaSelection.exposedSchemas}</h:panelGroup>
</p>
</div>
<div class="form-group">
<h:commandButton value="Edit Tapschema" class="btn btn-primary" action="#{schemaSelection.edit()}"></h:commandButton>
</div>
</div>
</h:panelGroup>
<!-- Create -->
<h:panelGroup rendered="#{schemaSelection.selectedRadioOption eq 'create'}">
<div id="createContainer">
<div class="form-group">
<h:outputLabel for="tapschemaName">Name:</h:outputLabel>
<h:inputText id="tapschemaName" value="#{schemaSelection.tapSchemaName}" class="form-control" validatorMessage="TAP_SCHEMA name is required">
<f:validateRequired></f:validateRequired>
</h:inputText>
<h:message for="tapschemaName" class="text-danger"></h:message>
</div>
<div class="form-group">
<h:outputLabel for="selectedSchemas">Databases to expose:</h:outputLabel>
<h:selectManyListbox value="#{schemaSelection.selectedSchemas}" id="selectedSchemas" class="form-control" size="7" validatorMessage="Select at least one schema">
<f:selectItems value="#{schemaSelection.allSchemas}"></f:selectItems>
<f:validateRequired></f:validateRequired>
</h:selectManyListbox>
<h:message for="selectedSchemas" class="text-danger"></h:message>
</div>
<div class="form-group">
<h:commandButton value="Create TAP_SCHEMA" class="btn btn-primary" action="#{schemaSelection.create()}"></h:commandButton>
</div>
</div>
</h:panelGroup>
</h:panelGroup>
</div>
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h:commandLink action="#{schemaSelection.logout()}" class="btn btn-danger pull-right">
<span class="glyphicon glyphicon-log-out"></span>
Close session
</h:commandLink>
</div>
</div>
</h:form>
</div>
</ui:define>
</ui:composition>