]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 8 Apr 2020 18:29:11 +0000 (20:29 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 8 Apr 2020 18:29:11 +0000 (20:29 +0200)
- 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 <roland@mxchange.org>
20 files changed:
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java
web/admin/basic_data/admin_basic_data_list.xhtml
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/contact/admin_contact_list.xhtml
web/admin/country/admin_country_list.xhtml
web/admin/department/admin_department_list.xhtml
web/admin/headquarter/admin_headquarter_list.xhtml

index 181a1a26dc8748037d8dc934cbfc75db1251d824..34779f7b68992272c4236a4a1f983da1a7e844ec 100644 (file)
@@ -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;
                }
 
index acde45d914facebcacc35b3615cda10f1eb7aafb..6b15bc396f0a331591def2ef57fc35026b4cd340 100644 (file)
@@ -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;
                }
 
index c296992c14582063014a4a934c60b50cf4720f77..a1c0afb6261173bb1998f767e9f6986c5a80a34d 100644 (file)
@@ -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;
                }
 
index 4dd51a1a9d21f335da74de1d07c2e9b25a869cc9..05e12cd3a5eb4a123d44f515383d0cab4162c514 100644 (file)
@@ -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;
                }
 
index dbb4ade814182896516328b003223f1d79d5dc7c..8e9d7ecd3397dcfc10d0780637db30e5a51a0263 100644 (file)
@@ -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
                }
 
index 7cb5da8b1c1c6ce02a0570d6b99d2dd799a83a04..e762c53ad55562c756b41045b66e60d1dfe58c2e 100644 (file)
@@ -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
                }
 
index c6cc08d52789394ac3a0119c2ca355495c923df1..782d8314e2b348045299419344be6657c0852391 100644 (file)
  */
 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<MobileProvider> providers = this.mobileController.allMobileProviders();
-
-               // Get iterator from it
-               Iterator<MobileProvider> 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;
index 5cc688d2f65955b1ea2d69d5af175def1a6612ec..c6ec1d8246b46a9b3ea6da394cd59fb9067e1561 100644 (file)
@@ -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
index 8fd3a1e9fb943b303aa483910f32319c0e60f632..7fb24036f13d9c68f87edac38e432ee0f15f1de1 100644 (file)
@@ -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;
                        }
 
index c22c0863e48e991c98d2e5c042ec48edc69b1c4c..ac1de94e5894012de870cd2febbb595a9327406f 100644 (file)
@@ -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
                }
 
index fd1585a1787ca4a96c201fd9fab0707f4bf59034..44b2c436c3ad2cae1646ae58087de60610b44894 100644 (file)
@@ -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
                }
        }
index 252a74d5f75fecf893469a2475badf90399e3eaf..f95d09fb9e67365cb8cd3c6aa3d46cd723905917 100644 (file)
@@ -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();
index ac39fa3991dd3f74adff4e0c11b6340854ced500..9499f3434599319414fe0110338550682179b3a1 100644 (file)
@@ -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
                }
 
index fa77b731da03e1dfa478397204eaeb89b826734e..97471dd34d8c26ed7467424fed02541100e679c0 100644 (file)
@@ -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
                }
 
index 45ce0bc89def8b7bf3deff555818fb50b50f31da..dc05e52a34a0531841ec8c12b3aed1a78499873a 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('basicDataList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('basicDataList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>
index 5abdb2b272b59f5760eebebbe47ed18e19de7a17..bbcb089350411b84b77001e536664a6750cbc649 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('branchOfficeList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('branchOfficeList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>
index 9eb72bd3cff854172765616106c550adc9106370..f7c2d4ed73ee44b8e3cf7518d6e92d83d3d67350 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('contactList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('contactList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>
index db3550ac92ce0292aa065575bdec8a92e1456750..eb34ffc2ffbd4cbfddbbd8beafc6b0c29f341f5f 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('countryList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('countryList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>
index d3a51beea20219dabe6eef64d12859e0ffbe5c06..70dcbde4e40d59a5e2dbe7d9ea02ef18f212c517 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('departmentList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('departmentList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>
index 089a71f1b1127cfb934c8cbd3df4e78db83bae3f..32d08e856d333e0d6c78aaa9f3a88650110c1a32 100644 (file)
                                                        layout="grid"
                                                        styleClass="ui-noborder"
                                                        >
-                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
-                                                       <p:inputText id="globalFilter" onkeyup="PF('headquarterList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                                       <p:outputLabel
+                                                               for="globalFilter"
+                                                               value="#{msg.SEARCH_ALL_FIELDS}"
+                                                               style="float: right"
+                                                               />
+
+                                                       <p:inputText
+                                                               id="globalFilter"
+                                                               onkeyup="PF('departmentList').filter()"
+                                                               placeholder="#{msg.ENTER_KEYWORD}"
+                                                               />
                                                </p:panelGrid>
 
                                                <p:outputPanel>