]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with splitting/cleanup: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Mon, 8 Aug 2016 15:43:11 +0000 (17:43 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 8 Aug 2016 17:48:09 +0000 (19:48 +0200)
- removed all boolean hasFoos() methods as isEmpty() works the same way
- got rid of many Collections.unmodifiableList() calls as they may confuse the developer, please watch out!
- splitted contact's special phone stuff out to own controller (bean)

Signed-off-by: Roland Häder <roland@mxchange.org>
14 files changed:
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationController.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
web/admin/cellphone/admin_cellphone_show.xhtml
web/admin/contact/admin_contact_export.xhtml
web/admin/contact/admin_contact_list.xhtml
web/admin/country/admin_country_list.xhtml
web/admin/user/admin_user_export.xhtml
web/admin/user/admin_user_list.xhtml

index dfbb9c9abd3d7d0ed03f1de6ca2b38a178ed2783..d337c84055a0c2cbaefbbe5ec0e01e9ec111e1f0 100644 (file)
@@ -19,11 +19,9 @@ package org.mxchange.pizzaapplication.beans.contact;
 import java.text.MessageFormat;
 import java.util.Collections;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
@@ -50,7 +48,6 @@ import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
@@ -60,7 +57,6 @@ import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
-import org.mxchange.pizzaapplication.beans.phone.PizzaAdminPhoneWebRequestController;
 import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
 
 /**
@@ -77,17 +73,6 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Remote EJB for phone number (administrative)
-        */
-       private AdminPhoneSessionBeanRemote adminPhoneBean;
-
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private PizzaAdminPhoneWebRequestController adminPhoneController;
-
        /**
         * Birth day
         */
@@ -103,11 +88,6 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
         */
        private Long cellphoneNumber;
 
-       /**
-        * All cell phone numbers
-        */
-       private final List<DialableCellphoneNumber> cellphoneNumbers;
-
        /**
         * City
         */
@@ -128,12 +108,6 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
         */
        private final List<Contact> contactList;
 
-       /**
-        * "Cache" for contact lists, mostly only one is assigned. So this cache
-        * shouldn't grow beyond control.
-        */
-       private final Map<Long, List<Contact>> contacts;
-
        /**
         * Country instance
         */
@@ -267,17 +241,12 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
 
                        // Try to lookup
                        this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-
-                       // Try to lookup the beans
-                       this.adminPhoneBean = (AdminPhoneSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/adminphone!org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote"); //NOI18N
                } catch (final NamingException e) {
                        // Throw again
                        throw new FaceletException(e);
                }
 
                // Init lists/maps
-               this.cellphoneNumbers = new LinkedList<>();
-               this.contacts = new HashMap<>(10);
                this.contactList = new LinkedList<>();
                this.emailAddressList = new LinkedList<>();
        }
@@ -460,42 +429,13 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
        }
 
        @Override
-       public List<Contact> allCellphoneContacts () {
-               // Get id
-               Long phoneId = this.adminPhoneController.getCellPhone().getPhoneId();
-
-               // Is cache there?
-               if (this.contacts.containsKey(phoneId)) {
-                       // Return cached version
-                       return this.contacts.get(phoneId);
-               } else {
-                       // Ask bean
-                       List<Contact> list = new LinkedList<>();
-
-                       // "Walk" through all contacts
-                       for (final Contact contact : this.contactList) {
-                               // Is cellphone instance the same?
-                               if (Objects.equals(contact.getContactCellphoneNumber(), this.adminPhoneController.getCellPhone())) {
-                                       // Found one
-                                       list.add(contact);
-                               }
-                       }
-
-                       // Store result in cache
-                       this.contacts.put(phoneId, list);
-
-                       // Return now-cached list
-                       return list;
-               }
-       }
-
-       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<Contact> allContacts () {
                // Debug message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactController.allContacts: contactList.size()={0} - EXIT!", this.contactList.size()));
 
                // Return un-modified list
-               return Collections.unmodifiableList(this.contactList);
+               return this.contactList;
        }
 
        @Override
@@ -876,11 +816,6 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                this.zipCode = zipCode;
        }
 
-       @Override
-       public boolean hasContacts () {
-               return (!this.contactList.isEmpty());
-       }
-
        /**
         * Post-initialization of this class
         */
@@ -925,9 +860,6 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
 
                // Set contact list
                this.selectableContacts = allContacts;
-
-               // All phone numbers
-               this.cellphoneNumbers.addAll(this.adminPhoneBean.allCellphoneNumbers());
        }
 
        @Override
index 79d1ac25402f3e7b97b4eb535c77d9a6e463fea8..6d4414e1a5ea1eacd8b5a1da7a92f66105f417e8 100644 (file)
@@ -53,20 +53,6 @@ public interface PizzaContactWebSessionController extends Serializable {
         */
        List<Contact> allContacts ();
 
-       /**
-        * Getter for all contacts having current cellphone instance linked
-        * <p>
-        * @return List of all linked contacts
-        */
-       List<Contact> allCellphoneContacts ();
-
-       /**
-        * Checks whether there are contacts.
-        * <p>
-        * @return Whether contacts are there
-        */
-       boolean hasContacts ();
-
        /**
         * Event observer for newly added users by adminstrator
         * <p>
diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java
new file mode 100644 (file)
index 0000000..0411a6b
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2016 Cho-Time GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans.contact.phone;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
+import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
+import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController;
+import org.mxchange.pizzaapplication.beans.phone.PizzaAdminPhoneWebRequestController;
+
+/**
+ * A general contact bean (controller)
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Named ("contactPhoneController")
+@SessionScoped
+public class PizzaContactPhoneWebSessionBean extends BasePizzaController implements PizzaContactPhoneWebSessionController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 542_145_347_916L;
+
+       /**
+        * Remote EJB for phone number (administrative)
+        */
+       private AdminPhoneSessionBeanRemote adminPhoneBean;
+
+       /**
+        * Administrative phone controller
+        */
+       @Inject
+       private PizzaAdminPhoneWebRequestController adminPhoneController;
+
+       /**
+        * All cell phone numbers
+        */
+       private final List<DialableCellphoneNumber> cellphoneNumbers;
+
+       /**
+        * General contact controller
+        */
+       @Inject
+       private PizzaContactWebSessionController contactController;
+
+       /**
+        * "Cache" for contact lists, mostly only one is assigned. So this cache
+        * shouldn't grow beyond control.
+        */
+       private final Map<Long, List<Contact>> contacts;
+
+       /**
+        * Default constructor
+        */
+       public PizzaContactPhoneWebSessionBean () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup the beans
+                       this.adminPhoneBean = (AdminPhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/adminphone!org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+
+               // Init lists/maps
+               this.cellphoneNumbers = new LinkedList<>();
+               this.contacts = new HashMap<>(10);
+       }
+
+       @Override
+       public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
+               // The event must be valid
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedContact() == null) {
+                       // Throw again ...
+                       throw new NullPointerException("event.addedContact is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() == null) {
+                       // ... and again
+                       throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
+               }
+
+               // Clear this bean
+               this.clear();
+       }
+
+       @Override
+       public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.addedUser is null"); //NOI18N
+               } else if (event.getAddedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
+               } else if (event.getAddedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
+               }
+
+               // Clear all data
+               this.clear();
+       }
+
+       @Override
+       public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) {
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUpdatedContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
+               }
+       }
+
+       @Override
+       public List<Contact> allCellphoneContacts () {
+               // Get id
+               Long phoneId = this.adminPhoneController.getCellPhone().getPhoneId();
+
+               // Is cache there?
+               if (this.contacts.containsKey(phoneId)) {
+                       // Return cached version
+                       return this.contacts.get(phoneId);
+               } else {
+                       // Ask bean
+                       List<Contact> list = new LinkedList<>();
+
+                       // "Walk" through all contacts
+                       for (final Contact contact : this.contactController.allContacts()) {
+                               // Is cellphone instance the same?
+                               if (Objects.equals(contact.getContactCellphoneNumber(), this.adminPhoneController.getCellPhone())) {
+                                       // Found one
+                                       list.add(contact);
+                               }
+                       }
+
+                       // Store result in cache
+                       this.contacts.put(phoneId, list);
+
+                       // Return now-cached list
+                       return list;
+               }
+       }
+
+       /**
+        * Post-initialization of this class
+        */
+       @PostConstruct
+       public void init () {
+               // All phone numbers
+               this.cellphoneNumbers.addAll(this.adminPhoneBean.allCellphoneNumbers());
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java
new file mode 100644 (file)
index 0000000..becb2a9
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 Cho-Time GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans.contact.phone;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Local;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
+import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * An interface for user beans
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Local
+public interface PizzaContactPhoneWebSessionController extends Serializable {
+
+       /**
+        * Minimum password length
+        */
+       public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
+
+       /**
+        * Getter for all contacts having current cellphone instance linked
+        * <p>
+        * @return List of all linked contacts
+        */
+       List<Contact> allCellphoneContacts ();
+
+       /**
+        * Event observer for newly added users by adminstrator
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
+
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedContact (final AdminAddedContactEvent event);
+
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
+       void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
+
+}
index 027076131d3dd518ec859c340e847e98047a0974..752b97e18a1b06b7361710fa00d96ec7cce32ff7 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.pizzaapplication.beans.country;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
@@ -97,12 +96,7 @@ public class PizzaCountryWebApplicationBean extends BasePizzaController implemen
        @Override
        public List<Country> allCountries () {
                // Return "cached" version
-               return Collections.unmodifiableList(this.countryList);
-       }
-
-       @Override
-       public boolean hasCountries () {
-               return (!this.countryList.isEmpty());
+               return this.countryList;
        }
 
        /**
index ef787e6f41ac3cf62b952c7fb6aa4e11de4825eb..2ae92eea1435e1df1bd1e71f251a02a61e7e3201 100644 (file)
@@ -35,13 +35,6 @@ public interface PizzaCountryWebApplicationController extends Serializable {
         */
        List<Country> allCountries ();
 
-       /**
-        * Checks whether countries has been registered
-        * <p>
-        * @return Whether countries has been registered
-        */
-       boolean hasCountries ();
-
        /**
         * Observing method when the event is fired that an administrator added a
         * new country
index c09ea390caa2c097eda16a7367f052d12f995a92..18925b2000ec601db1311ad2208f723c2be5e376 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.pizzaapplication.beans.user;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -389,15 +388,17 @@ public class PizzaUserWebSessionBean extends BasePizzaController implements Pizz
        }
 
        @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<User> allUsers () {
                // Return it
-               return Collections.unmodifiableList(this.userList);
+               return this.userList;
        }
 
        @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<User> allVisibleUsers () {
                // Return it
-               return Collections.unmodifiableList(this.visibleUserList);
+               return this.visibleUserList;
        }
 
        @Override
@@ -573,11 +574,6 @@ public class PizzaUserWebSessionBean extends BasePizzaController implements Pizz
                this.userProfileMode = userProfileMode;
        }
 
-       @Override
-       public boolean hasUsers () {
-               return (!this.allUsers().isEmpty());
-       }
-
        /**
         * Post-initialization of this class
         */
index 30995458ea7238fc09bfae970d56cad2306c5bd1..2847064e63ddcf392cbcfea4dd1890f49779242c 100644 (file)
@@ -107,13 +107,6 @@ public interface PizzaUserWebSessionController extends Serializable {
         */
        List<User> allVisibleUsers ();
 
-       /**
-        * Checks whether users are registered
-        * <p>
-        * @return Whether users are registered
-        */
-       boolean hasUsers ();
-
        /**
         * Checks whether the given contact is a user
         * <p>
index e59ccd7371e22c174e87ff9620a8fc0b2243c2e7..569b0624d8badfab1e26c7feed5b9d0106812dc1 100644 (file)
@@ -23,7 +23,7 @@
                                <ui:param name="isShowPage" value="#{true}" />
                        </ui:include>
 
-                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{adminPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
+                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{contactPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
                                <f:facet name="header">
                                        <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CELLPHONE_LINKS}">
                                                <f:param value="#{adminPhoneController.cellPhone.phoneId}" />
index 4cb937cc0f6a2b751fc477642f2123b9eb2adb8c..502d57a38f63e6aee5b086beb71e460bf6bf08cf 100644 (file)
@@ -17,7 +17,7 @@
 
                <ui:define name="content">
                        <h:form id="form_export_contacts">
-                               <p:dataTable id="table_export_contacts" var="contact" value="#{contactController.allContacts()}" tableStyleClass="table_big" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_CONTACT}" rendered="#{contactController.hasContacts()}">
+                               <p:dataTable id="table_export_contacts" var="contact" value="#{contactController.allContacts()}" tableStyleClass="table_big" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_CONTACT}" rendered="#{not contactController.allContacts().isEmpty()}">
                                        <p:column exportable="false">
                                                <f:facet name="header">
                                                        <h:outputText value="#{msg.ADMIN_EXPORT_CONTACT_ID}" />
index b01ffd2ebaf115b3dbcba2419b41ad72b97806ed..5b081f69c54df78b6cff1bdc4429775744e189d1 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <h:dataTable id="table_list_contacts" var="contact" value="#{contactController.allContacts()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}" rendered="#{contactController.hasContacts()}">
+                       <h:dataTable id="table_list_contacts" var="contact" value="#{contactController.allContacts()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}" rendered="#{not contactController.allContacts().isEmpty()}">
                                <h:column>
                                        <f:facet name="header">
                                                <h:outputText value="#{msg.ADMIN_CONTACT_ID}" />
index 6e6b3e7e51137db4b02da51f2d792b9ac216be5e..2462fdd78ae649ff11763a4b530a14c7b004fac6 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <h:dataTable id="table_list_countries" var="country" value="#{countryController.allCountries()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}" rendered="#{countryController.hasCountries()}">
+                       <h:dataTable id="table_list_countries" var="country" value="#{countryController.allCountries()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}" rendered="#{not countryController.allCountries().isEmpty()}">
                                <h:column>
                                        <f:facet name="header">
                                                <h:outputText value="#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_ID}" />
index 1063e00233fa494de456517e4fb63ed3e434392b..151ea73dbc0fcc561c7c7598bf7c76069d2c1fbd 100644 (file)
@@ -17,7 +17,7 @@
 
                <ui:define name="content">
                        <h:form id="form_export_users">
-                               <p:dataTable id="table_export_users" var="user" value="#{userController.allUsers()}" tableStyleClass="table_big" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_USER}" rendered="#{userController.hasUsers()}">
+                               <p:dataTable id="table_export_users" var="user" value="#{userController.allUsers()}" tableStyleClass="table_big" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_USER}" rendered="#{not userController.allUsers().isEmpty()}">
                                        <p:column exportable="false">
                                                <f:facet name="header">
                                                        <h:outputText value="#{msg.ADMIN_EXPORT_USER_ID}" />
index 89f6c70dcdf08bac7cae6aa5225b6762c14e83f3..f82cb0c49cd816efa701d082f335d1cc4f4117a7 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <h:dataTable id="table_list_users" var="user" value="#{userController.allUsers()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}" rendered="#{userController.hasUsers()}">
+                       <h:dataTable id="table_list_users" var="user" value="#{userController.allUsers()}" styleClass="table_big" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}" rendered="#{not userController.allUsers().isEmpty()}">
                                <h:column>
                                        <f:facet name="header">
                                                <h:outputText value="#{msg.ADMIN_LIST_USER_ID}" />