]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued with cell phone unlink: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Wed, 10 Aug 2016 14:51:46 +0000 (16:51 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 19 Aug 2016 20:40:22 +0000 (22:40 +0200)
- added new controller for contact-cellphone administrative things
- added new controller method unlinkCellphoneContactData() which unlinks cell phone instance from a contact
- added navigation rule admin_contact_cellphone_unlink.xhtml -> admin_show_contact
- added template admin_contact_data_mini.tpl
- removed phoneBean from controller as it is not being used there
- removed duplicated interface "constant"
- added missing i18n strings
- added CSS class unlink_button
- fixed "bean (controller)" to "controller (bean)"

Signed-off-by: Roland Häder <roland@mxchange.org>
20 files changed:
src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java [deleted file]
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java [deleted file]
src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.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/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl [new file with mode: 0644]
web/admin/cellphone/admin_contact_cellphone_unlink.xhtml
web/resources/css/cssLayout.css

index 54ffccb9b71da413e248a42b53d884e6de232707..d881bdb1948e9452f7d66b7b40efe43e72911bbb 100644 (file)
@@ -39,7 +39,7 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 
 /**
- * Regular bean (controller) for phone numbers
+ * Regular controller (bean) for phone numbers
  * <p>
  * @author Roland Haeder<rhaeder@cho-time.de>
  */
index 8b93305b84cb560aba769bbfb3658fb2e838f2b2..4c0036eab851596530cc72647f50cc4289a86a32 100644 (file)
@@ -53,7 +53,7 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
- * An administrative user bean (controller)
+ * An administrative user controller (bean)
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index 7ccff23805db53a673f4997110f7de256d94a7d9..b774c37d0ea40b28fcea66b242ac627b1a8a6b54 100644 (file)
@@ -60,7 +60,7 @@ import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.user.User;
 
 /**
- * A general contact bean (controller)
+ * A general contact controller (bean)
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
@@ -220,7 +220,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
        private JobsUserWebSessionController userController;
 
        /**
-        * Login bean (controller)
+        * Login controller (bean)
         */
        @Inject
        private JobsUserLoginWebSessionController userLoginController;
index 2640d420577e7cd4f565c94f11c8ec2df5cbd15b..8104d56164a05a1183005e1355eba31d6cb35bcb 100644 (file)
@@ -41,11 +41,6 @@ import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent;
 @Local
 public interface JobsContactWebSessionController extends Serializable {
 
-       /**
-        * Minimum password length
-        */
-       public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
-
        /**
         * Returns a list of all found contacts
         * <p>
diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java
new file mode 100644 (file)
index 0000000..8c182c6
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.jjobs.beans.contact.phone;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
+import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
+import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
+import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * An administrative contact phone controller (bean)
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("contactPhoneController")
+@RequestScoped
+public class JobsContactPhoneWebRequestBean extends BaseJobsController implements JobsContactPhoneWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 542_145_347_916L;
+
+       /**
+        * <<<<<<<
+        * HEAD:src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java
+        * Administrative phone controller
+        */
+       @Inject
+       private JobsAdminPhoneWebRequestController adminPhoneController;
+
+       /**
+        * ======= >>>>>>> 2a40d73... Continued with cell phone unlink: (please
+        * cherry-pick):src/java/de/chotime/landingpage/beans/contact/phone/LandingContactPhoneWebSessionBean.java
+        * Admin helper instance
+        */
+       @Inject
+       private JobsWebRequestController beanHelper;
+
+       /**
+        * General contact controller
+        */
+       @Inject
+       private JobsContactWebSessionController contactController;
+
+       /**
+        * "Cache" for contact lists, mostly only one is assigned. So this cache
+        * shouldn't grow beyond control.
+        */
+       private final Map<Long, List<Contact>> contacts;
+
+       /**
+        * Default constructor
+        */
+       public JobsContactPhoneWebRequestBean () {
+               // Init lists/maps
+               this.contacts = new HashMap<>(10);
+       }
+
+       @Override
+       public void afterAdminAddedContact (@Observes final AdminAddedContactEvent 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 //NOI18N
+               }
+
+               // Clear this bean
+               this.clear();
+       }
+
+       @Override
+       public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
+               // event 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();
+       }
+
+       @Override
+       public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) {
+               // event 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();
+       }
+
+       @Override
+       public List<Contact> allCellphoneContacts () {
+               // Get id
+               Long phoneId = this.beanHelper.getCellPhoneNumber().getPhoneId();
+
+               // Is cache there?
+               if (this.contacts.containsKey(phoneId)) {
+                       // Return cached version
+                       return this.contacts.get(phoneId);
+               } else {
+                       // Ask bean
+                       List<Contact> list = new LinkedList<>();
+
+                       // "Walk" through all contacts
+                       for (final Contact contact : this.contactController.allContacts()) {
+                               // Is cellphone instance the same?
+                               if (Objects.equals(contact.getContactCellphoneNumber(), this.beanHelper.getCellPhoneNumber())) {
+                                       // Found one
+                                       list.add(contact);
+                               }
+                       }
+
+                       // Store result in cache
+                       this.contacts.put(phoneId, list);
+
+                       // Return now-cached list
+                       return list;
+               }
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestController.java
new file mode 100644 (file)
index 0000000..adeb158
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.jjobs.beans.contact.phone;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Local;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
+import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
+
+/**
+ * An interface for user beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Local
+public interface JobsContactPhoneWebRequestController extends Serializable {
+
+       /**
+        * Getter for all contacts having current cellphone instance linked
+        * <p>
+        * @return List of all linked contacts
+        */
+       List<Contact> allCellphoneContacts ();
+
+       /**
+        * Event observer for newly added users by adminstrator
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
+
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedContact (final AdminAddedContactEvent event);
+
+       /**
+        * Event observer for updated contact data by administrators
+        * <p>
+        * @param event Updated contact data event
+        */
+       void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java
deleted file mode 100644 (file)
index 342a3e2..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * 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.jjobs.beans.contact.phone;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
-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.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
-import org.mxchange.jjobs.beans.BaseJobsController;
-import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
-import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
-import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
-import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
-
-/**
- * A general contact phone bean (controller)
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Named ("contactPhoneController")
-@SessionScoped
-public class JobsContactPhoneWebSessionBean extends BaseJobsController implements JobsContactPhoneWebSessionController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 542_145_347_916L;
-
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private JobsAdminPhoneWebRequestController adminPhoneController;
-
-       /**
-        * Admin helper instance
-        */
-       @Inject
-       private JobsWebRequestController beanHelper;
-
-       /**
-        * General contact controller
-        */
-       @Inject
-       private JobsContactWebSessionController contactController;
-
-       /**
-        * "Cache" for contact lists, mostly only one is assigned. So this cache
-        * shouldn't grow beyond control.
-        */
-       private final Map<Long, List<Contact>> contacts;
-
-       /**
-        * Remote EJB for phone number (administrative)
-        */
-       private PhoneSessionBeanRemote phoneBean;
-
-       /**
-        * Default constructor
-        */
-       public JobsContactPhoneWebSessionBean () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the beans
-                       this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
-
-               // Init lists/maps
-               this.contacts = new HashMap<>(10);
-       }
-
-       @Override
-       public void afterAdminAddedContact (@Observes final AdminAddedContactEvent 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 //NOI18N
-               }
-
-               // Clear this bean
-               this.clear();
-       }
-
-       @Override
-       public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
-               // event 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();
-       }
-
-       @Override
-       public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) {
-               // event 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();
-       }
-
-       @Override
-       public List<Contact> allCellphoneContacts () {
-               // Get id
-               Long phoneId = this.beanHelper.getCellPhoneNumber().getPhoneId();
-
-               // Is cache there?
-               if (this.contacts.containsKey(phoneId)) {
-                       // Return cached version
-                       return this.contacts.get(phoneId);
-               } else {
-                       // Ask bean
-                       List<Contact> list = new LinkedList<>();
-
-                       // "Walk" through all contacts
-                       for (final Contact contact : this.contactController.allContacts()) {
-                               // Is cellphone instance the same?
-                               if (Objects.equals(contact.getContactCellphoneNumber(), this.beanHelper.getCellPhoneNumber())) {
-                                       // Found one
-                                       list.add(contact);
-                               }
-                       }
-
-                       // Store result in cache
-                       this.contacts.put(phoneId, list);
-
-                       // Return now-cached list
-                       return list;
-               }
-       }
-
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-       }
-
-       /**
-        * Clears this bean
-        */
-       private void clear () {
-               // Clear all data
-       }
-
-}
diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java
deleted file mode 100644 (file)
index fefb5c1..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * 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.jjobs.beans.contact.phone;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Local;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
-import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
-
-/**
- * An interface for user beans
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Local
-public interface JobsContactPhoneWebSessionController extends Serializable {
-
-       /**
-        * Minimum password length
-        */
-       public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
-
-       /**
-        * Getter for all contacts having current cellphone instance linked
-        * <p>
-        * @return List of all linked contacts
-        */
-       List<Contact> allCellphoneContacts ();
-
-       /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
-
-       /**
-        * Observes events being fired when an administrator has added a new
-        * contact.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedContact (final AdminAddedContactEvent event);
-
-       /**
-        * Event observer for updated contact data by administrators
-        * <p>
-        * @param event Updated contact data event
-        */
-       void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event);
-
-}
index 781e798e64fe13a02571e86df133bc3299ed8dac..e69d52ae3ccfa5ec0d76e2225a73eb8be9746996 100644 (file)
@@ -78,7 +78,7 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements
        private JobsFeaturesWebApplicationController featureController;
 
        /**
-        * Login bean (controller)
+        * Login controller (bean)
         */
        @Inject
        private JobsUserLoginWebSessionController userLoginController;
index 72df0e116c70075b8e5d5e58386023386f8f0412..326835962f33b495420dfc8a365da664cf962caf 100644 (file)
@@ -38,7 +38,7 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
- * Administrative bean (controller) for mobile provider
+ * Administrative controller (bean) for mobile provider
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index 3097e973f38e53a89af8821189bdc4a0b1a9e7bf..1b1ae2407d18d0074792113215504e75c9bdf032 100644 (file)
@@ -38,7 +38,7 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 
 /**
- * Administrative bean (controller) for phone numbers
+ * Administrative controller (bean) for phone numbers
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
@@ -108,28 +108,28 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
                // Is all data set
                if (this.beanHelper.getCellPhoneNumber() == null) {
                        // Not set, throw NPE
-                       throw new NullPointerException("this.cellphoneNumber is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.cellphoneNumber.phoneId is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneId is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider() == null) {
                        // Throw NPE
-                       throw new NullPointerException("this.cellphoneNumber.cellphoneProvider is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
                        // ... throw again
-                       throw new NullPointerException("this.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.cellphoneNumber.phoneNumber is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneNumber is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
                }
 
                // Call EJB
@@ -147,28 +147,28 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements
                // Is all data set
                if (this.beanHelper.getCellPhoneNumber() == null) {
                        // Not set, throw NPE
-                       throw new NullPointerException("this.cellphoneNumber is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.cellphoneNumber.phoneId is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneId is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneId={0} is not valid", this.beanHelper.getCellPhoneNumber().getPhoneId())); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider() == null) {
                        // Throw NPE
-                       throw new NullPointerException("this.cellphoneNumber.cellphoneProvider is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() == null) {
                        // ... throw again
-                       throw new NullPointerException("this.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("this.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.cellphoneNumber.cellphoneProvider.providerId={0} is not valid.", this.beanHelper.getCellPhoneNumber().getCellphoneProvider().getProviderId())); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.cellphoneNumber.phoneNumber is null"); //NOI18N
+                       throw new NullPointerException("this.beanHelper.cellphoneNumber.phoneNumber is null"); //NOI18N
                } else if (this.beanHelper.getCellPhoneNumber().getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("this.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N
                } else if (this.getCellphoneProvider() == null) {
                        // Not provided
                        this.showFacesMessage("form_edit_cellphone:cellphoneProvider", "No mobile provider selected"); //NOI18N
index 022e2b989fef1a9ea3d95bc6e2a4c5b958a22a95..027f3698e8b6bd6879e70ea2fb8e2f983222cdea 100644 (file)
@@ -59,7 +59,7 @@ import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 
 /**
- * A user bean (controller)
+ * A user controller (bean)
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index 378218cfe1a340d5a72a887094020947a1b208af..add5d0929c53ccd1bcd7a4119a3baf9c4b85b90e 100644 (file)
@@ -57,7 +57,7 @@ import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 
 /**
- * A user bean (controller)
+ * A user controller (bean)
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
@@ -116,7 +116,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        private List<User> userList;
 
        /**
-        * Login bean (controller)
+        * Login controller (bean)
         */
        @Inject
        private JobsUserLoginWebSessionController userLoginController;
index d5cc6da01fdb8620d2776574428c0bdac40495b2..e9dc864679d3589797f9be1f91e6ce5d8702bf53 100644 (file)
@@ -41,7 +41,7 @@ import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
 
 /**
- * A user password (change) bean (controller)
+ * A user password (change) controller (bean)
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
@@ -71,7 +71,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
        private String userCurrentPassword;
 
        /**
-        * Login bean (controller)
+        * Login controller (bean)
         */
        @Inject
        private JobsUserLoginWebSessionController userLoginController;
index 0cc39a3bf1b5b1f74df11a14c6172057176a2ff7..cbfa38f945a61927afad4fb560b925880f051e56 100644 (file)
@@ -619,3 +619,7 @@ ADMIN_CELLPHONE_NUMBER_REQUIRED=Bitte Mobilfunknummer angeben.
 BUTTON_ADMIN_DELETE_CELLPHONE=Mobilfunknummer l\u00f6schen
 ADMIN_DELETE_CELLPHONE_DATA_NOTICE=Wenn Sie die Mobilfunknummer l\u00f6schen, steht diese nicht mehr im System zur Verf\u00fcgung. Bitte \u00fcberlegen Sie genau, ob Sie dies wollen.
 ADMIN_DELETE_CELLPHONE_TITLE=Wollen Sie die Mobilfunknummer wirklich l\u00f6schen?
+ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI=Die Tabelle enth\u00e4lt die wichtigsten Daten zum Konakt (minimalisierte Ansicht).
+ADMIN_SHOW_FULL_CONTACT_DATA=Gesamte Kontaktdaten anzeigen
+ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE=Wollen Sie wirklich die Mobilfunknummer vom Kontakt abtrennen?
+BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Mobilfunknummer vom Kontakt abtrennen
index ecbf277b91ad31d4cdce7b5eea55c1f0163a9da8..f732c8e9f6f66fbf690980d8baf7309f8146482f 100644 (file)
@@ -619,3 +619,7 @@ ADMIN_CELLPHONE_NUMBER_REQUIRED=Please enter a cell phone number.
 BUTTON_ADMIN_DELETE_CELLPHONE=Delete cell phone number
 ADMIN_DELETE_CELLPHONE_DATA_NOTICE=If you delete the cell phone number, it won't be available anymore for anything. Please consider carefully if you really want this.
 ADMIN_DELETE_CELLPHONE_TITLE=Do you really want to delete the cell phone number?
+ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI=The table contains the most important data from contact (minimalized view).
+ADMIN_SHOW_FULL_CONTACT_DATA=Show all contact data
+ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE=Do you really want to unlink the shown cell phone number from the contact?
+BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Unlink cell phone number from contact
index 72f91a4744fa35de7bcc9a9a8869506417da0c0f..22bce018fb61e38ef9a620a8964b78c36ba3366d 100644 (file)
                        <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/cellphone/admin_contact_cellphone_unlink.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_show_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/contact/admin_contact_list.xhtml</from-view-id>
                <navigation-case>
diff --git a/web/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl b/web/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl
new file mode 100644 (file)
index 0000000..7206e07
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:panelGrid id="show_contact" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CONTACT_MINI}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty beanHelper.contact}">
+               <f:facet name="header">
+                       <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CONTACT}">
+                               <f:param value="#{beanHelper.contact.contactId}" />
+                       </h:outputFormat>
+               </f:facet>
+
+               <h:column>
+                       <h:outputLabel for="contactId" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ID}" />
+
+                       <h:outputText id="contactId" styleClass="data_field" value="#{beanHelper.contact.contactId}" />
+               </h:column>
+
+               <h:column>
+                       <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />
+
+                       <h:outputText id="contactGender" styleClass="data_field" value="#{msg[beanHelper.contact.contactGender.messageKey]}" />
+               </h:column>
+
+               <h:column>
+                       <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />
+
+                       <h:outputText id="contactTitle" styleClass="data_field" value="#{beanHelper.contact.contactTitle}" />
+               </h:column>
+
+               <h:column>
+                       <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
+
+                       <h:outputText id="contactFirstName" styleClass="data_field" value="#{beanHelper.contact.contactFirstName}" />
+               </h:column>
+
+               <h:column>
+                       <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
+
+                       <h:outputText id="contactFamilyName" styleClass="data_field" value="#{beanHelper.contact.contactFamilyName}" />
+               </h:column>
+
+               <h:column>
+                       <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />
+
+                       <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{beanHelper.contact.contactEmailAddress}">
+                               <h:outputText value="#{beanHelper.contact.contactEmailAddress}" />
+                       </h:outputLink>
+               </h:column>
+       </h:panelGrid>
+</ui:composition>
index 1eb5525bba0bd003ecb9f9d7552c9a0ed7506fd4..4d6a5012a60a7271d4920c011c3641f2a30e0c82 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       Here goes your content.
+                       <h:form id="form_unlink_contact_cellphone" rendered="#{not empty beanHelper.cellPhoneNumber and not empty beanHelper.contact}">
+                               <div class="table">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.ADMIN_UNLINK_CONTACT_CELLPHONE_TITLE}" />
+                                       </div>
+
+                                       <div class="para">
+                                               <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl" />
+                                       </div>
+
+                                       <div class="para">
+                                               <h:link outcome="admin_show_contact">
+                                                       <h:outputText value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}" />
+                                                       <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
+                                               </h:link>
+                                       </div>
+
+                                       <div class="para">
+                                               <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl">
+                                                       <ui:param name="isShowPage" value="#{false}" />
+                                                       <ui:param name="showAdminLinks" value="#{false}" />
+                                               </ui:include>
+                                       </div>
+
+                                       <div class="table_footer">
+                                               <h:commandButton styleClass="unlink_button" type="submit" id="unlink_cellphone" value="#{msg.BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE}" action="#{adminContactPhoneController.unlinkCellphoneContactData()}" />
+                                       </div>
+                               </div>
+                       </h:form>
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_ADMIN_BEAN_CELLPHONE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.cellPhoneNumber}" />
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_CONTACT_NOT_SET}" rendered="#{empty beanHelper.contact}" />
                </ui:define>
        </ui:composition>
 </html>
index 612651dcfe1cc480569ad1a50bc0f38e56cca155..1c1e9bb7a2fc76ea506ff3aa3c96b260e4e0b84a 100644 (file)
@@ -248,7 +248,13 @@ ul.footer_nav li.footer_copyright {
 }
 
 .delete_button {
-       border: #ff0000 1px groove;
+       border: #ee0000 1px groove;
        background-color: #880000;
        color: #ffffff;
 }
+
+.unlink_button {
+       border: #eeee00 1px groove;
+       background-color: #aaaa00;
+       color: #ffffff;
+}