to query the information system to get the list of comunities up to now. It will have a more general usage when introducing bulk tagging

This commit is contained in:
Miriam Baglioni 2020-02-19 17:59:02 +01:00
parent 5ceb174d24
commit 5f63ab1416
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package eu.dnetlib.dhp;
import eu.dnetlib.dhp.utils.ISLookupClientFactory;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
import java.util.List;
public class QueryInformationSystem {
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()";
public static List<String> getCommunityList(final String isLookupUrl) throws ISLookUpException {
ISLookUpService isLookUp = ISLookupClientFactory.getLookUpService(isLookupUrl);
return isLookUp.quickSearchProfile(XQUERY);
}
}