Skip to content

Commit

Permalink
feat: add binding to service provider for use in Groovy script
Browse files Browse the repository at this point in the history
Add an additional binding for the Service Provider to Groovy scripts.

ING-4265
  • Loading branch information
emanuelaepure10 committed Apr 27, 2024
1 parent 4ba10d0 commit 99b7d04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Import-Package: com.google.common.base;version="9.0.0",
eu.esdihumboldt.hale.common.instance.model,
eu.esdihumboldt.hale.common.instance.model.impl,
eu.esdihumboldt.hale.common.instance.orient;resolution:=optional,
eu.esdihumboldt.hale.common.lookup,
eu.esdihumboldt.hale.common.schema.geometry,
eu.esdihumboldt.hale.common.schema.model,
eu.esdihumboldt.hale.common.schema.model.constraint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public interface GroovyConstants {
public static final String BINDING_INSTANCE_INDEX = "_instanceIndex";

/**
* Name of the lookup service in the binding.
* Name of the service provider in the binding.
*/
public static final String BINDING_LOOKUP_SERVICE = "_lookup";
public static final String BINDING_SERVICE_PROVIDER = "_serviceProvider";

/**
* Name of the helper functions accessor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import eu.esdihumboldt.hale.common.core.io.Text;
import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService;
import eu.esdihumboldt.hale.common.core.report.SimpleLog;
import eu.esdihumboldt.hale.common.core.service.ServiceProvider;
import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder;
import eu.esdihumboldt.hale.common.instance.index.InstanceIndexService;
import eu.esdihumboldt.hale.common.instance.index.spatial.SpatialIndexService;
import eu.esdihumboldt.hale.common.instance.model.MutableInstance;
import eu.esdihumboldt.hale.common.lookup.LookupService;
import eu.esdihumboldt.hale.common.schema.model.TypeDefinition;
import eu.esdihumboldt.hale.io.groovy.snippets.GroovySnippets;
import eu.esdihumboldt.util.groovy.sandbox.GroovyService;
Expand Down Expand Up @@ -306,8 +306,8 @@ public static Binding createBinding(InstanceBuilder builder, Cell cell, Cell typ
binding.setVariable(BINDING_INSTANCE_INDEX,
executionContext.getService(InstanceIndexService.class));

binding.setVariable(BINDING_LOOKUP_SERVICE,
executionContext.getService(LookupService.class));
binding.setVariable(BINDING_SERVICE_PROVIDER,
executionContext.getService(ServiceProvider.class));

return binding;
}
Expand Down

0 comments on commit 99b7d04

Please sign in to comment.