From: Roland Häder Date: Wed, 11 May 2016 14:07:42 +0000 (+0200) Subject: Fixed country controller: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=39132a069cd0cf8efbb4a601251b471033fbb18d;p=pizzaservice-war.git Fixed country controller: - renamed controller name to not have confusion to - moved hasCountries/allCountries to session-scoped bean to have full caching Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- 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}