]> git.mxchange.org Git - jjobs-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 18:53:00 +0000 (20:53 +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/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.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 80ee15f5d01f9056484a5a3eda1207e56b3f5928..7ccff23805db53a673f4997110f7de256d94a7d9 100644 (file)
@@ -19,11 +19,9 @@ package org.mxchange.jjobs.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;
@@ -45,7 +43,6 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
-import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
@@ -54,7 +51,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;
@@ -77,17 +73,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Remote EJB for phone number (administrative)
-        */
-       private AdminPhoneSessionBeanRemote adminPhoneBean;
-
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private JobsAdminPhoneWebRequestController adminPhoneController;
-
        /**
         * Birth day
         */
@@ -103,11 +88,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
         */
        private Long cellphoneNumber;
 
-       /**
-        * All cell phone numbers
-        */
-       private final List<DialableCellphoneNumber> cellphoneNumbers;
-
        /**
         * City
         */
@@ -128,12 +108,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
         */
        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 JobsContactWebSessionBean extends BaseJobsController implements Job
 
                        // Try to lookup
                        this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jratecalc-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-
-                       // Try to lookup the beans
-                       this.adminPhoneBean = (AdminPhoneSessionBeanRemote) context.lookup("java:global/jjobs-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<>();
        }
@@ -457,42 +426,13 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
        }
 
        @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
@@ -525,7 +465,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
 
                // Debug message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: this.emailAddress={1}", this.getClass().getSimpleName(), this.getEmailAddress()));
-
                // Don't set null or wrong references
                if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) {
                        // Now the number must be given
@@ -585,7 +524,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
 
                // Trace message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: contact={1} - EXIT!", this.getClass().getSimpleName(), contact));
-
                // Return it
                return contact;
        }
@@ -873,11 +811,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.zipCode = zipCode;
        }
 
-       @Override
-       public boolean hasContacts () {
-               return (!this.contactList.isEmpty());
-       }
-
        /**
         * Post-initialization of this class
         */
@@ -922,9 +855,6 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
 
                // Set contact list
                this.selectableContacts = allContacts;
-
-               // All phone numbers
-               this.cellphoneNumbers.addAll(this.adminPhoneBean.allCellphoneNumbers());
        }
 
        @Override
index 8dd604f90a6db4e4092ceda5467911fdf386ba00..2640d420577e7cd4f565c94f11c8ec2df5cbd15b 100644 (file)
@@ -53,20 +53,6 @@ public interface JobsContactWebSessionController 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/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java
new file mode 100644 (file)
index 0000000..f3292cc
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.jjobs.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.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
+import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * A general contact bean (controller)
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("contactPhoneController")
+@SessionScoped
+public class JobsContactPhoneWebSessionBean extends BaseJobsController implements JobsContactPhoneWebSessionController {
+
+       /**
+        * 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 JobsAdminPhoneWebRequestController adminPhoneController;
+
+       /**
+        * All cell phone numbers
+        */
+       private final List<DialableCellphoneNumber> cellphoneNumbers;
+
+       /**
+        * General contact controller
+        */
+       @Inject
+       private JobsContactWebSessionController 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 JobsContactPhoneWebSessionBean () {
+               // 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/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java
new file mode 100644 (file)
index 0000000..fefb5c1
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.jjobs.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<roland@mxchange.org>
+ */
+@Local
+public interface JobsContactPhoneWebSessionController 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 f2f15c02ca776551ede273b3666851e296215b2c..ff02ee7a6ee202a5d04d476c9b046712c7f4e2fe 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.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 JobsCountryWebApplicationBean extends BaseJobsController implements
        @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 1f6613214ce8e784183be08c34f28f4d3cb375b0..226fcc4584f6bcf3ba2c4b3f2163e42e38ac9811 100644 (file)
@@ -35,13 +35,6 @@ public interface JobsCountryWebApplicationController 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 2040fcd43bba5a157aa27ebe085dc8208af42f19..378218cfe1a340d5a72a887094020947a1b208af 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.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 JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        }
 
        @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 JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.userProfileMode = userProfileMode;
        }
 
-       @Override
-       public boolean hasUsers () {
-               return (!this.allUsers().isEmpty());
-       }
-
        /**
         * Post-initialization of this class
         */
index b64268aa82b7e17420fc2e8bc563aa3ef6b23066..418a251bcb6fdadeeb4d0d1c1691eaf621840697 100644 (file)
@@ -107,13 +107,6 @@ public interface JobsUserWebSessionController 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 32f5ccdd07bd01936cebb14f170058c6a161ee95..26e34fd1ef3f6692c4e03477dd3a14f1eb0b7738 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 d00e40f1223f6977112cd10e5059a5fbfeb4f922..29f9364119d358a956610df1093a652715892295 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}" />