git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/information-system/ic-client/1.0@139997 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8501fde466
commit
997eb495d0
|
@ -184,7 +184,7 @@ public class Helper {
|
|||
String functionContainsDeclaration =" declare namespace functx = \"http://www.functx.com\"; declare function functx:is-value-in-sequence "+
|
||||
" ( $value as xs:anyAtomicType? , $seq as xs:anyAtomicType* ) as xs:boolean { $value = $seq } ; \n";
|
||||
|
||||
Pattern declarePattern=Pattern.compile("(declare namespace .*;)*", Pattern.DOTALL);
|
||||
Pattern declarePattern=Pattern.compile("(\\s*declare namespace[^;]*;)*");
|
||||
Matcher declareMat=declarePattern.matcher(queryFiltered);
|
||||
|
||||
boolean declareFound = declareMat.find(0);
|
||||
|
@ -194,7 +194,6 @@ public class Helper {
|
|||
queryFiltered = queryFiltered.substring(0, declareIndex)+functionContainsDeclaration+queryFiltered.substring(declareIndex);
|
||||
} else
|
||||
queryFiltered= functionContainsDeclaration +queryFiltered;
|
||||
|
||||
|
||||
log.trace("submitting filtered query: {}",queryFiltered);
|
||||
return queryFiltered;
|
||||
|
|
|
@ -33,18 +33,15 @@ public class StubClient {
|
|||
|
||||
CollectorStub proxy = stubFor(collector).at(URI.create(address));
|
||||
|
||||
SimpleQuery query = queryFor(GCoreEndpoint.class);
|
||||
/*
|
||||
String queryString ="declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; declare namespace functx = \"http://www.functx.com\"; "+
|
||||
"declare function functx:is-value-in-sequence "+
|
||||
" ( $value as xs:anyAtomicType? , $seq as xs:anyAtomicType* ) as xs:boolean { $value = $seq } ;";
|
||||
|
||||
queryString+=" for $entry0ValueAuth in collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource/Scopes "+
|
||||
" where functx:is-value-in-sequence('/gcube/devNext/NextNext',$entry0ValueAuth/child::*[local-name()='Scope']/text()) or functx:is-value-in-sequence('/gcube/devNext',$entry0ValueAuth/child::*[local-name()='Scope']/text()) and ( ($entry0ValueAuth/../Profile/ServiceClass/text() eq 'DataAccess') and ($entry0ValueAuth/../Profile/DeploymentData/Status/text() eq 'ready') and ($entry0ValueAuth/../Profile/ServiceName/text() eq 'CkanConnector') ) "+
|
||||
" return $entry0ValueAuth/../Profile/AccessPoint/RunningInstanceInterfaces//Endpoint[@EntryName/string() eq \"org.gcube.data.access.ckanconnector.CkanConnector\"]/text()";
|
||||
*/
|
||||
//SimpleQuery query = queryFor(GCoreEndpoint.class);
|
||||
|
||||
String queryString ="declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; "+
|
||||
"for $profiles in collection('/db/Profiles/GenericResource')//Document/Data/ic:Profile/Resource "+
|
||||
" let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') "+
|
||||
" let $subtype := $profiles/Profile/SecondaryType/text() "+
|
||||
" return $profiles";
|
||||
|
||||
//Query query = new QueryBox(queryString);
|
||||
Query query = new QueryBox(queryString);
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue