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
florianesser authored and emanuelaepure10 committed Apr 29, 2024
1 parent 97b0df6 commit f1e57c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public interface GroovyConstants {
*/
public static final String BINDING_INSTANCE_INDEX = "_instanceIndex";

/**
* Name of the service provider in the binding.
*/
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,6 +43,7 @@
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;
Expand Down Expand Up @@ -305,6 +306,9 @@ public static Binding createBinding(InstanceBuilder builder, Cell cell, Cell typ
binding.setVariable(BINDING_INSTANCE_INDEX,
executionContext.getService(InstanceIndexService.class));

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

return binding;
}
}

0 comments on commit f1e57c3

Please sign in to comment.