]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Product-only
authorRoland Häder <roland@mxchange.org>
Sat, 25 Apr 2020 16:48:28 +0000 (18:48 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Apr 2020 16:53:36 +0000 (18:53 +0200)
- admin_product_price_input_panel_grid.tpl to a ui:include with fixed backing
  bean reference for type-safety
- decimalSeparator and thousandSeparator are both not localizable, let's dump
  them then and current user's locale will handle it
- FSC number exposed in product list and modal
- categoryEntryUpdated exposed in admin-list-category view
- removed unneeded id attribute
- removed product.jsf.taglib.xml

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java
src/java/org/mxchange/localization/product_de_DE.properties
src/java/org/mxchange/localization/product_en_US.properties
web/WEB-INF/product.jsf.taglib.xml [deleted file]
web/WEB-INF/resources/tags/input/panel_grid/generic_product/product_price_input_panel_grid.tpl [deleted file]
web/WEB-INF/templates/admin/generic_product/admin_form_generic_product_data.tpl
web/WEB-INF/templates/admin/generic_product/admin_product_price_input_panel_grid.tpl [new file with mode: 0644]
web/WEB-INF/web.xml
web/admin/generic_product/admin_generic_product_list.xhtml
web/admin/product_category/admin_product_category_list.xhtml

index ec0721c49739df6312d12499b1e7503e15f25392..e1a5185cf437c981fef2e40ff410fd5de142b8e3 100644 (file)
@@ -180,7 +180,10 @@ public class FinancialAdminCategoryWebRequestBean extends BaseFinancialsBean imp
         */
        private Category createCategoryInstance () {
                // Create category
-               final Category category = new ProductCategory(this.getCategoryI18nKey(), this.getCategoryShownInStatistics());
+               final Category category = new ProductCategory(
+                                          this.getCategoryI18nKey(),
+                                          this.getCategoryShownInStatistics()
+                          );
 
                // Set all optional fields
                category.setParentCategory(this.getParentCategory());
index 983ae2de3a22e2093661d4ffad0223bb6ff6c87c..36d982fb21825be2d2e840645336158e27d9a6c0 100644 (file)
@@ -203,3 +203,5 @@ ADMIN_ENTER_GENERIC_PRODUCT_FSC_NUMBER_TITLE=Geben Sie die FSC-Nummer des Produk
 ERROR_PRODUCT_FSC_NUMBER_NOT_VALID=Fehler: FSC-Nummer des Produktes entspricht nicht dem Format: Cxxxxxx
 #@TODO Please fix German umlauts!
 ADMIN_GENERIC_PRODUCT_NOT_UPDATED=Sie haben keine Aenderungen am dem Produkt vorgenommen.
+ADMIN_PRODUCT_FSC_NUMBER_HEADER=FSC-Nummer:
+PRODUCT_FSC_NUMBER_TITLE=The FSC-Nummer des Produktes.
index a4a2996ea4434af4954d6d07bee07bbcc5432e8b..e2e86e0bd4c86620403f93fa2f21970b89e4deaa 100644 (file)
@@ -162,3 +162,5 @@ ADMIN_ENTER_GENERIC_PRODUCT_FSC_NUMBER=Enter FSC number:
 ADMIN_ENTER_GENERIC_PRODUCT_FSC_NUMBER_TITLE=Enter product's FSC number with leading C and 6 digits.
 ERROR_PRODUCT_FSC_NUMBER_NOT_VALID=Error: FSC number not valid format: Cxxxxxx
 ADMIN_GENERIC_PRODUCT_NOT_UPDATED=You have not changed any product data.
+ADMIN_PRODUCT_FSC_NUMBER_HEADER=FSC number:
+PRODUCT_FSC_NUMBER_TITLE=The FSC number of the product.
diff --git a/web/WEB-INF/product.jsf.taglib.xml b/web/WEB-INF/product.jsf.taglib.xml
deleted file mode 100644 (file)
index d9254e2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2017 - 2020 Free Software Foundation
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-<facelet-taglib
-       version="2.2"
-       xmlns="http://xmlns.jcp.org/xml/ns/javaee"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       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/widgets</namespace>
-       <tag>
-               <tag-name>inputProductPricePanelGrid</tag-name>
-               <description>This tag renders input fields for creating a price panel grid for product prices.</description>
-               <source>resources/tags/input/panel_grid/generic_product/product_price_input_panel_grid.tpl</source>
-               <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>
-               <attribute>
-                       <name>targetController</name>
-                       <description>A target backing bean (EL code resolving into it) extending at least BaseFacesBean where to set the data in.</description>
-                       <required>true</required>
-                       <!-- @TODO Find an interface for BaseFacesBean and set it here instead -->
-                       <type>org.mxchange.jcoreee.bean.faces.BaseFacesBean</type>
-               </attribute>
-       </tag>
-</facelet-taglib>
diff --git a/web/WEB-INF/resources/tags/input/panel_grid/generic_product/product_price_input_panel_grid.tpl b/web/WEB-INF/resources/tags/input/panel_grid/generic_product/product_price_input_panel_grid.tpl
deleted file mode 100644 (file)
index 2fb59b2..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!-- @TODO Hard-coded values below -->
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-       xmlns:p="http://primefaces.org/ui"
-       >
-
-       <p:panelGrid
-               layout="grid"
-               columns="3"
-               columnClasses="ui-grid-col-3,ui-grid-col-2,ui-grid-col-3"
-               styleClass="ui-noborder"
-               rendered="#{empty rendered or rendered == true}"
-               >
-               <p:outputLabel for="productNetPrice" value="#{product.ENTER_NET_PRICE}" />
-
-               <p:outputLabel for="productTaxRate" value="#{product.ENTER_TAX_RATE}" />
-
-               <p:outputLabel for="productGrossPrice" value="#{product.ENTER_GROSS_PRICE}" />
-
-               <p:inputNumber
-                       id="productNetPrice"
-                       title="#{product.ENTER_PRODUCT_NET_PRICE_TITLE}"
-                       value="#{targetController.productNetPrice}"
-                       symbol=" EUR"
-                       symbolPosition="s"
-                       decimalSeparator=","
-                       thousandSeparator="."
-                       >
-               </p:inputNumber>
-
-               <p:inputNumber
-                       id="productTaxRate"
-                       title="#{product.ENTER_PRODUCT_TAX_RATE_TITLE}"
-                       value="#{targetController.productTaxRate}"
-                       symbol="%"
-                       symbolPosition="s"
-                       thousandSeparator="."
-                       decimalSeparator=","
-                       emptyValue="sign"
-                       >
-                       <f:validateDoubleRange minimum="0" maximum="100" />
-               </p:inputNumber>
-
-               <p:inputNumber
-                       id="productGrossPrice"
-                       title="#{product.ENTER_PRODUCT_GROSS_PRICE_TITLE}"
-                       value="#{targetController.productGrossPrice}"
-                       symbol=" EUR"
-                       symbolPosition="s"
-                       decimalSeparator=","
-                       thousandSeparator="."
-                       required="true"
-                       requiredMessage="#{product.PRODUCT_GROSS_PRICE_REQUIRED}"
-                       >
-               </p:inputNumber>
-       </p:panelGrid>
-</ui:composition>
index c2ed32d639e35a5d2d0de50d556748774e6057ed..29ad4f67d828180334c0bad39034fd210a32189f 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:product="http://mxchange.org/jsf/jproduct/widgets"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
                                />
 
                        <p:outputLabel value="#{product.ADMIN_ENTER_GENERIC_PRODUCT_PRICE}" />
-                       <product:inputProductPricePanelGrid targetController="#{adminGenericProductActionController}" />
+                       <ui:include src="/WEB-INF/templates/admin/generic_product/admin_product_price_input_panel_grid.tpl" />
 
                        <p:outputLabel for="productCurrencyCode" value="#{product.ADMIN_ENTER_GENERIC_PRODUCT_CURRENCY_CODE}" />
                        <p:inputText
                                size="20"
                                minValue="0.001"
                                maxValue="20000.000"
-                               decimalSeparator=","
-                               thousandSeparator="."
                                title="#{product.ADMIN_ENTER_GENERIC_PRODUCT_UNIT_AMOUNT_TITLE}"
                                required="true"
                                requiredMessage="#{product.ADMIN_PRODUCT_UNIT_AMOUNT_REQUIRED}"
diff --git a/web/WEB-INF/templates/admin/generic_product/admin_product_price_input_panel_grid.tpl b/web/WEB-INF/templates/admin/generic_product/admin_product_price_input_panel_grid.tpl
new file mode 100644 (file)
index 0000000..5e11965
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui"
+       >
+
+       <p:panelGrid
+               layout="grid"
+               columns="3"
+               columnClasses="ui-grid-col-3,ui-grid-col-2,ui-grid-col-3"
+               styleClass="ui-noborder"
+               rendered="#{empty rendered or rendered == true}"
+               >
+               <p:outputLabel for="productNetPrice" value="#{product.ENTER_NET_PRICE}" />
+
+               <p:outputLabel for="productTaxRate" value="#{product.ENTER_TAX_RATE}" />
+
+               <p:outputLabel for="productGrossPrice" value="#{product.ENTER_GROSS_PRICE}" />
+
+               <p:inputNumber
+                       id="productNetPrice"
+                       title="#{product.ENTER_PRODUCT_NET_PRICE_TITLE}"
+                       value="#{adminGenericProductActionController.productNetPrice}"
+                       symbol=" EUR"
+                       symbolPosition="s"
+                       />
+
+               <p:inputNumber
+                       id="productTaxRate"
+                       title="#{product.ENTER_PRODUCT_TAX_RATE_TITLE}"
+                       value="#{adminGenericProductActionController.productTaxRate}"
+                       symbol="%"
+                       symbolPosition="s"
+                       emptyValue="focus"
+                       minValue="0"
+                       maxValue="100"
+                       />
+
+               <p:inputNumber
+                       id="productGrossPrice"
+                       title="#{product.ENTER_PRODUCT_GROSS_PRICE_TITLE}"
+                       value="#{adminGenericProductActionController.productGrossPrice}"
+                       symbol=" EUR"
+                       symbolPosition="s"
+                       required="true"
+                       requiredMessage="#{product.PRODUCT_GROSS_PRICE_REQUIRED}"
+                       />
+       </p:panelGrid>
+</ui:composition>
index f2174cccbdb050475210dab8fa7454708308302d..0c57d37c8a17b8781ab8a1627f0217b4b6d4d4db 100644 (file)
@@ -30,7 +30,7 @@
        <context-param>
                <description>Generic custom JSF tags library</description>
                <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
-               <param-value>/WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/validators.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml;/WEB-INF/project-links.jsf.taglib.xml;/WEB-INF/product.jsf.taglib.xml;/WEB-INF/product-links.jsf.taglib.xml</param-value>
+               <param-value>/WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/validators.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml;/WEB-INF/project-links.jsf.taglib.xml;;/WEB-INF/product-links.jsf.taglib.xml</param-value>
        </context-param>
        <context-param>
                <description>Project stage</description>
index 8343e6f8ed79d1f57a31f2f0bd1e4c931b3f73b4..cb23b86b754f8c097b399ca2a79042dafc84c86e 100644 (file)
@@ -2,7 +2,6 @@
 <ui:composition
        template="/WEB-INF/templates/admin/admin_base.tpl"
        xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:product-links="http://mxchange.org/jsf/jproduct/links"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
                                        <h:outputText value="-" rendered="#{empty genericProduct.productNumber}" />
                                </p:column>
 
+                               <p:column
+                                       headerText="#{product.ADMIN_PRODUCT_FSC_NUMBER_HEADER}"
+                                       sortBy="#{genericProduct.productFscNumber}"
+                                       filterBy="#{genericProduct.productFscNumber}"
+                                       filterMatchMode="contains"
+                                       >
+                                       <h:outputText value="#{genericProduct.productFscNumber}" rendered="#{not empty genericProduct.productFscNumber}" />
+                                       <h:outputText value="-" rendered="#{empty genericProduct.productFscNumber}" />
+                               </p:column>
+
                                <p:column
                                        headerText="#{product.ADMIN_PRODUCT_BARCODE_HEADER}"
                                        sortBy="#{genericProduct.productBarCodeNumber}"
                                                <h:outputText value="#{product.PRODUCT_NO_BARCODE_NUMBER_ASSIGNED}" rendered="#{empty productListController.selectedProduct.productBarCodeNumber}" />
                                                <p:barcode format="svg" width="100%" type="#{initParam['product_barcode_type']}" value="#{productListController.selectedProduct.productBarCodeNumber}" rendered="#{not empty productListController.selectedProduct.productBarCodeNumber}" />
 
+                                               <p:outputLabel value="#{product.ADMIN_PRODUCT_FSC_NUMBER_HEADER}" title="#{product.PRODUCT_FSC_NUMBER_TITLE}" />
+                                               <h:outputText value="#{productListController.selectedProduct.productFscNumber}" />
+
                                                <p:outputLabel value="#{msg.AVAILABLE_HEADER}" title="#{product.PRODUCT_AVAILABILITY_TITLE}" />
                                                <h:outputText value="#{productListController.selectedProduct.productAvailability ? msg.CHOICE_YES : msg.CHOICE_NO}" />
 
index ee96d9f227015396640cb87a319292b71e46ea9e..9f5f9f64c9626c938d28f252fb91b92a4fcc2141 100644 (file)
@@ -2,7 +2,6 @@
 <ui:composition
        template="/WEB-INF/templates/admin/admin_base.tpl"
        xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:product-links="http://mxchange.org/jsf/jproduct/links"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
 
                                <p:column
                                        headerText="#{msg.ENTRY_CREATED_HEADER}"
-                                       sortBy="#{category.categoryCreated}"
+                                       sortBy="#{category.categoryEntryCreated}"
                                        filterable="false"
                                        >
-                                       <h:outputText id="categoryCreated" value="#{category.categoryCreated}">
+                                       <h:outputText value="#{category.categoryEntryCreated}">
+                                               <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </p:column>
+
+                               <p:column
+                                       headerText="#{msg.ENTRY_UPDATED_HEADER}"
+                                       sortBy="#{category.categoryEntryUpdated}"
+                                       filterable="false"
+                                       >
+                                       <h:outputText value="#{category.categoryEntryUpdated}">
                                                <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
                                        </h:outputText>
                                </p:column>
                                                <h:outputText value="#{product.CATEGORY_HAS_NO_PARENT}" rendered="#{empty categoryListController.selectedCategory.parentCategory}" />
 
                                                <p:outputLabel value="#{msg.ENTRY_CREATED_HEADER}" title="#{product.ADMIN_CATEGORY_ENTRY_CREATED_TITLE}" />
-                                               <h:outputText value="#{categoryListController.selectedCategory.categoryCreated}">
+                                               <h:outputText value="#{categoryListController.selectedCategory.categoryEntryCreated}">
+                                                       <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+                                               </h:outputText>
+
+                                               <p:outputLabel value="#{msg.ENTRY_UPDATED_HEADER}" title="#{product.ADMIN_CATEGORY_ENTRY_UPDATED_TITLE}" />
+                                               <h:outputText value="#{categoryListController.selectedCategory.categoryEntryUpdated}">
                                                        <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
                                                </h:outputText>
                                        </p:panelGrid>