From 132833660be5b95dfb8a2ef9adda79dcd94282da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 17 Apr 2020 16:58:31 +0200 Subject: [PATCH] Product-only: - heavy rewrite on (almost?) all admin-list-foo views, to use @ViewScoped beans and working JSR107 caching - also sorted out mixed usage of userController (or so?) as the login and register backing beans can surely have their own properties - rewrote web/WEB-INF/resources/tags/admin/dropdown/ to have it included back in views again, was a bad idea MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialsProductListWebViewBean.java | 2 +- .../FinancialsCategoryListWebViewBean.java | 2 +- web/WEB-INF/product-links.jsf.taglib.xml | 46 ------------------- .../admin_generic_product_links.tpl | 37 --------------- .../admin_product_category_links.tpl | 37 --------------- .../admin_generic_product_list.xhtml | 27 ++++++++++- .../admin_product_category_list.xhtml | 27 ++++++++++- 7 files changed, 54 insertions(+), 124 deletions(-) delete mode 100644 web/WEB-INF/resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl delete mode 100644 web/WEB-INF/resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl 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 363bad42..45fbd855 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 @@ -217,7 +217,7 @@ public class FinancialsProductListWebViewBean extends BaseFinancialsBean impleme // Is cache there? if (!this.productCache.iterator().hasNext()) { // "Walk" through all entries and add to cache - for (final Product product : this.productBean.allProducts()) { + for (final Product product : this.productBean.fetchAllProducts()) { // Add it by primary key this.productCache.put(product.getProductId(), product); } 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 9b2b22a8..bd850fc3 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 @@ -192,7 +192,7 @@ public class FinancialsCategoryListWebViewBean extends BaseFinancialsBean implem // Is cache there? if (!this.categoryCache.iterator().hasNext()) { // "Walk" through all entries and add to cache - for (final Category category : this.categoryBean.allCategories()) { + for (final Category category : this.categoryBean.fetchAllCategories()) { // Add it by primary key this.categoryCache.put(category.getCategoryId(), category); } diff --git a/web/WEB-INF/product-links.jsf.taglib.xml b/web/WEB-INF/product-links.jsf.taglib.xml index 711698d9..49556a1e 100644 --- a/web/WEB-INF/product-links.jsf.taglib.xml +++ b/web/WEB-INF/product-links.jsf.taglib.xml @@ -22,50 +22,4 @@ along with this program. If not, see . xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd" > http://mxchange.org/jsf/jproduct/links - - outputProductCategoryAdminDropdownMenu - This tag renders an administrative drop-down menu for given category instance. - resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl - - category - The product category instance that provides the data for this tag. - true - org.mxchange.jproduct.model.category.Category - - - renderShowLink - Whether to render (default: true) "show product" link. - false - java.langBoolean - - - rendered - Whether this tag is being rendered by JSF engine (default: true). - false - java.lang.Boolean - - - - outputGenericProductAdminDropdownMenu - This tag renders an administrative drop-down menu for given product instance. - resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl - - genericProduct - The generic product instance that provides the data for this tag. - true - org.mxchange.jproduct.model.product.Product - - - renderShowLink - Whether to render (default: true) "show product" link. - false - java.langBoolean - - - rendered - Whether this tag is being rendered by JSF engine (default: true). - false - java.lang.Boolean - - diff --git a/web/WEB-INF/resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl b/web/WEB-INF/resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl deleted file mode 100644 index 7b1ede12..00000000 --- a/web/WEB-INF/resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/web/WEB-INF/resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl b/web/WEB-INF/resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl deleted file mode 100644 index 182bab72..00000000 --- a/web/WEB-INF/resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/web/admin/generic_product/admin_generic_product_list.xhtml b/web/admin/generic_product/admin_generic_product_list.xhtml index bdbd0013..4f6c290f 100644 --- a/web/admin/generic_product/admin_generic_product_list.xhtml +++ b/web/admin/generic_product/admin_generic_product_list.xhtml @@ -253,7 +253,32 @@ sortable="false" filterable="false" > - + + + + + + + + + + + + + + diff --git a/web/admin/product_category/admin_product_category_list.xhtml b/web/admin/product_category/admin_product_category_list.xhtml index 8e0c0dc9..ee96d9f2 100644 --- a/web/admin/product_category/admin_product_category_list.xhtml +++ b/web/admin/product_category/admin_product_category_list.xhtml @@ -171,7 +171,32 @@ sortable="false" filterable="false" > - + + + + + + + + + + + + + + -- 2.39.5