1
|
<?xml version="1.0"?>
|
2
|
|
3
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
4
|
|
5
|
<xsl:output omit-xml-declaration="yes" method="html" encoding="UTF-8" standalone="no" />
|
6
|
|
7
|
<xsl:param name="profileId" />
|
8
|
<xsl:param name="ifaceId" />
|
9
|
<xsl:param name="protocol" />
|
10
|
<xsl:param name="baseUrl" />
|
11
|
<xsl:param name="compliance" />
|
12
|
<xsl:param name="overrideCompliance" />
|
13
|
<xsl:param name="typology" />
|
14
|
<xsl:param name="prefix" />
|
15
|
|
16
|
<xsl:template match="/">
|
17
|
<div class="row" style="margin-bottom:20px;">
|
18
|
<div class="col-xs-12 col-md-offset-2 col-md-8" style="border: 1px solid #dddddd; border-radius: 4px; padding: 20px">
|
19
|
<xsl:apply-templates select="//CONFIGURATION|//extra_info/parameters" />
|
20
|
</div>
|
21
|
</div>
|
22
|
</xsl:template>
|
23
|
|
24
|
<xsl:template match="CONFIGURATION">
|
25
|
|
26
|
<xsl:variable name="country" select="normalize-space(./COUNTRY)" />
|
27
|
|
28
|
|
29
|
<form class="form-horizontal">
|
30
|
<wf-form-row-static name="Datasource name" value="{./OFFICIAL_NAME}" />
|
31
|
<xsl:choose>
|
32
|
<xsl:when test="$typology = ./DATASOURCE_TYPE">
|
33
|
<wf-form-row-static name="Typology" value="{$typology}" />
|
34
|
</xsl:when>
|
35
|
<xsl:otherwise>
|
36
|
<wf-form-row-static name="Typology" value="{./DATASOURCE_TYPE} (datasource), {$typology} (API)" style="color: #dd9900" />
|
37
|
</xsl:otherwise>
|
38
|
</xsl:choose>
|
39
|
<wf-form-row-link name="Institution" value="{./REPOSITORY_INSTITUTION}" url="{./REPOSITORY_WEBPAGE}" />
|
40
|
<wf-form-row-link name="Contact email" value="{./ADMIN_INFO}" url="{./ADMIN_INFO}" />
|
41
|
<xsl:choose>
|
42
|
<xsl:when test="string-length($country) = 2">
|
43
|
<wf-form-row-static-img name="Country" value="{$country}" img="../resources/img/flags/{$country}.gif" />
|
44
|
</xsl:when>
|
45
|
<xsl:otherwise>
|
46
|
<wf-form-row-static name="Country" value="-" />
|
47
|
</xsl:otherwise>
|
48
|
</xsl:choose>
|
49
|
<wf-form-row-static name="Software typology" value="{./TYPOLOGY}" />
|
50
|
</form>
|
51
|
<hr />
|
52
|
<form class="form-horizontal">
|
53
|
<div class="form-group" ng-init="newCompatibilityLevel='{$overrideCompliance}'" ng-class="{{'has-warning': newCompatibilityLevel}}">
|
54
|
<label class="col-sm-3 control-label">Level of compliance</label>
|
55
|
<div class="col-sm-9">
|
56
|
<select class="form-control" ng-model="newCompatibilityLevel" ng-change="updateCompatibilityLevel('{$profileId}', '{$ifaceId}', newCompatibilityLevel)">
|
57
|
<xsl:for-each select="//extra_info/compatibilityLevels/level">
|
58
|
<option value="{.}">
|
59
|
<xsl:value-of select="concat(., ' (override)')" />
|
60
|
</option>
|
61
|
</xsl:for-each>
|
62
|
<option disabled="disabled" style="border-top: 1px solid lightgrey; margin-top: 10px;"></option>
|
63
|
<option value="">
|
64
|
<xsl:value-of select="concat($compliance, ' (by validator)')" />
|
65
|
</option>
|
66
|
</select>
|
67
|
</div>
|
68
|
</div>
|
69
|
</form>
|
70
|
<hr />
|
71
|
<form class="form-horizontal">
|
72
|
<wf-form-row-static name="API id" value="{$ifaceId}" />
|
73
|
<wf-form-row-static name="Datasource id" value="{./DATASOURCE_ORIGINAL_ID}" />
|
74
|
<wf-form-row-static name="Datasource prefix" value="{$prefix}" />
|
75
|
<wf-form-row-link name="Profile" value="[link]" url="isManager.do#/profile/{$profileId}" />
|
76
|
</form>
|
77
|
<hr />
|
78
|
<form class="form-horizontal">
|
79
|
<div class="form-group">
|
80
|
<label class="col-sm-3 control-label">Access Protocol</label>
|
81
|
<div class="col-sm-9">
|
82
|
<p class="form-control-static">
|
83
|
<table class="table table-condensed table-striped">
|
84
|
<tr>
|
85
|
<th colspan="2">Protocol</th>
|
86
|
<td class="col-xs-9">
|
87
|
<xsl:value-of select="$protocol" />
|
88
|
<xsl:if test="$protocol = 'oai' or $protocol = 'OAI'">
|
89
|
<a href="oaiExplorer.do?oaiBaseUrl={$baseUrl}" class="btn btn-xs btn-primary pull-right">verify</a>
|
90
|
</xsl:if>
|
91
|
</td>
|
92
|
</tr>
|
93
|
<tr>
|
94
|
<th colspan="2">Base URL</th>
|
95
|
<td>
|
96
|
<a href="{$baseUrl}">
|
97
|
<xsl:value-of select="$baseUrl" />
|
98
|
</a>
|
99
|
</td>
|
100
|
</tr>
|
101
|
|
102
|
<xsl:variable name="countParams" select="count(//extra_info/parameters/param)" />
|
103
|
<xsl:for-each select="//extra_info/parameters/param">
|
104
|
<tr>
|
105
|
<xsl:if test="position() = 1">
|
106
|
<th rowspan="{$countParams}" class="col-xs-2">Parameters</th>
|
107
|
</xsl:if>
|
108
|
<td class="col-xs-2">
|
109
|
<i>
|
110
|
<xsl:value-of select="@name" />
|
111
|
</i>
|
112
|
</td>
|
113
|
<td class="col-xs-8">
|
114
|
<xsl:value-of select="." />
|
115
|
</td>
|
116
|
</tr>
|
117
|
</xsl:for-each>
|
118
|
</table>
|
119
|
|
120
|
</p>
|
121
|
</div>
|
122
|
</div>
|
123
|
<div class="form-group">
|
124
|
<div class="col-sm-offset-3 col-sm-9">
|
125
|
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#editAccessParamsModal">configure</button>
|
126
|
</div>
|
127
|
</div>
|
128
|
</form>
|
129
|
<hr />
|
130
|
<form class="form-horizontal">
|
131
|
<div class="form-group">
|
132
|
<label class="col-sm-3 control-label">API Extra fields</label>
|
133
|
<div class="col-sm-9">
|
134
|
<p class="form-control-static">
|
135
|
<table class="table table-condensed table-striped">
|
136
|
<xsl:for-each select="//extra_info/extraFields/field">
|
137
|
<tr>
|
138
|
<th class="col-xs-4">
|
139
|
<xsl:value-of select="@name" />
|
140
|
</th>
|
141
|
<td class="col-xs-8">
|
142
|
<xsl:value-of select="." />
|
143
|
</td>
|
144
|
</tr>
|
145
|
</xsl:for-each>
|
146
|
</table>
|
147
|
</p>
|
148
|
</div>
|
149
|
</div>
|
150
|
|
151
|
</form>
|
152
|
<hr />
|
153
|
<form class="form-horizontal">
|
154
|
<div class="form-group">
|
155
|
<label class="col-sm-3 control-label">Related workflows</label>
|
156
|
<div class="col-sm-9">
|
157
|
<p class="form-control-static">
|
158
|
<xsl:choose>
|
159
|
<xsl:when test="count(//workflows/workflow) = 0">
|
160
|
No workflows
|
161
|
</xsl:when>
|
162
|
<xsl:otherwise>
|
163
|
<xsl:for-each select="//workflows/workflow">
|
164
|
<a href="workflows.do#/wf/{@id}"><xsl:value-of select="@name" /></a><br />
|
165
|
<xsl:if test="@description">
|
166
|
<span class="small text-muted">
|
167
|
<xsl:value-of select="@description"/>
|
168
|
</span>
|
169
|
</xsl:if>
|
170
|
</xsl:for-each>
|
171
|
</xsl:otherwise>
|
172
|
</xsl:choose>
|
173
|
</p>
|
174
|
</div>
|
175
|
</div>
|
176
|
|
177
|
<div class="form-group">
|
178
|
<div class="col-sm-offset-3 col-sm-9">
|
179
|
<xsl:variable name="definitiveCompliance">
|
180
|
<xsl:choose>
|
181
|
<xsl:when test="$overrideCompliance">
|
182
|
<xsl:value-of select="$overrideCompliance" />
|
183
|
</xsl:when>
|
184
|
<xsl:otherwise>
|
185
|
<xsl:value-of select="$compliance" />
|
186
|
</xsl:otherwise>
|
187
|
</xsl:choose>
|
188
|
</xsl:variable>
|
189
|
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#addWorkflowModal"
|
190
|
ng-click="findRepoHiWorkflows('{normalize-space($definitiveCompliance)}', '{normalize-space($typology)}')">
|
191
|
add workflow
|
192
|
</button>
|
193
|
<button type="button" class="btn btn-sm btn-default pull-right" ng-click="refresh()">
|
194
|
<span class="glyphicon glyphicon-refresh"></span>
|
195
|
</button>
|
196
|
</div>
|
197
|
</div>
|
198
|
</form>
|
199
|
|
200
|
|
201
|
<div id="addWorkflowModal" class="modal fade" tabindex="-1" role="dialog">
|
202
|
<div class="modal-dialog modal-lg">
|
203
|
<div class="modal-content">
|
204
|
<div class="modal-header">
|
205
|
<button type="button" class="close" data-dismiss="modal">
|
206
|
<xsl:text disable-output-escaping="yes"><![CDATA[×]]></xsl:text>
|
207
|
</button>
|
208
|
<h4 class="modal-title">Select workflow</h4>
|
209
|
</div>
|
210
|
<div class="modal-body">
|
211
|
<div ng-repeat="e in availableRepohiWfs" class="panel panel-default">
|
212
|
<div class="panel-heading">
|
213
|
<a ng-click="newRepoWorkflow('{$profileId}', '{$ifaceId}', e.id)" data-dismiss="modal" href="javascript:void(0)">{{e.name}}</a>
|
214
|
<a href="isManager.do#/profile/{{{{e.id}}}}" class="pull-right">[link]</a>
|
215
|
<br /><span class="text-muted small">{{e.description}}</span>
|
216
|
</div>
|
217
|
<table class="table table-striped table-condensed small">
|
218
|
<tr>
|
219
|
<th class="col-xs-3 text-right">Typology prefixes</th>
|
220
|
<td>{{e.ifaceTypes.join()}}</td>
|
221
|
</tr><tr>
|
222
|
<th class="col-xs-3 text-right">Compliance prefixes</th>
|
223
|
<td>{{e.compliances.join()}}</td>
|
224
|
</tr><tr ng-repeat="f in e.fields">
|
225
|
<th class="col-xs-3 text-right">{{f.key}}</th>
|
226
|
<td>{{f.value}}</td>
|
227
|
</tr>
|
228
|
</table>
|
229
|
</div>
|
230
|
</div>
|
231
|
<div class="modal-footer">
|
232
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
233
|
</div>
|
234
|
</div>
|
235
|
</div>
|
236
|
</div>
|
237
|
</xsl:template>
|
238
|
|
239
|
<xsl:template match="parameters">
|
240
|
<div id="editAccessParamsModal" class="modal fade" tabindex="-1" role="dialog">
|
241
|
<div class="modal-dialog modal-lg">
|
242
|
<div class="modal-content">
|
243
|
<div class="modal-header">
|
244
|
<button type="button" class="close" data-dismiss="modal">
|
245
|
<xsl:text disable-output-escaping="yes"><![CDATA[×]]></xsl:text>
|
246
|
</button>
|
247
|
<h4 class="modal-title">
|
248
|
<xsl:value-of select="concat('Protocol: ', $protocol)" />
|
249
|
</h4>
|
250
|
</div>
|
251
|
<div class="modal-body">
|
252
|
<form class="form-horizontal" role="form" ng-init="params.baseUrl = '{$baseUrl}'">
|
253
|
|
254
|
<div class="form-group">
|
255
|
<wf-form-row-text name="Base URL" mandatory="true" regex="^(http|https|ftp|ftps|sftp|file):\/\/" init-value="{$baseUrl}"
|
256
|
ng-model="params.baseUrl" ng-original-model="originalParams.baseUrl" />
|
257
|
|
258
|
<xsl:for-each select="./param">
|
259
|
<xsl:choose>
|
260
|
<xsl:when test="@functionPopulated = 'true' and @type = 'LIST'">
|
261
|
<wf-form-row-multi-select name="{@name}" init-value="{.}" ng-model="params.{@name}" ng-original-model="originalParams.{@name}" values-function="obtainValues('listProtocolFieldValues', {{ 'baseUrl': '{{{{params.baseUrl}}}}', 'protocol': '{$protocol}', 'field' : '{@name}' }} )">
|
262
|
<xsl:if test="not(@optional) or @optional != 'true'">
|
263
|
<xsl:attribute name="mandatory">true</xsl:attribute>
|
264
|
</xsl:if>
|
265
|
<xsl:if test="@regex">
|
266
|
<xsl:attribute name="regex"><xsl:value-of select="@regex" /></xsl:attribute>
|
267
|
</xsl:if>
|
268
|
</wf-form-row-multi-select>
|
269
|
</xsl:when>
|
270
|
<xsl:when test="@functionPopulated = 'true' and @type != 'LIST'">
|
271
|
<wf-form-row-select name="{@name}" init-value="{.}" ng-model="params.{@name}" ng-original-model="originalParams.{@name}" values-function="obtainValues('listProtocolFieldValues', {{ 'baseUrl': '{{{{params.baseUrl}}}}', 'protocol': '{$protocol}', 'field' : '{@name}' }} )">
|
272
|
<xsl:if test="not(@optional) or @optional != 'true'">
|
273
|
<xsl:attribute name="mandatory">true</xsl:attribute>
|
274
|
</xsl:if>
|
275
|
<xsl:if test="@regex">
|
276
|
<xsl:attribute name="regex"><xsl:value-of select="@regex" /></xsl:attribute>
|
277
|
</xsl:if>
|
278
|
</wf-form-row-select>
|
279
|
</xsl:when>
|
280
|
<xsl:otherwise>
|
281
|
<wf-form-row-text name="{@name}" init-value="{.}" ng-model="params.{@name}" ng-original-model="originalParams.{@name}">
|
282
|
<xsl:if test="not(@optional) or @optional != 'true'">
|
283
|
<xsl:attribute name="mandatory">true</xsl:attribute>
|
284
|
</xsl:if>
|
285
|
<xsl:if test="@regex">
|
286
|
<xsl:attribute name="regex"><xsl:value-of select="@regex" /></xsl:attribute>
|
287
|
</xsl:if>
|
288
|
</wf-form-row-text>
|
289
|
</xsl:otherwise>
|
290
|
</xsl:choose>
|
291
|
</xsl:for-each>
|
292
|
</div>
|
293
|
</form>
|
294
|
</div>
|
295
|
<div class="modal-footer">
|
296
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
297
|
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="updateRepoApi('{$profileId}', '{$ifaceId}', params)">Save</button>
|
298
|
</div>
|
299
|
</div>
|
300
|
</div>
|
301
|
</div>
|
302
|
</xsl:template>
|
303
|
|
304
|
</xsl:stylesheet>
|