fixed defect #1825

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/information-system/ic-client/1.0@76791 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Lucio Lelii 2013-06-05 13:53:21 +00:00
parent 8cc1491361
commit 78f51bc08a
4 changed files with 12 additions and 15 deletions

View File

@ -1,5 +1,8 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="${build.finalName}" date="2013-01-11"> <Changeset component="ic-client-1.0.0" date="2013-01-11">
<Change>First Release</Change> <Change>First Release</Change>
</Changeset> </Changeset>
<Changeset component="${build.finalName}" date="2013-06-05">
<Change>fixed defect #1825</Change>
</Changeset>
</ReleaseNotes> </ReleaseNotes>

View File

@ -9,7 +9,7 @@
<groupId>org.gcube.resources.discovery</groupId> <groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId> <artifactId>ic-client</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.1-SNAPSHOT</version>
<name>Information Collector Client</name> <name>Information Collector Client</name>
<description>Client API for the Information Collector service</description> <description>Client API for the Information Collector service</description>

View File

@ -41,9 +41,10 @@ public class Helper {
HashMap<String, String> varReplacementMap = new HashMap<String, String>(); HashMap<String, String> varReplacementMap = new HashMap<String, String>();
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 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 authStringNormal=" contains(*VAR*//Scope,'"+scope+"') ";
String queryFiltered; String queryFiltered;
@ -90,12 +91,11 @@ public class Helper {
if (propBool) if (propBool)
{ {
String resourceMatString= resourceMat.group(); String resourceMatString= resourceMat.group();
forStringTemp=forPropertiesString.replace("*VAR*","$entry"+collInsert.size()+"ValueAuth" ).replace("*COLLECTION*", resourceMatString ); forStringTemp=forPropertiesString.replace("*VAR*","$entry"+collInsert.size()+"ValueAuth" ).replace("*COLLECTION*", resourceMatString );
String oldVar = varMat.group(); String oldVar = varMat.group();
String newVar = "$entry"+collInsert.size()+"ValueAuth"; String newVar = "$entry"+collInsert.size()+"ValueAuth";
collInsert.add(true); collInsert.add(true);
varReplacementMap.put(oldVar, newVar+"/.."+tempPath); varReplacementMap.put(oldVar, newVar+"/.."+tempPath);
} }
else else
@ -128,10 +128,6 @@ public class Helper {
whereInsertFinal+=authString.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ; whereInsertFinal+=authString.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ;
else whereInsertFinal+=authStringNormal.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ; else whereInsertFinal+=authStringNormal.replace("*VAR*", "$entry"+i+"ValueAuth")+" and " ;
} }
Matcher whereMat=wherePattern.matcher(expression); Matcher whereMat=wherePattern.matcher(expression);
Matcher inSubResultMat= inSubResult.matcher(expression); Matcher inSubResultMat= inSubResult.matcher(expression);

View File

@ -26,7 +26,7 @@ public class APIClient {
@BeforeClass @BeforeClass
public static void setup() { 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() { public void someServiceInstances() {
XQuery query = queryFor(ServiceInstance.class); XQuery query = queryFor(ServiceInstance.class);
query.addCondition("$resource/Data/gcube:ServiceClass/text() eq 'DataAccess'"). query.addCondition("$resource/Data/gcube:ServiceClass/text() eq 'DataAccess'").
addCondition("$resource/Data/gcube:ServiceName/text() eq 'tree-manager-service'"); addCondition("$resource/Data/gcube:ServiceName/text() eq 'tree-manager-service'");
@ -159,11 +160,8 @@ public class APIClient {
DiscoveryClient<ServiceInstance> client = clientFor(ServiceInstance.class); DiscoveryClient<ServiceInstance> client = clientFor(ServiceInstance.class);
List<ServiceInstance> props = client.submit(query); List<ServiceInstance> props = client.submit(query);
System.out.println(props); System.out.println(props);
} }
@Test @Test