Fixed listing with multiple organization

This commit is contained in:
Luca Frosini 2022-07-14 17:18:20 +02:00
parent e6934b5819
commit de99335a56
3 changed files with 18 additions and 2 deletions

View File

@ -2,9 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for gCube Catalogue (gCat) Service # Changelog for gCube Catalogue (gCat) Service
## [v2.3.0] ## [v2.3.0-SNAPSHOT]
- Switched moderation messages to notification [#23317] - Switched moderation messages to notification [#23317]
- Item listing returns items in the default organization and not in all supported organization
## [v2.2.0] ## [v2.2.0]

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.data-catalogue</groupId> <groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcat</artifactId> <artifactId>gcat</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>2.3.0</version> <version>2.3.0-SNAPSHOT</version>
<name>gCube Catalogue (gCat) Service</name> <name>gCube Catalogue (gCat) Service</name>
<description> <description>
This service allows any client to publish on the gCube Catalogue. This service allows any client to publish on the gCube Catalogue.

View File

@ -536,6 +536,18 @@ public class CKANPackage extends CKAN implements Moderated {
protected String getFilterForOrganizations() { protected String getFilterForOrganizations() {
StringWriter stringWriter = new StringWriter(); StringWriter stringWriter = new StringWriter();
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.
*
int i=1; int i=1;
for(String organizationName : configuration.getSupportedOrganizations()) { for(String organizationName : configuration.getSupportedOrganizations()) {
stringWriter.append(String.format(GCatConstants.ORGANIZATION_FILTER_TEMPLATE, organizationName)); stringWriter.append(String.format(GCatConstants.ORGANIZATION_FILTER_TEMPLATE, organizationName));
@ -546,6 +558,8 @@ public class CKANPackage extends CKAN implements Moderated {
} }
i++; i++;
} }
*/
return stringWriter.toString(); return stringWriter.toString();
} }