consistencyChecks.xhtml 10.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
<?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"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <ui:define name="title">Consistency problems for #{consistency.tapSchema.name}</ui:define>
    <ui:define name="content">
10
        <f:event listener="#{loggedInChecker.checkFromNonIndex()}" type="preRenderView" />
11
12
13
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
14
15
16
17
18
19
20
                    <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.inconsistent}">
                        <h1>Consistency problems detected in #{consistency.tapSchema.name}</h1>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{!consistency.tapSchema.consistencyChecks.inconsistent and consistency.tapSchema.consistencyChecks.hasWarnings}">
                        <h1>Warnings - #{consistency.tapSchema.name}</h1>
                    </h:panelGroup>

21
22
23
24
                    <h:form id="main">

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.inconsistencies.size() gt 0}">
                            <h2>Inconsistent values</h2>
25
26
27
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
28
29
30
                                        <th>Table</th>
                                        <th>Column</th>
                                        <th>Field</th>
31
32
33
34
35
36
37
                                        <th>Wrong value</th>
                                        <th>Correct value</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <ui:repeat value="#{consistency.tapSchema.consistencyChecks.inconsistencies}" var="inconsistency">
                                        <tr>
38
39
40
                                            <td>${inconsistency.tableCompleteName}</td>
                                            <td>${inconsistency.columnName}</td>
                                            <td>${inconsistency.key}</td>
41
42
43
44
45
46
                                            <td class="text-danger">${inconsistency.currentValue}</td>
                                            <td class="text-success">${inconsistency.correctValue}</td>
                                        </tr>
                                    </ui:repeat>
                                </tbody>
                            </table>
47
48
49
                        </h:panelGroup>

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.unexisingSchemas.size() gt 0}">
50
                            <h2>Inexistent schemas</h2>
51
52
53
54
55
56
57
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.unexisingSchemas}" var="schema">
                                    <li>${schema}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

Sonia Zorba's avatar
Sonia Zorba committed
58
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.unexistingTables.size() gt 0}">
59
                            <h2>Inexistent tables</h2>
60
                            <ul>
Sonia Zorba's avatar
Sonia Zorba committed
61
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.unexistingTables}" var="table">
62
63
64
65
66
                                    <li>${table}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

Sonia Zorba's avatar
Sonia Zorba committed
67
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.unexistingColumns.size() gt 0}">
68
                            <h2>Inexistent columns</h2>
69
                            <ul>
Sonia Zorba's avatar
Sonia Zorba committed
70
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.unexistingColumns.toArray()}" var="column">
71
72
73
74
                                    <li>${column}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>
75

76
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.unexistingKeys.size() gt 0}">
77
                            <h2>Inexistent keys</h2>
78
                            <ul>
79
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.unexistingKeys.toArray()}" var="key">
80
81
82
83
                                    <li>${key}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.missingTables.size() gt 0}">
                            <h2>Missing tables</h2>
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.missingTables.keySet().toArray()}" var="schema">
                                    <ui:repeat value="#{consistency.tapSchema.consistencyChecks.missingTables.get(schema).toArray()}" var="table">
                                        <li>${schema}.${table}</li>
                                    </ui:repeat>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.missingColumns.size() gt 0}">
                            <h2>Missing columns</h2>
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.missingColumns.keySet().toArray()}" var="column">
                                    <li>${column}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.tablesToAdd.size() gt 0}">
                            <h2>Tables to expose</h2>
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.tablesToAdd.keySet().toArray()}" var="schema">
                                    <ui:repeat value="#{consistency.tapSchema.consistencyChecks.tablesToAdd.get(schema)}" var="table">
                                        <li>${schema}.${table}</li>
                                    </ui:repeat>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.columnsToAdd.size() gt 0}">
                            <h2>Columns to expose</h2>
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.columnsToAdd.toArray()}" var="column">
                                    <li>${column}</li>
                                </ui:repeat>
                            </ul>
                        </h:panelGroup>

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.wrongDataTypes.size() gt 0}">
                            <h2>Wrong data type in original table</h2>
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>Schema</th>
                                        <th>Table</th>
                                        <th>Column</th>
                                        <th>Wrong data type</th>
                                        <th>Correct data type</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <ui:repeat value="#{consistency.tapSchema.consistencyChecks.wrongDataTypes}" var="wdt">
                                        <tr>
                                            <td>${wdt.columnHolder.schemaName}</td>
                                            <td>${wdt.columnHolder.tableName}</td>
                                            <td>${wdt.columnHolder.columnName}</td>
                                            <td class="text-danger">${wdt.wrongDataType}</td>
                                            <td class="text-success">${wdt.correctDataType}</td>
                                        </tr>
                                    </ui:repeat>
                                </tbody>
                            </table>
                        </h:panelGroup>

151
152
153
154
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.missingObscore or consistency.tapSchema.consistencyChecks.obscoreToAdd}">
                            <h2>ObsCore to add</h2>
                            <span class="glyphicon glyphicon-check"></span>
                        </h:panelGroup>
155
156
                        <br/>

157
158
159
160
161
162
163
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.unaddedOptionalColumns.size() gt 0}">
                            <h2>Unadded optional columns</h2>
                            <ul>
                                <ui:repeat value="#{consistency.tapSchema.consistencyChecks.unaddedOptionalColumns.toArray()}" var="column">
                                    <li>${column}</li>
                                </ui:repeat>
                            </ul>
164
                        </h:panelGroup>
165

166
                        <h:panelGroup rendered="#{consistency.tapSchema.consistencyChecks.inconsistent}" layout="block" class="alert alert-warning text-center">
167
168
                            <span class="glyphicon glyphicon-warning-sign"></span>
                            <strong>If you proceed the TAP_SCHEMA Manager will fix these values.</strong>
169
                        </h:panelGroup>
170
171
172
173
174
175
176

                        <div class="text-center">
                            <h:commandLink action="#{consistency.back()}" class="btn btn-default">
                                <span class="glyphicon glyphicon-arrow-left"></span>
                                Back
                            </h:commandLink>
                            &#160;
Sonia Zorba's avatar
Sonia Zorba committed
177
                            <h:commandLink action="#{consistency.proceed()}" class="btn btn-primary" onclick="showWaiting()">
178
179
180
181
182
                                Proceed
                                <span class="glyphicon glyphicon-arrow-right"></span>
                            </h:commandLink>
                        </div>
                    </h:form>
183
                    <br/><br/>
184
185
186
187
188
189
                </div>
            </div>
        </div>

    </ui:define>
</ui:composition>