Revision 50485
Added by Michele Artini about 6 years ago
RepoUIUtils.java | ||
---|---|---|
26 | 26 |
import eu.dnetlib.data.collector.rmi.CollectorService; |
27 | 27 |
import eu.dnetlib.data.collector.rmi.ProtocolDescriptor; |
28 | 28 |
import eu.dnetlib.data.collector.rmi.ProtocolParameter; |
29 |
import eu.dnetlib.enabling.datasources.rmi.DatasourceConstants; |
|
30 | 29 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException; |
31 | 30 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; |
32 | 31 |
import eu.dnetlib.enabling.locators.UniqueServiceLocator; |
... | ... | |
41 | 40 |
@Resource |
42 | 41 |
private UniqueServiceLocator serviceLocator; |
43 | 42 |
|
44 |
private ClassPathResource getRepoApiQueryTmpl = new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st"); |
|
43 |
private final ClassPathResource getRepoApiQueryTmpl = |
|
44 |
new ClassPathResource("/eu/dnetlib/functionality/modular/ui/repositories/templates/getRepoApi.xquery.st"); |
|
45 | 45 |
|
46 | 46 |
private static final Log log = LogFactory.getLog(RepoUIUtils.class); |
47 | 47 |
|
48 |
private Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap(); |
|
48 |
private final Map<String, List<ProtocolParameter>> parametersMap = Maps.newHashMap();
|
|
49 | 49 |
|
50 | 50 |
public RepoInterfaceEntry getApi(final String repoId, final String ifaceId) throws Exception { |
51 | 51 |
final RepoInterfaceEntry ifc = new RepoInterfaceEntry(); |
... | ... | |
64 | 64 |
|
65 | 65 |
ifc.setId(doc.valueOf("/api/id")); |
66 | 66 |
ifc.setLabel(doc.valueOf("/api/label")); |
67 |
ifc.setRemovable((doc.valueOf("/api/removable").equalsIgnoreCase("true")) && doc.selectNodes("//metaWF").isEmpty());
|
|
67 |
ifc.setRemovable(doc.valueOf("/api/removable").equalsIgnoreCase("true") && doc.selectNodes("//metaWF").isEmpty());
|
|
68 | 68 |
ifc.setRepoId(doc.valueOf("/api/repo/@id")); |
69 | 69 |
ifc.setRepoName(StringEscapeUtils.unescapeHtml(doc.valueOf("/api/repo"))); |
70 | 70 |
ifc.setRepoCountry(doc.valueOf("/api/repo/@country")); |
... | ... | |
100 | 100 |
final Node n = (Node) o; |
101 | 101 |
final String name = n.valueOf("@name"); |
102 | 102 |
final String value = n.getText(); |
103 |
if (name.equalsIgnoreCase(DatasourceConstants.OVERRIDING_COMPLIANCE_FIELD)) {
|
|
103 |
if (name.equalsIgnoreCase("overriding_compliance")) {
|
|
104 | 104 |
for (final SimpleParamEntry e : ifc.getCommonParams()) { |
105 | 105 |
if (e.getName().equals("compliance")) { |
106 | 106 |
// The original compliance (assigned by the validator) is stored in otherValue |
107 |
e.setOtherValue(e.getValue()); |
|
108 |
e.setValue(value); |
|
107 |
e.setOtherValue(value); |
|
109 | 108 |
} |
110 | 109 |
} |
111 | 110 |
} else if (name.equalsIgnoreCase("last_aggregation_date")) { |
Also available in: Unified diff
merged branch dsm into trunk