From 9b00d6a5d0602eb5189aa77b66d56a69aa0bbdb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 12 May 2020 05:59:27 +0200 Subject: [PATCH] Product-only: - cache can be updated from the uniqueAddFoo() method - fixed some German umlauts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../list/FinancialsProductListWebViewBean.java | 2 +- .../list/FinancialsCategoryListWebViewBean.java | 9 +++++---- .../mxchange/localization/product_de_DE.properties | 11 ++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java index 30a544c6..1da57d3e 100644 --- a/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java @@ -147,7 +147,7 @@ public class FinancialsProductListWebViewBean extends BaseFinancialsBean impleme throw new NullPointerException("productId is null"); //NOI18N } else if (productId < 1) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("productId={0} is invalid", productId)); //NOI18N //NOI18N + throw new IllegalArgumentException(MessageFormat.format("productId={0} is invalid", productId)); //NOI18N } else if (!this.productCache.containsKey(productId)) { // Not found throw new ProductNotFoundException(productId); diff --git a/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java index 34aa90e3..e1f48d68 100644 --- a/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java @@ -111,8 +111,7 @@ public class FinancialsCategoryListWebViewBean extends BaseFinancialsBean implem throw new IllegalArgumentException(MessageFormat.format("event.addedCategory.categoryId={0} is not valid.", event.getAddedCategory().getCategoryId())); //NOI18N } - // Add the category - this.categoryCache.put(event.getAddedCategory().getCategoryId(), event.getAddedCategory()); + // Add category this.uniqueAddProductCategory(event.getAddedCategory()); } @@ -137,8 +136,7 @@ public class FinancialsCategoryListWebViewBean extends BaseFinancialsBean implem throw new IllegalArgumentException(MessageFormat.format("event.updatedCategory.categoryId={0} is not valid.", event.getUpdatedCategory().getCategoryId())); //NOI18N } - // Add the category - this.categoryCache.put(event.getUpdatedCategory().getCategoryId(), event.getUpdatedCategory()); + // Update category this.uniqueAddProductCategory(event.getUpdatedCategory()); } @@ -282,6 +280,9 @@ public class FinancialsCategoryListWebViewBean extends BaseFinancialsBean implem * @param category Category instance */ private void uniqueAddProductCategory (final Category category) { + // Update cache + this.categoryCache.put(category.getCategoryId(), category); + // Get iterator from final Iterator iterator = this.getAllProductCategories().iterator(); diff --git a/src/java/org/mxchange/localization/product_de_DE.properties b/src/java/org/mxchange/localization/product_de_DE.properties index 166e2e93..a85a1622 100644 --- a/src/java/org/mxchange/localization/product_de_DE.properties +++ b/src/java/org/mxchange/localization/product_de_DE.properties @@ -181,9 +181,8 @@ IS_DISCOUNT_HEADER=Ist ein Nachlass? IS_REFUND_HEADER=Ist eine R\u00fcckerstattung? ADMIN_EDIT_GENERIC_PRODUCT_TITLE=Produkt-Id {0} editieren #@TODO Please fix German umlauts! -ADMIN_EDIT_GENERIC_PRODUCT_MINIMUM_DATA=Sie koennen hier alle Werte aendern aber geben oder waehlen Sie mindestens die markierten (*) ein/aus. -#@TODO Please fix German umlauts! -BUTTON_ADMIN_EDIT_GENERIC_PRODUCT=Allgemeines Produkt aendern +ADMIN_EDIT_GENERIC_PRODUCT_MINIMUM_DATA=Sie koennen hier alle Werte \u00e4ndern aber geben oder waehlen Sie mindestens die markierten (*) ein/aus. +BUTTON_ADMIN_EDIT_GENERIC_PRODUCT=Allgemeines Produkt \u00e4ndern ADMIN_PRODUCT_NUMBER_HEADER=Produktnummer: NO_PRODUCT_NUMBER_ASSIGNED=Keine Produktnummer zugewiesen. ADMIN_ENTER_GENERIC_PRODUCT_BARCODE_NUMBER=Geben Sie die Balkencodenummer des Produktes ein: @@ -211,8 +210,6 @@ PAGE_TITLE_ADMIN_PRODUCT_CATEGORY_EDIT=Produktkategorien editieren CONTENT_TITLE_ADMIN_PRODUCT_CATEGORY_EDIT=Produktkategorien editieren: #@TODO Please fix German umlauts! ADMIN_EDIT_PRODUCT_CATEGORY_MINIMUM_DATA=Geben Sie mindestens den I18n-Schluessel ein, um diese Produktkategorie zu editieren. -#@TODO Please fix German umlauts! -BUTTON_ADMIN_EDIT_PRODUCT_CATEGORY=Produktkategorie aendern +BUTTON_ADMIN_EDIT_PRODUCT_CATEGORY=Produktkategorie \u00e4ndern ADMIN_EDIT_PRODUCT_CATEGORY_TITLE=Produktkategorie mit Id {0} editieren: -#@TODO Please fix German umlauts! -ADMIN_PRODUCT_CATEGORY_NOT_UPDATED=Sie haben die Produktkategorie nicht gaendert. +ADMIN_PRODUCT_CATEGORY_NOT_UPDATED=Sie haben die Produktkategorie nicht ge\u00e4ndert. -- 2.39.5