From: Roland Häder Date: Wed, 10 Aug 2016 14:51:46 +0000 (+0200) Subject: Continued with cell phone unlink: (please cherry-pick) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=74fc01205d863debc93e4b86bbc1016e2d00fe0b;p=jjobs-war.git Continued with cell phone unlink: (please cherry-pick) - 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 --- diff --git a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java b/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java index 54ffccb9..d881bdb1 100644 --- a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java +++ b/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java @@ -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 *

* @author Roland Haeder */ diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java index 8b93305b..4c0036ea 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java @@ -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) *

* @author Roland Haeder */ diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index 7ccff238..b774c37d 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -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) *

* @author Roland Haeder */ @@ -220,7 +220,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job private JobsUserWebSessionController userController; /** - * Login bean (controller) + * Login controller (bean) */ @Inject private JobsUserLoginWebSessionController userLoginController; diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java index 2640d420..8104d561 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java @@ -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 *

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 index 00000000..8c182c63 --- /dev/null +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java @@ -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 . + */ +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) + *

+ * @author Roland Haeder + */ +@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> 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 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 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 index 00000000..adeb1584 --- /dev/null +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestController.java @@ -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 . + */ +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 + *

+ * @author Roland Haeder + */ +@Local +public interface JobsContactPhoneWebRequestController extends Serializable { + + /** + * Getter for all contacts having current cellphone instance linked + *

+ * @return List of all linked contacts + */ + List allCellphoneContacts (); + + /** + * Event observer for newly added users by adminstrator + *

+ * @param event Event being fired + */ + void afterAdminAddedUserEvent (final AdminAddedUserEvent event); + + /** + * Observes events being fired when an administrator has added a new + * contact. + *

+ * @param event Event being fired + */ + void afterAdminAddedContact (final AdminAddedContactEvent event); + + /** + * Event observer for updated contact data by administrators + *

+ * @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 index 342a3e21..00000000 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java +++ /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 . - */ -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) - *

- * @author Roland Haeder - */ -@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> 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 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 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 index fefb5c1a..00000000 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java +++ /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 . - */ -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 - *

- * @author Roland Haeder - */ -@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 - *

- * @return List of all linked contacts - */ - List allCellphoneContacts (); - - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final AdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContact (final AdminAddedContactEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event); - -} diff --git a/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java index 781e798e..e69d52ae 100644 --- a/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java @@ -78,7 +78,7 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements private JobsFeaturesWebApplicationController featureController; /** - * Login bean (controller) + * Login controller (bean) */ @Inject private JobsUserLoginWebSessionController userLoginController; diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java index 72df0e11..32683596 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java @@ -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 *

* @author Roland Haeder */ diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index 3097e973..1b1ae240 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -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 *

* @author Roland Haeder */ @@ -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 diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index 022e2b98..027f3698 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -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) *

* @author Roland Haeder */ diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index 378218cf..add5d092 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -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) *

* @author Roland Haeder */ @@ -116,7 +116,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs private List userList; /** - * Login bean (controller) + * Login controller (bean) */ @Inject private JobsUserLoginWebSessionController userLoginController; diff --git a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java index d5cc6da0..e9dc8646 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java @@ -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) *

* @author Roland Haeder */ @@ -71,7 +71,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement private String userCurrentPassword; /** - * Login bean (controller) + * Login controller (bean) */ @Inject private JobsUserLoginWebSessionController userLoginController; diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 0cc39a3b..cbfa38f9 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -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 diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index ecbf277b..f732c8e9 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -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 diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 72f91a47..22bce018 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -403,6 +403,13 @@ /admin/contact/admin_contact_show.xhtml + + /admin/cellphone/admin_contact_cellphone_unlink.xhtml + + admin_show_contact + /admin/contact/admin_contact_show.xhtml + + /admin/contact/admin_contact_list.xhtml 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 index 00000000..7206e070 --- /dev/null +++ b/web/WEB-INF/templates/admin/contact/admin_contact_data_mini.tpl @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/admin/cellphone/admin_contact_cellphone_unlink.xhtml b/web/admin/cellphone/admin_contact_cellphone_unlink.xhtml index 1eb5525b..4d6a5012 100644 --- a/web/admin/cellphone/admin_contact_cellphone_unlink.xhtml +++ b/web/admin/cellphone/admin_contact_cellphone_unlink.xhtml @@ -20,7 +20,39 @@ - Here goes your content. + +

+
+ +
+ +
+ +
+ +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + + diff --git a/web/resources/css/cssLayout.css b/web/resources/css/cssLayout.css index 612651dc..1c1e9bb7 100644 --- a/web/resources/css/cssLayout.css +++ b/web/resources/css/cssLayout.css @@ -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; +}