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;
// 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;
}
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;
}
// 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;
}
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;
// 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;
}
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;
}
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;
// 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;
}
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;
}
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;
// 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;
}
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;
}
// 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;
}
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;
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
}
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;
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
}
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
}
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
}
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
}
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
}
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
}
*/
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;
// 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
// 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;
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;
// 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
// 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
// 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
// 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
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;
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);
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
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;
}
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;
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
}
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
}
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;
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
}
}
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;
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();
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();
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();
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();
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;
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())) {
} 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()) {
} 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()) {
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?
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
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
}
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;
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
}
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
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
}
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>
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>
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>
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>
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>
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>