Revision 45248
Added by Claudio Atzori about 7 years ago
modules/dnet-index-client/trunk/src/main/java/eu/dnetlib/functionality/index/utils/ServiceTools.java | ||
---|---|---|
82 | 82 |
return getResourceProfileByQuery(xquery); |
83 | 83 |
} catch (IndexServiceException e) { |
84 | 84 |
log.warn("couldn't find Metadata format profile matching specs: " + mdRef.toString()); |
85 |
return "";
|
|
85 |
throw new RuntimeException(e);
|
|
86 | 86 |
} |
87 | 87 |
} |
88 | 88 |
|
... | ... | |
92 | 92 |
} |
93 | 93 |
|
94 | 94 |
private List<String> listMDRefsAsString() throws IndexClientException { |
95 |
final String xquery = "for $x in //RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='MDFormatDSResourceType'] " |
|
96 |
+ "let $format:= $x//CONFIGURATION/NAME/string() " + "for $y in $x//LAYOUTS/LAYOUT " + "let $layout:= $y//LAYOUT/@name/string() " |
|
97 |
+ "let $interpretation:= $x//CONFIGURATION/INTERPRETATION/text() " + "return concat($format,'-',$layout,'-',$interpretation) "; |
|
95 |
final String xquery = "for $x in //RESOURCE_PROFILE[.//RESOURCE_TYPE/@value='MDFormatDSResourceType'] \n" |
|
96 |
+ "let $format:= $x//CONFIGURATION/NAME/string() \n" |
|
97 |
+ "let $interpretation:= $x//CONFIGURATION/INTERPRETATION/text() \n" |
|
98 |
+ "for $y in $x//LAYOUTS/LAYOUT \n" |
|
99 |
+ " let $layout:= $y/@name/string() \n" |
|
100 |
+ " return concat($format,'-',$layout,'-',$interpretation) "; |
|
98 | 101 |
return quickSearchProfile(xquery); |
99 | 102 |
} |
100 | 103 |
|
modules/dnet-index-client/trunk/src/main/java/eu/dnetlib/functionality/index/client/ResolvingIndexClientFactory.java | ||
---|---|---|
36 | 36 |
for (IndexClientFactory factory : indexClientFactories) { |
37 | 37 |
if (factory.getBackendId().equalsIgnoreCase(backendId)) { return factory.getClient(format, layout, interpretation); } |
38 | 38 |
} |
39 |
throw new IndexClientException("No client for bakendId: " + backendId); |
|
39 |
throw new IndexClientException("No client for backendId: " + backendId);
|
|
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
} |
modules/dnet-index-client/trunk/pom.xml | ||
---|---|---|
2 | 2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
3 | 3 |
<parent> |
4 | 4 |
<groupId>eu.dnetlib</groupId> |
5 |
<artifactId>dnet-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
5 |
<artifactId>dnet45-parent</artifactId>
|
|
6 |
<version>1.0.0-SNAPSHOT</version>
|
|
7 | 7 |
<relativePath /> |
8 | 8 |
</parent> |
9 | 9 |
<modelVersion>4.0.0</modelVersion> |
... | ... | |
12 | 12 |
<packaging>jar</packaging> |
13 | 13 |
<version>2.3.1-SNAPSHOT</version> |
14 | 14 |
<scm> |
15 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-index-client/trunk</developerConnection>
|
|
15 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-index-client/trunk</developerConnection>
|
|
16 | 16 |
</scm> |
17 | 17 |
<dependencies> |
18 | 18 |
<dependency> |
... | ... | |
29 | 29 |
<dependency> |
30 | 30 |
<groupId>org.mockito</groupId> |
31 | 31 |
<artifactId>mockito-core</artifactId> |
32 |
<version>1.6</version>
|
|
32 |
<version>${mockito.version}</version>
|
|
33 | 33 |
<scope>test</scope> |
34 | 34 |
</dependency> |
35 | 35 |
<dependency> |
Also available in: Unified diff
migrated to dnet45