From 39132a069cd0cf8efbb4a601251b471033fbb18d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 11 May 2016 16:07:42 +0200 Subject: [PATCH] Fixed country controller: - renamed controller name to not have confusion to - moved hasCountries/allCountries to session-scoped bean to have full caching MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- .../beans/country/PizzaAdminCountryWebRequestBean.java | 2 +- .../beans/country/PizzaCountryWebApplicationBean.java | 5 +++++ .../country/PizzaCountryWebApplicationController.java | 8 ++++++++ web/admin/country/admin_country_list.xhtml | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java index 10ce8b88..8690f7d2 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java @@ -36,7 +36,7 @@ import org.mxchange.jcountry.events.AdminEventCountryAdded; import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException; /** - * Administrative country bean + * An administrative country bean *

* @author Roland Haeder */ diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java index 623ced51..1e1bc4ac 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java @@ -99,6 +99,11 @@ public class PizzaCountryWebApplicationBean implements PizzaCountryWebApplicatio return Collections.unmodifiableList(this.countryList); } + @Override + public boolean hasCountries () { + return (!this.countryList.isEmpty()); + } + /** * Post-initialization of this class */ diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationController.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationController.java index cb9d267f..ef787e6f 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationController.java @@ -35,6 +35,13 @@ public interface PizzaCountryWebApplicationController extends Serializable { */ List allCountries (); + /** + * Checks whether countries has been registered + *

+ * @return Whether countries has been registered + */ + boolean hasCountries (); + /** * Observing method when the event is fired that an administrator added a * new country @@ -42,4 +49,5 @@ public interface PizzaCountryWebApplicationController extends Serializable { * @param event Event instance */ void afterAdminAddedCountry (final AdminAddedCountryEvent event); + } diff --git a/web/admin/country/admin_country_list.xhtml b/web/admin/country/admin_country_list.xhtml index 63cda07c..2d172240 100644 --- a/web/admin/country/admin_country_list.xhtml +++ b/web/admin/country/admin_country_list.xhtml @@ -16,7 +16,7 @@ - + #{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_ID} -- 2.39.5