]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Product-only:
authorRoland Häder <roland@mxchange.org>
Fri, 17 Apr 2020 14:58:31 +0000 (16:58 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 17 Apr 2020 14:59:15 +0000 (16:59 +0200)
- 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

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/generic_product/list/FinancialsProductListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/product_category/list/FinancialsCategoryListWebViewBean.java
web/WEB-INF/product-links.jsf.taglib.xml
web/WEB-INF/resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl [deleted file]
web/WEB-INF/resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl [deleted file]
web/admin/generic_product/admin_generic_product_list.xhtml
web/admin/product_category/admin_product_category_list.xhtml

index 363bad429c9f7fc232b81de532b7c120f8f23c0a..45fbd855ccab30ed30a9556974b9b2fd5fb54d75 100644 (file)
@@ -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);
                        }
index 9b2b22a8bc99e08c4c03071911a62f4af94368ed..bd850fc39c31bfb0ced041c601b3ac6ff64bfd3a 100644 (file)
@@ -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);
                        }
index 711698d9914702a3ef2585d65352591fface848e..49556a1e0b6741e95e293109c9b96e08d25487db 100644 (file)
@@ -22,50 +22,4 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd"
 >
        <namespace>http://mxchange.org/jsf/jproduct/links</namespace>
-       <tag>
-               <tag-name>outputProductCategoryAdminDropdownMenu</tag-name>
-               <description>This tag renders an administrative drop-down menu for given category instance.</description>
-               <source>resources/tags/admin/dropdown/product_category/admin_product_category_links.tpl</source>
-               <attribute>
-                       <name>category</name>
-                       <description>The product category instance that provides the data for this tag.</description>
-                       <required>true</required>
-                       <type>org.mxchange.jproduct.model.category.Category</type>
-               </attribute>
-               <attribute>
-                       <name>renderShowLink</name>
-                       <description>Whether to render (default: true) "show product" link.</description>
-                       <required>false</required>
-                       <type>java.langBoolean</type>
-               </attribute>
-               <attribute>
-                       <name>rendered</name>
-                       <description>Whether this tag is being rendered by JSF engine (default: true).</description>
-                       <required>false</required>
-                       <type>java.lang.Boolean</type>
-               </attribute>
-       </tag>
-       <tag>
-               <tag-name>outputGenericProductAdminDropdownMenu</tag-name>
-               <description>This tag renders an administrative drop-down menu for given product instance.</description>
-               <source>resources/tags/admin/dropdown/generic_product/admin_generic_product_links.tpl</source>
-               <attribute>
-                       <name>genericProduct</name>
-                       <description>The generic product instance that provides the data for this tag.</description>
-                       <required>true</required>
-                       <type>org.mxchange.jproduct.model.product.Product</type>
-               </attribute>
-               <attribute>
-                       <name>renderShowLink</name>
-                       <description>Whether to render (default: true) "show product" link.</description>
-                       <required>false</required>
-                       <type>java.langBoolean</type>
-               </attribute>
-               <attribute>
-                       <name>rendered</name>
-                       <description>Whether this tag is being rendered by JSF engine (default: true).</description>
-                       <required>false</required>
-                       <type>java.lang.Boolean</type>
-               </attribute>
-       </tag>
 </facelet-taglib>
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 (file)
index 7b1ede1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-       xmlns:p="http://primefaces.org/ui"
-       >
-
-       <p:menuButton value="#{msg.OPTIONS}" rendered="#{empty rendered or rendered}">
-               <p:menuitem
-                       outcome="admin_show_generic_product"
-                       value="#{msg.ADMIN_LINK_SHOW_SHORT}"
-                       title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_TITLE}"
-                       rendered="#{empty renderShowLink or renderShowLink}"
-                       >
-                       <f:param name="productId" value="#{genericProduct.productId}" />
-               </p:menuitem>
-
-               <p:menuitem
-                       outcome="admin_edit_generic_product"
-                       value="#{msg.ADMIN_LINK_EDIT_SHORT}"
-                       title="#{product.ADMIN_LINK_EDIT_GENERIC_PRODUCT_TITLE}"
-                       >
-                       <f:param name="productId" value="#{genericProduct.productId}" />
-               </p:menuitem>
-
-               <p:menuitem outcome="admin_delete_generic_product">
-                       <h:outputText
-                               styleClass="link-danger"
-                               value="#{msg.ADMIN_LINK_DELETE_SHORT}"
-                               title="#{product.ADMIN_LINK_DELETE_GENERIC_PRODUCT_TITLE}"
-                               />
-                       <f:param name="productId" value="#{genericProduct.productId}" />
-               </p:menuitem>
-       </p:menuButton>
-</ui:composition>
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 (file)
index 182bab7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-       xmlns:p="http://primefaces.org/ui"
-       >
-
-       <p:menuButton value="#{msg.OPTIONS}" rendered="#{empty rendered or rendered}">
-               <p:menuitem
-                       outcome="admin_show_product_category"
-                       value="#{msg.ADMIN_LINK_SHOW_SHORT}"
-                       title="#{product.ADMIN_LINK_SHOW_PRODUCT_CATEGORY_TITLE}"
-                       rendered="#{empty renderShowLink or renderShowLink}"
-                       >
-                       <f:param name="categoryId" value="#{category.categoryId}" />
-               </p:menuitem>
-
-               <p:menuitem
-                       outcome="admin_edit_product_category"
-                       value="#{msg.ADMIN_LINK_EDIT_SHORT}"
-                       title="#{product.ADMIN_LINK_EDIT_PRODUCT_CATEGORY_TITLE}"
-                       >
-                       <f:param name="categoryId" value="#{category.categoryId}" />
-               </p:menuitem>
-
-               <p:menuitem outcome="admin_delete_product_category">
-                       <h:outputText
-                               styleClass="link-danger"
-                               value="#{msg.ADMIN_LINK_DELETE_SHORT}"
-                               title="#{product.ADMIN_LINK_DELETE_PRODUCT_CATEGORY_TITLE}"
-                               />
-                       <f:param name="categoryId" value="#{category.categoryId}" />
-               </p:menuitem>
-       </p:menuButton>
-</ui:composition>
index bdbd00133b0e7902a28c2a784215ed3b5da49245..4f6c290f86a08cc881bcda5371bc37913107e899 100644 (file)
                                        sortable="false"
                                        filterable="false"
                                        >
-                                       <product-links:outputGenericProductAdminDropdownMenu genericProduct="#{genericProduct}" />
+                                       <p:menuButton value="#{msg.OPTIONS}">
+                                               <p:menuitem
+                                                       outcome="admin_show_generic_product"
+                                                       value="#{msg.ADMIN_LINK_SHOW_SHORT}"
+                                                       title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_TITLE}"
+                                                       >
+                                                       <f:param name="productId" value="#{genericProduct.productId}" />
+                                               </p:menuitem>
+
+                                               <p:menuitem
+                                                       outcome="admin_edit_generic_product"
+                                                       value="#{msg.ADMIN_LINK_EDIT_SHORT}"
+                                                       title="#{product.ADMIN_LINK_EDIT_GENERIC_PRODUCT_TITLE}"
+                                                       >
+                                                       <f:param name="productId" value="#{genericProduct.productId}" />
+                                               </p:menuitem>
+
+                                               <p:menuitem outcome="admin_delete_generic_product">
+                                                       <h:outputText
+                                                               styleClass="link-danger"
+                                                               value="#{msg.ADMIN_LINK_DELETE_SHORT}"
+                                                               title="#{product.ADMIN_LINK_DELETE_GENERIC_PRODUCT_TITLE}"
+                                                               />
+                                                       <f:param name="productId" value="#{genericProduct.productId}" />
+                                               </p:menuitem>
+                                       </p:menuButton>
                                </p:column>
                        </p:dataTable>
 
index 8e0c0dc9989eb759d6bdf1519e3bb9b03a3a5c76..ee96d9f227015396640cb87a319292b71e46ea9e 100644 (file)
                                        sortable="false"
                                        filterable="false"
                                        >
-                                       <product-links:outputProductCategoryAdminDropdownMenu category="#{category}" />
+                                       <p:menuButton value="#{msg.OPTIONS}">
+                                               <p:menuitem
+                                                       outcome="admin_show_product_category"
+                                                       value="#{msg.ADMIN_LINK_SHOW_SHORT}"
+                                                       title="#{product.ADMIN_LINK_SHOW_PRODUCT_CATEGORY_TITLE}"
+                                                       >
+                                                       <f:param name="categoryId" value="#{category.categoryId}" />
+                                               </p:menuitem>
+
+                                               <p:menuitem
+                                                       outcome="admin_edit_product_category"
+                                                       value="#{msg.ADMIN_LINK_EDIT_SHORT}"
+                                                       title="#{product.ADMIN_LINK_EDIT_PRODUCT_CATEGORY_TITLE}"
+                                                       >
+                                                       <f:param name="categoryId" value="#{category.categoryId}" />
+                                               </p:menuitem>
+
+                                               <p:menuitem outcome="admin_delete_product_category">
+                                                       <h:outputText
+                                                               styleClass="link-danger"
+                                                               value="#{msg.ADMIN_LINK_DELETE_SHORT}"
+                                                               title="#{product.ADMIN_LINK_DELETE_PRODUCT_CATEGORY_TITLE}"
+                                                               />
+                                                       <f:param name="categoryId" value="#{category.categoryId}" />
+                                               </p:menuitem>
+                                       </p:menuButton>
                                </p:column>
                        </p:dataTable>