1
|
for \$x in
|
2
|
collection('/db/DRIVER/RepositoryServiceResources/RepositoryServiceResourceType')[.//RESOURCE_IDENTIFIER/@value='$dsId$' or .//DATASOURCE_ORIGINAL_ID = '$dsId$']//INTERFACE[@id='$ifaceId$']
|
3
|
let \$repoId := \$x/../../../../HEADER/RESOURCE_IDENTIFIER/@value/string()
|
4
|
return
|
5
|
<api>
|
6
|
<id>{\$x/@id/string()}</id>
|
7
|
<label>{\$x/@label/string()}</label>
|
8
|
<removable>{\$x/@removable/string()}</removable>
|
9
|
<protocol>{\$x/ACCESS_PROTOCOL/text()}</protocol>
|
10
|
<repo
|
11
|
id="{\$repoId}"
|
12
|
country="{\$x/../../COUNTRY/text()}"
|
13
|
prefix="{\$x/../..//EXTRA_FIELDS/FIELD[./key='NamespacePrefix']/value}"
|
14
|
type="{\$x/../../TYPOLOGY/text()}"
|
15
|
email="{\$x/../../ADMIN_INFO/text()}">
|
16
|
{\$x/../../OFFICIAL_NAME/text()}
|
17
|
</repo>
|
18
|
<commonParams>
|
19
|
<param name="id">{\$x/@id/string()}</param>
|
20
|
<param name="label">{\$x/@label/string()}</param>
|
21
|
<param name="typology">{\$x/@typology/string()}</param>
|
22
|
<param name="active">{\$x/@active/string()}</param>
|
23
|
<param name="compliance">{\$x/@compliance/string()}</param>
|
24
|
</commonParams>
|
25
|
<accessParams>
|
26
|
<param name="baseUrl">{\$x/BASE_URL/text()}</param>
|
27
|
{
|
28
|
for \$y in
|
29
|
\$x/ACCESS_PROTOCOL/@*
|
30
|
return
|
31
|
<param name="{\$y/name()}">{\$y/string()}</param>
|
32
|
}
|
33
|
</accessParams>
|
34
|
<extraFields>
|
35
|
{
|
36
|
for \$y in
|
37
|
\$x/INTERFACE_EXTRA_FIELD
|
38
|
return
|
39
|
<field name="{\$y/@name/string()}">{\$y/text()}</field>
|
40
|
}
|
41
|
</extraFields>
|
42
|
<metaWFs>
|
43
|
{
|
44
|
for \$y in
|
45
|
collection('/db/DRIVER/MetaWorkflowDSResources/MetaWorkflowDSResourceType')
|
46
|
where
|
47
|
\$y//DATAPROVIDER/@interface = \$x/@id and \$y//DATAPROVIDER/@id= \$repoId
|
48
|
return
|
49
|
<metaWF>
|
50
|
<id>{\$y//RESOURCE_IDENTIFIER/@value/string()}</id>
|
51
|
<name>{\$y//METAWORKFLOW_NAME/text()}</name>
|
52
|
<status>{\$y//CONFIGURATION/@status/string()}</status>
|
53
|
<destroyWorkflow>{\$y//CONFIGURATION/@destroyWorkflow/string()}</destroyWorkflow>
|
54
|
</metaWF>
|
55
|
}
|
56
|
</metaWFs>
|
57
|
</api>
|
58
|
|
59
|
|