From 7184da40f79a5bc0a76dec37c9e38fd870446262 Mon Sep 17 00:00:00 2001 From: Florian Esser Date: Mon, 13 May 2024 10:56:43 +0200 Subject: [PATCH] refactor: use _serviceProvider binding to retrieve LookupService Uses the new `_serviceProvider` Groovy binding to instantiate `LookupService`. This allows to automate the transformation with gradle-hale-plugin. SVC-1812 --- Snippets/helperFunctions.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Snippets/helperFunctions.groovy b/Snippets/helperFunctions.groovy index 61289bd..a93b9e5 100644 --- a/Snippets/helperFunctions.groovy +++ b/Snippets/helperFunctions.groovy @@ -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() @@ -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()