diff --git a/distro/changelog.xml b/distro/changelog.xml index f09bc6d..e41cee3 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,5 +1,8 @@ - + First Release + + fixed defect #1825 + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 019320c..60433df 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.resources.discovery ic-client - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT Information Collector Client Client API for the Information Collector service diff --git a/src/main/java/org/gcube/resources/discovery/icclient/Helper.java b/src/main/java/org/gcube/resources/discovery/icclient/Helper.java index 0482a25..60d3b55 100644 --- a/src/main/java/org/gcube/resources/discovery/icclient/Helper.java +++ b/src/main/java/org/gcube/resources/discovery/icclient/Helper.java @@ -41,9 +41,10 @@ public class Helper { HashMap varReplacementMap = new HashMap(); - String forPropertiesString="\n *VAR* in *COLLECTION*/Data/child::*[local-name()='Scopes'] \n"; + + String forPropertiesString="\n *VAR* in *COLLECTION*/Data \n"; ///child::*[local-name()='Scope'] String forString=" *VAR* in *COLLECTION*/Scopes \n"; - String authString=" (contains(*VAR*//Scope,'"+scope+"') or contains(*VAR*//Scope,'"+scope.substring(0,scope.lastIndexOf("/"))+"')) "; + String authString=" (contains(*VAR*/child::*[local-name()='Scope'],'"+scope+"') or contains(*VAR*/child::*[local-name()='Scope'],'"+scope.substring(0,scope.lastIndexOf("/"))+"')) "; String authStringNormal=" contains(*VAR*//Scope,'"+scope+"') "; String queryFiltered; @@ -90,12 +91,11 @@ public class Helper { if (propBool) { String resourceMatString= resourceMat.group(); - forStringTemp=forPropertiesString.replace("*VAR*","$entry"+collInsert.size()+"ValueAuth" ).replace("*COLLECTION*", resourceMatString ); String oldVar = varMat.group(); - String newVar = "$entry"+collInsert.size()+"ValueAuth"; collInsert.add(true); + varReplacementMap.put(oldVar, newVar+"/.."+tempPath); } else @@ -128,10 +128,6 @@ public class Helper { whereInsertFinal+=authString.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ; else whereInsertFinal+=authStringNormal.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ; } - - - - Matcher whereMat=wherePattern.matcher(expression); Matcher inSubResultMat= inSubResult.matcher(expression); diff --git a/src/test/java/org/acme/APIClient.java b/src/test/java/org/acme/APIClient.java index c92cd5f..920fde2 100644 --- a/src/test/java/org/acme/APIClient.java +++ b/src/test/java/org/acme/APIClient.java @@ -26,7 +26,7 @@ public class APIClient { @BeforeClass public static void setup() { - ScopeProvider.instance.set("/gcube/devsec/devVre"); + ScopeProvider.instance.set("/gcube/devNext/devVre"); } @@ -152,6 +152,7 @@ public class APIClient { public void someServiceInstances() { + XQuery query = queryFor(ServiceInstance.class); query.addCondition("$resource/Data/gcube:ServiceClass/text() eq 'DataAccess'"). addCondition("$resource/Data/gcube:ServiceName/text() eq 'tree-manager-service'"); @@ -159,11 +160,8 @@ public class APIClient { DiscoveryClient client = clientFor(ServiceInstance.class); List props = client.submit(query); - - - + System.out.println(props); - } @Test