From 27eec2775eb63318a3525ed6f26a1236155df25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Wed, 1 Mar 2023 13:50:57 +0100 Subject: [PATCH] feature/View name check 2 --- obp-api/src/main/scala/bootstrap/liftweb/Boot.scala | 4 ++-- .../main/scala/code/views/system/ViewDefinition.scala | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index d637deeb0..4e38a3d4e 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -799,8 +799,8 @@ class Boot extends MdcLoggable { } ApiWarnings.logWarningsRegardingProperties() - ApiWarnings.incorrectCustomViewNames() - ApiWarnings.incorrectSystemViewNames() + ApiWarnings.customViewNamesCheck() + ApiWarnings.systemViewNamesCheck() //see the notes for this method: createDefaultBankAndDefaultAccountsIfNotExisting() diff --git a/obp-api/src/main/scala/code/views/system/ViewDefinition.scala b/obp-api/src/main/scala/code/views/system/ViewDefinition.scala index 21e62737e..891170e5c 100644 --- a/obp-api/src/main/scala/code/views/system/ViewDefinition.scala +++ b/obp-api/src/main/scala/code/views/system/ViewDefinition.scala @@ -544,6 +544,11 @@ object ViewDefinition extends ViewDefinition with LongKeyedMetaMapper[ViewDefini By(ViewDefinition.view_id, viewId), ) } + def getSystemViews(): List[ViewDefinition] = { + ViewDefinition.findAll( + By(ViewDefinition.isSystem_, true) + ) + } def findCustomView(bankId: String, accountId: String, viewId: String): Box[ViewDefinition] = { ViewDefinition.find( @@ -553,6 +558,11 @@ object ViewDefinition extends ViewDefinition with LongKeyedMetaMapper[ViewDefini By(ViewDefinition.view_id, viewId), ) } + def getCustomViews(): List[ViewDefinition] = { + ViewDefinition.findAll( + By(ViewDefinition.isSystem_, false) + ) + } @deprecated("This is method only used for migration stuff, please use @findCustomView and @findSystemView instead.","13-12-2019") def findByUniqueKey(bankId: String, accountId: String, viewId: String): Box[ViewDefinition] = {