try again to solve clash with master

This commit is contained in:
Miriam Baglioni 2020-08-14 15:24:36 +02:00
parent 5040d72d5e
commit de995970ea
1 changed files with 57 additions and 57 deletions

View File

@ -12,63 +12,63 @@ import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
public class QueryInformationSystem { public class QueryInformationSystem {
private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') " private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') "
+ " let $subj := $x//CONFIGURATION/context/param[./@name='subject']/text() " + " let $subj := $x//CONFIGURATION/context/param[./@name='subject']/text() "
+ " let $datasources := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::contentproviders')]/concept " + " let $datasources := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::contentproviders')]/concept "
+ " let $organizations := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::resultorganizations')]/concept " + " let $organizations := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::resultorganizations')]/concept "
+ " let $communities := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::zenodocommunities')]/concept " + " let $communities := $x//CONFIGURATION/context/category[./@id=concat($x//CONFIGURATION/context/@id,'::zenodocommunities')]/concept "
+ +
"let $zenodo := $x//param[./@name='zenodoCommunity']/text() " "let $zenodo := $x//param[./@name='zenodoCommunity']/text() "
+ " where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] and $x//context/param[./@name = 'status']/text() != 'hidden' " + " where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] and $x//context/param[./@name = 'status']/text() != 'hidden' "
+ " return " + " return "
+ " <community> " + " <community> "
+ " { $x//CONFIGURATION/context/@id} " + " { $x//CONFIGURATION/context/@id} "
+ " <subjects> " + " <subjects> "
+ " {for $y in tokenize($subj,',') " + " {for $y in tokenize($subj,',') "
+ " return " + " return "
+ " <subject>{$y}</subject>} " + " <subject>{$y}</subject>} "
+ " </subjects> " + " </subjects> "
+ " <datasources> " + " <datasources> "
+ " {for $d in $datasources " + " {for $d in $datasources "
+ " where $d/param[./@name='enabled']/text()='true' " + " where $d/param[./@name='enabled']/text()='true' "
+ " return " + " return "
+ " <datasource> " + " <datasource> "
+ " <openaireId> " + " <openaireId> "
+ " {$d//param[./@name='openaireId']/text()} " + " {$d//param[./@name='openaireId']/text()} "
+ " </openaireId> " + " </openaireId> "
+ " <selcriteria> " + " <selcriteria> "
+ " {$d/param[./@name='selcriteria']/text()} " + " {$d/param[./@name='selcriteria']/text()} "
+ " </selcriteria> " + " </selcriteria> "
+ " </datasource> } " + " </datasource> } "
+ " </datasources> " + + " </datasources> " +
" <zenodocommunities> " + " <zenodocommunities> " +
"{for $zc in $zenodo " + "{for $zc in $zenodo " +
"return " + "return " +
"<zenodocommunity> " + "<zenodocommunity> " +
"<zenodoid> " + "<zenodoid> " +
"{$zc} " + "{$zc} " +
"</zenodoid> " + "</zenodoid> " +
"</zenodocommunity>}" "</zenodocommunity>}"
+ " {for $zc in $communities " + " {for $zc in $communities "
+ " return " + " return "
+ " <zenodocommunity> " + " <zenodocommunity> "
+ " <zenodoid> " + " <zenodoid> "
+ " {$zc/param[./@name='zenodoid']/text()} " + " {$zc/param[./@name='zenodoid']/text()} "
+ " </zenodoid> " + " </zenodoid> "
+ " <selcriteria> " + " <selcriteria> "
+ " {$zc/param[./@name='selcriteria']/text()} " + " {$zc/param[./@name='selcriteria']/text()} "
+ " </selcriteria> " + " </selcriteria> "
+ " </zenodocommunity>} " + " </zenodocommunity>} "
+ " </zenodocommunities> " + " </zenodocommunities> "
+ " </community>"; + " </community>";
public static CommunityConfiguration getCommunityConfiguration(final String isLookupUrl) public static CommunityConfiguration getCommunityConfiguration(final String isLookupUrl)
throws ISLookUpException, DocumentException { throws ISLookUpException, DocumentException {
ISLookUpService isLookUp = ISLookupClientFactory.getLookUpService(isLookupUrl); ISLookUpService isLookUp = ISLookupClientFactory.getLookUpService(isLookupUrl);
final List<String> res = isLookUp.quickSearchProfile(XQUERY); final List<String> res = isLookUp.quickSearchProfile(XQUERY);
final String xmlConf = "<communities>" + Joiner.on(" ").join(res) + "</communities>"; final String xmlConf = "<communities>" + Joiner.on(" ").join(res) + "</communities>";
return CommunityConfigurationFactory.newInstance(xmlConf); return CommunityConfigurationFactory.newInstance(xmlConf);
} }
} }