From 4aa17d0b5adc7630f68b62682bab8da2d6ea9677 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Fri, 23 Jun 2023 18:11:25 +0200 Subject: [PATCH] Implementing gcat customization --- .gitignore | 2 +- pom.xml | 22 ++++++- .../grsf/publisher/GRSFInitializator.java | 29 ++++++++- .../GRSFFacetBasedISConfigurationProxy.java | 59 +++++++++++++++++++ ...FacetBasedISConfigurationProxyFactory.java | 20 +++++++ .../impl/GRSFGCoreISConfigurationProxy.java | 16 +++++ .../GRSFGCoreISConfigurationProxyFactory.java | 23 ++++++++ .../01-get-calls-for-query-template.json | 39 ++++++++++++ .../01-get-catalogue-virtual-service.json | 13 ++++ .../query/02-get-catalogue-configuration.json | 30 ++++++++++ ...mple-facet-of-catalogue-configuration.json | 36 +++++++++++ .../resources/query/04-get-ckan-service.json | 31 ++++++++++ ...et-access-point-facet-of-ckan-service.json | 37 ++++++++++++ .../query/06-get-postgres-ckan-db.json | 49 +++++++++++++++ ...ccess-point-facet-of-postgres-ckan-db.json | 55 +++++++++++++++++ .../resources/query/08-get-solr-service.json | 49 +++++++++++++++ ...et-access-point-facet-of-solr-service.json | 55 +++++++++++++++++ src/main/resources/query/GraphOfResources.txt | 31 ++++++++++ .../grsf/publisher/record/RecordTest.java | 10 +++- 19 files changed, 599 insertions(+), 7 deletions(-) create mode 100644 src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxy.java create mode 100644 src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxyFactory.java create mode 100644 src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxy.java create mode 100644 src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxyFactory.java create mode 100644 src/main/resources/query-template/01-get-calls-for-query-template.json create mode 100644 src/main/resources/query/01-get-catalogue-virtual-service.json create mode 100644 src/main/resources/query/02-get-catalogue-configuration.json create mode 100644 src/main/resources/query/03-get-simple-facet-of-catalogue-configuration.json create mode 100644 src/main/resources/query/04-get-ckan-service.json create mode 100644 src/main/resources/query/05-get-access-point-facet-of-ckan-service.json create mode 100644 src/main/resources/query/06-get-postgres-ckan-db.json create mode 100644 src/main/resources/query/07-get-access-point-facet-of-postgres-ckan-db.json create mode 100644 src/main/resources/query/08-get-solr-service.json create mode 100644 src/main/resources/query/09-get-access-point-facet-of-solr-service.json create mode 100644 src/main/resources/query/GraphOfResources.txt diff --git a/.gitignore b/.gitignore index 2961dd6..283ebae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ /.project /.settings /.classpath -/.DS_Store +/**/.DS_Store diff --git a/pom.xml b/pom.xml index c6977a1..c6fdf05 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.gcube.distribution gcube-smartgears-bom - 2.4.0 + 2.5.0-SNAPSHOT pom import @@ -104,14 +104,34 @@ 2.3.32 + + org.gcube.resource-management + gcube-model + org.gcube.information-system resource-registry-api + + org.gcube.information-system + resource-registry-client + + + org.gcube.information-system + resource-registry-publisher + org.gcube.information-system resource-registry-query-template-client + + org.gcube.resources + common-gcore-resources + + + org.gcube.resources + registry-publisher + org.gcube.common diff --git a/src/main/java/org/gcube/grsf/publisher/GRSFInitializator.java b/src/main/java/org/gcube/grsf/publisher/GRSFInitializator.java index 4e1c5b2..47d8e45 100644 --- a/src/main/java/org/gcube/grsf/publisher/GRSFInitializator.java +++ b/src/main/java/org/gcube/grsf/publisher/GRSFInitializator.java @@ -3,8 +3,14 @@ package org.gcube.grsf.publisher; import java.io.IOException; import org.gcube.common.authorization.utils.manager.SecretManagerProvider; +import org.gcube.gcat.configuration.CatalogueConfigurationFactory; +import org.gcube.grsf.publisher.configuration.isproxies.impl.GRSFFacetBasedISConfigurationProxy; +import org.gcube.grsf.publisher.configuration.isproxies.impl.GRSFFacetBasedISConfigurationProxyFactory; +import org.gcube.grsf.publisher.configuration.isproxies.impl.GRSFGCoreISConfigurationProxyFactory; import org.gcube.grsf.publisher.rest.RequestFilter; import org.gcube.smartgears.ApplicationManager; +import org.gcube.smartgears.ContextProvider; +import org.gcube.smartgears.context.application.ApplicationContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,6 +26,9 @@ public class GRSFInitializator implements ApplicationManager { public static final String NAME = "GRSF Publisher"; + public static boolean initialised; + + /** * {@inheritDoc} * The method discover the plugins available on classpath and their own @@ -44,10 +53,26 @@ public class GRSFInitializator implements ApplicationManager { + "-------------------------------------------------------", NAME, context); - /* ApplicationContext applicationContext = ContextProvider.get(); String grsfEServiceID = applicationContext.id(); - */ + + + try { + GRSFFacetBasedISConfigurationProxyFactory fbigcpf = new GRSFFacetBasedISConfigurationProxyFactory(); + GRSFFacetBasedISConfigurationProxy facetBasedISConfigurationProxy = fbigcpf.getInstance(context); + if(!initialised) { + CatalogueConfigurationFactory.addISConfigurationProxyFactory(fbigcpf); + GRSFGCoreISConfigurationProxyFactory gcigcpf = new GRSFGCoreISConfigurationProxyFactory(); + CatalogueConfigurationFactory.addISConfigurationProxyFactory(gcigcpf); + facetBasedISConfigurationProxy.installQueryTemplate(); + initialised = true; + } + facetBasedISConfigurationProxy.setServiceEServiceID(grsfEServiceID); + facetBasedISConfigurationProxy.createCallsForToVirtualService(); + }catch (Exception e) { + logger.warn("Gcat is not configured through the Facet Based IS in context {}. Please create/addToContext the expected resources ASAP. The Gcore IS will be used.", context); + logger.trace("Gcat is not configured through the Facet Based IS in context {}. The reason is:\n", context, e); + } logger.trace( "\n-------------------------------------------------------\n" diff --git a/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxy.java b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxy.java new file mode 100644 index 0000000..5ff8f7a --- /dev/null +++ b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxy.java @@ -0,0 +1,59 @@ +package org.gcube.grsf.publisher.configuration.isproxies.impl; + +import java.io.File; +import java.net.URL; + +import org.gcube.gcat.configuration.isproxies.impl.FacetBasedISConfigurationProxy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class GRSFFacetBasedISConfigurationProxy extends FacetBasedISConfigurationProxy { + + private static Logger logger = LoggerFactory.getLogger(GRSFFacetBasedISConfigurationProxy.class); + + public GRSFFacetBasedISConfigurationProxy(String context) { + super(context); + serviceName = "grsf-publisher"; + } + + protected File getBaseDirectory(String directoryName) { + URL directoryURL = GRSFFacetBasedISConfigurationProxy.class.getClassLoader().getResource(directoryName); + File directory = new File(directoryURL.getPath()); + return directory; + } + +// +// Configuration +// --------------------------- +// IsCustomizedBy | | +// -----------------> | catalogue-configuration | +// / | | +// / --------------------------- +// EService VirtualService / +// ------------ ----------------------------- +// | | CallsFor | | +// | grsf | ------------> | catalogue-virtual-service | +// | | | | +// ------------ ----------------------------- +// \ EService +// \ -------------------- +// \ Uses | | +// \ ------------------> | postgres-ckan-db | +// \ / | | +// \ EService / -------------------- +// \ ----------------- +// \ CallsFor | | +// -------------> | ckan | +// | | +// ----------------- EService +// \ -------------------- +// \ Uses | | +// ------------------> | solr | +// | | +// -------------------- + + +} diff --git a/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxyFactory.java b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxyFactory.java new file mode 100644 index 0000000..693dda5 --- /dev/null +++ b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFFacetBasedISConfigurationProxyFactory.java @@ -0,0 +1,20 @@ +package org.gcube.grsf.publisher.configuration.isproxies.impl; + +import org.gcube.gcat.configuration.isproxies.ISConfigurationProxyFactory; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class GRSFFacetBasedISConfigurationProxyFactory extends ISConfigurationProxyFactory { + + public GRSFFacetBasedISConfigurationProxyFactory() { + super(); + } + + @Override + protected GRSFFacetBasedISConfigurationProxy newInstance(String context) { + return new GRSFFacetBasedISConfigurationProxy(context); + } + + +} diff --git a/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxy.java b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxy.java new file mode 100644 index 0000000..94c1bca --- /dev/null +++ b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxy.java @@ -0,0 +1,16 @@ +package org.gcube.grsf.publisher.configuration.isproxies.impl; + +import org.gcube.gcat.configuration.isproxies.impl.GCoreISConfigurationProxy; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class GRSFGCoreISConfigurationProxy extends GCoreISConfigurationProxy { + + public GRSFGCoreISConfigurationProxy(String context) { + super(context); + } + + + +} diff --git a/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxyFactory.java b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxyFactory.java new file mode 100644 index 0000000..ba2edee --- /dev/null +++ b/src/main/java/org/gcube/grsf/publisher/configuration/isproxies/impl/GRSFGCoreISConfigurationProxyFactory.java @@ -0,0 +1,23 @@ +package org.gcube.grsf.publisher.configuration.isproxies.impl; + +import org.gcube.gcat.configuration.isproxies.ISConfigurationProxyFactory; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class GRSFGCoreISConfigurationProxyFactory extends ISConfigurationProxyFactory { + + public GRSFGCoreISConfigurationProxyFactory() { + super(); + } + + @Override + protected GRSFGCoreISConfigurationProxy newInstance(String context) { + GRSFGCoreISConfigurationProxy isConfigurationProxy = new GRSFGCoreISConfigurationProxy(context); + return isConfigurationProxy; + } + + + + +} diff --git a/src/main/resources/query-template/01-get-calls-for-query-template.json b/src/main/resources/query-template/01-get-calls-for-query-template.json new file mode 100644 index 0000000..1ac7907 --- /dev/null +++ b/src/main/resources/query-template/01-get-calls-for-query-template.json @@ -0,0 +1,39 @@ +{ + "type" : "QueryTemplate", + "name" : "GCat-Get-CallsFor-to-VirtualService", + "description" : "The following query return all CallsFor relation from the EService of gcat identified by the UUID provided as parameter to the Virtual Service with name 'catalogue-virtual-service'. The content of the request to run this query template will be something like {\"$uuid\": \"335580b6-c164-4506-980a-21e5bcf8dbcf\"}", + "template" : { + "type" : "CallsFor", + "source" : { + "type" : "EService", + "id" : "$uuid", + "consistsOf" : [ { + "type" : "IsIdentifiedBy", + "target" : { + "type" : "SoftwareFacet", + "group" : "org.gcube.data-catalogue", + "name" : "gcat" + } + } ] + }, + "target" : { + "type" : "VirtualService", + "consistsOf" : [ { + "type" : "IsIdentifiedBy", + "target" : { + "type" : "SoftwareFacet", + "group" : "org.gcube.data-catalogue", + "name" : "catalogue-virtual-service" + } + } ] + } + }, + "templateVariables" : { + "$uuid" : { + "type": "TemplateVariable", + "name": "$uuid", + "description": "The uuid of the gCat EService, e.g. 335580b6-c164-4506-980a-21e5bcf8dbcf. Please note that the default value has no meaning but we need a valid value so that the query can be tested by the resource-registry service.", + "defaultValue": "335580b6-c164-4506-980a-21e5bcf8dbcf" + } + } +} \ No newline at end of file diff --git a/src/main/resources/query/01-get-catalogue-virtual-service.json b/src/main/resources/query/01-get-catalogue-virtual-service.json new file mode 100644 index 0000000..9070bb3 --- /dev/null +++ b/src/main/resources/query/01-get-catalogue-virtual-service.json @@ -0,0 +1,13 @@ +{ + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/query/02-get-catalogue-configuration.json b/src/main/resources/query/02-get-catalogue-configuration.json new file mode 100644 index 0000000..2b92ac7 --- /dev/null +++ b/src/main/resources/query/02-get-catalogue-configuration.json @@ -0,0 +1,30 @@ +{ + "@class": "Configuration", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "IdentifierFacet", + "value": "catalogue-configuration" + } + } + ], + "isRelatedTo": [ + { + "@class": "IsCustomizedBy", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/query/03-get-simple-facet-of-catalogue-configuration.json b/src/main/resources/query/03-get-simple-facet-of-catalogue-configuration.json new file mode 100644 index 0000000..5ee9d9b --- /dev/null +++ b/src/main/resources/query/03-get-simple-facet-of-catalogue-configuration.json @@ -0,0 +1,36 @@ +{ + "@class": "SimpleFacet", + "_in": { + "@class": "ConsistsOf", + "source": { + "@class": "Configuration", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "IdentifierFacet", + "value": "gcat-configuration" + } + } + ], + "isRelatedTo": [ + { + "@class": "IsCustomizedBy", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/query/04-get-ckan-service.json b/src/main/resources/query/04-get-ckan-service.json new file mode 100644 index 0000000..bfccb4f --- /dev/null +++ b/src/main/resources/query/04-get-ckan-service.json @@ -0,0 +1,31 @@ +{ + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/query/05-get-access-point-facet-of-ckan-service.json b/src/main/resources/query/05-get-access-point-facet-of-ckan-service.json new file mode 100644 index 0000000..2cc1960 --- /dev/null +++ b/src/main/resources/query/05-get-access-point-facet-of-ckan-service.json @@ -0,0 +1,37 @@ +{ + "@class": "AccessPointFacet", + "_in": { + "@class": "ConsistsOf", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/query/06-get-postgres-ckan-db.json b/src/main/resources/query/06-get-postgres-ckan-db.json new file mode 100644 index 0000000..ea692c7 --- /dev/null +++ b/src/main/resources/query/06-get-postgres-ckan-db.json @@ -0,0 +1,49 @@ +{ + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.postgresql", + "name": "postgresql" + } + } + ], + "isRelatedTo": [ + { + "@class": "Uses", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/query/07-get-access-point-facet-of-postgres-ckan-db.json b/src/main/resources/query/07-get-access-point-facet-of-postgres-ckan-db.json new file mode 100644 index 0000000..ede06dd --- /dev/null +++ b/src/main/resources/query/07-get-access-point-facet-of-postgres-ckan-db.json @@ -0,0 +1,55 @@ +{ + "@class": "AccessPointFacet", + "_in": { + "@class": "ConsistsOf", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.postgresql", + "name": "postgresql" + } + } + ], + "isRelatedTo": [ + { + "@class": "Uses", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/query/08-get-solr-service.json b/src/main/resources/query/08-get-solr-service.json new file mode 100644 index 0000000..4830884 --- /dev/null +++ b/src/main/resources/query/08-get-solr-service.json @@ -0,0 +1,49 @@ +{ + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.apache.solr", + "name": "solr" + } + } + ], + "isRelatedTo": [ + { + "@class": "Uses", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/query/09-get-access-point-facet-of-solr-service.json b/src/main/resources/query/09-get-access-point-facet-of-solr-service.json new file mode 100644 index 0000000..21d4638 --- /dev/null +++ b/src/main/resources/query/09-get-access-point-facet-of-solr-service.json @@ -0,0 +1,55 @@ +{ + "@class": "AccessPointFacet", + "_in": { + "@class": "ConsistsOf", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.apache.solr", + "name": "solr" + } + } + ], + "isRelatedTo": [ + { + "@class": "Uses", + "source": { + "@class": "EService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "ckan-organization", + "name": "ckan" + } + } + ], + "isRelatedTo": [ + { + "@class": "CallsFor", + "source": { + "@class": "VirtualService", + "consistsOf": [ + { + "@class": "IsIdentifiedBy", + "target": { + "@class": "SoftwareFacet", + "group": "org.gcube.data-catalogue", + "name": "catalogue-virtual-service" + } + } + ] + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/query/GraphOfResources.txt b/src/main/resources/query/GraphOfResources.txt new file mode 100644 index 0000000..f30a721 --- /dev/null +++ b/src/main/resources/query/GraphOfResources.txt @@ -0,0 +1,31 @@ + + + Configuration + --------------------------- + IsCustomizedBy | | + -----------------> | catalogue-configuration | + / | | + / --------------------------- + EService VirtualService / + ------------ ----------------------------- + | | CallsFor | | + | grsf | ------------> | catalogue-virtual-service | + | | | | + ------------ ----------------------------- + \ EService + \ -------------------- + \ Uses | | + \ ------------------> | postgres-ckan-db | + \ / | | + \ EService / -------------------- + \ ----------------- + \ CallsFor | | + -------------> | ckan | + | | + ----------------- EService + \ -------------------- + \ Uses | | + ------------------> | solr | + | | + -------------------- + \ No newline at end of file diff --git a/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java b/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java index 7778586..32da435 100644 --- a/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java +++ b/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java @@ -59,7 +59,8 @@ public class RecordTest extends ContextTest { outputTypeDir.mkdir(); // File[] sourceFiles = examplesDir.listFiles(dirnameFilter); - File[] sourceFiles = new File[] { new File(examplesDir, "grsf") }; + // File[] sourceFiles = new File[] { new File(examplesDir, "grsf") }; + File[] sourceFiles = new File[] { new File(examplesDir, "ram") }; for (File source : sourceFiles) { @@ -69,7 +70,9 @@ public class RecordTest extends ContextTest { outputSourceDir.mkdir(); // File[] jsonFiles = source.listFiles(filenameFilter); - File[] jsonFiles = new File[] {new File(source,"88818c3f-7120-322b-9637-7c7d2e9fc1e5.json")}; + // File[] jsonFiles = new File[] {new File(source,"88818c3f-7120-322b-9637-7c7d2e9fc1e5.json")}; + File[] jsonFiles = new File[] {new File(source,"00702023-0e2d-345d-8b20-60580c107acd.json")}; + // File[] jsonFiles = new File[] {new File(source,"88818c3f-7120-322b-9637-7c7d2e9fc1e5.json")}; for (File jsonFile : jsonFiles) { ObjectMapper mapper = new ObjectMapper(); @@ -95,7 +98,8 @@ public class RecordTest extends ContextTest { return; } - record.create(mapper.writeValueAsString(input)); + record.setName(input.get("grsf_uuid").asText()); + //String ret = record.create(mapper.writeValueAsString(input)); record.purge(); }