2020-04-30 11:05:17 +02:00
|
|
|
|
2020-02-19 17:59:02 +01:00
|
|
|
package eu.dnetlib.dhp;
|
|
|
|
|
2020-04-30 11:05:17 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2020-02-19 17:59:02 +01:00
|
|
|
import eu.dnetlib.dhp.utils.ISLookupClientFactory;
|
|
|
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
|
|
|
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
|
|
|
|
|
|
|
public class QueryInformationSystem {
|
2020-04-30 11:05:17 +02:00
|
|
|
private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType')"
|
|
|
|
+ " where $x//CONFIGURATION/context[./@type='community' or ./@type='ri']"
|
|
|
|
+ " and $x//CONFIGURATION/context/param[./@name='status']/text() != 'hidden'"
|
|
|
|
+ " return $x//CONFIGURATION/context/@id/string()";
|
2020-02-19 17:59:02 +01:00
|
|
|
|
2020-04-30 11:05:17 +02:00
|
|
|
public static List<String> getCommunityList(final String isLookupUrl) throws ISLookUpException {
|
|
|
|
ISLookUpService isLookUp = ISLookupClientFactory.getLookUpService(isLookupUrl);
|
|
|
|
return isLookUp.quickSearchProfile(XQUERY);
|
|
|
|
}
|
2020-02-19 17:59:02 +01:00
|
|
|
}
|