]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 25 Aug 2016 15:54:15 +0000 (17:54 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 25 Aug 2016 18:53:15 +0000 (20:53 +0200)
- renamed helper interface and class according to naming convention
- added link in administrative user links including navigation rule
- added + implemented controller method allCurrentUsersActivityLog() which requires beanHeper.user being set

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java

index edc4f1b918c57c883cf3d88ce6a56d5c1237bc08..5e81e92423a42d0188662100ee1fb897f719d77a 100644 (file)
@@ -31,6 +31,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jusercore.events.confirmation.ConfirmedUserAccountEvent;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
@@ -39,7 +40,6 @@ import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * A web request bean for confirmation link handling
@@ -56,7 +56,7 @@ public class JobsConfirmationLinkWebRequestBean extends BaseJobsController imple
        private static final long serialVersionUID = 57_637_182_796_370L;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index 99cf6b91d02bd83fb0ec98708fb599478093f9e4..f5f168a94f6a491b8565bf6be4915de5852e6627 100644 (file)
@@ -45,13 +45,13 @@ import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * An administrative user controller (bean)
@@ -80,7 +80,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
        private AdminContactSessionBeanRemote adminContactBean;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index a6d5280480ee10674b5edc873545def801610d1a..e41685dc924f9aeb23f48461b80963480b84bfb2 100644 (file)
@@ -45,6 +45,7 @@ import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEv
 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
 import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
 import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
@@ -56,7 +57,6 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * An administrative contact phone controller (bean)
@@ -110,7 +110,7 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController impl
        private JobsAdminPhoneWebRequestController adminPhoneController;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index ece8bd7eef642ac8553cc4e1d1964fa2ceb1146e..cb25fef7269cd4b3b883705bd837149fae3ed13f 100644 (file)
@@ -34,12 +34,12 @@ import org.mxchange.jcontacts.events.landline.unlinked.AdminUnlinkedLandLineNumb
 import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * An administrative contact phone controller (bean)
@@ -56,7 +56,7 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement
        private static final long serialVersionUID = 542_145_347_916L;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index 024020b7bcd2cb6e2838d3f99770db9806d04da6..9342c2bb662fb1fb299d7a44e7d10b2313a7dc2d 100644 (file)
@@ -30,6 +30,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent;
 import org.mxchange.jphone.events.fax.removed.AdminFaxNumberRemovedFromListEvent;
@@ -53,7 +54,6 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * Administrative controller (bean) for phone numbers
@@ -80,7 +80,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
        private AdminPhoneSessionBeanRemote adminPhoneBean;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index a806e1a653837e6a1878fa0bcc290901ed0fef68..19e7b17a2bb3346371ff75a7b70110edca9a65e6 100644 (file)
@@ -34,6 +34,7 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jusercore.container.login.UserLoginContainer;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -60,7 +61,6 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 
 /**
  * A user controller (bean)
@@ -95,7 +95,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
        private final AdminUserSessionBeanRemote adminUserBean;
 
        /**
-        * Admin helper instance
+        * Bean helper
         */
        @Inject
        private JobsWebViewHelperController beanHelper;
index 6062b05676b6628f31d9f02a1cc5e48f42b14be9..722385d4c58abba0f0d30bf58cb8aae2b6ae7a65 100644 (file)
@@ -26,11 +26,13 @@ import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.event.Observes;
 import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
@@ -61,6 +63,12 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple
         */
        private static final long serialVersionUID = 192_586_376_717_856_904L;
 
+       /**
+        * Bean helper
+        */
+       @Inject
+       private JobsWebViewHelperController beanHelper;
+
        /**
         * EJB for user activity log
         */
@@ -383,6 +391,36 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple
                this.addUserActivity(event.getUpdatedUser(), "USER_UPDATED_PERSONAL_DATA"); //NOI18N
        }
 
+       @Override
+       public List<LogableUserActivity> allCurrentUsersActivityLog () {
+               // Get user
+               User user = this.beanHelper.getUser();
+
+               // beanHelper.user should be set and valid
+               if (null == user) {
+                       // Is not set
+                       throw new NullPointerException("this.beanHelper.user is null");
+               } else if (user.getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.beanHelper.user.userId is null");
+               } else if (user.getUserId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.user.userId={0} is not valid", user.getUserId()));
+               }
+
+               // Init list
+               List<LogableUserActivity> list = new LinkedList<>();
+
+               // Is the user set?
+               if (this.usersActivity.containsKey(user)) {
+                       // Return it
+                       list.addAll(this.usersActivity.get(user));
+               }
+
+               // Return it
+               return list;
+       }
+
        /**
         * Post-constructor method
         */