From: Roland Häder Date: Wed, 8 Apr 2020 18:29:11 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5676714c11770b7a35dee5881e4cb209eefbdb94;p=jjobs-war.git 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? Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java index 8a2c912e..75a538c3 100644 --- a/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements // 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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements 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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements // 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/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java index 0db3e12e..b55c6625 100644 --- a/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.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; @@ -119,7 +120,7 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J // 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 JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J 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/jjobs/beans/business/employee/JobsAdminEmployeeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminEmployeeWebRequestBean.java index c2859de2..daba8d86 100644 --- a/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminEmployeeWebRequestBean.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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job // 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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job 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/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java index af5b9e15..580f601c 100644 --- a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements // 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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements 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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements // 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/jjobs/beans/contact/JobsContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java index f3ea2e71..1407ed67 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.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 JobsContactWebRequestBean extends BaseJobsBean implements JobsConta 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/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java index f656bb3d..33f9048e 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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 JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements 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/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java index 49f509a7..b66314fa 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java @@ -16,13 +16,12 @@ */ package org.mxchange.jjobs.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 JobsAdminMobileProviderWebRequestBean extends BaseJobsBean implemen // 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 JobsAdminMobileProviderWebRequestBean extends BaseJobsBean implemen // 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/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index f8804681..cc089f35 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.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 JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // 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 JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // 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 JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // 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 JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // 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/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index 5c5f3124..b25488b5 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.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 JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm 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 JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm 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 JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm 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/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java index a916b3a5..9f689a6a 100644 --- a/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.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 JobsEmailChangeWebRequestBean extends BaseJobsBean implements JobsE 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 JobsEmailChangeWebRequestBean extends BaseJobsBean implements JobsE 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/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java index 8c290cc0..adf2e69b 100644 --- a/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.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 JobsUserLoginWebSessionBean extends BaseJobsBean implements JobsUse 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/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java index e88410b4..22c28a8e 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.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 JobsUserPasswordWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserPasswordWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserPasswordWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserPasswordWebRequestBean extends BaseJobsBean implements Jobs 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/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.java index 01fe562c..ec151328 100644 --- a/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs } 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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs } 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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs 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 JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs 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/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.java index 6c2feed1..6478da0f 100644 --- a/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.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 JobsResendLinkWebRequestBean extends BaseJobsBean implements JobsRe 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 JobsResendLinkWebRequestBean extends BaseJobsBean implements JobsRe 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 JobsResendLinkWebRequestBean extends BaseJobsBean implements JobsRe 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" > - - + + +