Skip to content

Commit

Permalink
refactor: use _serviceProvider binding to retrieve LookupService
Browse files Browse the repository at this point in the history
Uses the new `_serviceProvider` Groovy binding to instantiate `LookupService`.
This allows to automate the transformation with gradle-hale-plugin.

SVC-1812
  • Loading branch information
florianesser committed May 13, 2024
1 parent 43ec861 commit 7184da4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Snippets/helperFunctions.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import eu.esdihumboldt.hale.common.lookup.*;
import eu.esdihumboldt.hale.ui.HaleUI;
import eu.esdihumboldt.hale.common.core.io.*;
import java.text.SimpleDateFormat;

def getLookupTableValue(value, tableId) {
// retrieve Lookup table
LookupService ls = HaleUI.getServiceProvider().getService(LookupService.class)
LookupService ls = _serviceProvider.getService(LookupService.class)
LookupTableInfo lithTable = ls.getTable(tableId)
def table = lithTable.getTable()

Expand All @@ -16,7 +15,7 @@ def getLookupTableValue(value, tableId) {

def getLookupTableKeys(tableId) {
// retrieve Lookup table
LookupService ls = HaleUI.getServiceProvider().getService(LookupService.class)
LookupService ls = _serviceProvider.getService(LookupService.class)
LookupTableInfo lithTable = ls.getTable(tableId)
def table = lithTable.getTable()

Expand Down

0 comments on commit 7184da4

Please sign in to comment.