From 6f007c9525180e91090caa95dae5a1dfe39631d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 8 Apr 2020 20:29:11 +0200 Subject: [PATCH] Please cherry-pick: - reformatted some p:outputLabel/p:inputText to have all attributes in single line - as jcoreee's showFacesMessage() methods require severity now, added FacesMessage.SEVERITY_* to those method calls, strange that still it still shows no effect? Where is the bug here? MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...ncialsAdminBranchOfficeWebRequestBean.java | 7 ++++--- ...nancialsAdminDepartmentWebRequestBean.java | 7 ++++--- ...FinancialsAdminEmployeeWebRequestBean.java | 5 +++-- ...ancialsAdminHeadquarterWebRequestBean.java | 7 ++++--- .../FinancialsContactWebRequestBean.java | 3 ++- ...ncialsAdminContactPhoneWebRequestBean.java | 13 ++++++------ ...ialsAdminMobileProviderWebRequestBean.java | 20 +++++-------------- .../FinancialsAdminPhoneWebRequestBean.java | 17 ++++++++-------- .../FinancialsAdminUserWebRequestBean.java | 9 +++++---- .../FinancialsEmailChangeWebRequestBean.java | 7 ++++--- .../FinancialsUserLoginWebSessionBean.java | 9 +++++---- .../FinancialsUserPasswordWebRequestBean.java | 9 +++++---- .../FinancialsUserRegisterWebRequestBean.java | 17 ++++++++-------- .../FinancialsResendLinkWebRequestBean.java | 11 +++++----- .../basic_data/admin_basic_data_list.xhtml | 13 ++++++++++-- .../admin_branch_office_list.xhtml | 13 ++++++++++-- web/admin/contact/admin_contact_list.xhtml | 13 ++++++++++-- web/admin/country/admin_country_list.xhtml | 13 ++++++++++-- .../department/admin_department_list.xhtml | 13 ++++++++++-- .../headquarter/admin_headquarter_list.xhtml | 13 ++++++++++-- 20 files changed, 137 insertions(+), 82 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java index 181a1a26..34779f7b 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java @@ -24,6 +24,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontactsbusiness.events.branchoffice.added.BranchOfficeAddedEvent; @@ -236,7 +237,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea // Is the branch office not created yet? if (this.isBranchOfficeCreatedByRequiredData(branchOffice)) { // Then show proper faces message - this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } @@ -248,7 +249,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea updatedOffice = this.adminBranchOfficeBean.addBranchOffice(branchOffice); } catch (final BranchOfficeAlreadyAddedException ex) { // Output message - this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N return; } @@ -285,7 +286,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea // Is same found? if (this.isSameOpeningTimeFound(openingTime)) { // Yes then abort here - this.showFacesMessage("form-admin-add-branch-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-branch-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } diff --git a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java index acde45d9..6b15bc39 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java @@ -20,6 +20,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontactsbusiness.events.department.added.DepartmentAddedEvent; @@ -33,8 +34,8 @@ import org.mxchange.jcontactsbusiness.model.department.Department; import org.mxchange.jcontactsbusiness.model.employee.Employable; import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter; import org.mxchange.jfinancials.beans.BaseFinancialsBean; -import org.mxchange.jusercore.model.user.User; import org.mxchange.jfinancials.beans.business.department.list.FinancialsDepartmentListWebViewController; +import org.mxchange.jusercore.model.user.User; /** * An administrative bean for departments @@ -119,7 +120,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean // Is the department not created yet? if (this.departmentListController.isDepartmentAlreadyAdded(department)) { // Then show proper faces message - this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } @@ -131,7 +132,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean updatedDepartment = this.adminDepartmentBean.addDepartment(department); } catch (final DepartmentAlreadyAddedException ex) { // Output message - this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N return; } diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java index c296992c..a1c0afb6 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java @@ -20,6 +20,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.model.contact.Contact; @@ -149,7 +150,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im // Is the branch office not created yet? if (this.isEmployeeCreatedByRequiredData(employee)) { // Then show proper faces message - this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } @@ -161,7 +162,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im updatedOffice = this.adminEmployeeBean.addEmployee(employee); } catch (final EmployeeAlreadyAddedException ex) { // Output message - this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N return; } diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java index 4dd51a1a..05e12cd3 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java @@ -24,6 +24,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontactsbusiness.events.headquarter.added.HeadquarterAddedEvent; @@ -224,7 +225,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean // Is the headquarter not created yet? if (this.headquarterListController.isHeadquarterCreatedByRequiredData(headquarter)) { // Then show proper faces message - this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } @@ -236,7 +237,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean updatedHeadquarter = this.adminHeadquarterBean.addHeadquarter(headquarter); } catch (final HeadquarterAlreadyAddedException ex) { // Output message - this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N return; } @@ -273,7 +274,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean // Is same found? if (this.isSameOpeningTimeFound(openingTime)) { // Yes then abort here - this.showFacesMessage("form-admin-add-headquarter-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED"); //NOI18N + this.showFacesMessage("form-admin-add-headquarter-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N return; } diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java index dbb4ade8..8e9d7ecd 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java @@ -22,6 +22,7 @@ import java.util.Objects; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; +import javax.faces.application.FacesMessage; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -396,7 +397,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen throw new FaceletException("Not all required fields are set."); //NOI18N } else if (!this.userLoginController.ifCurrentPasswordMatches()) { // Password not matching - this.showFacesMessage("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); //NOI18N + this.showFacesMessage("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()), FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java index 7cb5da8b..e762c53a 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java @@ -23,6 +23,7 @@ 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.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; @@ -461,7 +462,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.linkNewFaxNumberWithContact(targetContact, number); } catch (final PhoneNumberAlreadyLinkedException ex) { // Throw again as cause - this.showFacesMessage("form_add_contact_fax:faxNumber", ex); //NOI18N + this.showFacesMessage("form_add_contact_fax:faxNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -525,7 +526,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.linkNewLandLineNumberWithContact(targetContact, number); } catch (final PhoneNumberAlreadyLinkedException ex) { // Throw again as cause - this.showFacesMessage("form_add_contact_landLine:landLineNumber", ex); //NOI18N + this.showFacesMessage("form_add_contact_landLine:landLineNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -582,7 +583,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.linkNewMobileNumberWithContact(targetContact, number); } catch (final PhoneNumberAlreadyLinkedException ex) { // Throw again as cause - this.showFacesMessage("form_add_contact_mobile:mobileNumber", ex); //NOI18N + this.showFacesMessage("form_add_contact_mobile:mobileNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -817,7 +818,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.unlinkFaxDataFromContact(this.getContact(), number); } catch (final PhoneNumberNotLinkedException ex) { // Did not work - this.showFacesMessage("form_unlink_contact_fax:faxNumberId", ex); //NOI18N + this.showFacesMessage("form_unlink_contact_fax:faxNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -872,7 +873,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.unlinkLandLineDataFromContact(this.getContact(), number); } catch (final PhoneNumberNotLinkedException ex) { // Did not work - this.showFacesMessage("form_unlink_contact_landLine:landLineNumberId", ex); //NOI18N + this.showFacesMessage("form_unlink_contact_landLine:landLineNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -936,7 +937,7 @@ public class FinancialsAdminContactPhoneWebRequestBean extends BaseFinancialsBea updatedContact = this.adminContactPhoneBean.unlinkMobileDataFromContact(this.getContact(), number); } catch (final PhoneNumberNotLinkedException ex) { // Did not work - this.showFacesMessage("form_unlink_contact_mobile:mobileNumberId", ex); //NOI18N + this.showFacesMessage("form_unlink_contact_mobile:mobileNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java index c6cc08d5..782d8314 100644 --- a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java @@ -16,13 +16,12 @@ */ package org.mxchange.jfinancials.beans.mobileprovider; -import java.util.Iterator; -import java.util.List; import java.util.Objects; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -110,8 +109,8 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsB // Is the provider already created? if (this.isMobileProviderCreated(mobileProvider)) { // Then throw exception - this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider)); //NOI18N - return; //NOI18N + this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider), FacesMessage.SEVERITY_WARN); //NOI18N + return; } // Init variable @@ -213,19 +212,10 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsB // Default is not found boolean isFound = false; - // Get list of all providers - List providers = this.mobileController.allMobileProviders(); - - // Get iterator from it - Iterator iterator = providers.iterator(); - // Loop through all - while (iterator.hasNext()) { - // Get next element - MobileProvider next = iterator.next(); - + for (final MobileProvider currentMobileProvider : this.mobileController.allMobileProviders()) { // Is the provider's dial prefix and country the same? - if ((Objects.equals(mobileProvider.getProviderDialPrefix(), next.getProviderDialPrefix())) && (Objects.equals(mobileProvider.getProviderCountry(), next.getProviderCountry()))) { + if (Objects.equals(mobileProvider, currentMobileProvider)) { // Is the same, abort loop isFound = true; break; diff --git a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java index 5cc688d2..c6ec1d82 100644 --- a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java @@ -25,6 +25,7 @@ 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.jcountry.model.data.Country; @@ -538,7 +539,7 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // Is the mobile provider and number the same? if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) { // Show message - this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N + this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N // No difference in both together, no need to edit return ""; //NOI18N @@ -604,7 +605,7 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // Is the mobile provider and number the same? if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) { // Show message - this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N + this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N // No difference in both together, no need to edit return ""; //NOI18N @@ -660,9 +661,8 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // Throw NPE again throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N } else if (this.getMobileProvider() == null) { - // Not provided - this.showFacesMessage("form_edit_mobile:mobileProvider", "ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED"); //NOI18N - return ""; //NOI18N + // Throw NPE again + throw new NullPointerException("this.mobileProvider is null"); //NOI18N } else if (this.getMobileProvider().getProviderId() == null) { // Throw NPE again ... throw new NullPointerException("this.mobileProvider.providerId is null"); //NOI18N @@ -670,15 +670,14 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // Invalid id number throw new IllegalArgumentException(MessageFormat.format("this.mobileProvider.providerId={0} is not valid.", this.getMobileProvider().getProviderId())); //NOI18N } else if (this.getPhoneNumber() == null) { - // Not provided - this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_EMPTY_MOBILE_NUMBER"); //NOI18N - return ""; //NOI18N + // Throw NPE + throw new NullPointerException("this.phoneNumber is null"); //NOI18N } // Is the mobile provider and number the same? if ((Objects.equals(this.getMobileProvider(), number.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) { // Show message - this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N + this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED", FacesMessage.SEVERITY_WARN); //NOI18N // No difference in both together, no need to edit return ""; //NOI18N diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java index 8fd3a1e9..7fb24036 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java @@ -25,6 +25,7 @@ import javax.enterprise.event.Event; import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; import javax.faces.FacesException; +import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -240,7 +241,7 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem throw new FaceletException(new UserNameAlreadyRegisteredException(newUser)); } else if ((this.getContact() == null) && (this.contactController.isEmailAddressRegistered(newUser.getUserContact()))) { // Email address is already used - this.showFacesMessage("admin_add_user:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N + this.showFacesMessage("admin_add_user:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED", FacesMessage.SEVERITY_WARN); //NOI18N // Always clear password this.setUserPassword(null); @@ -390,14 +391,14 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem this.setUserPasswordRepeat(null); // Not same password entered - this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_PASSWORD_REPEAT_DIFFERENT"); //NOI18N + this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_PASSWORD_REPEAT_DIFFERENT", FacesMessage.SEVERITY_INFO); //NOI18N return; } else if ((!Objects.equals(this.getUser().getUserName(), this.getUserName())) && (this.userBean.ifUserNameExists(this.getUserName()))) { // Clear all fields this.clear(); // User name already exists - this.showFacesMessage("form_edit_user:userName", "ADMIN_USER_NAME_ALREADY_EXISTS"); //NOI18N + this.showFacesMessage("form_edit_user:userName", "ADMIN_USER_NAME_ALREADY_EXISTS", FacesMessage.SEVERITY_WARN); //NOI18N return; } else if (this.isSamePasswordEntered()) { // Same password entered, create container @@ -407,7 +408,7 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem this.setUserPasswordRepeat(null); // Same password entered - this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD"); //NOI18N + this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD", FacesMessage.SEVERITY_WARN); //NOI18N return; } diff --git a/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java index c22c0863..ac1de94e 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java @@ -23,6 +23,7 @@ import javax.annotation.PostConstruct; import javax.cache.Cache; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; +import javax.faces.application.FacesMessage; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -112,11 +113,11 @@ public class FinancialsEmailChangeWebRequestBean extends BaseFinancialsBean impl throw new FaceletException("Not all required fields are set."); //NOI18N } else if (!Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat())) { // Email address 1+2 mismatch - this.showFacesMessage("form_user_change_email_address:emailAddressRepeat", "ERROR_USER_EMAIL_ADDRESSES_MISMATCH"); //NOI18N + this.showFacesMessage("form_user_change_email_address:emailAddressRepeat", "ERROR_USER_EMAIL_ADDRESSES_MISMATCH", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (!this.userLoginController.ifCurrentPasswordMatches()) { // Password not matching - this.showFacesMessage("form_login_user_change_email_address:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); //NOI18N + this.showFacesMessage("form_login_user_change_email_address:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()), FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } @@ -138,7 +139,7 @@ public class FinancialsEmailChangeWebRequestBean extends BaseFinancialsBean impl this.setEmailAddressRepeat(null); // Yes, then abort here - this.showFacesMessage("form_user_change_email_address:emailAddress", "ERROR_USER_CHANGE_EMAIL_ADDRESS_ALREADY_QUEUED"); //NOI18N + this.showFacesMessage("form_user_change_email_address:emailAddress", "ERROR_USER_CHANGE_EMAIL_ADDRESS_ALREADY_QUEUED", FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java index fd1585a1..44b2c436 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java @@ -25,6 +25,7 @@ import javax.enterprise.context.SessionScoped; import javax.enterprise.event.Event; import javax.enterprise.event.Observes; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.inject.Inject; import javax.inject.Named; @@ -226,17 +227,17 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsBean implem return "login_user"; //NOI18N } catch (final UserNotFoundException ex) { // Show JSF message - this.showFacesMessage("form_user_login:userName", "ERROR_USER_NOT_FOUND"); //NOI18N + this.showFacesMessage("form_user_login:userName", "ERROR_USER_NOT_FOUND", FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } catch (final UserStatusLockedException ex) { - this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_LOCKED"); //NOI18N + this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_LOCKED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } catch (final UserStatusUnconfirmedException ex) { - this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_UNCONFIRMED"); //NOI18N + this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_UNCONFIRMED", FacesMessage.SEVERITY_INFO); //NOI18N return ""; //NOI18N } catch (final UserPasswordMismatchException ex) { // Show JSF message - this.showFacesMessage("form_user_login:userPassword", "ERROR_USER_PASSWORD_MISMATCH"); //NOI18N + this.showFacesMessage("form_user_login:userPassword", "ERROR_USER_PASSWORD_MISMATCH", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } } diff --git a/src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java index 252a74d5..f95d09fb 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java @@ -21,6 +21,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -124,7 +125,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsBean imp throw new IllegalStateException("User tried to change password."); //NOI18N } else if (!UserLoginUtils.ifPasswordMatches(this.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) { // Password mismatches - this.showFacesMessage("form_user_change_password:userCurrentPassword", "Entered current password does not matched stored password."); //NOI18N + this.showFacesMessage("form_user_change_password:userCurrentPassword", "Entered current password does not matched stored password.", FacesMessage.SEVERITY_WARN); //NOI18N // Clear bean this.clear(); @@ -133,7 +134,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsBean imp return ""; //NOI18N } else if (!Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())) { // Both entered passwords don't match - this.showFacesMessage("form_user_change_password:userPasswordRepeat", "Entered new passwords mismatch."); //NOI18N + this.showFacesMessage("form_user_change_password:userPasswordRepeat", "Entered new passwords mismatch.", FacesMessage.SEVERITY_ERROR); //NOI18N // Clear bean this.clear(); @@ -142,7 +143,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsBean imp return ""; //NOI18N } else if (Objects.equals(this.getUserCurrentPassword(), this.getUserPassword())) { // New password matches current - this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is same as current password."); //NOI18N + this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is same as current password.", FacesMessage.SEVERITY_WARN); //NOI18N // Clear bean this.clear(); @@ -151,7 +152,7 @@ public class FinancialsUserPasswordWebRequestBean extends BaseFinancialsBean imp return ""; //NOI18N } else if (this.userLoginController.isPasswordInHistory(this.getUserPassword())) { // Is already in list (to old passwords are ignored) - this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is has already been used some time ago."); //NOI18N + this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is has already been used some time ago.", FacesMessage.SEVERITY_WARN); //NOI18N // Clear bean this.clear(); diff --git a/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java index ac39fa39..9499f343 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java @@ -20,6 +20,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.application.FacesMessage; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -158,7 +159,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp this.clearUserNameEvent.fire(new ClearUserNameEvent()); // Output message - this.showFacesMessage("form_register_single:userName", "ERROR_USER_NAME_ALREADY_USED"); //NOI18N + this.showFacesMessage("form_register_single:userName", "ERROR_USER_NAME_ALREADY_USED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) { @@ -169,7 +170,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp } else { // May happen here, reset fields this.contactController.clearEmailAddresses(); - this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N + this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESS_ALREADY_USED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } } else if (!this.contactController.isSameEmailAddressEntered()) { @@ -180,7 +181,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp } else { // May happen here, reset fields this.contactController.clearEmailAddresses(); - this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING"); //NOI18N + this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING", FacesMessage.SEVERITY_INFO); //NOI18N return ""; //NOI18N } } else if (!this.userController.isSamePasswordEntered()) { @@ -268,12 +269,12 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp this.clearUserNameEvent.fire(new ClearUserNameEvent()); // Output message - this.showFacesMessage("form_register_page1:userName", "ERROR_USER_NAME_ALREADY_USED"); //NOI18N + this.showFacesMessage("form_register_page1:userName", "ERROR_USER_NAME_ALREADY_USED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (!this.contactController.isSameEmailAddressEntered()) { // Not same email address entered, clear both this.contactController.clearEmailAddresses(); - this.showFacesMessage("form_register_page1:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING"); //NOI18N + this.showFacesMessage("form_register_page1:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (!this.userController.isSamePasswordEntered()) { // Is multi-page enabled? @@ -282,8 +283,8 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp this.clearUserPasswordEvent.fire(new ClearUserPasswordEvent()); // Output faces message - this.showFacesMessage("form_register_page1:userPassword", "ERROR_USER_PASSWORD_EMPTY"); //NOI18N - this.showFacesMessage("form_register_page1:userPasswordRepeat", "ERROR_USER_PASSWORD_REPEAT_EMPTY"); //NOI18N + this.showFacesMessage("form_register_page1:userPassword", "ERROR_USER_PASSWORD_EMPTY", FacesMessage.SEVERITY_WARN); //NOI18N + this.showFacesMessage("form_register_page1:userPasswordRepeat", "ERROR_USER_PASSWORD_REPEAT_EMPTY", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (this.userController.ifBothPasswordsEmptyAllowed()) { // Both passwords are left empty and is allowed, then generate a random password @@ -308,7 +309,7 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp if (this.contactController.isEmailAddressRegistered(user.getUserContact())) { // Email address has already been taken, clear both this.contactController.clearEmailAddresses(); - this.showFacesMessage("form_register_page1:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N + this.showFacesMessage("form_register_page1:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java index fa77b731..97471dd3 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java @@ -22,6 +22,7 @@ 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; @@ -133,7 +134,7 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple this.clear(); // Not found, should not happen as the registered validator should find it - this.showFacesMessage("form_resend_link:", "ERROR_USER_EMAIL_ADDRESS_NOT_FOUND"); //NOI18N + this.showFacesMessage("form_resend_link:", "ERROR_USER_EMAIL_ADDRESS_NOT_FOUND", FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } @@ -143,14 +144,14 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple this.clear(); // Then abort here - this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_ALREADY_CONFIRMED"); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_ALREADY_CONFIRMED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) { // Always clear bean this.clear(); // User account is locked - this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_LOCKED"); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_LOCKED", FacesMessage.SEVERITY_WARN); //NOI18N return ""; //NOI18N } else if (user.getUserConfirmKey() == null) { // Status is UNCONFIRMED but confirmation key is NULL @@ -168,11 +169,11 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple managedUser = this.resendLinkBean.resendConfirmationLink(user, this.getLocale(), baseUrl); } catch (final UserNotFoundException ex) { // User not found - this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_NOT_FOUND"); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_NOT_FOUND", FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } catch (final UserStatusLockedException | UserStatusConfirmedException ex) { // Output message, this should not happen as the confirmation key is being removed - this.showFacesMessage("form_resend_link:resendEmailAddress", ex); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", ex, FacesMessage.SEVERITY_ERROR); //NOI18N return ""; //NOI18N } diff --git a/web/admin/basic_data/admin_basic_data_list.xhtml b/web/admin/basic_data/admin_basic_data_list.xhtml index 45ce0bc8..dc05e52a 100644 --- a/web/admin/basic_data/admin_basic_data_list.xhtml +++ b/web/admin/basic_data/admin_basic_data_list.xhtml @@ -54,8 +54,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + diff --git a/web/admin/branch_office/admin_branch_office_list.xhtml b/web/admin/branch_office/admin_branch_office_list.xhtml index 5abdb2b2..bbcb0893 100644 --- a/web/admin/branch_office/admin_branch_office_list.xhtml +++ b/web/admin/branch_office/admin_branch_office_list.xhtml @@ -55,8 +55,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + diff --git a/web/admin/contact/admin_contact_list.xhtml b/web/admin/contact/admin_contact_list.xhtml index 9eb72bd3..f7c2d4ed 100644 --- a/web/admin/contact/admin_contact_list.xhtml +++ b/web/admin/contact/admin_contact_list.xhtml @@ -55,8 +55,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + diff --git a/web/admin/country/admin_country_list.xhtml b/web/admin/country/admin_country_list.xhtml index db3550ac..eb34ffc2 100644 --- a/web/admin/country/admin_country_list.xhtml +++ b/web/admin/country/admin_country_list.xhtml @@ -54,8 +54,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + diff --git a/web/admin/department/admin_department_list.xhtml b/web/admin/department/admin_department_list.xhtml index d3a51bee..70dcbde4 100644 --- a/web/admin/department/admin_department_list.xhtml +++ b/web/admin/department/admin_department_list.xhtml @@ -54,8 +54,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + diff --git a/web/admin/headquarter/admin_headquarter_list.xhtml b/web/admin/headquarter/admin_headquarter_list.xhtml index 089a71f1..32d08e85 100644 --- a/web/admin/headquarter/admin_headquarter_list.xhtml +++ b/web/admin/headquarter/admin_headquarter_list.xhtml @@ -54,8 +54,17 @@ layout="grid" styleClass="ui-noborder" > - - + + + -- 2.39.5