]> git.mxchange.org Git - jjobs-war.git/commitdiff
Rewrites:
authorRoland Häder <roland@mxchange.org>
Tue, 3 May 2016 15:25:29 +0000 (17:25 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 6 May 2016 20:44:59 +0000 (22:44 +0200)
- moved a lot unrelated user-only methods to proper admin controller

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/profile/JobsUserProfileWebRequestBean.java
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java
web/admin/user/admin_user_delete.xhtml
web/admin/user/admin_user_list.xhtml
web/admin/user/admin_user_show.xhtml
web/admin/user/admin_user_unlock.xhtml

index 84c9cf6b2127c5e634a253453da8d6682be19bbf..735273050747ca2b50d13f59b644f10076c2c325 100644 (file)
@@ -22,6 +22,7 @@ import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
+import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
@@ -41,6 +42,12 @@ public class JobsUserProfileWebRequestBean implements JobsUserProfileWebRequestC
         */
        private static final long serialVersionUID = 187_687_145_286_710L;
 
+       /**
+        * Administrative user controller
+        */
+       @Inject
+       private JobsAdminUserWebRequestController adminUserController;
+
        /**
         * User controller
         */
@@ -60,7 +67,7 @@ public class JobsUserProfileWebRequestBean implements JobsUserProfileWebRequestC
 
                try {
                        // Try to get it
-                       u = this.userController.lookupUserById(userId);
+                       u = this.adminUserController.lookupUserById(userId);
                } catch (final UserNotFoundException ex) {
                        // Throw again
                        throw new FaceletException(ex);
index dca9fc6c8f9874561df394720e2d42c3e60fa4b4..8a8d9dbefd16ec5cdfc1d580d58cfdc5de90971f 100644 (file)
@@ -27,6 +27,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jusercore.events.registration.RegisteredUserEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
@@ -52,6 +53,12 @@ public class JobsUserRegisterWebSessionBean implements JobsUserRegisterWebSessio
         */
        private static final long serialVersionUID = 47_828_986_719_691_592L;
 
+       /**
+        * User controller
+        */
+       @Inject
+       private JobsAdminUserWebRequestController adminUserController;
+
        /**
         * User controller
         */
@@ -104,7 +111,7 @@ public class JobsUserRegisterWebSessionBean implements JobsUserRegisterWebSessio
                } else if (!this.userController.isRequiredPersonalDataSet()) {
                        // Not all required fields are set
                        throw new FaceletException("Not all required fields are set."); //NOI18N
-               } else if (this.userController.isUserNameRegistered(user)) {
+               } else if (this.adminUserController.isUserNameRegistered(user)) {
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
index ae35f28657085618bc509d691e68901bcd95f3f1..0517694c9888c4a972d773214941d615102c890a 100644 (file)
@@ -35,7 +35,10 @@ import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
 import org.mxchange.jjobs.beans.helper.JobsAdminWebRequestController;
+import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
 import org.mxchange.jusercore.container.login.UserLoginContainer;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
+import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.AdminUserAddedEvent;
 import org.mxchange.jusercore.events.user.update.AdminUpdatedUserDataEvent;
@@ -85,6 +88,11 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
        @Inject
        private JobsContactWebSessionController contactController;
 
+       /**
+        * A list of all selectable contacts
+        */
+       private List<Contact> selectableContacts;
+
        /**
         * An event fired when the administrator has updated a new user
         */
@@ -108,11 +116,22 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
         */
        private List<User> userList;
 
+       /**
+        * Login bean (controller)
+        */
+       @Inject
+       private JobsUserLoginWebSessionController userLoginController;
+
        /**
         * User name
         */
        private String userName;
 
+       /**
+        * User name list
+        */
+       private List<String> userNameList;
+
        /**
         * User password (unencrypted from web form)
         */
@@ -123,6 +142,11 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
         */
        private String userPasswordRepeat;
 
+       /**
+        * A list of all public user profiles
+        */
+       private List<User> visibleUserList;
+
        /**
         * Default constructor
         */
@@ -203,7 +227,7 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
 
                // Is the user name or email address used already?
                // @TODO Add password length check
-               if (this.userController.isUserNameRegistered(user)) {
+               if (this.isUserNameRegistered(user)) {
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                } else if ((this.adminHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) {
@@ -257,6 +281,77 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
                return "admin_list_user"; //NOI18N
        }
 
+       @Override
+       public void afterRegistrationEvent (@Observes final UserRegisteredEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterRegistration: event={0} - CALLED!", event)); //NOI18N
+
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getRegisteredUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.user is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.user.userId is null"); //NOI18N
+               } else if (event.getRegisteredUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N
+               }
+
+               // Get user instance
+               User registeredUser = event.getRegisteredUser();
+
+               // Debug message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N
+               // Add user name
+               this.addUserName(registeredUser);
+
+               // Clear all data
+               this.clear();
+
+               // Add user to local list
+               this.userList.add(registeredUser);
+
+               // Is the account public?
+               if (Objects.equals(registeredUser.getUserProfileMode(), ProfileMode.PUBLIC)) {
+                       // Also add it to this list
+                       this.visibleUserList.add(registeredUser);
+               }
+
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N
+       }
+
+       @Override
+       public void afterUserLogin (final @Observes UserLoggedInEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N
+
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getLoggedInUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.user is null"); //NOI18N
+               } else if (event.getLoggedInUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.user.userId is null"); //NOI18N
+               } else if (event.getLoggedInUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
+               }
+
+               // Re-initialize list
+               this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
+
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
+       }
+
        @Override
        public void afterUserUpdatedPersonalData (@Observes final UpdatedUserPersonalDataEvent event) {
                // Check parameter
@@ -284,6 +379,12 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
                return Collections.unmodifiableList(this.userList);
        }
 
+       @Override
+       public List<User> allVisibleUsers () {
+               // Return it
+               return Collections.unmodifiableList(this.visibleUserList);
+       }
+
        @Override
        public String editUserData () {
                // Get user instance
@@ -393,6 +494,52 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
        public void init () {
                // Initialize user list
                this.userList = this.userBean.allUsers();
+
+               // Get full user name list for reducing EJB calls
+               this.userNameList = this.userBean.getUserNameList();
+
+               // Is the user logged-in?
+               if (this.userLoginController.isUserLoggedIn()) {
+                       // Is logged-in, so load also users visible to memebers
+                       this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
+               } else {
+                       // Initialize user list
+                       this.visibleUserList = this.userBean.allPublicUsers();
+               }
+
+               // Get all users
+               List<User> allUsers = this.allUsers();
+
+               // Get all contacts
+               List<Contact> allContacts = this.contactController.allContacts();
+
+               // Get iterator
+               Iterator<Contact> iterator = allContacts.iterator();
+
+               // Loop through it
+               while (iterator.hasNext()) {
+                       // Get next element
+                       Contact next = iterator.next();
+
+                       // Get iterator
+                       Iterator<User> userIterator = allUsers.iterator();
+
+                       // Loop through all users
+                       while (userIterator.hasNext()) {
+                               // Get user instance
+                               User nextUser = userIterator.next();
+
+                               // Is contact same?
+                               if (Objects.equals(next, nextUser.getUserContact())) {
+                                       // Found same
+                                       iterator.remove();
+                                       break;
+                               }
+                       }
+               }
+
+               // Set contact list
+               this.selectableContacts = allContacts;
        }
 
        @Override
@@ -432,6 +579,16 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
                return isFound;
        }
 
+       @Override
+       public boolean isUserNameRegistered (final User user) {
+               return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
+       }
+
+       @Override
+       public boolean isVisibleUserFound () {
+               return ((this.visibleUserList instanceof List) && (this.visibleUserList.size() > 0));
+       }
+
        @Override
        public User lookupUserById (final Long userId) throws UserNotFoundException {
                // Parameter must be valid
@@ -469,6 +626,42 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr
                return user;
        }
 
+       @Override
+       public List<Contact> selectableContacts () {
+               return Collections.unmodifiableList(this.selectableContacts);
+       }
+
+       /**
+        * Adds user's name to bean's internal list. It also updates the public user
+        * list if the user has decided to have a public account,
+        * <p>
+        * @param user User instance
+        */
+       private void addUserName (final User user) {
+               // Make sure the entry is not added yet
+               if (this.userNameList.contains(user.getUserName())) {
+                       // Abort here
+                       throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N
+               } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
+                       // Already added
+                       throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N
+               }
+
+               // Add user name
+               this.userNameList.add(user.getUserName());
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+               // - other data
+               this.setUserName(null);
+               this.setUserPassword(null);
+               this.setUserPasswordRepeat(null);
+       }
+
        /**
         * Checks if same password is entered and that they are not empty.
         * <p>
index fe084f60dea0ec69149c9838620afd81a2868747..928235011647053334baa215b7ffae23c05c9f6e 100644 (file)
@@ -19,6 +19,8 @@ package org.mxchange.jjobs.beans.user;
 import java.io.Serializable;
 import java.util.List;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jusercore.events.login.UserLoggedInEvent;
+import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
@@ -30,6 +32,20 @@ import org.mxchange.jusercore.model.user.User;
  */
 public interface JobsAdminUserWebRequestController extends Serializable {
 
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event User registration event
+        */
+       void afterRegistrationEvent (final UserRegisteredEvent event);
+
+       /**
+        * Event observer for logged-in user
+        * <p>
+        * @param event Event instance
+        */
+       void afterUserLogin (final UserLoggedInEvent event);
+
        /**
         * Listens to fired event when user updated personal data
         * <p>
@@ -46,6 +62,23 @@ public interface JobsAdminUserWebRequestController extends Serializable {
         */
        boolean isContactFound (final Contact contact);
 
+       /**
+        * Checks whether a public user account is registered. This means that at
+        * least one user profile has its flag "public user profile" enabled.
+        * <p>
+        * @return Whether at least one user has a public profile
+        */
+       boolean isVisibleUserFound ();
+
+       /**
+        * Checks whether given user instance's name is used
+        * <p>
+        * @param user User instance's name to check
+        * <p>
+        * @return Whether it is already used
+        */
+       boolean isUserNameRegistered (final User user);
+
        /**
         * Tries to lookup user by given id number. If the user is not found or the
         * account status is not CONFIRMED proper exceptions are thrown.
@@ -65,6 +98,13 @@ public interface JobsAdminUserWebRequestController extends Serializable {
         */
        List<User> allUsers ();
 
+       /**
+        * All public user profiles
+        * <p>
+        * @return A list of all public user profiles
+        */
+       List<User> allVisibleUsers ();
+
        /**
         * Checks whether users are registered
         * <p>
@@ -130,4 +170,12 @@ public interface JobsAdminUserWebRequestController extends Serializable {
         */
        void setUserPasswordRepeat (final String userPasswordRepeat);
 
+       /**
+        * Returns a list of all selectable contacts for user creation. Contacts
+        * from already existing users are excluded in this list.
+        * <p>
+        * @return A list of all selectable contacts
+        */
+       List<Contact> selectableContacts ();
+
 }
index fdfb13807fee89c64c9c837c0d35fe69789fabfa..eafd48d3989bb658f2b4477c52ba79e180a68457 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.user;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -69,17 +68,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
        @Inject
        private JobsContactWebSessionController contactController;
 
-       /**
-        * Login bean (controller)
-        */
-       @Inject
-       private JobsUserLoginWebSessionController userLoginController;
-
-       /**
-        * A list of all selectable contacts
-        */
-       private List<Contact> selectableContacts;
-
        /**
         * Event being fired when user updated personal data
         */
@@ -98,14 +86,15 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
        private Long userId;
 
        /**
-        * User name
+        * Login bean (controller)
         */
-       private String userName;
+       @Inject
+       private JobsUserLoginWebSessionController userLoginController;
 
        /**
-        * User name list
+        * User name
         */
-       private List<String> userNameList;
+       private String userName;
 
        /**
         * User password (unencrypted from web form)
@@ -173,21 +162,12 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                // Copy all data from registered->user
                this.copyUser(registeredUser);
 
-               // Add user name and email address
-               this.addUserNameEmailAddress(registeredUser);
-
                // Clear all data
                this.clear();
 
                // Set user id again
                this.setUserId(registeredUser.getUserId());
 
-               // Is the account public?
-               if (Objects.equals(registeredUser.getUserProfileMode(), ProfileMode.PUBLIC)) {
-                       // Also add it to this list
-                       this.visibleUserList.add(registeredUser);
-               }
-
                // Trace message
                //* NOISY-DEBUG: */ System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N
        }
@@ -212,9 +192,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                        throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
                }
 
-               // Re-initialize list
-               this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
-
                // Copy all data to this bean
                this.copyUser(event.getLoggedInUser());
 
@@ -222,12 +199,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N
        }
 
-       @Override
-       public List<User> allVisibleUsers () {
-               // Return it
-               return Collections.unmodifiableList(this.visibleUserList);
-       }
-
        @Override
        public User createUserInstance () {
                // User message
@@ -351,17 +322,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
         */
        @PostConstruct
        public void init () {
-               // Get full user name list for reducing EJB calls
-               this.userNameList = this.userBean.getUserNameList();
-
-               // Is the user logged-in?
-               if (this.userLoginController.isUserLoggedIn()) {
-                       // Is logged-in, so load also users visible to memebers
-                       this.visibleUserList = this.userBean.allMemberPublicVisibleUsers();
-               } else {
-                       // Initialize user list
-                       this.visibleUserList = this.userBean.allPublicUsers();
-               }
        }
 
        @Override
@@ -390,16 +350,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                return ((this.getUserId() == null) || (this.getUserId() == 0));
        }
 
-       @Override
-       public boolean isUserNameRegistered (final User user) {
-               return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
-       }
-
-       @Override
-       public boolean isVisibleUserFound () {
-               return ((this.visibleUserList instanceof List) && (this.visibleUserList.size() > 0));
-       }
-
        @Override
        public User lookupUserById (final Long userId) throws UserNotFoundException {
                // Init variable
@@ -434,29 +384,6 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                return localUser;
        }
 
-       /**
-        * Adds user's name and email address to bean's internal list. It also
-        * updates the public user list if the user has decided to ha   }
-        * <p>
-        * @param user User instance
-        */
-       private void addUserNameEmailAddress (final User user) {
-               // Make sure the entry is not added yet
-               if (this.userNameList.contains(user.getUserName())) {
-                       // Abort here
-                       throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N
-               } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
-                       // Already added
-                       throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N
-               }
-
-               // Add user name
-               this.userNameList.add(user.getUserName());
-
-               // Add email addres
-               this.contactController.addEmailAddress(user.getUserContact().getContactEmailAddress());
-       }
-
        /**
         * Clears this bean
         */
index 2c28731d2dfe2c40e07ba28f55f47a78fee3d977..d905ce5ef0390ce1f1d9a2d51c7661827821d74e 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.user;
 
 import java.io.Serializable;
-import java.util.List;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -62,13 +61,6 @@ public interface JobsUserWebSessionController extends Serializable {
         */
        void afterUserLogin (final UserLoggedInEvent event);
 
-       /**
-        * All public user profiles
-        * <p>
-        * @return A list of all public user profiles
-        */
-       List<User> allVisibleUsers ();
-
        /**
         * Creates an instance from all properties
         * <p>
@@ -167,23 +159,6 @@ public interface JobsUserWebSessionController extends Serializable {
         */
        boolean isSamePasswordEntered ();
 
-       /**
-        * Checks whether given user instance's name is used
-        * <p>
-        * @param user User instance's name to check
-        * <p>
-        * @return Whether it is already used
-        */
-       boolean isUserNameRegistered (final User user);
-
-       /**
-        * Checks whether a public user account is registered. This means that at
-        * least one user profile has its flag "public user profile" enabled.
-        * <p>
-        * @return Whether at least one user has a public profile
-        */
-       boolean isVisibleUserFound ();
-
        /**
         * Checks if the user id is empty
         * <p>
index 0fdcb19947c3ad782deec6f2e934d02d5b8c7027..720c9033efa056f05a38d7bb9ac905c8cd14e2fc 100644 (file)
@@ -10,6 +10,7 @@
 
        <f:metadata>
                <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
+               <f:viewAction action="#{adminHelper.copyUserToController()}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
index 11ead762e7f4dfd3768a77e8369b73cd802f71ad..4c7d045c151a6543be09e195466cffcfc68a31c3 100644 (file)
@@ -88,7 +88,7 @@
                                                                <div class="table_right_medium">
                                                                        <h:selectOneMenu class="select" id="userContact" value="#{adminHelper.contact}" converter="ContactConverter">
                                                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                                                               <f:selectItems value="#{userController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactGender.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
+                                                                               <f:selectItems value="#{adminUserController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactGender.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
                                                                        </h:selectOneMenu>
                                                                </div>
 
index 98d5d702efdceaa4c936c3d72fed03628862d6a3..927dfc9b74ad1f63eee940d94f4ad2454af3fed1 100644 (file)
@@ -10,6 +10,7 @@
 
        <f:metadata>
                <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
+               <f:viewAction action="#{adminHelper.copyUserToController()}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
index fe96f5512baed7fceab3e970ce1e017cb8e154d7..7b33fdaa463d22fbcf5b7ac0420c18115b2b0b74 100644 (file)
@@ -10,6 +10,7 @@
 
        <f:metadata>
                <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
+               <f:viewAction action="#{adminHelper.copyUserToController()}" />
        </f:metadata>
 
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">