From 075cd9b9f4f2d3614b1c898d7b911d35403ab95c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 27 Apr 2016 11:17:27 +0200 Subject: [PATCH] Continued again with customer: - added missing method selectableContacts() - added missing doc-tag - better show names and id number, not object --- .../beans/customer/PizzaCustomerWebSessionBean.java | 7 ++++++- .../beans/customer/PizzaCustomerWebSessionController.java | 8 ++++++++ .../beans/user/PizzaUserWebSessionController.java | 5 +++++ web/admin/customer/admin_customer_list.xhtml | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java index b0a3a01d..1d910236 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java @@ -127,7 +127,7 @@ public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionContr } else if (customer.getCustomerContact().getContactId() < 1) { // Not valid throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId())); //NOI18N - } + } // Add to list this.customerList.add(customer); @@ -242,4 +242,9 @@ public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionContr return isFound; } + @Override + public List selectableContacts () { + return Collections.unmodifiableList(this.selectableContacts); + } + } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java index be6035f0..1abb8977 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java @@ -45,6 +45,14 @@ public interface PizzaCustomerWebSessionController extends Serializable { */ void afterAdminAddedCustomer (final AdminAddedCustomerEvent event); + /** + * Returns a list of all selectable contacts for user creation. Contacts + * from already existing users are excluded in this list. + *

+ * @return A list of all selectable contacts + */ + List selectableContacts (); + /** * Checks whether the given contact is a customer *

diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java index aecd5490..8109b928 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java @@ -69,6 +69,11 @@ public interface PizzaUserWebSessionController extends Serializable { */ void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event); + /** + * Updates list with given user + *

+ * @param user User to update + */ void updateList (final User user); /** diff --git a/web/admin/customer/admin_customer_list.xhtml b/web/admin/customer/admin_customer_list.xhtml index 6289a989..200b194a 100644 --- a/web/admin/customer/admin_customer_list.xhtml +++ b/web/admin/customer/admin_customer_list.xhtml @@ -88,7 +88,7 @@

- +
-- 2.39.5