]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Rewrites:
authorRoland Haeder <roland@mxchange.org>
Sun, 10 Apr 2016 10:49:03 +0000 (12:49 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 10 Apr 2016 11:06:01 +0000 (13:06 +0200)
- renamed controller (beans) to have them all a suffix "Controller"
- renamed converter to have them all a suffix "Converter"
- Localized German word "Anzahl" and changed it to "Bestellmenge" (order amount)
- added more empty lines

19 files changed:
src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java
web/WEB-INF/templates/admin/admin_category_selection_box.tpl
web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl
web/WEB-INF/templates/base.tpl
web/WEB-INF/templates/generic/form_personal_data.tpl
web/WEB-INF/templates/generic/gender_selection_box.tpl
web/WEB-INF/templates/generic/locale_selection_box.tpl
web/WEB-INF/templates/guest/guest_login_form.tpl
web/admin/admin_category.xhtml
web/admin/admin_product.xhtml
web/index.xhtml

index b9fbf685c9430bf0dfae980e04b3480fe565cbef..30769b0a2603677de721f6ab857b6a2e43fdd888 100644 (file)
@@ -19,18 +19,15 @@ package org.mxchange.jshopcore.model.category;
 import java.text.MessageFormat;
 import java.util.List;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.FacesConverter;
-import javax.inject.Inject;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-import org.mxchange.pizzaapplication.beans.shop.PizzaShopWebApplicationController;
 
 /**
  * A converter for transfering category objects
@@ -40,6 +37,11 @@ import org.mxchange.pizzaapplication.beans.shop.PizzaShopWebApplicationControlle
 @FacesConverter (value = "category")
 public class PizzaCategoryConverter implements Converter {
 
+       /**
+        * Category EJB
+        */
+       private CategorySessionBeanRemote categoryBean;
+
        /**
         * Logger instance
         */
@@ -47,10 +49,21 @@ public class PizzaCategoryConverter implements Converter {
        private LoggerBeanLocal loggerBeanLocal;
 
        /**
-        * Category bean
+        * Default constructor
         */
-       @Inject
-       private PizzaShopWebApplicationController shopController;
+       public PizzaCategoryConverter () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+               }
+       }
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
@@ -58,7 +71,7 @@ public class PizzaCategoryConverter implements Converter {
                this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
 
                // Get full list
-               List<Category> categoryList = this.shopController.getAllCategories();
+               List<Category> categoryList = this.categoryBean.getAllCategories();
 
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
@@ -119,22 +132,4 @@ public class PizzaCategoryConverter implements Converter {
                return String.valueOf(((Category) value).getCategoryId());
        }
 
-       /**
-        * Initialization of this converter
-        */
-       @PostConstruct
-       public void init () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
-               }
-       }
-
 }
index c94dc3fadf74c20450605e0549c095b6b567039a..4f9e2a02d99d0ece1ea81ae9211efb5f5128653b 100644 (file)
@@ -228,3 +228,4 @@ PAGE_TITLE_ADMIN_ADD_USER=Neues Benutzeraccount hinzufuegen
 #CONTENT_TITLE_ADMIN_ADD_USER
 CONTENT_TITLE_ADMIN_ADD_USER=Neues Benutzeraccount hinzufuegen:
 TABLE_SUMMARY_ADMIN_LIST_USERS=Administration, alle Benutzer auflisten
+ITEM_ORDER_AMOUNT=Bestellmenge:
index 1c3fb43b1be8433adde1417687ac12a592b2c3b2..15b087b8012f954ddbcf668bfe63d79ee00903f3 100644 (file)
@@ -219,3 +219,4 @@ ADMIN_MENU_USER_TITLE=User management
 PAGE_TITLE_ADMIN_ADD_USER=Add new user account
 CONTENT_TITLE_ADMIN_ADD_USER=Add new user account:
 TABLE_SUMMARY_ADMIN_LIST_USERS=Administration, list all users
+ITEM_ORDER_AMOUNT=Amount:
index 1c7d11ced1b32e0a1d63292e7321d12437d3636a..67622e0ef0551db74c9b81dc0ca3c470effc4119 100644 (file)
@@ -35,7 +35,7 @@ import org.mxchange.pizzaapplication.beans.shop.PizzaShopWebApplicationControlle
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("admin_category")
+@Named ("adminCategoryController")
 @RequestScoped
 public class PizzaAdminCategoryWebRequestBean implements PizzaAdminCategoryWebRequestController {
 
index 3efd54b9fb9232484f4e874e96ca61b669686ff5..2431d44e6f69dddda5441d7c6934000da8f6e411 100644 (file)
@@ -33,7 +33,7 @@ import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("country")
+@Named ("countryController")
 @ApplicationScoped
 public class PizzaCountryWebApplicationBean implements PizzaCountryWebApplicationController {
 
index eb956f1e90611ab6e1db03db6673c0db9f330dc4..914355776eff9582e5e9e29be1c51b26cbe8aeb0 100644 (file)
@@ -27,7 +27,7 @@ import org.mxchange.jcontacts.contact.gender.GenderUtils;
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("gender")
+@Named ("genderController")
 @ApplicationScoped
 public class PizzaGenderWebApplicationBean implements PizzaGenderWebApplicationController {
 
index fea4a58969d3384728fd035b044c08a0ea302a6c..8df94172cafcf23bcef002c0576cb5984dcfbf87 100644 (file)
@@ -31,7 +31,7 @@ import org.mxchange.jcoreee.database.BaseDatabaseBean;
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("localization")
+@Named ("localizationController")
 @SessionScoped
 public class PizzaLocalizationSessionBean extends BaseDatabaseBean implements PizzaLocalizationSessionController {
 
index 1c365165de27e5a089067c6aa95709194182f178..f0e5333034ffaa3c7f41c5c5d324713c60b28f53 100644 (file)
@@ -37,7 +37,7 @@ import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named ("controller")
+@Named ("shopController")
 @ApplicationScoped
 public class PizzaShopWebApplicationBean implements PizzaShopWebApplicationController {
 
index b2e3e453982c0543e077080debb682c235f64bd5..d07345631a582198ebf3ca40beef5a4715c0b09f 100644 (file)
@@ -36,7 +36,7 @@ import org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemo
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-@FacesConverter (value = "cellphoneCarrier")
+@FacesConverter (value = "CellphoneCarrierConverter")
 public class PizzaSmsProviderConverter implements Converter {
 
        /**
index 8149afdb8cef3e4784f6cd505470f5e94e4443f7..b40fdcde5b52de2729af9da1c9641d2ed1beeb97 100644 (file)
@@ -5,6 +5,6 @@
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
        <h:selectOneMenu class="select" id="productCategory" value="#{adminProductController.productCategory}" required="true" requiredMessage="#{msg.ADMIN_CATEGORY_MUST_BE_SELECTED}" converter="category">
-               <f:selectItems value="#{controller.allCategories}" var="cat" itemValue="#{cat}" itemLabel="#{cat.categoryTitle}" />
+               <f:selectItems value="#{shopController.allCategories}" var="cat" itemValue="#{cat}" itemLabel="#{cat.categoryTitle}" />
        </h:selectOneMenu>
 </ui:composition>
index 94fb50b535ace0907c3e1059d71ad280978ad07c..d711ed70f06c870eb9cff232813a2f466b27c0e5 100644 (file)
@@ -4,8 +4,8 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
-       <h:selectOneMenu class="select" id="parentCategory" value="#{admin_category.parentCategory}">
+       <h:selectOneMenu class="select" id="parentCategory" value="#{adminCategoryController.parentCategory}">
                <f:selectItem itemValue="" itemLabel="#{msg.ADMIN_CATEGORY_HAS_NO_PARENT}" />
-               <f:selectItems value="#{controller.allCategoriesParent}" var="parent_category" itemValue="#{parent_category.categoryId}" itemLabel="#{parent_category.categoryTitle}" />
+               <f:selectItems value="#{shopController.allCategoriesParent}" var="parent_category" itemValue="#{parent_category.categoryId}" itemLabel="#{parent_category.categoryTitle}" />
        </h:selectOneMenu>
 </ui:composition>
index 4dad5f8c0c85c5048fb272147f5e2a7a669d3a64..cc0e5f9991b4e7a46dbe3f2574f3d6503bc22bc8 100644 (file)
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <html
-       lang="#{localization.language}" xml:lang="#{localization.language}"
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
 
-       <f:view locale="#{localization.locale}" contentType="text/html">
+       <f:view locale="#{localizationController.locale}" contentType="text/html">
                <h:head>
                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
index 6b4506214a0b492f41d88c20ee09a3525b481611..f5ae4407e1c3eb81e6b9f782bcaf63cf234405fa 100644 (file)
                                <div class="table_right">
                                        <h:selectOneMenu class="select" id="country" value="#{userController.country}" converter="country">
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryCode} (#{msg[c.countryI18nkey]})" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryCode} (#{msg[c.countryI18nkey]})" />
                                        </h:selectOneMenu>
                                </div>
 
                                <div class="table_right">
                                        <h:selectOneMenu class="select" id="phoneCountryCode" value="#{userController.phoneCountry}" converter="country">
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
                                        </h:selectOneMenu>
 
                                        <h:inputText class="input" id="phoneAreaCode" size="5" maxlength="10" value="#{userController.phoneAreaCode}">
                                <div class="table_right">
                                        <h:selectOneMenu class="select" id="faxCountryCode" value="#{userController.faxCountry}" converter="country">
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
                                        </h:selectOneMenu>
 
                                        <h:inputText class="input" id="faxAreaCode" size="5" maxlength="10" value="#{userController.faxAreaCode}">
                                </div>
 
                                <div class="table_right">
-                                       <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{userController.cellphoneCarrier}" converter="cellphoneCarrier">
+                                       <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{userController.cellphoneCarrier}" converter="CellphoneCarrierConverter">
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
                                                <f:selectItems value="#{cellphone.allSmsProvider()}" var="p" itemValue="#{p}" itemLabel="#{p.providerCountry.countryLocalDialPrefix}#{p.providerDialPrefix} (#{p.providerName})" />
                                        </h:selectOneMenu>
index 422ace8d49e56c9dbe349f356757c1b5a66c7725..294151e0ab76eb9a4e47d3d5320c043ebcfd6f40 100644 (file)
@@ -6,6 +6,6 @@
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
        <h:selectOneMenu class="select" id="gender" value="#{customerController.gender}">
-               <f:selectItems value="#{gender.selectableGenders}" var="g" itemValue="#{g}" itemLabel="#{msg[g.messageKey]}" />
+               <f:selectItems value="#{genderController.selectableGenders}" var="g" itemValue="#{g}" itemLabel="#{msg[g.messageKey]}" />
        </h:selectOneMenu>
 </ui:composition>
index baea374b89333f6eb756a73061b73a814dd55496..2d81840d305ad0bd36f3501a7db05f78e74130aa 100644 (file)
@@ -6,9 +6,9 @@
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
        <h:form id="locale_selection">
-               <h:selectOneMenu id="language_selection" value="#{localization.language}" onchange="submit()">
+               <h:selectOneMenu id="language_selection" value="#{localizationController.language}" onchange="submit()">
                        <f:selectItem itemLabel="#{msg.SELECT_LANGUAGE}" noSelectionOption="true" />
-                       <f:selectItems value="#{localization.selectableLocalizations}" var="l" itemValue="#{l}" itemLabel="#{msg[l.toString().toUpperCase()]}" />
+                       <f:selectItems value="#{localizationController.selectableLocalizations}" var="l" itemValue="#{l}" itemLabel="#{msg[l.toString().toUpperCase()]}" />
                </h:selectOneMenu>
        </h:form>
 </ui:composition>
index 0a0f5cefbbe8cbd4719b5a22d135e50304f5e39d..85d0e0d2848148e0eae19130640a9f3cff1758ef 100644 (file)
@@ -41,7 +41,7 @@
 
                                <div class="table_footer">
                                        <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton class="submit" type="submit" action="#{controller.doLogin()}" value="#{msg.BUTTON_CUSTOMER_LOGIN}" />
+                                       <h:commandButton class="submit" type="submit" action="#{loginController.doLogin()}" value="#{msg.BUTTON_CUSTOMER_LOGIN}" />
                                </div>
                        </div>
                </h:form>
index b8730f0e7a0f3dd8cdfc6e8dcfb21d0e43e52428..92c84cecfcd6c5a860b4c046410d9cc51104fceb 100644 (file)
@@ -16,7 +16,7 @@
                <ui:define name="content">
                        <div class="para">
                                <h:form id="form">
-                                       <h:dataTable id="categories" var="cat" value="#{controller.allCategories}" styleClass="table" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_CATEGORY}">
+                                       <h:dataTable id="categories" var="cat" value="#{shopController.allCategories}" styleClass="table" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_CATEGORY}">
                                                <h:column>
                                                        <f:facet name="header">#{msg.SELECT_ENTRY}</f:facet>
                                                        #{cat.categoryId}:
@@ -36,8 +36,8 @@
 
                                        <div class="table_footer">
                                                <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton class="submit" type="submit" id="edit" action="#{admin_category.editCategory(cat)}" value="#{msg.ADMIN_BUTTON_EDIT_ENTRIES}" />
-                                               <h:commandButton class="delete" type="submit" id="delete" action="#{admin_category.deleteCategory(cat)}" value="#{msg.ADMIN_BUTTON_DELETE_ENTRIES}" />
+                                               <h:commandButton class="submit" type="submit" id="edit" action="#{adminCategoryController.editCategory(cat)}" value="#{msg.ADMIN_BUTTON_EDIT_ENTRIES}" />
+                                               <h:commandButton class="delete" type="submit" id="delete" action="#{adminCategoryController.deleteCategory(cat)}" value="#{msg.ADMIN_BUTTON_DELETE_ENTRIES}" />
                                        </div>
                                </h:form>
                        </div>
@@ -59,7 +59,7 @@
                                                                </div>
 
                                                                <div class="table_right">
-                                                                       <h:inputText class="input" id="guest_title" value="#{admin_category.categoryTitle}" size="10" maxlength="255" required="true" />
+                                                                       <h:inputText class="input" id="guest_title" value="#{adminCategoryController.categoryTitle}" size="10" maxlength="255" required="true" />
                                                                </div>
 
                                                                <div class="clear"></div>
@@ -80,7 +80,7 @@
 
                                                <div class="table_footer">
                                                        <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton class="submit" type="submit" action="#{admin_category.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
+                                                       <h:commandButton class="submit" type="submit" action="#{adminCategoryController.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
                                                </div>
                                        </div>
                                </h:form>
index ea8fc2a1367548fd13c962f709f7ea6e5c2de5cd..1c1b3899bf429455eccee1fac7169737b83dd4e3 100644 (file)
@@ -68,7 +68,7 @@
                                                                </div>
 
                                                                <div class="table_right">
-                                                                       <h:inputText class="input" id="guest_title" size="10" maxlength="255" required="true" value="#{admin_product.productTitle}" />
+                                                                       <h:inputText class="input" id="guest_title" size="10" maxlength="255" required="true" value="#{adminProductController.productTitle}" />
                                                                </div>
 
                                                                <div class="clear"></div>
@@ -81,7 +81,7 @@
                                                                </div>
 
                                                                <div class="table_right">
-                                                                       <h:inputText class="input" id="price" size="10" maxlength="255" required="true" value="#{admin_product.productPrice}" />
+                                                                       <h:inputText class="input" id="price" size="10" maxlength="255" required="true" value="#{adminProductController.productPrice}" />
                                                                </div>
 
                                                                <div class="clear"></div>
index 0ece4d80411345fd1ae2dc1b3a61531ebd31e610..35035d32901011657b4e9919250002aca0227dcb 100644 (file)
@@ -25,7 +25,7 @@
                                </div>
                        </div>
 
-                       <h:dataTable id="table_show_available_products" var="product" value="#{controller.availableProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_INDEX_PRODUCTS}">
+                       <h:dataTable id="table_show_available_products" var="product" value="#{shopController.availableProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_INDEX_PRODUCTS}">
                                <h:column>
                                        <div id="main_item_container">
                                                <div class="item_title">
@@ -50,7 +50,7 @@
 
                                                                        <ui:fragment rendered="#{basketController.isProductAdded(product)}">
                                                                                <div class="item_amount">
-                                                                                       Anzahl:
+                                                                                       #{msg.ITEM_ORDER_AMOUNT}
                                                                                        #{basketController.getItemAmount(product)}
                                                                                </div>
 
@@ -66,7 +66,7 @@
                                                        <div class="table_right">
                                                                <div class="item_price">
                                                                        #{msg.SINGLE_ITEM_PRICE}
-                                                                       <h:outputText class="price" value="#{product.price}">
+                                                                       <h:outputText class="price" value="#{product.productPrice}">
                                                                                <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
                                                                        </h:outputText>
                                                                </div>