From e378d275bc15998db4927d029cde772763993e2e Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Tue, 27 Jun 2023 14:58:11 +0200 Subject: [PATCH] Fixing organization filtering --- .../gcube/gcat/persistence/ckan/CKANPackage.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java index aa11a42..f51b618 100644 --- a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java +++ b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java @@ -642,19 +642,16 @@ public class CKANPackage extends CKAN implements Moderated { protected String getFilterForOrganizations() { StringWriter stringWriter = new StringWriter(); - stringWriter.append(String.format(GCatConstants.ORGANIZATION_FILTER_TEMPLATE, configuration.getDefaultOrganization())); + // stringWriter.append(String.format(GCatConstants.ORGANIZATION_FILTER_TEMPLATE, configuration.getDefaultOrganization())); /* - * TODO - * * This generated something like: - * organization:orgfortesting OR organization:prevre OR organization:data_inrae - * and it seems not working - * I need to investigate better this part. + * (organization:orgfortesting OR organization:prevre OR organization:data_inrae) + * */ int i=1; - stringWriter.append("("); + stringWriter.append(" ("); for(String organizationName : configuration.getSupportedOrganizations()) { stringWriter.append(String.format(GCatConstants.ORGANIZATION_FILTER_TEMPLATE, organizationName)); if(i!=configuration.getSupportedOrganizations().size()) { @@ -664,7 +661,7 @@ public class CKANPackage extends CKAN implements Moderated { } i++; } - stringWriter.append(")"); + stringWriter.append(") "); // */ return stringWriter.toString();