From cddf98113209fac56d0c7859901708fd6773ccd4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 3 Sep 2015 15:33:34 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20DataBean=20which=20will?= =?utf8?q?=20hold=20"static"=20data,=20e.g.=20genders=20-=20continued=20wi?= =?utf8?q?th=20improvements=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcore.jar | Bin 113150 -> 112822 bytes lib/jsfcore.jar | Bin 19197 -> 20348 bytes .../beans/enums/DataBean.java | 41 +++++++++ .../beans/enums/PizzaServiceDataBean.java | 86 ++++++++++++++++++ web/WEB-INF/faces-config.xml | 4 + web/WEB-INF/templates.dist/guest_page.xhtml | 3 +- web/WEB-INF/templates/base.tpl | 5 +- .../generic/gender_selection_box.tpl | 8 +- web/customer/login.xhtml | 3 +- web/customer/lost_passwd.xhtml | 3 +- web/customer/register.xhtml | 24 +++-- web/imprint.xhtml | 3 +- web/index.xhtml | 3 +- web/privacy.xhtml | 3 +- web/terms.xhtml | 3 +- 15 files changed, 160 insertions(+), 29 deletions(-) create mode 100644 src/java/org/mxchange/pizzaapplication/beans/enums/DataBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/enums/PizzaServiceDataBean.java diff --git a/lib/jcore.jar b/lib/jcore.jar index 526b59ecc5ea534f708216abf6c4ce26d6498229..74d0330e214ade54a63d465aaf71f359a475023c 100644 GIT binary patch delta 3597 zcmZu!eNa@_6+dUcS)QZG>yqiJiMOp9^SRL9hwbKkP$b-FY6oqNyuopXNo z-23i*`=6(l%TFvyQNGb+2e1LmsHjm=4AU!WCI|!dd*k@|RSG@TS8z0o0-VI+V;s+- z!JMcb+F?`s(9Xjb_$rGBmPEDac7SMfqg`EZu(58dVLFR$!!!+;sAl&D=rXgL=u5{C zy|&Vr%N{q3`7FXsIV={LCbKwUn#$syX$lMWPjAIA`@n3}W#)-&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niJqTiViiz7uUDAXk@@{KHDn) F{tL01sa^m8 diff --git a/src/java/org/mxchange/pizzaapplication/beans/enums/DataBean.java b/src/java/org/mxchange/pizzaapplication/beans/enums/DataBean.java new file mode 100644 index 00000000..6a7d4000 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/enums/DataBean.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.enums; + +import java.util.List; +import org.mxchange.jcore.contact.Gender; +import org.mxchange.jshop.beans.FrameworkBean; + +/** + * An interface for data beans + * + * @author Roland Haeder + */ +public interface DataBean extends FrameworkBean { + /** + * Getter for all genders as array + * + * @return All genders as array + */ + public Gender[] getGenders (); + /** + * Getter for only selectable genders as array, UNKNOWN is not selectable + * + * @return All genders as array + */ + public List getSelectableGenders (); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/enums/PizzaServiceDataBean.java b/src/java/org/mxchange/pizzaapplication/beans/enums/PizzaServiceDataBean.java new file mode 100644 index 00000000..152f60bd --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/enums/PizzaServiceDataBean.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.enums; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import org.mxchange.jcore.contact.Gender; +import org.mxchange.jshop.beans.BaseFrameworkBean; + +/** + * A customer bean which hides the customer instance + * + * @author Roland Haeder + */ +@Named ("data") +@ApplicationScoped +public class PizzaServiceDataBean extends BaseFrameworkBean implements DataBean { + + /** + * Serial number + */ + private static final long serialVersionUID = 835482364189L; + + @Override + public Gender[] getGenders () { + // Trace message + this.getLogger().trace(MessageFormat.format("Genders={0} - EXIT!", Arrays.toString(Gender.values()))); + + // Return it + return Gender.values(); + } + + @Override + public List getSelectableGenders () { + // Trace message + this.getLogger().trace("CALLED!"); //NOI18N + + // Init array + List genders = new ArrayList<>(this.getGenders().length - 1); + + // Debug message + this.getLogger().debug(MessageFormat.format("genders.size()={0}", genders.size())); + + // Return it + for (final Gender gender : Gender.values()) { + // Debug message + this.getLogger().debug(MessageFormat.format("gender={0}", gender)); + + // Is it unknown? + if (!gender.equals(Gender.UNKNOWN)) { + // Debug message + this.getLogger().debug(MessageFormat.format("gender={0} - adding ...", gender)); + + // Not, then add it + boolean added = genders.add(gender); + + // Debug message + this.getLogger().debug(MessageFormat.format("added={0}", added)); + } + } + + // Trace message + this.getLogger().trace(MessageFormat.format("genders={0} - EXIT!", genders)); //NOI18N + + // Return it + return genders; + } +} diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index d7b1bde5..59dad757 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -7,4 +7,8 @@ PrivacyTermsCheckboxValidator org.mxchange.jsfcore.validator.bool.privacy_terms.PrivacyTermsCheckboxValidator + + NameValidator + org.mxchange.jsfcore.validator.string.names.NameValidator + diff --git a/web/WEB-INF/templates.dist/guest_page.xhtml b/web/WEB-INF/templates.dist/guest_page.xhtml index d045118d..7439d638 100644 --- a/web/WEB-INF/templates.dist/guest_page.xhtml +++ b/web/WEB-INF/templates.dist/guest_page.xhtml @@ -1,5 +1,4 @@ - - + - + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:f="http://xmlns.jcp.org/jsf/core"> + Pizza-Service - <ui:insert name="title">Default title</ui:insert> diff --git a/web/WEB-INF/templates/generic/gender_selection_box.tpl b/web/WEB-INF/templates/generic/gender_selection_box.tpl index 18b0d360..7360554e 100644 --- a/web/WEB-INF/templates/generic/gender_selection_box.tpl +++ b/web/WEB-INF/templates/generic/gender_selection_box.tpl @@ -7,9 +7,7 @@ - - - - - + + + diff --git a/web/customer/login.xhtml b/web/customer/login.xhtml index ab2c954d..198e37cb 100644 --- a/web/customer/login.xhtml +++ b/web/customer/login.xhtml @@ -1,5 +1,4 @@ - - + - + - +
-
@@ -68,7 +66,9 @@
- + + +
@@ -80,7 +80,9 @@
- + + +
@@ -92,7 +94,9 @@
- + + +
@@ -104,7 +108,9 @@
- + + +
@@ -128,7 +134,9 @@
- + + +
diff --git a/web/imprint.xhtml b/web/imprint.xhtml index f7512adf..f31594d2 100644 --- a/web/imprint.xhtml +++ b/web/imprint.xhtml @@ -1,5 +1,4 @@ - - + - + - + - +