]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 22 Jan 2023 05:51:00 +0000 (06:51 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Jan 2023 05:55:50 +0000 (06:55 +0100)
- jcoree.jar has changed, so showFacesException() is now the new name as this
  method shows a message from a thrown exception

src/java/org/mxchange/jfinancials/beans/contact/mobile/FinancialsAdminContactMobileWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java

diff --git a/src/java/org/mxchange/jfinancials/beans/contact/mobile/FinancialsAdminContactMobileWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/contact/mobile/FinancialsAdminContactMobileWebRequestBean.java
new file mode 100644 (file)
index 0000000..67c1a08
--- /dev/null
@@ -0,0 +1,551 @@
+/*
+ * Copyright (C) 2016 - 2022 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.contact.mobile;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import javax.ejb.EJB;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.faces.application.FacesMessage;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableUpdatedContactEvent;
+import org.mxchange.jcontacts.events.mobile.linked.AdminLinkedMobileNumberEvent;
+import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
+import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent;
+import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.mobile.AdminContactsMobileSessionBeanRemote;
+import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
+import org.mxchange.jphone.exceptions.mobile.MobileNumberAlreadyLinkedException;
+import org.mxchange.jphone.exceptions.mobile.MobileNumberNotLinkedException;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
+
+/**
+ * An administrative contact mobile controller (bean)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminContactMobileController")
+@RequestScoped
+public class FinancialsAdminContactMobileWebRequestBean extends BaseFinancialsBean implements FinancialsAdminContactMobileWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 542_145_347_919L;
+
+       /**
+        * Administrative EJB for phone number
+        */
+       @EJB (lookup = "java:global/jfinancials-ejb/adminContactMobile!org.mxchange.jcontacts.model.mobile.AdminContactsMobileSessionBeanRemote")
+       private AdminContactsMobileSessionBeanRemote adminContactMobileBean;
+
+       /**
+        * Event being fired when a mobile number has been linked
+        */
+       @Inject
+       @Any
+       private Event<ObservableAdminLinkedMobileNumberEvent> adminLinkedMobileNumberEvent;
+
+       /**
+        * Contact instance
+        */
+       private Contact contact;
+
+       /**
+        * When mobile number has been created
+        */
+       private Date mobileEntryCreated;
+
+       /**
+        * When mobile number has been updated
+        */
+       private Date mobileEntryUpdated;
+
+       /**
+        * Phone id (primary key)
+        */
+       private Long mobileId;
+
+       /**
+        * Mobile number
+        */
+       private Long mobileNumber;
+
+       /**
+        * Event being fired when administrator unlinks mobile from contact
+        */
+       @Inject
+       @Any
+       private Event<ObservableAdminUnlinkedMobileNumberEvent> mobileNumberUnlinkedEvent;
+
+       /**
+        * Mobile provider
+        */
+       private MobileProvider mobileProvider;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsAdminContactMobileWebRequestBean () {
+               // Call super constructor
+               super();
+
+               // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[3].getClassName(), Thread.currentThread().getStackTrace()[3].getMethodName());
+               // System.out.println(MessageFormat.format("{0}: Constructed, caller: {1}", this.getClass().getSimpleName(), caller));
+       }
+
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) {
+               // The event must be valid
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedContact() == null) {
+                       // Throw again ...
+                       throw new NullPointerException("event.addedContact is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() == null) {
+                       // ... and again
+                       throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N
+               }
+
+               // Clear this bean
+               this.clear();
+       }
+
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.addedUser is null"); //NOI18N
+               } else if (event.getAddedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
+               } else if (event.getAddedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
+               }
+
+               // Clear all data
+               this.clear();
+       }
+
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
+       public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUpdatedContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
+               }
+
+               // Clear all data
+               this.clear();
+       }
+
+       /**
+        * Observer for events being fired when a bean helper has successfully
+        * created a contact instance.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterCreatedContactEvent (@Observes final ObservableCreatedContactEvent event) {
+               // Log message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
+
+               // The event instance must be valid
+               if (null == event) {
+                       // Throw NPE again
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getCreatedContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdContact is null"); //NOI18N
+               } else if (event.getCreatedContact().getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
+               } else if (event.getCreatedContact().getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
+               }
+
+               // Set it here
+               this.setContact(event.getCreatedContact());
+       }
+
+       /**
+        * Observes events being fired when a bean helper has successfully created a
+        * mobile number instance.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterCreatedMobileNumberEvent (@Observes final ObservableCreatedMobileNumberEvent event) {
+               // The event instance must be valid
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.mobileNumber is null"); //NOI18N
+               } else if (event.getMobileNumber().getMobileId() == null) {
+                       // Throw NPE yet again
+                       throw new NullPointerException("event.mobileNumber.mobileId is null"); //NOI18N
+               } else if (event.getMobileNumber().getMobileId() < 1) {
+                       // Throw NPE yet again
+                       throw new NullPointerException(MessageFormat.format("event.mobileNumber.mobileId={0} is invalid", event.getMobileNumber().getMobileId())); //NOI18N
+               }
+
+               // Get fax number from event
+               final DialableMobileNumber number = event.getMobileNumber();
+
+               // Copy all data to this bean
+               this.setMobileId(number.getMobileId());
+               this.setMobileProvider(number.getMobileProvider());
+               this.setMobileNumber(number.getMobileNumber());
+               this.setMobileEntryCreated(number.getMobileEntryCreated());
+               this.setMobileEntryUpdated(number.getMobileEntryUpdated());
+       }
+
+       /**
+        * Event observer for updated contact data by the user
+        * <p>
+        * @param event Updated contact data event
+        */
+       public void afterUpdatedContactDataEvent (@Observes final ObservableUpdatedContactEvent event) {
+               // Event and contained entity instance should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUpdatedContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
+               } else if (event.getUpdatedContact().getContactId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
+               }
+
+               // Clear all data
+               this.clear();
+       }
+
+       /**
+        * Links mobile number to contact from bean helper as "main mobile number".
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doLinkMainMobileNumber () {
+               // Get contact from helper
+               final Contact targetContact = this.getContact();
+
+               // Is all data properly set?
+               if (null == targetContact) {
+                       // Throw NPE
+                       throw new NullPointerException("targetContact is null"); //NOI18N
+               } else if (targetContact.getContactId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("targetContact.contactId is null"); //NOI18N
+               } else if (targetContact.getContactId() < 1) {
+                       // Is not valid
+                       throw new IllegalArgumentException(MessageFormat.format("targetContact.contactId={0} is not valid", targetContact.getContactId())); //NOI18N
+               } else if (this.getMobileProvider() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.mobileProvider is null"); //NOI18N
+               } else if (this.getMobileProvider().getProviderId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.mobileProvider.providerId is null"); //NOI18N
+               } else if (this.getMobileProvider().getProviderId() < 1) {
+                       // Throw NPE
+                       throw new NullPointerException(MessageFormat.format("this.mobileProvider.providerId={0} is invalid", this.getMobileProvider().getProviderId())); //NOI18N
+               } else if (this.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.mobileNumber is null"); //NOI18N
+               } else if (this.getMobileNumber() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber={0} is invalid", this.getMobileNumber())); //NOI18N
+               }
+
+               // Init instance
+               final Contact updatedContact;
+               final DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+
+               // Try it again
+               try {
+                       // Link it, too
+                       updatedContact = this.adminContactMobileBean.linkNewMobileNumberWithContact(targetContact, number);
+               } catch (final MobileNumberAlreadyLinkedException | ContactNotFoundException ex) {
+                       // Throw again as cause
+                       this.showFacesException("form_add_contact_mobile:mobileNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
+                       return ""; //NOI18N
+               }
+
+               // Fire event
+               this.adminLinkedMobileNumberEvent.fire(new AdminLinkedMobileNumberEvent(updatedContact, number));
+
+               // Return to contact profile
+               return "admin_show_contact"; //NOI18N
+       }
+
+       /**
+        * Getter for contact instance
+        * <p>
+        * @return Contact instance
+        */
+       public Contact getContact () {
+               return this.contact;
+       }
+
+       /**
+        * Setter for contact instance
+        * <p>
+        * @param contact Contact instance
+        */
+       public void setContact (final Contact contact) {
+               this.contact = contact;
+       }
+
+       /**
+        * Setter for phone id
+        * <p>
+        * @return Phone id
+        */
+       public Long getMobileId () {
+               return this.mobileId;
+       }
+
+       /**
+        * Getter for phone id
+        * <p>
+        * @param mobileId Phone id
+        */
+       public void setMobileId (final Long mobileId) {
+               this.mobileId = mobileId;
+       }
+
+       /**
+        * Getter for mobile number
+        * <p>
+        * @return Mobile number
+        */
+       public Long getMobileNumber () {
+               return this.mobileNumber;
+       }
+
+       /**
+        * Setter for mobile number
+        * <p>
+        * @param mobileNumber Mobile number
+        */
+       public void setMobileNumber (final Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
+       }
+
+       /**
+        * Getter for mobile provider
+        * <p>
+        * @return Mobile provider
+        */
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
+       }
+
+       /**
+        * Setter for mobile provider
+        * <p>
+        * @param mobileProvider Mobile provider
+        */
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
+       }
+
+       /**
+        * Unlinks mobile data with current contact
+        * <p>
+        * @return Redirect outcome
+        */
+       public String unlinkMobileContactData () {
+               // Create fax number instance
+               final DialableMobileNumber number = this.createMobileNumber();
+
+               // Is all data set
+               if (number == null) {
+                       // Not set, throw NPE
+                       throw new NullPointerException("number is null"); //NOI18N
+               } else if (number.getMobileId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("number.phoneId is null"); //NOI18N
+               } else if (number.getMobileId() < 1) {
+                       // Invalid number
+                       throw new IllegalArgumentException(MessageFormat.format("number.phoneId={0} is not valid", number.getMobileId())); //NOI18N
+               } else if (number.getMobileProvider() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("number.mobileProvider is null"); //NOI18N
+               } else if (number.getMobileProvider().getProviderId() == null) {
+                       // ... throw again
+                       throw new NullPointerException("number.mobileProvider.providerId is null"); //NOI18N
+               } else if (number.getMobileProvider().getProviderId() < 1) {
+                       // Id not valid
+                       throw new IllegalArgumentException(MessageFormat.format("number.mobileProvider.providerId={0} is not valid.", number.getMobileProvider().getProviderId())); //NOI18N
+               } else if (number.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("number.phoneNumber is null"); //NOI18N
+               } else if (number.getMobileNumber() < 1) {
+                       // Throw it again ...
+                       throw new NullPointerException(MessageFormat.format("number.phoneNumber={0} is not valid.", number.getMobileNumber())); //NOI18N
+               } else if (this.getContact() == null) {
+                       // ... and throw again
+                       throw new NullPointerException("this.contact is null"); //NOI18N
+               } else if (this.getContact().getContactId() == null) {
+                       // ... and again ...
+                       throw new NullPointerException("this.contact.contactId is null"); //NOI18N
+               } else if (this.getContact().getContactId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.contact.contactId={0} is invalid.", this.getContact().getContactId())); //NOI18N
+               }
+
+               // Init contact instance
+               final Contact updatedContact;
+
+               try {
+                       // Unlink it and return contact without mobile instance
+                       updatedContact = this.adminContactMobileBean.unlinkMobileDataFromContact(this.getContact(), number);
+               } catch (final MobileNumberNotLinkedException | ContactNotFoundException ex) {
+                       // Did not work
+                       this.showFacesException("form_unlink_contact_mobile:mobileNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
+                       return ""; //NOI18N
+               }
+
+               // Fire event
+               this.mobileNumberUnlinkedEvent.fire(new AdminUnlinkedMobileNumberEvent(updatedContact, number));
+
+               // All fine here
+               return "admin_show_contact"; //NOI18N
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+       }
+
+       /**
+        * Returns an instance of a DialableMobileNumber from all fields stored in
+        * this bean.
+        * <p>
+        * @return An instance of a DialableMobileNumber class
+        */
+       private DialableMobileNumber createMobileNumber () {
+               // Initialize it
+               final DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+
+               // Add all other data
+               number.setMobileEntryCreated(this.getMobileEntryCreated());
+               number.setMobileEntryUpdated(this.getMobileEntryUpdated());
+
+               // Is id number set?
+               if (this.getMobileId() instanceof Long) {
+                       // Set it
+                       number.setMobileId(this.getMobileId());
+               }
+
+               // Return it
+               return number;
+       }
+
+       /**
+        * Getter for mobile entry created
+        * <p>
+        * @return Mobile entry created
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       private Date getMobileEntryCreated () {
+               return this.mobileEntryCreated;
+       }
+
+       /**
+        * Setter for mobile entry created
+        * <p>
+        * @param mobileEntryCreated Mobile entry created
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       private void setMobileEntryCreated (final Date mobileEntryCreated) {
+               this.mobileEntryCreated = mobileEntryCreated;
+       }
+
+       /**
+        * Getter for mobile entry updated
+        * <p>
+        * @return Mobile entry updated
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       private Date getMobileEntryUpdated () {
+               return this.mobileEntryUpdated;
+       }
+
+       /**
+        * Setter for mobile entry updated
+        * <p>
+        * @param mobileEntryUpdated Mobile entry updated
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       private void setMobileEntryUpdated (final Date mobileEntryUpdated) {
+               this.mobileEntryUpdated = mobileEntryUpdated;
+       }
+
+}
index b35b453ecbc3547f3404fe34dec5149145bd9007..e1e8fdf76edb15d3598150406ee5d55712821587 100644 (file)
@@ -541,7 +541,7 @@ public class PizzaContactWebRequestBean extends BasePizzaBean implements PizzaCo
                        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.showFacesException("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()), FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }
 
index 79dbe719e1048f08ad489d58e422ebee2c547397..39fe6fe0c26fddd7fb87c66f2279338a205cd4d0 100644 (file)
@@ -103,12 +103,6 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaBean implemen
        @Any
        private Event<ObservableAdminLinkedMobileNumberEvent> adminLinkedMobileNumberEvent;
 
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private PizzaAdminPhoneWebRequestController adminPhoneController;
-
        /**
         * Contact instance
         */
@@ -459,7 +453,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaBean implemen
                        updatedContact = this.adminContactPhoneBean.linkNewFaxNumberWithContact(targetContact, number);
                } catch (final PhoneNumberAlreadyLinkedException ex) {
                        // Throw again as cause
-                       this.showFacesMessage("form_add_contact_fax:faxNumber", ex); //NOI18N
+                       this.showFacesException("form_add_contact_fax:faxNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -523,7 +517,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaBean implemen
                        updatedContact = this.adminContactPhoneBean.linkNewLandLineNumberWithContact(targetContact, number);
                } catch (final PhoneNumberAlreadyLinkedException ex) {
                        // Throw again as cause
-                       this.showFacesMessage("form_add_contact_landLine:landLineNumber", ex); //NOI18N
+                       this.showFacesException("form_add_contact_landLine:landLineNumber", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -815,7 +809,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaBean implemen
                        updatedContact = this.adminContactPhoneBean.unlinkFaxDataFromContact(this.getContact(), number);
                } catch (final PhoneNumberNotLinkedException ex) {
                        // Did not work
-                       this.showFacesMessage("form_unlink_contact_fax:faxNumberId", ex); //NOI18N
+                       this.showFacesException("form_unlink_contact_fax:faxNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -870,7 +864,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaBean implemen
                        updatedContact = this.adminContactPhoneBean.unlinkLandLineDataFromContact(this.getContact(), number);
                } catch (final PhoneNumberNotLinkedException ex) {
                        // Did not work
-                       this.showFacesMessage("form_unlink_contact_landLine:landLineNumberId", ex); //NOI18N
+                       this.showFacesException("form_unlink_contact_landLine:landLineNumberId", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }
 
index 8734037b008765ce1015fc008a6ecf8bc56b8e49..15647ba35ac2b763a507d855f51731f319f07bad 100644 (file)
@@ -112,8 +112,8 @@ public class PizzaAdminMobileProviderWebRequestBean extends BasePizzaBean implem
                // 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.showFacesException("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider), FacesMessage.SEVERITY_WARN); //NOI18N
+                       return;
                }
 
                // Init variable
index 0eb78e95e649985a23200defdfe1171d39714d43..6d166fa2cdb1cabbb41641350970b355dd59b76f 100644 (file)
@@ -119,7 +119,7 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaBean implements Piz
                        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.showFacesException("form_login_user_change_email_address:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()), FacesMessage.SEVERITY_WARN); //NOI18N
                        return ""; //NOI18N
                }
 
index 7c9f85f0315519e0b2e443f5ac2b4e9eb02b32aa..b420f3cee6b3e8d12ea45e66c3f699e0e07bf420 100644 (file)
@@ -179,7 +179,7 @@ public class PizzaResendLinkWebRequestBean extends BasePizzaBean implements Pizz
                        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.showFacesException("form_resend_link:resendEmailAddress", ex, FacesMessage.SEVERITY_ERROR); //NOI18N
                        return ""; //NOI18N
                }