From: Roland Haeder Date: Sun, 10 Apr 2016 10:49:03 +0000 (+0200) Subject: Rewrites: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bbfabde6c7ae876946aae7a93c0bbd6db0f13ffd;p=pizzaservice-war.git Rewrites: - 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 --- diff --git a/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java b/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java index b9fbf685..30769b0a 100644 --- a/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java +++ b/src/java/org/mxchange/jshopcore/model/category/PizzaCategoryConverter.java @@ -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 categoryList = this.shopController.getAllCategories(); + List 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 - } - } - } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index c94dc3fa..4f9e2a02 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -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: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 1c3fb43b..15b087b8 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -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: diff --git a/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java index 1c7d11ce..67622e0e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java @@ -35,7 +35,7 @@ import org.mxchange.pizzaapplication.beans.shop.PizzaShopWebApplicationControlle *

* @author Roland Haeder */ -@Named ("admin_category") +@Named ("adminCategoryController") @RequestScoped public class PizzaAdminCategoryWebRequestBean implements PizzaAdminCategoryWebRequestController { diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java index 3efd54b9..2431d44e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java @@ -33,7 +33,7 @@ import org.mxchange.jcountry.data.CountrySingletonBeanRemote; *

* @author Roland Haeder */ -@Named ("country") +@Named ("countryController") @ApplicationScoped public class PizzaCountryWebApplicationBean implements PizzaCountryWebApplicationController { diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java index eb956f1e..91435577 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java @@ -27,7 +27,7 @@ import org.mxchange.jcontacts.contact.gender.GenderUtils; *

* @author Roland Haeder */ -@Named ("gender") +@Named ("genderController") @ApplicationScoped public class PizzaGenderWebApplicationBean implements PizzaGenderWebApplicationController { diff --git a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java index fea4a589..8df94172 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java @@ -31,7 +31,7 @@ import org.mxchange.jcoreee.database.BaseDatabaseBean; *

* @author Roland Haeder */ -@Named ("localization") +@Named ("localizationController") @SessionScoped public class PizzaLocalizationSessionBean extends BaseDatabaseBean implements PizzaLocalizationSessionController { diff --git a/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java index 1c365165..f0e53330 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/shop/PizzaShopWebApplicationBean.java @@ -37,7 +37,7 @@ import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote; *

* @author Roland Haeder */ -@Named ("controller") +@Named ("shopController") @ApplicationScoped public class PizzaShopWebApplicationBean implements PizzaShopWebApplicationController { diff --git a/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java b/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java index b2e3e453..d0734563 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java @@ -36,7 +36,7 @@ import org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemo *

* @author Roland Haeder */ -@FacesConverter (value = "cellphoneCarrier") +@FacesConverter (value = "CellphoneCarrierConverter") public class PizzaSmsProviderConverter implements Converter { /** diff --git a/web/WEB-INF/templates/admin/admin_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl index 8149afdb..b40fdcde 100644 --- a/web/WEB-INF/templates/admin/admin_category_selection_box.tpl +++ b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl @@ -5,6 +5,6 @@ xmlns:ui="http://java.sun.com/jsf/facelets"> - + diff --git a/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl index 94fb50b5..d711ed70 100644 --- a/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl +++ b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl @@ -4,8 +4,8 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> - + - + diff --git a/web/WEB-INF/templates/base.tpl b/web/WEB-INF/templates/base.tpl index 4dad5f8c..cc0e5f99 100644 --- a/web/WEB-INF/templates/base.tpl +++ b/web/WEB-INF/templates/base.tpl @@ -1,12 +1,12 @@ - + diff --git a/web/WEB-INF/templates/generic/form_personal_data.tpl b/web/WEB-INF/templates/generic/form_personal_data.tpl index 6b450621..f5ae4407 100644 --- a/web/WEB-INF/templates/generic/form_personal_data.tpl +++ b/web/WEB-INF/templates/generic/form_personal_data.tpl @@ -117,7 +117,7 @@

- +
@@ -132,7 +132,7 @@
- + @@ -155,7 +155,7 @@
- + @@ -176,7 +176,7 @@
- + diff --git a/web/WEB-INF/templates/generic/gender_selection_box.tpl b/web/WEB-INF/templates/generic/gender_selection_box.tpl index 422ace8d..294151e0 100644 --- a/web/WEB-INF/templates/generic/gender_selection_box.tpl +++ b/web/WEB-INF/templates/generic/gender_selection_box.tpl @@ -6,6 +6,6 @@ xmlns:ui="http://java.sun.com/jsf/facelets"> - + diff --git a/web/WEB-INF/templates/generic/locale_selection_box.tpl b/web/WEB-INF/templates/generic/locale_selection_box.tpl index baea374b..2d81840d 100644 --- a/web/WEB-INF/templates/generic/locale_selection_box.tpl +++ b/web/WEB-INF/templates/generic/locale_selection_box.tpl @@ -6,9 +6,9 @@ xmlns:ui="http://java.sun.com/jsf/facelets"> - + - + diff --git a/web/WEB-INF/templates/guest/guest_login_form.tpl b/web/WEB-INF/templates/guest/guest_login_form.tpl index 0a0f5cef..85d0e0d2 100644 --- a/web/WEB-INF/templates/guest/guest_login_form.tpl +++ b/web/WEB-INF/templates/guest/guest_login_form.tpl @@ -41,7 +41,7 @@
diff --git a/web/admin/admin_category.xhtml b/web/admin/admin_category.xhtml index b8730f0e..92c84cec 100644 --- a/web/admin/admin_category.xhtml +++ b/web/admin/admin_category.xhtml @@ -16,7 +16,7 @@
- + #{msg.SELECT_ENTRY} #{cat.categoryId}: @@ -36,8 +36,8 @@
@@ -59,7 +59,7 @@
- +
@@ -80,7 +80,7 @@ diff --git a/web/admin/admin_product.xhtml b/web/admin/admin_product.xhtml index ea8fc2a1..1c1b3899 100644 --- a/web/admin/admin_product.xhtml +++ b/web/admin/admin_product.xhtml @@ -68,7 +68,7 @@
- +
@@ -81,7 +81,7 @@
- +
diff --git a/web/index.xhtml b/web/index.xhtml index 0ece4d80..35035d32 100644 --- a/web/index.xhtml +++ b/web/index.xhtml @@ -25,7 +25,7 @@ - +
@@ -50,7 +50,7 @@
- Anzahl: + #{msg.ITEM_ORDER_AMOUNT} #{basketController.getItemAmount(product)}
@@ -66,7 +66,7 @@
#{msg.SINGLE_ITEM_PRICE} - +