1
|
<?xml version="1.0"?>
|
2
|
|
3
|
<xsl:stylesheet version="1.0"
|
4
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
5
|
|
6
|
<xsl:output omit-xml-declaration="yes" method="html"
|
7
|
encoding="UTF-8" standalone="no" />
|
8
|
|
9
|
<xsl:param name="ifaceId" />
|
10
|
|
11
|
<xsl:template match="/">
|
12
|
<div class="row" style="margin-bottom:20px;">
|
13
|
<div class="col-xs-12 col-md-4 col-lg-2">
|
14
|
<ul class="nav nav-pills nav-stacked">
|
15
|
<li class="active" style="cursor: pointer">
|
16
|
<a data-target="#tabInfo" data-toggle="tab" ng-click="refresh()">Datasource API</a>
|
17
|
</li>
|
18
|
<li style="cursor: pointer">
|
19
|
<a data-target="#tabProtocolParameters" data-toggle="tab">Protocol parameters</a>
|
20
|
</li>
|
21
|
<li style="cursor: pointer">
|
22
|
<a data-target="#tabApiExtraFields" data-toggle="tab">API Extra fields</a>
|
23
|
</li>
|
24
|
<li style="cursor: pointer">
|
25
|
<a data-target="#tabDsExtraFields" data-toggle="tab">Datasource Extra fields</a>
|
26
|
</li>
|
27
|
<li style="cursor: pointer">
|
28
|
<a data-target="#tabHistory" data-toggle="tab" ng-click="updateHistory()">History</a>
|
29
|
</li>
|
30
|
<li style="cursor: pointer">
|
31
|
<a data-target="#tabGraph" data-toggle="tab" ng-click="redrawGraph()">Graph</a>
|
32
|
</li>
|
33
|
<li style="cursor: pointer">
|
34
|
<a data-target="#tabSettings" data-toggle="tab">Other settings</a>
|
35
|
</li>
|
36
|
</ul>
|
37
|
</div>
|
38
|
<div class="col-xs-12 col-md-8 col-lg-10">
|
39
|
<div class="tab-content" style="border: 1px solid #dddddd; border-radius: 4px; padding: 20px">
|
40
|
<div class="tab-pane active" id="tabInfo">
|
41
|
<xsl:for-each select="//CONFIGURATION">
|
42
|
<xsl:call-template name="datasource" />
|
43
|
</xsl:for-each>
|
44
|
<hr />
|
45
|
<xsl:for-each select="//INTERFACE[@id = $ifaceId]">
|
46
|
<xsl:call-template name="api" />
|
47
|
</xsl:for-each>
|
48
|
</div>
|
49
|
<div class="tab-pane" id="tabDsExtraFields">
|
50
|
<xsl:for-each select="//CONFIGURATION/EXTRA_FIELDS">
|
51
|
<xsl:call-template name="datasourceExtraFields" />
|
52
|
</xsl:for-each>
|
53
|
</div>
|
54
|
|
55
|
<div class="tab-pane" id="tabProtocolParameters">
|
56
|
<xsl:for-each select="//INTERFACE[@id = $ifaceId]">
|
57
|
<xsl:call-template name="apiProtocolParams" />
|
58
|
</xsl:for-each>
|
59
|
</div>
|
60
|
<div class="tab-pane" id="tabApiExtraFields">
|
61
|
<xsl:for-each select="//INTERFACE[@id = $ifaceId]">
|
62
|
<xsl:call-template name="apiExtraFields" />
|
63
|
</xsl:for-each>
|
64
|
</div>
|
65
|
<div class="tab-pane" id="tabHistory">
|
66
|
|
67
|
</div>
|
68
|
</div>
|
69
|
</div>
|
70
|
</div>
|
71
|
</xsl:template>
|
72
|
|
73
|
<xsl:template name="datasource">
|
74
|
<xsl:variable name="profileId" select="//RESOURCE_IDENTIFIER/@value" />
|
75
|
<xsl:variable name="country" select="normalize-space(./COUNTRY)" />
|
76
|
<xsl:variable name="prefix"
|
77
|
select="normalize-space(.//FIELD[./key = 'NamespacePrefix']/value)" />
|
78
|
|
79
|
|
80
|
<form class="form-horizontal">
|
81
|
<wf-form-row-static name="Datasource name" value="{./OFFICIAL_NAME}"/>
|
82
|
<wf-form-row-link name="Institution" value="{./REPOSITORY_INSTITUTION}" url="{./REPOSITORY_WEBPAGE}"/>
|
83
|
<wf-form-row-link name="Contact email" value="{./ADMIN_INFO}" url="{./ADMIN_INFO}"/>
|
84
|
<xsl:choose>
|
85
|
<xsl:when test="string-length($country) = 2">
|
86
|
<wf-form-row-static-img name="country" value="{$country}" img="../resources/img/flags/{$country}.gif" />
|
87
|
</xsl:when>
|
88
|
<xsl:otherwise>
|
89
|
<wf-form-row-static name="Country" value="-"/>
|
90
|
</xsl:otherwise>
|
91
|
</xsl:choose>
|
92
|
<wf-form-row-static name="Software typology" value="{./TYPOLOGY}"/>
|
93
|
<wf-form-row-link name="Profile ID" value="{$profileId}" url="isManager.do#/profile/{$profileId}"/>
|
94
|
<wf-form-row-static name="Datasource id" value="{./DATASOURCE_ORIGINAL_ID}"/>
|
95
|
<wf-form-row-static name="API id" value="{$ifaceId}"/>
|
96
|
<wf-form-row-static name="Datasource prefix" value="{$prefix}"/>
|
97
|
<wf-form-row-static name="Datasource typology" value="{./DATASOURCE_TYPE}"/>
|
98
|
|
99
|
|
100
|
|
101
|
</form>
|
102
|
</xsl:template>
|
103
|
|
104
|
<xsl:template name="datasourceExtraFields">
|
105
|
<form class="form-horizontal">
|
106
|
<xsl:for-each select="./FIELD">
|
107
|
<wf-form-row-static name="{./key}" value="{./value}"/>
|
108
|
</xsl:for-each>
|
109
|
</form>
|
110
|
</xsl:template>
|
111
|
|
112
|
<xsl:template name="api">
|
113
|
<form class="form-horizontal">
|
114
|
<wf-form-row-static name="Api Id" value="{@id}" />
|
115
|
<wf-form-row-static name="Api label" value="{@label}" />
|
116
|
<wf-form-row-static name="Api typology" value="{@typology}" />
|
117
|
<wf-form-row-static name="Is active" value="{@active}" />
|
118
|
<wf-form-row-static name="Level of compliance" value="{@compliance}" />
|
119
|
<xsl:choose>
|
120
|
<xsl:when test="normalize-space(//ACCESS_PROTOCOL) = 'oai' or normalize-space(//ACCESS_PROTOCOL) = 'OAI'">
|
121
|
<wf-form-row-link name="Protocol" value="{./ACCESS_PROTOCOL}" url="oaiExplorer.do?oaiBaseUrl={./BASE_URL}" />
|
122
|
</xsl:when>
|
123
|
<xsl:otherwise>
|
124
|
<wf-form-row-static name="Protocol" value="{./ACCESS_PROTOCOL}" />
|
125
|
</xsl:otherwise>
|
126
|
</xsl:choose>
|
127
|
<wf-form-row-link name="Base URL" value="{./BASE_URL}" url="{./BASE_URL}" />
|
128
|
<xsl:for-each select="./ACCESS_PROTOCOL/@*">
|
129
|
<wf-form-row-static name="Parameter: {name()}" value="{.}" />
|
130
|
</xsl:for-each>
|
131
|
<xsl:for-each select="./INTERFACE_EXTRA_FIELD">
|
132
|
<wf-form-row-static name="Api extra field: {@name}" value="{.}" />
|
133
|
</xsl:for-each>
|
134
|
</form>
|
135
|
</xsl:template>
|
136
|
|
137
|
<xsl:template name="apiProtocolParams">
|
138
|
<form class="form-horizontal">
|
139
|
<wf-form-row-static name="Protocol" value="{./ACCESS_PROTOCOL}" />
|
140
|
<wf-form-row-link name="Base URL" value="{./BASE_URL}" url="{./BASE_URL}" />
|
141
|
<xsl:for-each select="./ACCESS_PROTOCOL/@*">
|
142
|
<wf-form-row-static name="Parameter: {name()}" value="{.}" />
|
143
|
</xsl:for-each>
|
144
|
</form>
|
145
|
</xsl:template>
|
146
|
|
147
|
<xsl:template name="apiExtraFields">
|
148
|
<form class="form-horizontal">
|
149
|
<xsl:for-each select="./INTERFACE_EXTRA_FIELD">
|
150
|
<wf-form-row-static name="Api extra field: {@name}" value="{.}" />
|
151
|
</xsl:for-each>
|
152
|
</form>
|
153
|
</xsl:template>
|
154
|
|
155
|
</xsl:stylesheet>
|