]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:38:06 +0000 (21:38 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 10 Apr 2020 19:44:11 +0000 (21:44 +0200)
- WIP: rewrote admin-list-users view into ViewScoped
- added missing "global search" to it
- added initial p:dialog box to it
- also output userLastLock[Reason] and userMustChangePassword
- added/removed/renamed some i18n strings
- rewrote cache initialization to avoid a local List<Entity> copy

Signed-off-by: Roland Häder <roland@mxchange.org>
49 files changed:
src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/business/department/list/FinancialsDepartmentListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/headquarter/list/FinancialsHeadquarterListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/contact/list/FinancialsContactListWebViewController.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/list/FinancialsCountryListWebViewBean.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java
src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java
src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionController.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewController.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewtBean.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java
src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java
src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java
src/java/org/mxchange/localization/generic_de_DE.properties
src/java/org/mxchange/localization/generic_en_US.properties
web/WEB-INF/templates/admin/basic_data/admin_form_basic_data.tpl
web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl
web/WEB-INF/templates/admin/department/admin_form_department_data.tpl
web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl
web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl
web/WEB-INF/templates/admin/user/admin_show_user_data.tpl
web/WEB-INF/templates/admin/user/admin_show_user_data_mini.tpl
web/admin/basic_data/admin_basic_data_list.xhtml
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/department/admin_department_list.xhtml
web/admin/employee/admin_employee_list.xhtml
web/admin/headquarter/admin_headquarter_list.xhtml
web/admin/user/admin_user_activity_log.xhtml
web/admin/user/admin_user_export.xhtml
web/admin/user/admin_user_list.xhtml
web/admin/user/admin_user_unlock.xhtml
web/guest/user/user_list.xhtml

index 41184b88aba4adcf18a6dc3c5dbc163ae3c44a1b..f281a4645304adc1c379fa2c4e628858dc0198ce 100644 (file)
@@ -197,11 +197,8 @@ public class FinancialsBasicDataListWebViewBean extends BaseFinancialsBean imple
        public void initializeList () {
                // Is cache there?
                if (!this.basicDataCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<BasicData> basicDatas = this.basicDataBean.allBusinessBasicData();
-
                        // Add all
-                       for (final BasicData basicData : basicDatas) {
+                       for (final BasicData basicData : this.basicDataBean.allBusinessBasicData()) {
                                // Add it to cache
                                this.basicDataCache.put(basicData.getBasicDataId(), basicData);
                        }
index 7a7fbc17c2aaec5f0d1abbf9287178ad149654ba..5d56953a570a2ba350950ce9ddb2b915cc4b42f2 100644 (file)
@@ -190,11 +190,8 @@ public class FinancialsBranchOfficeListWebViewBean extends BaseFinancialsBean im
        public void initializeList () {
                // Is cache there?
                if (!this.branchOfficeCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<BranchOffice> branchOffices = this.branchOfficeBean.allBranchOffices();
-
                        // Add all
-                       for (final BranchOffice branchOffice : branchOffices) {
+                       for (final BranchOffice branchOffice : this.branchOfficeBean.allBranchOffices()) {
                                // Add it to cache
                                this.branchOfficeCache.put(branchOffice.getBranchId(), branchOffice);
                        }
index 2b40abf57d10d7ba9a918adaff38c4d0bb511c8e..30815f8631bb149978f4bff8d255cde475848935 100644 (file)
@@ -194,11 +194,8 @@ public class FinancialsDepartmentListWebViewBean extends BaseFinancialsBean impl
        public void initializeList () {
                // Is cache there?
                if (!this.departmentCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<Department> departments = this.departmentBean.allDepartments();
-
                        // Add all
-                       for (final Department department : departments) {
+                       for (final Department department : this.departmentBean.allDepartments()) {
                                // Add it to cache
                                this.departmentCache.put(department.getDepartmentId(), department);
                        }
index 84b6a29d863570a8ea4c64cd576b5be18720d296..2dbc4548c5f461683066727099fbef3d5a2e0753 100644 (file)
@@ -163,11 +163,8 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
        public void init () {
                // Is cache there?
                if (!this.employeeCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<Employable> employees = this.employeeBean.allEmployees();
-
                        // Add all
-                       for (final Employable employee : employees) {
+                       for (final Employable employee : this.employeeBean.allEmployees()) {
                                // Add it to cache
                                this.employeeCache.put(employee.getEmployeeId(), employee);
                        }
index b5bce36b6d693b0e01fcf8304ee884be6a4ff84d..e4f579d6465459ff1c83d89c326e432e70b2f432 100644 (file)
@@ -191,11 +191,8 @@ public class FinancialsHeadquarterListWebViewBean extends BaseFinancialsBean imp
        public void initializeList () {
                // Is cache there?
                if (!this.headquarterCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<Headquarter> Headquarter = this.headquarterBean.allHeadquarters();
-
                        // Add all
-                       for (final Headquarter headquarter : Headquarter) {
+                       for (final Headquarter headquarter : this.headquarterBean.allHeadquarters()) {
                                // Add it to cache
                                this.headquarterCache.put(headquarter.getHeadquarterId(), headquarter);
                        }
index 7577eec10c51c3d5a88cddcc92db0722eb0b324a..5399bec3aae91509abeafca9266a1ba576f6a5ec 100644 (file)
@@ -162,11 +162,8 @@ public class FinancialsOpeningTimeWebRequestBean extends BaseFinancialsBean impl
        public void initializeList () {
                // Is cache there?
                if (!this.openingTimesCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<OpeningTime> openingTimes = this.openingTimesBean.allOpeningTimes();
-
                        // Add all
-                       for (final OpeningTime openingTime : openingTimes) {
+                       for (final OpeningTime openingTime : this.openingTimesBean.allOpeningTimes()) {
                                // Add it to cache
                                this.openingTimesCache.put(openingTime.getOpeningId(), openingTime);
                        }
index cca45e73a327bd38d897ee10ef9b440753bdcdc3..0860406914b5fa4486232d071f0c2b3202b33234 100644 (file)
@@ -271,7 +271,7 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp
                final Contact contact = this.createContactInstance();
 
                // Default is not same contact
-               if (this.contactListController.isSameContactFound(contact)) {
+               if (this.contactListController.isContactFound(contact)) {
                        // Already registered
                        throw new FaceletException(new ContactAlreadyAddedException(contact));
                }
index 8e9d7ecd3397dcfc10d0780637db30e5a51a0263..bf31d213dc35457bb3976e33fe0cc2ce55de270c 100644 (file)
@@ -217,7 +217,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -243,7 +243,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
         * @param event Event being fired
         */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -271,7 +271,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
index 83f001cd92e0a07cb2ce81187663206330546f94..7b6079f1a6ce8cbdff9edbd90c849d8381ada88f 100644 (file)
@@ -126,7 +126,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
         * @param event Updated contact data event
         */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -151,7 +151,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
         * @param event Event being fired
         */
        public void afterUserConfirmedAccount (@Observes final ObservableUserConfirmedAccountEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -176,7 +176,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
         * @param event User registration event
         */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -323,11 +323,8 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
        public void initializeList () {
                // Is cache there?
                if (!this.contactCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<Contact> contacts = this.contactBean.allContacts();
-
                        // Add all
-                       for (final Contact contact : contacts) {
+                       for (final Contact contact : this.contactBean.allContacts()) {
                                // Add it to cache
                                this.contactCache.put(contact.getContactId(), contact);
                        }
@@ -355,7 +352,7 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
        }
 
        @Override
-       public boolean isSameContactFound (final Contact contact) {
+       public boolean isContactFound (final Contact contact) {
                // Default is not found
                boolean IsFound = false;
 
index 51d3346e3395c86708f6a99e00565ea34ac5f16d..ceea41151270e736eb4f3149f08bd1cf25725a23 100644 (file)
@@ -46,7 +46,7 @@ public interface FinancialsContactListWebViewController extends Serializable {
         *
         * @return Whether contact has been found
         */
-       boolean isSameContactFound (final Contact contact);
+       boolean isContactFound (final Contact contact);
 
        /**
         * Getter for all contacts
index e762c53ad55562c756b41045b66e60d1dfe58c2e..ad5d0103ad401f1699429d6d256ef030e7bee6cc 100644 (file)
@@ -236,7 +236,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -261,7 +261,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea
         * @param event Updated contact data event
         */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
index 1be5d85e542508bfe03442d36fd82efa155090c0..48f48fef9e19bac1e87df770d11b4c644440fcbe 100644 (file)
@@ -127,7 +127,7 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -152,7 +152,7 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsBean imp
         * @param event Unlinked fax contact event
         */
        public void afterAdminUnlinkedFaxContactDataEvent (@Observes final ObservableAdminUnlinkedFaxNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -180,7 +180,7 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsBean imp
         * @param event Unlinked land-line contact event
         */
        public void afterAdminUnlinkedLandLineContactDataEvent (@Observes final ObservableAdminUnlinkedLandLineNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -208,7 +208,7 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsBean imp
         * @param event Unlinked mobile contact event
         */
        public void afterAdminUnlinkedMobileContactDataEvent (@Observes final ObservableAdminUnlinkedMobileNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -236,7 +236,7 @@ public class FinancialsContactPhoneWebRequestBean extends BaseFinancialsBean imp
         * @param event Updated contact data event
         */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
index 19e0059885642a838a079c0d6509efa29dc7fbb2..f772c1fcd7cb88fafd8dae2aa52f169028aae433 100644 (file)
@@ -185,11 +185,8 @@ public class FinancialsCountryListWebViewBean extends BaseFinancialsBean impleme
        public void initializeList () {
                // Is cache there?
                if (!this.countryCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<Country> countrys = this.countryBean.allCountries();
-
                        // Add all
-                       for (final Country country : countrys) {
+                       for (final Country country : this.countryBean.allCountries()) {
                                // Add it to cache
                                this.countryCache.put(country.getCountryId(), country);
                        }
index 4fc6ef40910ec01a7c6de896be806ee60e561da9..c94a402b597a75f51ef28ad42b310c94ceff1ad7 100644 (file)
@@ -32,8 +32,8 @@ import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.contact.list.FinancialsContactListWebViewController;
 import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
 import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent;
@@ -125,7 +125,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F
         * Regular user controller
         */
        @Inject
-       private FinancialsUserWebRequestController userController;
+       private FinancialsContactListWebViewController contactListController;
 
        /**
         * Event for when a user instance was created
@@ -185,7 +185,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F
                String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
 
                // Check user first
-               if (this.userController.isContactFound(contact)) {
+               if (this.contactListController.isContactFound(contact)) {
                        // Only user
                        messageKey = "CONTACT_IS_USER"; //NOI18N
                }
index 16fd8b48c7c5660757585e0a2a5d8256e032be0b..e291a1453d71664160d37bfe62db340e23fe22de 100644 (file)
@@ -98,7 +98,7 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -129,7 +129,7 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
         * @param event Event instance
         */
        public void afterUserLogoutEvent (@Observes final ObservableUserLogoutEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -198,11 +198,7 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
                return NUMBER_FORMAT.format(amount);
        }
 
-       /**
-        * Getter for locale
-        * <p>
-        * @return Locale
-        */
+       @Override
        public Locale getLocale () {
                return this.locale;
        }
index 745760030bf6d7c5e1dd39c4c2f8022f77fc63e8..d845049f85e1afa1e71de40582ec8846924b11e5 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jfinancials.beans.localization;
 
 import java.io.Serializable;
+import java.util.Locale;
 
 /**
  * An interface for localization change beans
@@ -34,4 +35,11 @@ public interface FinancialsLocalizationSessionController extends Serializable {
         */
        String formatCurrency (final Float amount);
 
+       /**
+        * Getter for locale
+        * <p>
+        * @return Locale
+        */
+       Locale getLocale ();
+
 }
index 7d86d788842f73e64d952068e0773913719a08c7..184b68b20f40eb428c231b44abead117e20ae89e 100644 (file)
@@ -164,11 +164,8 @@ public class FinancialsMobileProviderWebRequestBean extends BaseFinancialsBean i
        public void initCache () {
                // Is cache there?
                if (!this.mobileProviderCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<MobileProvider> mobileProviders = this.mobileProviderBean.allMobileProviders();
-
                        // Add all
-                       for (final MobileProvider mobileProvider : mobileProviders) {
+                       for (final MobileProvider mobileProvider : this.mobileProviderBean.allMobileProviders()) {
                                // Add it to cache
                                this.mobileProviderCache.put(mobileProvider.getProviderId(), mobileProvider);
                        }
index 70a20c914e988581505158272ed112e1575b3c5e..35f54e2748bf7df3804af19e0326ae220cccdd8e 100644 (file)
@@ -132,7 +132,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -161,7 +161,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminDeletedFaxNumberEvent (@Observes final AdminDeletedFaxNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -190,7 +190,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminDeletedLandLineNumberEvent (@Observes final AdminDeletedLandLineNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -219,7 +219,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminDeletedMobileNumberEvent (@Observes final AdminDeletedMobileNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -371,7 +371,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -400,7 +400,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminUpdatedFaxNumberEvent (@Observes final AdminUpdatedFaxNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -429,7 +429,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminUpdatedLandLineNumberEvent (@Observes final AdminUpdatedLandLineNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -458,7 +458,7 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminUpdatedMobileNumberEvent (@Observes final AdminUpdatedMobileNumberEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -598,11 +598,8 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
        public void init () {
                // Is cache there?
                if (!this.faxNumberCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<DialableFaxNumber> faxNumbers = this.phoneBean.allFaxNumbers();
-
                        // Add all
-                       for (final DialableFaxNumber faxNumber : faxNumbers) {
+                       for (final DialableFaxNumber faxNumber : this.phoneBean.allFaxNumbers()) {
                                // Add it to cache
                                this.faxNumberCache.put(faxNumber.getPhoneId(), faxNumber);
                        }
@@ -610,11 +607,8 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
 
                // Is cache there?
                if (!this.landLineNumberCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<DialableLandLineNumber> lineNumbers = this.phoneBean.allLandLineNumbers();
-
                        // Add all
-                       for (final DialableLandLineNumber lineNumber : lineNumbers) {
+                       for (final DialableLandLineNumber lineNumber : this.phoneBean.allLandLineNumbers()) {
                                // Add it to cache
                                this.landLineNumberCache.put(lineNumber.getPhoneId(), lineNumber);
                        }
@@ -622,11 +616,8 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
 
                // Is cache there?
                if (!this.mobileNumberCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<DialableMobileNumber> mobileNumbers = this.phoneBean.allMobileNumbers();
-
                        // Add all
-                       for (final DialableMobileNumber mobileNumber : mobileNumbers) {
+                       for (final DialableMobileNumber mobileNumber : this.phoneBean.allMobileNumbers()) {
                                // Add it to cache
                                this.mobileNumberCache.put(mobileNumber.getPhoneId(), mobileNumber);
                        }
index 42e39d6192e25c89a477e09c10f84a578073eea8..bf3c9b28c2f24c47d7c8d854dacfbb8d275533b8 100644 (file)
@@ -22,7 +22,7 @@ import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
@@ -43,10 +43,10 @@ public class FinancialsUserProfileWebRequestBean extends BaseFinancialsBean impl
        private static final long serialVersionUID = 187_687_145_286_710L;
 
        /**
-        * User controller
+        * User list controller
         */
        @Inject
-       private FinancialsUserWebRequestController userController;
+       private FinancialsUserListWebViewController userListController;
 
        /**
         * Login controller
@@ -69,7 +69,7 @@ public class FinancialsUserProfileWebRequestBean extends BaseFinancialsBean impl
 
                try {
                        // Try to get it
-                       user = this.userController.lookupUserById(userId);
+                       user = this.userListController.lookupUserById(userId);
                } catch (final UserNotFoundException ex) {
                        // Throw again
                        throw new FaceletException(ex);
index 7fb24036f13d9c68f87edac38e432ee0f15f1de1..9c5cf60726f57139cfe52ce426a292c92a613d02 100644 (file)
@@ -36,6 +36,7 @@ import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsAdminContactWebRequestController;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -141,12 +142,6 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
        @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
-       /**
-        * Regular user controller
-        */
-       @Inject
-       private FinancialsUserWebRequestController userController;
-
        /**
         * Delete reason
         */
@@ -160,6 +155,12 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
        @Any
        private Event<ObservableAdminLinkedUserEvent> userLinkedEvent;
 
+       /**
+        * Regular user controller
+        */
+       @Inject
+       private FinancialsUserListWebViewController userListController;
+
        /**
         * User lock reason
         */
@@ -236,7 +237,7 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
 
                // Is the user name or email address used already?
                // @TODO Add password length check
-               if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userController.isUserNameRegistered(newUser))) {
+               if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userListController.isUserNameRegistered(newUser))) {
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(newUser));
                } else if ((this.getContact() == null) && (this.contactController.isEmailAddressRegistered(newUser.getUserContact()))) {
@@ -311,7 +312,7 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
         * @param event User registration event
         */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
index 96916310be601a415717b81470e6220c9119eb38..23bc0e50aef143416d3b1ed19ec37c7709ed9310 100644 (file)
  */
 package org.mxchange.jfinancials.beans.user;
 
-import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
-import java.util.Comparator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
-import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
@@ -35,29 +28,22 @@ import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
+import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
 import org.mxchange.jusercore.events.user.clear.username.ObservableClearUserNameEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
-import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
-import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
-import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
-import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
 import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
-import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
-import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
 import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
 import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
@@ -78,11 +64,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * List of all users
-        */
-       private final List<User> allUsers;
-
        /**
         * General contact controller
         */
@@ -96,14 +77,10 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
        private FinancialsFeaturesWebApplicationController featureController;
 
        /**
-        * List of filtered users
-        */
-       private List<User> filteredUsers;
-
-       /**
-        * Locale instance
+        * Localization controller
         */
-       private Locale locale;
+       @Inject
+       private FinancialsLocalizationSessionController localizationController;
 
        /**
         * Event being fired when user updated personal data
@@ -118,13 +95,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
        @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
        private UserSessionBeanRemote userBean;
 
-       /**
-        * A list of all user profiles
-        */
-       @Inject
-       @NamedCache (cacheName = "userCache")
-       private Cache<Long, User> userCache;
-
        /**
         * User id
         */
@@ -162,9 +132,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
        public FinancialsUserWebRequestBean () {
                // Call super constructor
                super();
-
-               // Init list
-               this.allUsers = new LinkedList<>();
        }
 
        /**
@@ -173,7 +140,7 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -188,51 +155,17 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                        throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
                }
 
-               // Update user list
-               this.updateList(event.getAddedUser());
-
-               // Clear all data
-               this.clear();
-
                // Set user id again
                this.setUserId(event.getAddedUser().getUserId());
        }
 
-       /**
-        * Event observer for deleted user accounts (by administrator)
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getDeletedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.deletedUser is null"); //NOI18N
-               } else if (event.getDeletedUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.deletedUser.userId is null"); //NOI18N
-               } else if (event.getDeletedUser().getUserId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getDeletedUser(), event.getDeletedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.removeFromList(event.getDeletedUser());
-
-               // Clear all data
-               this.clear();
-       }
-
        /**
         * Event observer for linked users with existing contact data
         * <p>
         * @param event Event being fired
         */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -247,94 +180,10 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                        throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLinkedUser(), event.getLinkedUser().getUserId())); //NOI18N
                }
 
-               // Update user list
-               this.updateList(event.getLinkedUser());
-
-               // Clear all data
-               this.clear();
-
                // Set user id again
                this.setUserId(event.getLinkedUser().getUserId());
        }
 
-       /**
-        * Event observer for locked users
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterAdminLockedUserEvent (@Observes final ObservableAdminLockedUserEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getLockedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.lockedUser is null"); //NOI18N
-               } else if (event.getLockedUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.lockedUser.userId is null"); //NOI18N
-               } else if (event.getLockedUser().getUserId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLockedUser(), event.getLockedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getLockedUser());
-       }
-
-       /**
-        * Event observer for unlocked users
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterAdminUnlockedUserEvent (@Observes final ObservableAdminUnlockedUserEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUnlockedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.unlockedUser is null"); //NOI18N
-               } else if (event.getUnlockedUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.unlockedUser.userId is null"); //NOI18N
-               } else if (event.getUnlockedUser().getUserId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUnlockedUser(), event.getUnlockedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getUnlockedUser());
-       }
-
-       /**
-        * Event observer for updated user data by administrator
-        * <p>
-        * @param event Event being updated
-        */
-       public void afterAdminUpdatedUserDataEvent (@Observes final ObservableAdminUpdatedUserDataEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUpdatedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.updatedUser is null"); //NOI18N
-               } else if (event.getUpdatedUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.updatedUser.userId is null"); //NOI18N
-               } else if (event.getUpdatedUser().getUserId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUpdatedUser(), event.getUpdatedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getUpdatedUser());
-
-               // Clear all data
-               this.clear();
-       }
-
        /**
         * Event observer for when a bean helper has successfully created a user
         * instance, means the user exists. If the user does not exist, this event
@@ -365,58 +214,13 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                this.copyUser(user);
        }
 
-       /**
-        * Observer method for events being fired when the application's locale has
-        * been changed.
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterLocaleChangeEvent (@Observes final ObservableLocaleChangeEvent event) {
-               // Is the parameter valid?
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getLocale() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.locale is null"); //NOI18N
-               }
-
-               // Set it here
-               this.setLocale(event.getLocale());
-       }
-
-       /**
-        * Event observer when user confirmed account.
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterUserConfirmedAccountEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
-               // event should not be null
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getConfirmedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.confirmedUser is null"); //NOI18N
-               } else if (event.getConfirmedUser().getUserId() == null) {
-                       // userId is null
-                       throw new NullPointerException("event.confirmedUser.userId is null"); //NOI18N
-               } else if (event.getConfirmedUser().getUserId() < 1) {
-                       // Not avalid id
-                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getConfirmedUser(), event.getConfirmedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getConfirmedUser());
-       }
-
        /**
         * Event observer for logged-in user
         * <p>
         * @param event Event instance
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -467,7 +271,7 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
         * @param event User registration event
         */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -488,73 +292,10 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Copy all data from registered->user
                this.copyUser(registeredUser);
 
-               // Clear all data
-               this.clear();
-
-               // Update user list
-               this.updateList(registeredUser);
-
                // Set user id again
                this.setUserId(registeredUser.getUserId());
        }
 
-       /**
-        * Method being call after user's password has been updated (and history
-        * entry has been created).
-        * <p>
-        * @param event Event being observed
-        */
-       public void afterUserUpdatedPasswordEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
-               // Check parameter
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getPasswordHistory() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.passwordHistory is null"); //NOI18N
-               } else if (event.getPasswordHistory().getUserPasswordHistoryId() == null) {
-                       // ... and again
-                       throw new NullPointerException("event.passwordHistory.userPasswordHistoryId is null"); //NOI18N
-               } else if (event.getPasswordHistory().getUserPasswordHistoryId() < 1) {
-                       // Invalid value
-                       throw new IllegalArgumentException(MessageFormat.format("event.passwordHistory.userPasswordHistoryId={0} is in valid", event.getPasswordHistory().getUserPasswordHistoryId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getPasswordHistory().getUserPasswordHistoryUser());
-       }
-
-       /**
-        * Listens to fired event when user updated personal data
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterUserUpdatedPersonalDataEvent (@Observes final ObservableUpdatedUserPersonalDataEvent event) {
-               // Check parameter
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getUpdatedUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.updatedUser is null"); //NOI18N
-               } else if (event.getUpdatedUser().getUserId() == null) {
-                       // ... and again
-                       throw new NullPointerException("event.updatedUser.userId is null"); //NOI18N
-               } else if (event.getUpdatedUser().getUserId() < 1) {
-                       // Invalid value
-                       throw new IllegalArgumentException(MessageFormat.format("event.updatedUser.userId={0} is in valid", event.getUpdatedUser().getUserId())); //NOI18N
-               }
-
-               // Update user list
-               this.updateList(event.getUpdatedUser());
-       }
-
-       @Override
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<User> allUsers () {
-               return this.allUsers;
-       }
-
        /**
         * Event observer for when a user name should be cleared
         * <p>
@@ -592,9 +333,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Required personal data must be set
                assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
 
-               // Create new user instance
-               final User user = new LoginUser();
-
                // Is user name required?
                if (!this.isUserNameRequired()) {
                        // Generate pseudo-random user name
@@ -613,10 +351,13 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                        this.setUserPasswordRepeat(randomPassword);
                }
 
+               // Create new user instance
+               final User user = new LoginUser();
+
                // Set user name profile mode and locale
                user.setUserName(this.getUserName());
                user.setUserProfileMode(this.getUserProfileMode());
-               user.setUserLocale(this.getLocale());
+               user.setUserLocale(this.localizationController.getLocale());
 
                // Is multiple registration page
                if ((createContactData) || (!this.featureController.isFeatureEnabled("user_register_multiple_page"))) { //NOI18N
@@ -696,47 +437,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                return "user_contact_data_saved"; //NOI18N
        }
 
-       @Override
-       public User findUserById (final Long userId) throws UserNotFoundException {
-               // Validate parameter
-               if (null == userId) {
-                       // Throw NPE
-                       throw new NullPointerException("userId is null"); //NOI18N
-               } else if (userId < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
-               } else if (!this.userCache.containsKey(userId)) {
-                       // Not found
-                       throw new UserNotFoundException(userId);
-               }
-
-               // Get it from cache
-               final User user = this.userCache.get(userId);
-
-               // Return it
-               return user;
-       }
-
-       /**
-        * Getter for filtered users list
-        * <p>
-        * @return Filtered users list
-        */
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<User> getFilteredUsers () {
-               return this.filteredUsers;
-       }
-
-       /**
-        * Setter for filtered users list
-        * <p>
-        * @param filteredUsers Filtered users list
-        */
-       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredUsers (final List<User> filteredUsers) {
-               this.filteredUsers = filteredUsers;
-       }
-
        /**
         * Getter for user id
         * <p>
@@ -831,90 +531,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                                ((this.getUserPasswordRepeat() == null) || (this.getUserPasswordRepeat().isEmpty())));
        }
 
-       @Override
-       public boolean ifUserIdExists (final Long userId) {
-               // Validate parameter
-               if (null == userId) {
-                       // Throw NPE
-                       throw new NullPointerException("userId is null"); //NOI18N
-               } else if (userId < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
-               }
-
-               // Check if key is there
-               boolean isFound = this.userCache.containsKey(userId);
-
-               // Return flag
-               return isFound;
-       }
-
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // Is cache there?
-               if (!this.userCache.iterator().hasNext()) {
-                       // Get whole list from EJB
-                       final List<User> users = this.userBean.allUsers();
-
-                       // Add all
-                       for (final User user : users) {
-                               // Add it to cache
-                               this.userCache.put(user.getUserId(), user);
-                       }
-               }
-
-               // Is cache filled and list is empty
-               if ((this.userCache.iterator().hasNext()) && (this.allUsers.isEmpty())) {
-                       // Build up list
-                       for (final Cache.Entry<Long, User> currentEntry : this.userCache) {
-                               // Add to list
-                               this.allUsers.add(currentEntry.getValue());
-                       }
-
-                       // Sort list
-                       this.allUsers.sort(new Comparator<User>() {
-                               @Override
-                               public int compare (final User user1, final User user2) {
-                                       return user1.getUserId() > user2.getUserId() ? 1 : user1.getUserId() < user2.getUserId() ? -1 : 0;
-                               }
-                       });
-               }
-       }
-
-       @Override
-       public boolean isContactFound (final Contact contact) {
-               // The contact must be valid
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Throw again ...
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
-               }
-
-               // Default is not found
-               boolean isFound = false;
-
-               // Loop through all entries
-               for (final User currentUser : this.allUsers()) {
-                       // Compare both objects
-                       if (Objects.equals(contact, currentUser.getUserContact())) {
-                               // Found it
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return status
-               return isFound;
-       }
-
        @Override
        public boolean isRequiredChangePersonalDataSet () {
                return ((this.getUserProfileMode() != null) &&
@@ -947,25 +563,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                return ((this.getUserId() == null) || (this.getUserId() == 0));
        }
 
-       @Override
-       public boolean isUserNameRegistered (final User user) {
-               // Default is not found
-               boolean isFound = false;
-
-               // Determine it
-               for (final User currentUser : this.allUsers()) {
-                       // Is same name found?
-                       if (Objects.equals(user.getUserName(), currentUser.getUserName())) {
-                               // Yes, then set flag and abort loop
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return flag
-               return isFound;
-       }
-
        @Override
        public boolean isUserNameRequired () {
                // Get context parameter
@@ -978,98 +575,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                return isRequired;
        }
 
-       @Override
-       public User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException {
-               // Parameter must be valid
-               if (null == emailAddress) {
-                       // Throw NPE
-                       throw new NullPointerException("emailAddress is null"); //NOI18N
-               } else if (emailAddress.isEmpty()) {
-                       // Not valid
-                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
-               }
-
-               // Init variable
-               User user = null;
-
-               // Try to lookup it in visible user list
-               for (final Cache.Entry<Long, User> currentUser : this.userCache) {
-                       // Contact should be set
-                       if (currentUser.getValue().getUserContact() == null) {
-                               // Contact is null
-                               throw new NullPointerException(MessageFormat.format("currentUser.userContact is null for user id {0}", currentUser.getKey())); //NOI18N
-                       } else if (currentUser.getValue().getUserContact().getContactEmailAddress() == null) {
-                               // Email address should be set
-                               throw new NullPointerException(MessageFormat.format("currentUser.userContact.contactEmailAddress is null for user id {0}", currentUser.getKey())); //NOI18N
-                       }
-
-                       // Is the email address found?
-                       if (Objects.equals(currentUser.getValue().getUserContact().getContactEmailAddress(), emailAddress)) {
-                               // Copy to other variable
-                               user = currentUser.getValue();
-                               break;
-                       }
-               }
-
-               // Is it still null?
-               if (null == user) {
-                       // Not visible for the current user
-                       throw new UserEmailAddressNotFoundException(emailAddress);
-               }
-
-               // Return it
-               return user;
-       }
-
-       @Override
-       public User lookupUserById (final Long userId) throws UserNotFoundException {
-               // Parameter must be valid
-               if (null == userId) {
-                       // Throw NPE
-                       throw new NullPointerException("userId is null"); //NOI18N
-               } else if (userId < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("userId={0} is not valid.", userId)); //NOI18N
-               }
-
-               // Init variable
-               User user = null;
-
-               // Try to lookup it in visible user list
-               for (final Cache.Entry<Long, User> currentUser : this.userCache) {
-                       // Is the user id found?
-                       if (Objects.equals(currentUser.getKey(), userId)) {
-                               // Copy to other variable
-                               user = currentUser.getValue();
-                               break;
-                       }
-               }
-
-               // Is it still null?
-               if (null == user) {
-                       // Not visible for the current user
-                       throw new UserNotFoundException(userId);
-               }
-
-               // Return it
-               return user;
-       }
-
-       /**
-        * Clears this bean
-        */
-       private void clear () {
-               // Clear all data
-               // - personal data
-               this.setUserId(null);
-               this.setUserProfileMode(null);
-
-               // - other data
-               this.clearUserName();
-               this.clearUserPasswords();
-               this.setLocale(null);
-       }
-
        /**
         * Clears user name
         */
@@ -1108,77 +613,4 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                this.setUserProfileMode(user.getUserProfileMode());
        }
 
-       /**
-        * Getter for locale instance
-        * <p>
-        * @return Locale instance
-        */
-       private Locale getLocale () {
-               return this.locale;
-       }
-
-       /**
-        * Setter for locale instance
-        * <p>
-        * @param locale Locale instance
-        */
-       private void setLocale (final Locale locale) {
-               this.locale = locale;
-       }
-
-       /**
-        * Removes user from all lists
-        * <p>
-        * @param user User to remove
-        */
-       private void removeFromList (final User user) {
-               // The user should be valid
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // ... again NPE
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is invalid", user.getUserId())); //NOI18N
-               }
-
-               // Remove it from lists
-               this.allUsers().remove(user);
-               this.userCache.remove(user.getUserId());
-       }
-
-       /**
-        * Updates list with given user instance
-        * <p>
-        * @param user User instance
-        */
-       private void updateList (final User user) {
-               // The user should be valid
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // ... again NPE
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is invalid", user.getUserId())); //NOI18N
-               } else if (user.getUserContact() == null) {
-                       // Throw again ...
-                       throw new NullPointerException("user.userContact is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() == null) {
-                       // Throw again ...
-                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() < 1) {
-                       // Throw again ...
-                       throw new NullPointerException(MessageFormat.format("user.userContact.contactId={0} is invalid.", user.getUserContact().getContactId())); //NOI18N
-               }
-
-               // Add/update user
-               this.userCache.put(user.getUserId(), user);
-               this.allUsers.add(user);
-       }
-
 }
index edc0d531c07626b7d60f22227496691cb5f8bd04..8faebffb055ed79c18e254e92a7c6788bd561196 100644 (file)
 package org.mxchange.jfinancials.beans.user;
 
 import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -38,27 +34,6 @@ public interface FinancialsUserWebRequestController extends Serializable {
        @Deprecated
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
-       /**
-        * Returns a user instance by given primary key. If not found, a proper
-        * exception is thrown.
-        * <p>
-        * @param userId User id
-        * <p>
-        * @return User instance
-        * <p>
-        * @throws UserNotFoundException If the user is not found
-        */
-       User findUserById (final Long userId) throws UserNotFoundException;
-
-       /**
-        * Checks if given user id exists
-        * <p>
-        * @param userId User id to check
-        * <p>
-        * @return Whether the user id exists
-        */
-       boolean ifUserIdExists (final Long userId);
-
        /**
         * Getter for clear-text user password
         * <p>
@@ -76,56 +51,6 @@ public interface FinancialsUserWebRequestController extends Serializable {
         */
        boolean ifBothPasswordsEmptyAllowed ();
 
-       /**
-        * All users
-        * <p>
-        * @return A list of all public user profiles
-        */
-       List<User> allUsers ();
-
-       /**
-        * Checks whether the given contact is a user
-        * <p>
-        * @param contact Contact to check
-        * <p>
-        * @return Whether the contact is a user
-        */
-       boolean isContactFound (final Contact contact);
-
-       /**
-        * Checks whether given user instance name is used
-        * <p>
-        * @param user User instance name to check
-        * <p>
-        * @return Whether it is already used
-        */
-       boolean isUserNameRegistered (final User user);
-
-       /**
-        * Tries to lookup user by given id number. If the user is not found or the
-        * account status is not CONFIRMED proper exceptions are thrown.
-        * <p>
-        * @param userId User id
-        * <p>
-        * @return User instance
-        * <p>
-        * @throws UserNotFoundException If the user is not found
-        */
-       User lookupUserById (final Long userId) throws UserNotFoundException;
-
-       /**
-        * Tries to lookup user by given email address. If the user is not found a
-        * proper exceptions is thrown.
-        * <p>
-        * @param emailAddress Email address
-        * <p>
-        * @return User instance
-        * <p>
-        * @throws UserEmailAddressNotFoundException If the user's email address is
-        * not found
-        */
-       User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;
-
        /**
         * Creates an instance from all properties
         * <p>
index 47f6e8eaafeac40443205529921830e02592e031..7bcbdcf871cb5ad5ae133cfce1364c16dc6b0ceb 100644 (file)
@@ -97,7 +97,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -122,7 +122,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -147,7 +147,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -172,7 +172,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminLockedUserEvent (@Observes final ObservableAdminLockedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -197,7 +197,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterAdminUnlockedUserEvent (@Observes final ObservableAdminUnlockedUserEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -222,7 +222,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being updated
         */
        public void afterAdminUpdatedUserDataEvent (@Observes final ObservableAdminUpdatedUserDataEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -274,7 +274,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterUserConfirmedAccountEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -299,7 +299,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -324,7 +324,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event instance
         */
        public void afterUserLogoutEvent (@Observes final ObservableUserLogoutEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -349,7 +349,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -374,7 +374,7 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         * @param event Event being fired
         */
        public void afterUserResendConfirmationLinkEvent (@Observes final ObservableUserResendLinkAccountEvent event) {
-               // event should not be null
+               // Event and contained entity instance should not be null
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
@@ -544,11 +544,8 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp
         */
        @PostConstruct
        public void init () {
-               // Get whole list from EJB
-               final List<LogableUserActivity> userActivities = this.userActivityBean.fetchAllUserActivityLog();
-
                // Put all in map, per-user
-               for (final LogableUserActivity userActivity : userActivities) {
+               for (final LogableUserActivity userActivity : this.userActivityBean.fetchAllUserActivityLog()) {
                        // Is the list there?
                        if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) {
                                // Init list
index fdbd7ddb23593100645bb46f42bbab7d3facd449..ead0a81883b3b0550c77e5f1694ef5f3d13f18e3 100644 (file)
@@ -29,7 +29,7 @@ import org.mxchange.jcoreee.events.helper.clear.HelperCleanupEvent;
 import org.mxchange.jcoreee.events.helper.clear.ObservableHelperCleanupEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
 import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
@@ -80,17 +80,17 @@ public class FinancialsConfirmationLinkWebRequestBean extends BaseFinancialsBean
        private Event<ObservableUserConfirmedAccountEvent> userConfirmedEvent;
 
        /**
-        * User controller
+        * Event for when a user instance was created
         */
+       @Any
        @Inject
-       private FinancialsUserWebRequestController userController;
+       private Event<ObservableCreatedUserEvent> userCreatedEvent;
 
        /**
-        * Event for when a user instance was created
+        * User controller
         */
-       @Any
        @Inject
-       private Event<ObservableCreatedUserEvent> userCreatedEvent;
+       private FinancialsUserListWebViewController userListController;
 
        /**
         * Default constructor
@@ -125,7 +125,7 @@ public class FinancialsConfirmationLinkWebRequestBean extends BaseFinancialsBean
                User user = null;
 
                // Then loop through all
-               for (final User currentUser : this.userController.allUsers()) {
+               for (final User currentUser : this.userListController.getAllUsers()) {
                        // Same confirmation key?
                        if (Objects.equals(this.getConfirmationKey(), currentUser.getUserConfirmKey())) {
                                // Found it, then set it and abort loop
diff --git a/src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewController.java b/src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewController.java
new file mode 100644 (file)
index 0000000..aad39e3
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2016 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.beans.user.list;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An interface for user beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsUserListWebViewController extends Serializable {
+
+       /**
+        * Returns a user instance by given primary key. If not found, a proper
+        * exception is thrown.
+        * <p>
+        * @param userId User id
+        * <p>
+        * @return User instance
+        * <p>
+        * @throws UserNotFoundException If the user is not found
+        */
+       User findUserById (final Long userId) throws UserNotFoundException;
+
+       /**
+        * All users
+        * <p>
+        * @return A list of all public user profiles
+        */
+       List<User> getAllUsers ();
+
+       /**
+        * Checks if given user id exists
+        * <p>
+        * @param userId User id to check
+        * <p>
+        * @return Whether the user id exists
+        */
+       boolean ifUserIdExists (final Long userId);
+
+       /**
+        * Checks whether given user instance name is used
+        * <p>
+        * @param user User instance name to check
+        * <p>
+        * @return Whether it is already used
+        */
+       boolean isUserNameRegistered (final User user);
+
+       /**
+        * Tries to lookup user by given id number. If the user is not found or the
+        * account status is not CONFIRMED proper exceptions are thrown.
+        * <p>
+        * @param userId User id
+        * <p>
+        * @return User instance
+        * <p>
+        * @throws UserNotFoundException If the user is not found
+        */
+       User lookupUserById (final Long userId) throws UserNotFoundException;
+
+       /**
+        * Tries to lookup user by given email address. If the user is not found a
+        * proper exceptions is thrown.
+        * <p>
+        * @param emailAddress Email address
+        * <p>
+        * @return User instance
+        * <p>
+        * @throws UserEmailAddressNotFoundException If the user's email address is
+        * not found
+        */
+       User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;
+
+}
diff --git a/src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewtBean.java b/src/java/org/mxchange/jfinancials/beans/user/list/FinancialsUserListWebViewtBean.java
new file mode 100644 (file)
index 0000000..0f7db16
--- /dev/null
@@ -0,0 +1,588 @@
+/*
+ * Copyright (C) 2016 - 2020 Free Software Foundation
+ *
+ * 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.jfinancials.beans.user.list;
+
+import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Objects;
+import javax.annotation.PostConstruct;
+import javax.cache.Cache;
+import javax.ejb.EJB;
+import javax.enterprise.event.Observes;
+import javax.faces.view.ViewScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
+import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
+import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
+import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
+import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
+import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
+import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
+import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
+
+/**
+ * A user list bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("userListController")
+@ViewScoped
+public class FinancialsUserListWebViewtBean extends BaseFinancialsBean implements FinancialsUserListWebViewController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 542_145_347_918L;
+
+       /**
+        * List of all users
+        */
+       private final List<User> allUsers;
+
+       /**
+        * List of filtered users
+        */
+       private List<User> filteredUsers;
+
+       /**
+        * Selected user instance
+        */
+       private User selectedUser;
+
+       /**
+        * Remote user bean
+        */
+       @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
+       private UserSessionBeanRemote userBean;
+
+       /**
+        * A list of all user profiles
+        */
+       @Inject
+       @NamedCache (cacheName = "userCache")
+       private transient Cache<Long, User> userCache;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsUserListWebViewtBean () {
+               // Call super constructor
+               super();
+
+               // Init list
+               this.allUsers = new LinkedList<>();
+       }
+
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
+               // Event and contained entity instance 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
+               }
+
+               // Update user list
+               this.updateList(event.getAddedUser());
+       }
+
+       /**
+        * Event observer for deleted user accounts (by administrator)
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getDeletedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.deletedUser is null"); //NOI18N
+               } else if (event.getDeletedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.deletedUser.userId is null"); //NOI18N
+               } else if (event.getDeletedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getDeletedUser(), event.getDeletedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.removeFromList(event.getDeletedUser());
+       }
+
+       /**
+        * Event observer for linked users with existing contact data
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getLinkedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.linkedUser is null"); //NOI18N
+               } else if (event.getLinkedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.linkedUser.userId is null"); //NOI18N
+               } else if (event.getLinkedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLinkedUser(), event.getLinkedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getLinkedUser());
+       }
+
+       /**
+        * Event observer for locked users
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminLockedUserEvent (@Observes final ObservableAdminLockedUserEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getLockedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.lockedUser is null"); //NOI18N
+               } else if (event.getLockedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.lockedUser.userId is null"); //NOI18N
+               } else if (event.getLockedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLockedUser(), event.getLockedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getLockedUser());
+       }
+
+       /**
+        * Event observer for unlocked users
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminUnlockedUserEvent (@Observes final ObservableAdminUnlockedUserEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUnlockedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.unlockedUser is null"); //NOI18N
+               } else if (event.getUnlockedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.unlockedUser.userId is null"); //NOI18N
+               } else if (event.getUnlockedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUnlockedUser(), event.getUnlockedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getUnlockedUser());
+       }
+
+       /**
+        * Event observer for updated user data by administrator
+        * <p>
+        * @param event Event being updated
+        */
+       public void afterAdminUpdatedUserDataEvent (@Observes final ObservableAdminUpdatedUserDataEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUpdatedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.updatedUser is null"); //NOI18N
+               } else if (event.getUpdatedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.updatedUser.userId is null"); //NOI18N
+               } else if (event.getUpdatedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUpdatedUser(), event.getUpdatedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getUpdatedUser());
+       }
+
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterUserConfirmedAccountEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getConfirmedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.confirmedUser is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.confirmedUser.userId is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getConfirmedUser(), event.getConfirmedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getConfirmedUser());
+       }
+
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event User registration event
+        */
+       public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getRegisteredUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.registeredUser is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.registeredUser.userId is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getRegisteredUser());
+       }
+
+       /**
+        * Method being call after user's password has been updated (and history
+        * entry has been created).
+        * <p>
+        * @param event Event being observed
+        */
+       public void afterUserUpdatedPasswordEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
+               // Check parameter
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getPasswordHistory() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.passwordHistory is null"); //NOI18N
+               } else if (event.getPasswordHistory().getUserPasswordHistoryId() == null) {
+                       // ... and again
+                       throw new NullPointerException("event.passwordHistory.userPasswordHistoryId is null"); //NOI18N
+               } else if (event.getPasswordHistory().getUserPasswordHistoryId() < 1) {
+                       // Invalid value
+                       throw new IllegalArgumentException(MessageFormat.format("event.passwordHistory.userPasswordHistoryId={0} is in valid", event.getPasswordHistory().getUserPasswordHistoryId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getPasswordHistory().getUserPasswordHistoryUser());
+       }
+
+       /**
+        * Listens to fired event when user updated personal data
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterUserUpdatedPersonalDataEvent (@Observes final ObservableUpdatedUserPersonalDataEvent event) {
+               // Check parameter
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUpdatedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.updatedUser is null"); //NOI18N
+               } else if (event.getUpdatedUser().getUserId() == null) {
+                       // ... and again
+                       throw new NullPointerException("event.updatedUser.userId is null"); //NOI18N
+               } else if (event.getUpdatedUser().getUserId() < 1) {
+                       // Invalid value
+                       throw new IllegalArgumentException(MessageFormat.format("event.updatedUser.userId={0} is in valid", event.getUpdatedUser().getUserId())); //NOI18N
+               }
+
+               // Update user list
+               this.updateList(event.getUpdatedUser());
+       }
+
+       @Override
+       public User findUserById (final Long userId) throws UserNotFoundException {
+               // Validate parameter
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
+               } else if (!this.userCache.containsKey(userId)) {
+                       // Not found
+                       throw new UserNotFoundException(userId);
+               }
+
+               // Get it from cache
+               final User user = this.userCache.get(userId);
+
+               // Return it
+               return user;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<User> getAllUsers () {
+               return this.allUsers;
+       }
+
+       /**
+        * Getter for filtered users list
+        * <p>
+        * @return Filtered users list
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<User> getFilteredUsers () {
+               return this.filteredUsers;
+       }
+
+       /**
+        * Setter for filtered users list
+        * <p>
+        * @param filteredUsers Filtered users list
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setFilteredUsers (final List<User> filteredUsers) {
+               this.filteredUsers = filteredUsers;
+       }
+
+       /**
+        * Getter for selected user instance
+        * <p>
+        * @return Selected user instance
+        */
+       public User getSelectedUser () {
+               return this.selectedUser;
+       }
+
+       /**
+        * Setter for selected user instance
+        * <p>
+        * @param selectedUser Selected user instance
+        */
+       public void setSelectedUser (final User selectedUser) {
+               this.selectedUser = selectedUser;
+       }
+
+       @Override
+       public boolean ifUserIdExists (final Long userId) {
+               // Validate parameter
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
+               }
+
+               // Check if key is there
+               boolean isFound = this.userCache.containsKey(userId);
+
+               // Return flag
+               return isFound;
+       }
+
+       /**
+        * Post-initialization of this class
+        */
+       @PostConstruct
+       public void initializeList () {
+               // Is cache there?
+               if (!this.userCache.iterator().hasNext()) {
+                       // Add all
+                       for (final User user : this.userBean.allUsers()) {
+                               // Add it to cache
+                               this.userCache.put(user.getUserId(), user);
+                       }
+               }
+
+               // Is cache filled and list is empty
+               if ((this.userCache.iterator().hasNext()) && (this.getAllUsers().isEmpty())) {
+                       // Build up list
+                       for (final Cache.Entry<Long, User> currentEntry : this.userCache) {
+                               // Add to list
+                               this.getAllUsers().add(currentEntry.getValue());
+                       }
+
+                       // Sort list
+                       this.getAllUsers().sort(new Comparator<User>() {
+                               @Override
+                               public int compare (final User user1, final User user2) {
+                                       return user1.getUserId() > user2.getUserId() ? 1 : user1.getUserId() < user2.getUserId() ? -1 : 0;
+                               }
+                       });
+
+                       // Set full list
+                       this.setFilteredUsers(this.getAllUsers());
+               }
+       }
+
+       @Override
+       public boolean isUserNameRegistered (final User user) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Determine it
+               for (final User currentUser : this.getAllUsers()) {
+                       // Is same name found?
+                       if (Objects.equals(user.getUserName(), currentUser.getUserName())) {
+                               // Yes, then set flag and abort loop
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+       @Override
+       public User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException {
+               // Parameter must be valid
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Not valid
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
+               // Init variable
+               User user = null;
+
+               // Try to lookup it in visible user list
+               for (final Cache.Entry<Long, User> currentUser : this.userCache) {
+                       // Contact should be set
+                       if (currentUser.getValue().getUserContact() == null) {
+                               // Contact is null
+                               throw new NullPointerException(MessageFormat.format("currentUser.userContact is null for user id {0}", currentUser.getKey())); //NOI18N
+                       } else if (currentUser.getValue().getUserContact().getContactEmailAddress() == null) {
+                               // Email address should be set
+                               throw new NullPointerException(MessageFormat.format("currentUser.userContact.contactEmailAddress is null for user id {0}", currentUser.getKey())); //NOI18N
+                       }
+
+                       // Is the email address found?
+                       if (Objects.equals(currentUser.getValue().getUserContact().getContactEmailAddress(), emailAddress)) {
+                               // Copy to other variable
+                               user = currentUser.getValue();
+                               break;
+                       }
+               }
+
+               // Is it still null?
+               if (null == user) {
+                       // Not visible for the current user
+                       throw new UserEmailAddressNotFoundException(emailAddress);
+               }
+
+               // Return it
+               return user;
+       }
+
+       @Override
+       public User lookupUserById (final Long userId) throws UserNotFoundException {
+               // Parameter must be valid
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("userId={0} is not valid.", userId)); //NOI18N
+               }
+
+               // Init variable
+               User user = null;
+
+               // Try to lookup it in visible user list
+               for (final Cache.Entry<Long, User> currentUser : this.userCache) {
+                       // Is the user id found?
+                       if (Objects.equals(currentUser.getKey(), userId)) {
+                               // Copy to other variable
+                               user = currentUser.getValue();
+                               break;
+                       }
+               }
+
+               // Is it still null?
+               if (null == user) {
+                       // Not visible for the current user
+                       throw new UserNotFoundException(userId);
+               }
+
+               // Return it
+               return user;
+       }
+
+       /**
+        * Removes user from all lists
+        * <p>
+        * @param user User to remove
+        */
+       private void removeFromList (final User user) {
+               // Remove it from lists
+               this.getAllUsers().remove(user);
+               this.userCache.remove(user.getUserId());
+       }
+
+       /**
+        * Updates list with given user instance
+        * <p>
+        * @param user User instance
+        */
+       private void updateList (final User user) {
+               // Add/update user
+               this.userCache.put(user.getUserId(), user);
+               this.getAllUsers().add(user);
+       }
+
+}
index 9499f3434599319414fe0110338550682179b3a1..b949dd3ced530ac5f2f3bbef17a7ac32cb92d023 100644 (file)
@@ -31,6 +31,7 @@ import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
 import org.mxchange.jusercore.events.user.clear.password.ClearUserPasswordEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
 import org.mxchange.jusercore.events.user.clear.username.ClearUserNameEvent;
@@ -101,6 +102,12 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp
        @Inject
        private FinancialsUserWebRequestController userController;
 
+       /**
+        * User list controller
+        */
+       @Inject
+       private FinancialsUserListWebViewController userListController;
+
        /**
         * An event being fired when a user password was changed
         */
@@ -149,7 +156,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp
                } else if (!this.userController.isRequiredPersonalDataSet()) {
                        // Not all required fields are set
                        throw new FaceletException("Not all required fields are set."); //NOI18N
-               } else if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userController.isUserNameRegistered(user))) { //NOI18N
+               } else if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userListController.isUserNameRegistered(user))) { //NOI18N
                        // Is multi-page enabled?
                        if (this.featureController.isFeatureEnabled("user_register_multiple_page")) { //NOI18N
                                // User name is already used, should not happen here
@@ -264,7 +271,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp
                if (null == user) {
                        // user must be set
                        throw new NullPointerException("user is null after createUserInstance() was called"); //NOI18N
-               } else if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userController.isUserNameRegistered(user))) { //NOI18N
+               } else if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userListController.isUserNameRegistered(user))) { //NOI18N
                        // User name is already used, so clear it
                        this.clearUserNameEvent.fire(new ClearUserNameEvent());
 
index 97471dd34d8c26ed7467424fed02541100e679c0..5822c83e4f261692e2658ce6ca8648bb7f977159 100644 (file)
  */
 package org.mxchange.jfinancials.beans.user.resendlink;
 
-import java.util.Locale;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
-import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
 import javax.faces.application.FacesMessage;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
@@ -59,9 +57,10 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
        private String emailAddress;
 
        /**
-        * Locale instance
+        * Localization controller
         */
-       private Locale locale;
+       @Inject
+       private FinancialsLocalizationSessionController localizationController;
 
        /**
         * EJB for resending confirmation link
@@ -73,7 +72,7 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
         * Regular user controller
         */
        @Inject
-       private FinancialsUserWebRequestController userController;
+       private FinancialsUserListWebViewController userListController;
 
        /**
         * Event being fired after confirmation link is being sent
@@ -90,26 +89,6 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
                super();
        }
 
-       /**
-        * Observer method for events being fired when the application's locale has
-        * been changed.
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterLocaleChangeEvent (@Observes final ObservableLocaleChangeEvent event) {
-               // Is the parameter valid?
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null");
-               } else if (event.getLocale() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.locale is null");
-               }
-
-               // Set it here
-               this.setLocale(event.getLocale());
-       }
-
        /**
         * Resends (new) confirmation link to given email address, if found.
         * Otherwise an exception is thrown. On success a redirect takes place.
@@ -128,7 +107,7 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
 
                try {
                        // Is the email address really not used?
-                       user = this.userController.lookupUserByEmailAddress(this.getEmailAddress());
+                       user = this.userListController.lookupUserByEmailAddress(this.getEmailAddress());
                } catch (final UserEmailAddressNotFoundException ex) {
                        // Always clear bean
                        this.clear();
@@ -166,7 +145,7 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
                        final String baseUrl = FacesUtils.generateBaseUrl();
 
                        // Call EJB and return redirect target
-                       managedUser = this.resendLinkBean.resendConfirmationLink(user, this.getLocale(), baseUrl);
+                       managedUser = this.resendLinkBean.resendConfirmationLink(user, this.localizationController.getLocale(), baseUrl);
                } catch (final UserNotFoundException ex) {
                        // User not found
                        this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_NOT_FOUND", FacesMessage.SEVERITY_ERROR); //NOI18N
@@ -213,22 +192,4 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
                this.setEmailAddress(null);
        }
 
-       /**
-        * Getter for locale instance
-        * <p>
-        * @return Locale instance
-        */
-       private Locale getLocale () {
-               return this.locale;
-       }
-
-       /**
-        * Setter for locale instance
-        * <p>
-        * @param locale Locale instance
-        */
-       private void setLocale (final Locale locale) {
-               this.locale = locale;
-       }
-
 }
index f507461223aed253a047d29f0fc09314596b800c..18ecbb94648df169c4b5b3e1479584692ce64d68 100644 (file)
@@ -22,8 +22,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestBean;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewtBean;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 
@@ -38,14 +38,14 @@ public class FinancialsUserConverter implements Converter<User> {
        /**
         * User backing bean
         */
-       private static FinancialsUserWebRequestController USER_CONTROLLER;
+       private static FinancialsUserListWebViewController USER_LIST_CONTROLLER;
 
        @Override
        public User getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (null == USER_CONTROLLER) {
+               if (null == USER_LIST_CONTROLLER) {
                        // Get bean from CDI directly
-                       USER_CONTROLLER = CDI.current().select(FinancialsUserWebRequestBean.class).get();
+                       USER_LIST_CONTROLLER = CDI.current().select(FinancialsUserListWebViewtBean.class).get();
                }
 
                // Is the value null or empty?
@@ -65,7 +65,7 @@ public class FinancialsUserConverter implements Converter<User> {
                        final Long userId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       user = USER_CONTROLLER.findUserById(userId);
+                       user = USER_LIST_CONTROLLER.findUserById(userId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 3a50709cf78345da07008fa9dafa524f8a68a7a3..0279469e64bccbafc9aa9d60be0f383f232850a5 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
 import org.mxchange.jcoreee.validator.number.BaseNumberValidator;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestBean;
-import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewController;
+import org.mxchange.jfinancials.beans.user.list.FinancialsUserListWebViewtBean;
 
 /**
  * A validator for user ids
@@ -38,7 +38,7 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
        /**
         * User backing bean
         */
-       private static FinancialsUserWebRequestController USER_CONTROLLER;
+       private static FinancialsUserListWebViewController USER_LIST_CONTROLLER;
 
        /**
         * Serial number
@@ -54,16 +54,16 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
                super.preValidate(context, component, value, requiredFields, false);
 
                // Is the instance there?
-               if (null == USER_CONTROLLER) {
+               if (null == USER_LIST_CONTROLLER) {
                        // Get bean from CDI directly
-                       USER_CONTROLLER = CDI.current().select(FinancialsUserWebRequestBean.class).get();
+                       USER_LIST_CONTROLLER = CDI.current().select(FinancialsUserListWebViewtBean.class).get();
                }
 
                // Cast value
                final Long userId = (Long) value;
 
                // Define variable
-               final Boolean ifUserExists = USER_CONTROLLER.ifUserIdExists(userId);
+               final Boolean ifUserExists = USER_LIST_CONTROLLER.ifUserIdExists(userId);
 
                // Is the user id valid?
                if (!ifUserExists) {
index 86d78d02f51e322254924eccc829f8386d685b64..9b5722b8ac60296119c71d03a69e6a47b4bfa27e 100644 (file)
@@ -330,8 +330,10 @@ ENTRY_UPDATED_HEADER=Aktualisiert:
 ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Editieren oder l\u00f6schen des Handyanbieters
 ADMIN_USER_DATA_ENTER_PASSWORD=Passwort eingeben:
 ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT=Passwort wiederholen:
-ADMIN_LIST_USER_ID=Benutzer-Id:
-ADMIN_LIST_USER_NAME=Benutzername:
+DATA_USER_ID=Benutzer-Id:
+DATA_USER_NAME=Benutzername:
+#@TODO Please fix German umlauts!
+CHANGE=Aendern?
 ADMIN_LIST_USER_PERSONAL_TITLE=Anrede:
 ADMIN_LIST_USER_FIRST_NAME=Vorname:
 ADMIN_LIST_USER_FAMILY_NAME=Nachname:
@@ -351,14 +353,12 @@ ERROR_PARAMETER_USER_ID_NOT_SET=Fehler: Benutzer-Id nicht gesetzt (Parameter: us
 ERROR_USER_NOT_FOUND=Fehler: Benutzereintrag nicht gefunden.
 ADMIN_TABLE_SUMMARY_SHOW_USER_DATA=Diese Tabelle zeigt ein Benutzerprofil f\u00fcr administrative Zwecke an.
 ADMIN_SHOW_USER_HEADER=Benutzer {0} (Nummer {1}):
-ADMIN_USER_ID=Benutzer-Id:
-ADMIN_USER_NAME=Benutzername:
 ADMIN_USER_CREATED=Wann Benutzer erstellt:
 ADMIN_USER_UPDATED=Wann Benutzerdaten ge\u00e4ndert:
 ADMIN_USER_ACCOUNT_STATUS=Account-Status:
 ADMIN_USER_PROFILE_MODE=Profilmodus:
-ADMIN_USER_LAST_LOCKED=Zuletzt gesperrt:
-ADMIN_USER_LAST_LOCKED_REASON=Letzter Sperrgrund:
+DATA_USER_LAST_LOCKED=Zuletzt gesperrt:
+DATA_USER_LAST_LOCKED_REASON=Letzter Sperrgrund:
 ADMIN_CONTACT_IS_OWN_CONTACT=Eigenes Account:
 ADMIN_CONTACT_PERSONAL_TITLE=Anrede:
 ADMIN_CONTACT_ACADEMIC_TITLE=Akademischer Titel:
index 2997970ba7f8dc13dd86297415bf08b5616692a5..91dab17ddbc7957c51cf89e5219c89e9acd6f9a9 100644 (file)
@@ -313,8 +313,8 @@ ENTRY_UPDATED_HEADER=Updated:
 ADMIN_LINK_EDIT_DELETE_MOBILE_PROVIDER_TITLE=Edit or delete mobile provider
 ADMIN_USER_DATA_ENTER_PASSWORD=Enter password:
 ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT=Repeat password:
-ADMIN_LIST_USER_ID=User id:
-ADMIN_LIST_USER_NAME=User name:
+DATA_USER_ID=User id:
+DATA_USER_NAME=User name:
 ADMIN_LIST_USER_PERSONAL_TITLE=Gender:
 ADMIN_LIST_USER_FIRST_NAME=First name:
 ADMIN_LIST_USER_FAMILY_NAME=Family name:
@@ -331,14 +331,12 @@ ERROR_PARAMETER_USER_ID_NOT_SET=Error: User id not set (parameter userId).
 ERROR_USER_NOT_FOUND=Error: User entry not found.
 ADMIN_TABLE_SUMMARY_SHOW_USER_DATA=This table shows a single user profile for administrative purposes.
 ADMIN_SHOW_USER_HEADER=User {0} (id {1}):
-ADMIN_USER_ID=User id:
-ADMIN_USER_NAME=User name:
 ADMIN_USER_CREATED=When user created:
 ADMIN_USER_UPDATED=When user data updated:
 ADMIN_USER_ACCOUNT_STATUS=Account status:
 ADMIN_USER_PROFILE_MODE=Profile mode:
-ADMIN_USER_LAST_LOCKED=Last locked:
-ADMIN_USER_LAST_LOCKED_REASON=Last lock reason:
+DATA_USER_LAST_LOCKED=Last locked:
+DATA_USER_LAST_LOCKED_REASON=Last lock reason:
 ADMIN_CONTACT_IS_OWN_CONTACT=Own account:
 ADMIN_CONTACT_PERSONAL_TITLE=Gender:
 ADMIN_CONTACT_ACADEMIC_TITLE=Academic title:
@@ -1125,3 +1123,4 @@ BARCODE=Barcode:
 ADMIN_CONTACT_DETAILS_HEADER=Contact data of {0} {1} {2}:
 ADMIN_DEPARTMENT_DETAILS_HEADER=Data of department {0} (Id {1}):
 ADMIN_HEADQUARTER_DETAILS_HEADER=Headquarter of {0} (Id {1})):
+CHANGE=Change?
index 126dbca04f8a3aa6138177b5430e19739cedac83..f919ad5dc0d24ac72052e9c065f2bdad732f9ac8 100644 (file)
@@ -89,7 +89,7 @@
                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                        <f:selectItems
-                                               value="#{userController.allUsers()}"
+                                               value="#{userListController.allUsers}"
                                                var="companyUserOwner"
                                                itemValue="#{companyUserOwner}"
                                                itemLabel="#{beanHelper.renderContact(companyUserOwner.userContact)} (#{companyUserOwner.userName})"
index dde0a62b64e7179f0cb4fb6f62fb17cf81e1e4fd..7421b753c7454b0c67a35dc184dcc49e6a9a86d3 100644 (file)
@@ -93,7 +93,7 @@
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{userController.allUsers()}"
+                                       value="#{userListController.allUsers}"
                                        var="branchUserOwner"
                                        itemValue="#{branchUserOwner}"
                                        itemLabel="#{beanHelper.renderContact(branchUserOwner.userContact)} (#{branchUserOwner.userName})"
index 502fcb9990aa8e8ee9e721da00c5674a32e99bd4..e8ecea93d20497119b91e9cb04f95826036f5f7b 100644 (file)
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{userController.allUsers()}"
+                                       value="#{userListController.allUsers}"
                                        var="departmentUserOwner"
                                        itemValue="#{departmentUserOwner}"
                                        itemLabel="#{beanHelper.renderContact(departmentUserOwner.userContact)} (#{departmentUserOwner.userName})"
index 66b46eb95ea2ec461948ae6303fe8ec3181b24cb..5b1b297db8f89d2802b87b8665d8da470ab9505a 100644 (file)
@@ -98,7 +98,7 @@
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{userController.allUsers()}"
+                                       value="#{userListController.allUsers}"
                                        var="employeeUserOwner"
                                        itemValue="#{employeeUserOwner}"
                                        itemLabel="#{beanHelper.renderContact(employeeUserOwner.userContact)} (#{employeeUserOwner.userName})"
index f7feab04df8e167cf8b15e53c54669b0a3a9bdfa..2f8350af54e223a7d164d38dd261450cad610035 100644 (file)
@@ -64,7 +64,7 @@
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{userController.allUsers()}"
+                                       value="#{userListController.allUsers}"
                                        var="headquarterUserOwner"
                                        itemValue="#{headquarterUserOwner}"
                                        itemLabel="#{beanHelper.renderContact(headquarterUserOwner.userContact)} (#{headquarterUserOwner.userName})"
index c5d4537b8ec42357f795600cadde1a89b7203071..28f60d9e1a25b045e0967541888ba395762c19b3 100644 (file)
                </f:facet>
 
                <p:column>
-                       <p:outputLabel for="userId" styleClass="table-data-label" value="#{msg.ADMIN_USER_ID}" />
+                       <p:outputLabel for="userId" styleClass="table-data-label" value="#{msg.DATA_USER_ID}" />
 
                        <h:outputText id="userId" styleClass="table-data-field" value="#{beanHelper.user.userId}" />
                </p:column>
 
                <ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
                        <p:column>
-                               <p:outputLabel for="userName" styleClass="table-data-label" value="#{msg.ADMIN_USER_NAME}" />
+                               <p:outputLabel for="userName" styleClass="table-data-label" value="#{msg.DATA_USER_NAME}" />
 
                                <h:outputText id="userName" styleClass="table-data-field" value="#{beanHelper.user.userName}" />
                        </p:column>
@@ -65,7 +65,7 @@
                </p:column>
 
                <p:column>
-                       <p:outputLabel for="userLastLocked" styleClass="table-data-label" value="#{msg.ADMIN_USER_LAST_LOCKED}" />
+                       <p:outputLabel for="userLastLocked" styleClass="table-data-label" value="#{msg.DATA_USER_LAST_LOCKED}" />
 
                        <h:outputText id="userLastLocked" styleClass="table-data-field" value="#{beanHelper.user.userLastLocked}">
                                <f:convertDateTime type="both" />
@@ -73,7 +73,7 @@
                </p:column>
 
                <p:column>
-                       <p:outputLabel for="userLastLockedReason" styleClass="table-data-label" value="#{msg.ADMIN_USER_LAST_LOCKED_REASON}" />
+                       <p:outputLabel for="userLastLockedReason" styleClass="table-data-label" value="#{msg.DATA_USER_LAST_LOCKED_REASON}" />
 
                        <h:outputText id="userLastLockedReason" styleClass="table-data-field" value="#{beanHelper.user.userLastLockedReason}" />
                </p:column>
index 367fd3413d46fbeb657e27a6c54f7bd6ad3e1bfd..23db73bdd98c56372df2a0d777788c32382b1472 100644 (file)
@@ -23,7 +23,7 @@
                </f:facet>
 
                <p:column>
-                       <p:outputLabel for="userId" styleClass="table-data-label" value="#{msg.ADMIN_USER_ID}" />
+                       <p:outputLabel for="userId" styleClass="table-data-label" value="#{msg.DATA_USER_ID}" />
 
                        <h:panelGroup styleClass="table-data-field" layout="block">
                                <p:link
@@ -39,7 +39,7 @@
 
                <ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
                        <p:column>
-                               <p:outputLabel for="userName" styleClass="table-data-label" value="#{msg.ADMIN_USER_NAME}" />
+                               <p:outputLabel for="userName" styleClass="table-data-label" value="#{msg.DATA_USER_NAME}" />
 
                                <h:outputText id="userName" styleClass="table-data-field" value="#{beanHelper.user.userName}" />
                        </p:column>
index 7eca15cf72004ea9f1abd3bb149942c03a713334..71952482dcb4e31a315c2afdbd3bc3e0e5551620 100644 (file)
                                                        <f:converter converterId="UserConverter" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"
index c3a94b05d3f9e1c61b5bb51c578aac1be8399e8c..26522083848e198b08314b0181bd2e8ca06eba05 100644 (file)
                                                        <f:converter converterId="UserConverter" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"
index f149368ee4af0b6887ef322230d0c55f0430d49e..7b7d8f4fcf32a1dbc80640dd0ed6907bbe21a318 100644 (file)
                                                        <f:converter converterId="UserConverter" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"
index 79f47baca677554cd422d587204ab1b4fc7c55e8..eabf74684189bad46fc435084ab5a699b7de769d 100644 (file)
                                                        <f:converter converterId="UserConverter" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"
index a31f77d299fe4e6dc298a63bad0d8753de86ad04..d985667d06c7e501e0ec2e49c278441452d1e8ba 100644 (file)
                                                        <f:converter converterId="UserConverter" />
 
                                                        <f:selectItems
-                                                               value="#{userController.allUsers()}"
+                                                               value="#{userListController.allUsers}"
                                                                var="user"
                                                                itemValue="#{user}"
                                                                itemLabel="#{beanHelper.renderUser(user)}"
index ad13834f10d8c9237eb63e7125da0957dfbc34c6..2c5797934c8ad8a480f289d939638f958edd67c6 100644 (file)
@@ -38,7 +38,7 @@
                        >
                        <p:column>
                                <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_LIST_USER_ID}" />
+                                       <h:outputText value="#{msg.DATA_USER_ID}" />
                                </f:facet>
 
                                <p:link
@@ -53,7 +53,7 @@
                        <ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
                                <p:column>
                                        <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_LIST_USER_NAME}" />
+                                               <h:outputText value="#{msg.DATA_USER_NAME}" />
                                        </f:facet>
 
                                        <h:outputText value="#{userActivity.activityUserName}" />
index 3b845988d39a58a68826ea0952d95c51e607651a..6a8bb38d6f02269928d62973d9ac6ceb670742ce 100644 (file)
@@ -22,7 +22,7 @@
                        <p:dataTable
                                id="table-export-users"
                                var="user"
-                               value="#{userController.allUsers()}"
+                               value="#{userListController.allUsers}"
                                paginator="true"
                                rows="10"
                                summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_USER}"
index 71a397255bd87e4af188426d534ddb66a72f471c..884aae50af07527b7e8f17dacfc137a1d4c9a36c 100644 (file)
                        <p:dataTable
                                id="userList"
                                var="user"
-                               value="#{userController.allUsers()}"
+                               value="#{userListController.allUsers}"
                                paginator="true"
                                paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
-                               filteredValue="#{userController.filteredUsers}"
+                               filteredValue="#{userListController.filteredUsers}"
                                rows="10"
+                               rowKey="#{user.userId}"
                                reflow="true"
                                resizableColumns="true"
                                rowsPerPageTemplate="5,10,20,50,100"
                                summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}"
                                emptyMessage="#{msg.ADMIN_EMPTY_LIST_USER}"
                                widgetVar="userList"
+                               selectionMode="single"
+                               selection="#{userListController.selectedUser}"
+                               skipChildren="true"
                                >
 
                                <f:facet name="header">
-                                       <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
-                                               <h:outputText value="#{msg.ADMIN_LIST_USERS_HEADER}" />
+                                       <p:panelGrid
+                                               columns="3"
+                                               layout="grid"
+                                               columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
+                                               >
+                                               <p:spacer />
 
-                                               <p:commandButton
-                                                       id="toggler"
-                                                       type="button"
-                                                       value="#{msg.SELECT_SHOWN_COLUMNS}"
-                                                       styleClass="column-selector"
-                                                       />
+                                               <p:panelGrid
+                                                       columns="2"
+                                                       columnClasses="ui-grid-4,ui-grid-8"
+                                                       layout="grid"
+                                                       styleClass="ui-noborder"
+                                                       >
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('userList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
+                                               </p:panelGrid>
+
+                                               <p:outputPanel>
+                                                       <p:spacer height="4" />
+
+                                                       <p:commandButton
+                                                               id="toggler"
+                                                               type="button"
+                                                               value="#{msg.SELECT_SHOWN_COLUMNS}"
+                                                               styleClass="column-selector"
+                                                               />
 
-                                               <p:columnToggler datasource="userList" trigger="toggler" />
+                                                       <p:columnToggler datasource="userList" trigger="toggler" />
+                                               </p:outputPanel>
                                        </p:panelGrid>
                                </f:facet>
 
+                               <p:ajax
+                                       event="rowSelect"
+                                       update="form-list-users:user-details"
+                                       oncomplete="PF('userDialog').show()"
+                                       />
+
                                <p:column
-                                       headerText="#{msg.ADMIN_USER_ID}"
+                                       headerText="#{msg.DATA_USER_ID}"
                                        sortBy="#{user.userId}"
-                                       filterBy="#{user.userId}"
-                                       filterMatchMode="contains"
+                                       filterable="false"
                                        >
                                        <p:link
                                                outcome="admin_show_user"
                                </p:column>
 
                                <p:column
-                                       headerText="#{msg.ADMIN_LIST_USER_NAME}"
+                                       headerText="#{msg.DATA_USER_NAME}"
                                        sortBy="#{user.userName}"
                                        filterBy="#{user.userName}"
                                        filterMatchMode="contains"
                                        <h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
                                </p:column>
 
+                               <p:column
+                                       headerText="#{msg.DATA_USER_LAST_LOCKED_REASON}"
+                                       sortBy="#{user.userLastLockedReason}"
+                                       filterBy="#{user.userLastLockedReason}"
+                                       filterMatchMode="contains"
+                                       >
+                                       <h:outputText value="#{user.userLastLockedReason}" />
+                               </p:column>
+
+                               <p:column
+                                       headerText="#{msg.DATA_USER_LAST_LOCKED}"
+                                       sortBy="#{user.userLastLocked}"
+                                       filterable="false"
+                                       >
+                                       <h:outputText value="#{user.userLastLocked}">
+                                               <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </p:column>
+
+                               <p:column
+                                       headerText="#{msg.CHANGE}"
+                                       sortBy="#{user.userMustChangePassword}"
+                                       filterable="false"
+                                       >
+                                       <h:outputText value="#{user.userMustChangePassword ? msg.CHOICE_YES : msg.CHOICE_NO}" />
+                               </p:column>
+
                                <p:column
                                        headerText="#{msg.ENTRY_CREATED_HEADER}"
                                        sortBy="#{user.userCreated}"
                                        filterable="false"
                                        >
-                                       <h:outputText id="userCreated" value="#{user.userCreated}">
+                                       <h:outputText value="#{user.userCreated}">
+                                               <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </p:column>
+
+                               <p:column
+                                       headerText="#{msg.ENTRY_UPDATED_HEADER}"
+                                       sortBy="#{user.userUpdated}"
+                                       filterable="false"
+                                       >
+                                       <h:outputText value="#{user.userUpdated}">
                                                <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
                                        </h:outputText>
                                </p:column>
                                        <links:outputUserAdminDropdownMenu user="#{user}" />
                                </p:column>
                        </p:dataTable>
+
+                       <p:dialog
+                               dynamic="true"
+                               modal="true"
+                               resizable="false"
+                               header="#{msg.ADMIN_SINGLE_USER_DETAILS_HEADER}"
+                               hideEffect="fade"
+                               showEffect="fade"
+                               widgetVar="userDialog"
+                               position="top"
+                               responsive="true"
+                               closeOnEscape="true"
+                               >
+                               <p:outputPanel id="user-details">
+                                       <p:panelGrid columns="2" rendered="#{not empty userListController.selectedUser}">
+                                               <f:facet name="header">
+                                                       <h:outputFormat value="#{msg.ADMIN_USER_DETAILS_HEADER}">
+                                                               <f:param value="#{userListController.selectedUser.userName}" />
+                                                               <f:param value="#{userListController.selectedUser.userId}" />
+                                                       </h:outputFormat>
+                                               </f:facet>
+
+                                               <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.USER_ID_NUMBER_TITLE}" />
+                                               <h:outputText value="#{userListController.selectedUser.userId}" />
+                                       </p:panelGrid>
+                               </p:outputPanel>
+                       </p:dialog>
                </h:form>
 
                <h:form>
index 3cee469f7a1477111fb3635782803d0104ccfcfd..0958cd5f92c3658fe17a80509285c2dc394a536a 100644 (file)
@@ -84,7 +84,7 @@
 
                                <h:panelGroup styleClass="para" layout="block">
                                        <div class="table-data-label">
-                                               <p:outputLabel for="userLastLocked" value="#{msg.ADMIN_USER_LAST_LOCKED}" />
+                                               <p:outputLabel for="userLastLocked" value="#{msg.DATA_USER_LAST_LOCKED}" />
                                        </div>
 
                                        <div class="table-data-field">
@@ -96,7 +96,7 @@
 
                                <h:panelGroup styleClass="para" layout="block">
                                        <div class="table-data-label">
-                                               <p:outputLabel for="userLockReason" value="#{msg.ADMIN_USER_LAST_LOCKED_REASON}" />
+                                               <p:outputLabel for="userLockReason" value="#{msg.DATA_USER_LAST_LOCKED_REASON}" />
                                        </div>
 
                                        <div class="table-data-field">
index 5222b035b087045fc6b7f9dc94ad30c3e04ff6c9..66a2339d0d97aab194d2f5d49c47a34e5891e781 100644 (file)
@@ -32,7 +32,7 @@
                        <p:dataTable
                                id="userList"
                                var="user"
-                               value="#{userController.allUsers()}"
+                               value="#{userListController.allUsers}"
                                paginator="true"
                                rows="10"
                                summary="#{msg.TABLE_SUMMARY_USER_LIST}"