]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
updated jar(s)
authorRoland Häder <roland@mxchange.org>
Wed, 16 Aug 2017 21:46:31 +0000 (23:46 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 17 Aug 2017 20:19:37 +0000 (22:19 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
lib/juser-core.jar
src/java/org/mxchange/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebApplicationBean.java

index 47124fbd731e4d580c450ed628e41034bfbce6da..a215338d6eb209b93504d153752fbbac917e5236 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index 897946154f7ea66407ac3d16e86c974c68daff58..7a38bce380699b53fff6da584af91832083675a3 100644 (file)
@@ -61,7 +61,6 @@ public class PizzaCheckoutWebSessionBean extends BasePizzaController implements
         */
        private static final long serialVersionUID = 51_987_348_347_183L;
 
-       ////////////////////// Bean injections ///////////////////////
        /**
         * Basket bean
         */
index f998d3dbafa011b61440bfd34a7f202baaf562e7..fc5f90192a33d5e98aa1d7bca419812daceffa43 100644 (file)
@@ -40,7 +40,7 @@ import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
 import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestHelperController;
 import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote;
-import org.mxchange.pizzaapplication.model.customer.PizzaCustomer;
+import org.mxchange.jcustomercore.model.customer.ContactCustomer;
 
 /**
  * Administrative customer bean (controller)
@@ -126,7 +126,7 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem
                String customerNumber = this.adminCustomerBean.createCustomerNumber();
 
                // Create new customer instance
-               Customer customer = new PizzaCustomer(CustomerAccountStatus.CONFIRMED, customerContact, customerNumber);
+               Customer customer = new ContactCustomer(CustomerAccountStatus.CONFIRMED, customerContact, customerNumber);
 
                // Init instance
                Customer updatedCustomer;
index e3ba84a07995561e0b8b84cb0fe430054a693e08..c64970857fb200fe8320bf70bcd5c5bc452185d7 100644 (file)
@@ -94,99 +94,10 @@ public class PizzaUserActivityWebApplicationBean extends BasePizzaController imp
         */
        @SuppressWarnings ("CollectionWithoutInitialCapacity")
        public PizzaUserActivityWebApplicationBean () {
-               // Try to get EJB instance
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.userActivityBean = (UserActivityLogSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userActivity!org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-
                // Init cache
                this.usersActivity = new LinkedHashMap<>();
        }
 
-       /**
-        * Adds user activity entry with given type
-        * <p>
-        * @param user User instance
-        * @param activityType Activity type
-        */
-       private void addUserActivity (final User user, final String activityType) {
-               // Better re-validate
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
-               } else if (null == activityType) {
-                       // Throw NPE again
-                       throw new NullPointerException("activityType is null"); //NOI18N
-               } else if (activityType.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("activityType is empty"); //NOI18N
-               }
-
-               // Create new activity object
-               LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName());
-
-               // Call bean to add it
-               this.userActivityBean.addUserActivityLog(userActivity);
-
-               // Add to cache, too
-               this.addUserActivityToCache(userActivity);
-       }
-
-       /**
-        * Adds user activity log with type and message
-        * <p>
-        * @param user User instance
-        * @param activityType Activity type
-        * @param message Activity message
-        */
-       private void addUserActivity (final User user, final String activityType, final String message) {
-               // Better re-validate
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
-               } else if (null == activityType) {
-                       // Throw NPE again
-                       throw new NullPointerException("activityType is null"); //NOI18N
-               } else if (activityType.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("activityType is empty"); //NOI18N
-               } else if (null == message) {
-                       // Throw NPE again
-                       throw new NullPointerException("message is null"); //NOI18N
-               } else if (message.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("message is empty"); //NOI18N
-               }
-
-               // Create new activity object
-               LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName());
-
-               // Call bean to add it
-               this.userActivityBean.addUserActivityLog(userActivity);
-
-               // Add to cache, too
-               this.addUserActivityToCache(userActivity);
-       }
-
        /**
         * Event observer for newly added users by administrator
         * <p>
@@ -640,6 +551,18 @@ public class PizzaUserActivityWebApplicationBean extends BasePizzaController imp
         */
        @PostConstruct
        public void init () {
+               // Try to get EJB instance
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.userActivityBean = (UserActivityLogSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userActivity!org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+
                // Get whole list
                List<LogableUserActivity> list = this.userActivityBean.fetchAllUserActivityLog();
 
@@ -659,6 +582,83 @@ public class PizzaUserActivityWebApplicationBean extends BasePizzaController imp
                }
        }
 
+       /**
+        * Adds user activity entry with given type
+        * <p>
+        * @param user         User instance
+        * @param activityType Activity type
+        */
+       private void addUserActivity (final User user, final String activityType) {
+               // Better re-validate
+               if (null == user) {
+                       // Throw NPE
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Throw again
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+               } else if (null == activityType) {
+                       // Throw NPE again
+                       throw new NullPointerException("activityType is null"); //NOI18N
+               } else if (activityType.isEmpty()) {
+                       // Is empty
+                       throw new IllegalArgumentException("activityType is empty"); //NOI18N
+               }
+
+               // Create new activity object
+               LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName());
+
+               // Call bean to add it
+               this.userActivityBean.addUserActivityLog(userActivity);
+
+               // Add to cache, too
+               this.addUserActivityToCache(userActivity);
+       }
+
+       /**
+        * Adds user activity log with type and message
+        * <p>
+        * @param user         User instance
+        * @param activityType Activity type
+        * @param message      Activity message
+        */
+       private void addUserActivity (final User user, final String activityType, final String message) {
+               // Better re-validate
+               if (null == user) {
+                       // Throw NPE
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Throw again
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+               } else if (null == activityType) {
+                       // Throw NPE again
+                       throw new NullPointerException("activityType is null"); //NOI18N
+               } else if (activityType.isEmpty()) {
+                       // Is empty
+                       throw new IllegalArgumentException("activityType is empty"); //NOI18N
+               } else if (null == message) {
+                       // Throw NPE again
+                       throw new NullPointerException("message is null"); //NOI18N
+               } else if (message.isEmpty()) {
+                       // Is empty
+                       throw new IllegalArgumentException("message is empty"); //NOI18N
+               }
+
+               // Create new activity object
+               LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName());
+
+               // Call bean to add it
+               this.userActivityBean.addUserActivityLog(userActivity);
+
+               // Add to cache, too
+               this.addUserActivityToCache(userActivity);
+       }
+
        /**
         * Adds given user activity instance to "cache" (local map)
         * <p>