]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
added clear() methods to clear beans
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 13:24:02 +0000 (15:24 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 20:22:31 +0000 (22:22 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java

index 43079c27f5fff7abde0784c9a782f181a80c6d75..bbbc007a48f38336132a9029e77473aa4348da82 100644 (file)
@@ -671,6 +671,37 @@ public class PizzaAdminContactWebRequestBean implements PizzaAdminContactWebRequ
        public void init () {
        }
 
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+               // - personal data
+               this.setGender(Gender.UNKNOWN);
+               this.setFirstName(null);
+               this.setFamilyName(null);
+               this.setStreet(null);
+               this.setHouseNumber(null);
+               this.setZipCode(null);
+               this.setCity(null);
+               this.setCountry(null);
+
+               // - contact data
+               this.setEmailAddress(null);
+               this.setPhoneCountry(null);
+               this.setPhoneAreaCode(null);
+               this.setPhoneNumber(null);
+               this.setCellphoneCarrier(null);
+               this.setCellphoneNumber(null);
+               this.setFaxCountry(null);
+               this.setFaxAreaCode(null);
+               this.setFaxNumber(null);
+
+               // - other data
+               this.setBirthday(null);
+               this.setComment(null);
+       }
+
        /**
         * Updates all data in contact instance.
         * <p>
index 591b52f209da8b0ed2993c52887360f8a54ddb6e..28a37f4c180fd09235f446c9f1b42a40b3a7cadd 100644 (file)
@@ -353,7 +353,6 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl
 
                // Debug message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactWebBean:afterRegistration: registeredContact={0}", registeredContact)); //NOI18N
-
                // Copy all data from registered->user
                this.copyContact(registeredContact);
 
@@ -399,34 +398,6 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl
                return this.contactList;
        }
 
-       /**
-        * Clears this bean
-        */
-       @Override
-       public void clear () {
-               // Clear all data
-               // - personal data
-               this.setGender(Gender.UNKNOWN);
-               this.setFirstName(null);
-               this.setFamilyName(null);
-               this.setStreet(null);
-               this.setHouseNumber(null);
-               this.setZipCode(null);
-               this.setCity(null);
-               this.setCountry(null);
-
-               // - contact data
-               this.setEmailAddress(null);
-               this.setEmailAddressRepeat(null);
-               this.setPhoneAreaCode(null);
-               this.setCellphoneCarrier(null);
-               this.setFaxAreaCode(null);
-
-               // - other data
-               this.setBirthday(null);
-               this.setComment(null);
-       }
-
        @Override
        public Contact createContactInstance () {
                // Required personal data must be set
@@ -874,6 +845,38 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl
                this.emailAddressList.add(contact.getContactEmailAddress());
        }
 
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+               // - personal data
+               this.setGender(Gender.UNKNOWN);
+               this.setFirstName(null);
+               this.setFamilyName(null);
+               this.setStreet(null);
+               this.setHouseNumber(null);
+               this.setZipCode(null);
+               this.setCity(null);
+               this.setCountry(null);
+
+               // - contact data
+               this.setEmailAddress(null);
+               this.setEmailAddressRepeat(null);
+               this.setPhoneCountry(null);
+               this.setPhoneAreaCode(null);
+               this.setPhoneNumber(null);
+               this.setCellphoneCarrier(null);
+               this.setCellphoneNumber(null);
+               this.setFaxCountry(null);
+               this.setFaxAreaCode(null);
+               this.setFaxNumber(null);
+
+               // - other data
+               this.setBirthday(null);
+               this.setComment(null);
+       }
+
        /**
         * Copies given contact into the controller
         * <p>
index 381330ef2638770697f7dc67a1c77ecc6cb190ed..18a12e6625f32da4872f29944669c5b4a470fbbf 100644 (file)
@@ -75,11 +75,6 @@ public interface PizzaContactWebSessionController extends Serializable {
         */
        Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
 
-       /**
-        * Clears this controller
-        */
-       void clear ();
-
        /**
         * Event observer for new user registrations
         * <p>
index 014bcbe6de59c883c22372348a07fb368b174486..10ce8b88f66f944104605578bc4da908b3fe9197 100644 (file)
@@ -147,6 +147,9 @@ public class PizzaAdminCountryWebRequestBean implements PizzaAdminCountryWebRequ
                // Fire event
                this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
 
+               // Clear this bean
+               this.clear();
+
                // Redirect to list
                return "admin_list_country"; //NOI18N
        }
@@ -222,6 +225,19 @@ public class PizzaAdminCountryWebRequestBean implements PizzaAdminCountryWebRequ
                return (!this.allCountries().isEmpty());
        }
 
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all fields
+               this.setCountryAbroadDialPrefix(null);
+               this.setCountryCode(null);
+               this.setCountryExternalDialPrefix(null);
+               this.setCountryI18nKey(null);
+               this.setCountryIsLocalPrefixRequired(Boolean.FALSE);
+               this.setCountryPhoneCode(null);
+       }
+
        /**
         * Checks if given country is already added by iterating over the whole list
         * and try to find it.
index 79c3f00ab5e6bf60dd7f1ea6cb11e3a18e4d849a..78c3da760ce5e0440f45874c0223c0e2f0398785 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.pizzaapplication.beans.login;
 
+import de.chotime.jratecalc.beans.user.RateCalcUserWebSessionController;
 import java.util.Objects;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
@@ -206,16 +207,11 @@ public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionCon
 
        @Override
        public boolean isUserLoggedIn () {
-               // Trace message
-               // NOISY: System.out.println(MessageFormat.format("PizzaUserLoginWebSessionBean:isUserLoggedIn: this.loggedInUser={0},this.templateType={1} - CALLED!", this.getLoggedInUser(), this.getTemplateType()));
-
                // Compare instance
                this.userLoggedIn = ((this.getLoggedInUser() instanceof User) && (Objects.equals(this.getLoggedInUser().getUserAccountStatus(), UserAccountStatus.CONFIRMED)));
 
-               // Trace message
-               // NOISY: System.out.println(MessageFormat.format("PizzaUserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn));
-
                // Return it
                return this.userLoggedIn;
        }
+
 }
index a43f0631d562d42da9e31705034a62ccc6f9433b..056de736e5ba39d797e8d81f222f4a6f5c50f571 100644 (file)
@@ -191,7 +191,7 @@ public class PizzaAdminMobileProviderWebRequestBean implements PizzaAdminMobileP
         * Clears this bean
         */
        private void clear () {
-               // Set all vaues to null
+               // Clear all fields
                this.setProviderCountry(null);
                this.setProviderDialPrefix(null);
                this.setProviderMailPattern(null);
index 4cde05e99274fa0656f20c37f9199f8004aca342..12ab8240a5367ba2a2c473953fac1050b01da725 100644 (file)
@@ -157,4 +157,15 @@ public class PizzaAdminContactPhoneWebRequestBean implements PizzaAdminContactPh
                this.landLine = landLine;
        }
 
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all fields
+               this.setCellPhone(null);
+               this.setContact(null);
+               this.setFax(null);
+               this.setLandLine(null);
+       }
+
 }
index e1d40d3274d01f19fa11de12313f29380554c67f..556b9277f806f939a5ac6aa55d3feee69607de6c 100644 (file)
@@ -248,6 +248,9 @@ public class PizzaAdminUserWebRequestBean implements PizzaAdminUserWebRequestCon
                // Fire event
                this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser));
 
+               // Clear this bean
+               this.clear();
+
                // Return to user list (for now)
                return "admin_list_user"; //NOI18N
        }
@@ -356,6 +359,16 @@ public class PizzaAdminUserWebRequestBean implements PizzaAdminUserWebRequestCon
        public void init () {
        }
 
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all fields
+               this.setUserName(null);
+               this.setUserPassword(null);
+               this.setUserPasswordRepeat(null);
+       }
+
        /**
         * Checks if same password is entered and that they are not empty.
         * <p>