From 78b13d1497ac626aeacc43048bc55126f96cbc93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 16 Aug 2016 16:08:48 +0200 Subject: [PATCH] Continued with land-line and fax numbers: (please cherry-pick) - added "all" (?) JSF pages for administrative land-line/fax number pages - added admin menus for fax/land-line number listing - added navigation rules - added more class (controller=managed bean) fields for fax/land-line - implemented method allFaxNumberContacts() - implemented method allLandLineNumberContacts() - implemented method allNonLinkedFaxNumbers() - implemented method allNonLinkedLandLineNumbers() - some methods had been renamed (cellphone -> mobile) - added missing i18n strings - renamed some i18n strings as they can be generic (for all 3 types) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../converter/fax/LandingFaxConverter.java | 121 ++++++++++++++++ .../landline/LandingLandLineConverter.java | 121 ++++++++++++++++ .../contact/JobsContactWebSessionBean.java | 8 +- .../phone/JobsContactPhoneWebSessionBean.java | 66 ++++++++- .../JobsContactPhoneWebSessionController.java | 14 ++ .../phone/JobsAdminPhoneWebRequestBean.java | 85 ++++++++++-- .../JobsAdminPhoneWebRequestController.java | 30 ++++ .../localization/bundle_de_DE.properties | 16 ++- .../localization/bundle_en_US.properties | 16 ++- web/WEB-INF/faces-config.xml | 130 ++++++++++++++++++ web/WEB-INF/templates/admin/admin_menu.tpl | 2 + .../admin/fax/admin_fax_add_show.tpl | 17 +++ .../templates/admin/fax/admin_fax_data.tpl | 50 +++++++ .../templates/admin/fax/admin_fax_links.tpl | 46 +++++++ .../admin/fax/admin_form_add_contact_fax.tpl | 56 ++++++++ .../admin/fax/admin_form_fax_data.tpl | 47 +++++++ .../admin_form_add_contact_landline.tpl | 56 ++++++++ .../landline/admin_form_landline_data.tpl | 47 +++++++ .../landline/admin_landline_add_show.tpl | 17 +++ .../admin/landline/admin_landline_data.tpl | 50 +++++++ .../admin/landline/admin_landline_links.tpl | 46 +++++++ .../admin/mobile/admin_form_mobile_data.tpl | 2 +- .../admin/mobile/admin_mobile_data.tpl | 2 +- web/admin/fax/admin_contact_fax_unlink.xhtml | 63 +++++++++ web/admin/fax/admin_fax_delete.xhtml | 48 +++++++ web/admin/fax/admin_fax_edit.xhtml | 41 ++++++ web/admin/fax/admin_fax_list.xhtml | 62 +++++++++ web/admin/fax/admin_fax_show.xhtml | 92 +++++++++++++ .../admin_contact_landline_unlink.xhtml | 63 +++++++++ .../landline/admin_landline_delete.xhtml | 48 +++++++ web/admin/landline/admin_landline_edit.xhtml | 41 ++++++ web/admin/landline/admin_landline_list.xhtml | 62 +++++++++ web/admin/landline/admin_landline_show.xhtml | 92 +++++++++++++ web/admin/mobile/admin_mobile_list.xhtml | 6 +- 34 files changed, 1634 insertions(+), 29 deletions(-) create mode 100644 src/java/de/chotime/landingpage/converter/fax/LandingFaxConverter.java create mode 100644 src/java/de/chotime/landingpage/converter/landline/LandingLandLineConverter.java create mode 100644 web/WEB-INF/templates/admin/fax/admin_fax_add_show.tpl create mode 100644 web/WEB-INF/templates/admin/fax/admin_fax_data.tpl create mode 100644 web/WEB-INF/templates/admin/fax/admin_fax_links.tpl create mode 100644 web/WEB-INF/templates/admin/fax/admin_form_add_contact_fax.tpl create mode 100644 web/WEB-INF/templates/admin/fax/admin_form_fax_data.tpl create mode 100644 web/WEB-INF/templates/admin/landline/admin_form_add_contact_landline.tpl create mode 100644 web/WEB-INF/templates/admin/landline/admin_form_landline_data.tpl create mode 100644 web/WEB-INF/templates/admin/landline/admin_landline_add_show.tpl create mode 100644 web/WEB-INF/templates/admin/landline/admin_landline_data.tpl create mode 100644 web/WEB-INF/templates/admin/landline/admin_landline_links.tpl create mode 100644 web/admin/fax/admin_contact_fax_unlink.xhtml create mode 100644 web/admin/fax/admin_fax_delete.xhtml create mode 100644 web/admin/fax/admin_fax_edit.xhtml create mode 100644 web/admin/fax/admin_fax_list.xhtml create mode 100644 web/admin/fax/admin_fax_show.xhtml create mode 100644 web/admin/landline/admin_contact_landline_unlink.xhtml create mode 100644 web/admin/landline/admin_landline_delete.xhtml create mode 100644 web/admin/landline/admin_landline_edit.xhtml create mode 100644 web/admin/landline/admin_landline_list.xhtml create mode 100644 web/admin/landline/admin_landline_show.xhtml diff --git a/src/java/de/chotime/landingpage/converter/fax/LandingFaxConverter.java b/src/java/de/chotime/landingpage/converter/fax/LandingFaxConverter.java new file mode 100644 index 00000000..28a6c52e --- /dev/null +++ b/src/java/de/chotime/landingpage/converter/fax/LandingFaxConverter.java @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2016 Cho-Time GmbH + * + * 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 de.chotime.landingpage.converter.fax; + +import java.text.MessageFormat; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; +import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException; +import org.mxchange.jphone.phonenumbers.DialableNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; + +/** + * Converter for fax id <-> valid fax number instance + *

+ * @author Roland Haeder + */ +@FacesConverter (value = "FaxConverter") +public class LandingFaxConverter implements Converter { + + /** + * Logger instance + */ + @Log + private LoggerBeanLocal loggerBeanLocal; + + /** + * Phone EJB + */ + private PhoneSessionBeanRemote phoneBean; + + /** + * Initialization of this converter + */ + public LandingFaxConverter () { + // Try to get it + try { + // Get initial context + Context context = new InitialContext(); + + // Lookup logger + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + + // ... and user controller + this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + + @Override + public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { + // Is the value null or empty? + if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { + // Warning message + this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N + + // Return null + return null; + } + + // Init instance + DialableFaxNumber faxNumber = null; + + try { + // Try to parse the value as long + Long faxNumberId = Long.valueOf(submittedValue); + + // Try to get mobile instance from it + faxNumber = this.phoneBean.findFaxNumberById(faxNumberId); + } catch (final NumberFormatException ex) { + // Throw again + throw new ConverterException(ex); + } catch (final PhoneEntityNotFoundException ex) { + // Debug message + this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N + } + + // Return it + return faxNumber; + } + + @Override + public String getAsString (final FacesContext context, final UIComponent component, final Object value) { + // Is the object null? + if ((null == value) || ((String.valueOf(value)).isEmpty())) { + // Is null + return ""; //NOI18N + } else if (!(value instanceof DialableNumber)) { + // Not same interface + throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N + } + + // Return category id + return String.valueOf(((DialableNumber) value).getPhoneId()); + } + +} diff --git a/src/java/de/chotime/landingpage/converter/landline/LandingLandLineConverter.java b/src/java/de/chotime/landingpage/converter/landline/LandingLandLineConverter.java new file mode 100644 index 00000000..fdf2758d --- /dev/null +++ b/src/java/de/chotime/landingpage/converter/landline/LandingLandLineConverter.java @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2016 Cho-Time GmbH + * + * 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 de.chotime.landingpage.converter.landline; + +import java.text.MessageFormat; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; +import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException; +import org.mxchange.jphone.phonenumbers.DialableNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; + +/** + * Converter for land-line id <-> valid land-line number instance + *

+ * @author Roland Haeder + */ +@FacesConverter (value = "LandLineConverter") +public class LandingLandLineConverter implements Converter { + + /** + * Logger instance + */ + @Log + private LoggerBeanLocal loggerBeanLocal; + + /** + * Phone EJB + */ + private PhoneSessionBeanRemote phoneBean; + + /** + * Initialization of this converter + */ + public LandingLandLineConverter () { + // Try to get it + try { + // Get initial context + Context context = new InitialContext(); + + // Lookup logger + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + + // ... and user controller + this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + + @Override + public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { + // Is the value null or empty? + if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { + // Warning message + this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N + + // Return null + return null; + } + + // Init instance + DialableLandLineNumber landLineNumber = null; + + try { + // Try to parse the value as long + Long landLineNumberId = Long.valueOf(submittedValue); + + // Try to get mobile instance from it + landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId); + } catch (final NumberFormatException ex) { + // Throw again + throw new ConverterException(ex); + } catch (final PhoneEntityNotFoundException ex) { + // Debug message + this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N + } + + // Return it + return landLineNumber; + } + + @Override + public String getAsString (final FacesContext context, final UIComponent component, final Object value) { + // Is the object null? + if ((null == value) || ((String.valueOf(value)).isEmpty())) { + // Is null + return ""; //NOI18N + } else if (!(value instanceof DialableNumber)) { + // Not same interface + throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N + } + + // Return category id + return String.valueOf(((DialableNumber) value).getPhoneId()); + } + +} diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index 2f0e7ef9..f0e11841 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -970,10 +970,10 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getCellphoneList() == null) { + } else if (event.getMobileNumberList() == null) { // Throw NPE again throw new NullPointerException("event.mobileList is null"); //NOI18N - } else if (event.getCellphoneList().isEmpty()) { + } else if (event.getMobileNumberList().isEmpty()) { // List is empty, no need to check return; } @@ -981,9 +981,9 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job // Check all entries for (final Contact contact : this.contactList) { // Is the mobile instance set and in list? - if ((contact.getContactMobileNumber() instanceof DialableMobileNumber) && (event.getCellphoneList().contains(contact.getContactMobileNumber()))) { + if ((contact.getContactMobileNumber() instanceof DialableMobileNumber) && (event.getMobileNumberList().contains(contact.getContactMobileNumber()))) { // Found it, so remvoe it from list - event.getCellphoneList().remove(contact.getContactMobileNumber()); + event.getMobileNumberList().remove(contact.getContactMobileNumber()); } } } diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java index 0f156a44..6065ddcc 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java @@ -34,6 +34,8 @@ import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent; import org.mxchange.jphone.phonenumbers.DialableNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; @@ -65,8 +67,8 @@ public class JobsContactPhoneWebSessionBean extends BaseLandingController implem /** * "Cache" for contact's mobile, land-line and fax numbers. Currently one - * one per each type is supported. Maybe later this will change into a - * OneToMany relationship (one contact, many numbers). + * per each type is supported. Maybe later this will change into a OneToMany + * relationship (one contact, many numbers). */ private final Map> contacts; @@ -165,6 +167,66 @@ public class JobsContactPhoneWebSessionBean extends BaseLandingController implem this.clear(); } + @Override + public List allFaxNumberContacts () { + // Get id + DialableFaxNumber faxNumber = this.beanHelper.getFaxNumber(); + + // Is cache there? + if (this.contacts.containsKey(faxNumber)) { + // Return cached version + return this.contacts.get(faxNumber); + } else { + // Ask bean + List list = new LinkedList<>(); + + // "Walk" through all contacts + for (final Contact contact : this.contactController.allContacts()) { + // Is mobile instance the same? + if (Objects.equals(contact.getContactFaxNumber(), this.beanHelper.getFaxNumber())) { + // Found one + list.add(contact); + } + } + + // Store result in cache + this.contacts.put(faxNumber, list); + + // Return now-cached list + return list; + } + } + + @Override + public List allLandLineNumberContacts () { + // Get id + DialableLandLineNumber landLineNumber = this.beanHelper.getLandLineNumber(); + + // Is cache there? + if (this.contacts.containsKey(landLineNumber)) { + // Return cached version + return this.contacts.get(landLineNumber); + } else { + // Ask bean + List list = new LinkedList<>(); + + // "Walk" through all contacts + for (final Contact contact : this.contactController.allContacts()) { + // Is mobile instance the same? + if (Objects.equals(contact.getContactLandLineNumber(), this.beanHelper.getLandLineNumber())) { + // Found one + list.add(contact); + } + } + + // Store result in cache + this.contacts.put(landLineNumber, list); + + // Return now-cached list + return list; + } + } + @Override public List allMobileNumberContacts () { // Get id diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java index 9a8f06cc..9fb14699 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java @@ -33,6 +33,20 @@ import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; @Local public interface JobsContactPhoneWebSessionController extends Serializable { + /** + * Getter for all contacts having current fax number linked + *

+ * @return List of all linked contacts + */ + List allFaxNumberContacts (); + + /** + * Getter for all contacts having current land-line number linked + *

+ * @return List of all linked contacts + */ + List allLandLineNumberContacts (); + /** * Getter for all contacts having current mobile number linked *

diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index 239ccb6b..b05a7ea3 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -30,12 +30,18 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.helper.JobsWebRequestController; +import org.mxchange.jphone.events.fax.removed.AdminFaxNumberRemovedFromListEvent; +import org.mxchange.jphone.events.fax.removed.AdminRemoveFaxNumberFromListEvent; +import org.mxchange.jphone.events.landline.removed.AdminLandLineNumberRemovedFromListEvent; +import org.mxchange.jphone.events.landline.removed.AdminRemoveLandLineNumberFromListEvent; import org.mxchange.jphone.events.mobile.deleted.AdminDeletedMobileNumberEvent; import org.mxchange.jphone.events.mobile.deleted.AdminMobileNumberDeletedEvent; import org.mxchange.jphone.events.mobile.remove.AdminMobileNumberRemovedFromListEvent; import org.mxchange.jphone.events.mobile.remove.AdminRemoveMobileNumberFromListEvent; import org.mxchange.jphone.events.mobile.updated.AdminMobileNumberUpdatedEvent; import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote; @@ -65,6 +71,21 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements @Inject private JobsWebRequestController beanHelper; + /** + * Choosen land-line number + */ + private DialableLandLineNumber choosenLandLineNumber; + + /** + * Choosen mobile number + */ + private DialableMobileNumber choosenMobileNumber; + + /** + * (Entered) mobile number + */ + private Long mobileNumber; + /** * Event being fired when an administrator has deleted mobile number */ @@ -79,16 +100,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements @Any private Event mobileNumberUpdatedEvent; - /** - * Choosen mobile number - */ - private DialableMobileNumber choosenMobileNumber; - - /** - * (Entered) mobile number - */ - private Long mobileNumber; - /** * Mobile provider */ @@ -105,13 +116,29 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements */ private Long phoneNumber; + /** + * Event being fired when a list of all unsed fax numbers is being + * created. + */ + @Inject + @Any + private Event removeLinkedFaxNumbersEvent; + + /** + * Event being fired when a list of all unsed land-line numbers is being + * created. + */ + @Inject + @Any + private Event removeLinkedLandLineNumbersEvent; + /** * Event being fired when a list of all unsed mobile numbers is being * created. */ @Inject @Any - private Event removeLinkedCellphoneNumbersEvent; + private Event removeLinkedMobileNumbersEvent; /** * Default constructor @@ -130,13 +157,37 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements } } + @Override + public List allNonLinkedFaxNumbers () { + // Get list of all mobile numbers + List list = this.phoneController.allFaxNumbers(); + + // Visit all controllers to reduce the list + this.removeLinkedFaxNumbersEvent.fire(new AdminFaxNumberRemovedFromListEvent(list)); + + // Return it + return list; + } + + @Override + public List allNonLinkedLandLineNumbers () { + // Get list of all mobile numbers + List list = this.phoneController.allLandLineNumbers(); + + // Visit all controllers to reduce the list + this.removeLinkedLandLineNumbersEvent.fire(new AdminLandLineNumberRemovedFromListEvent(list)); + + // Return it + return list; + } + @Override public List allNonLinkedMobileNumbers () { // Get list of all mobile numbers List list = this.phoneController.allMobileNumbers(); // Visit all controllers to reduce the list - this.removeLinkedCellphoneNumbersEvent.fire(new AdminMobileNumberRemovedFromListEvent(list)); + this.removeLinkedMobileNumbersEvent.fire(new AdminMobileNumberRemovedFromListEvent(list)); // Return it return list; @@ -244,6 +295,16 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements return "admin_edit_mobile?faces-redirect=true&includeViewParams=true"; //NOI18N } + @Override + public DialableLandLineNumber getChoosenLandLineNumber () { + return this.choosenLandLineNumber; + } + + @Override + public void setChoosenLandLineNumber (final DialableLandLineNumber choosenLandLineNumber) { + this.choosenLandLineNumber = choosenLandLineNumber; + } + @Override public DialableMobileNumber getChoosenMobileNumber () { return this.choosenMobileNumber; diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java index cab34861..7af1d526 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java @@ -19,6 +19,8 @@ package org.mxchange.jjobs.beans.phone; import java.io.Serializable; import java.util.List; import javax.ejb.Local; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; @@ -38,6 +40,20 @@ public interface JobsAdminPhoneWebRequestController extends Serializable { */ List allNonLinkedMobileNumbers (); + /** + * Returns a list of all unused ("non-linked") land-line numbers + *

+ * @return List with all unused land-line numbers + */ + List allNonLinkedFaxNumbers (); + + /** + * Returns a list of all unused ("non-linked") land-line numbers + *

+ * @return List with all unused land-line numbers + */ + List allNonLinkedLandLineNumbers (); + /** * Deletes given mobile entry data *

@@ -80,6 +96,20 @@ public interface JobsAdminPhoneWebRequestController extends Serializable { */ void setChoosenMobileNumber (final DialableMobileNumber choosenMobileNumber); + /** + * Getter for choosen land-line number + *

+ * @return Choosen land-line number + */ + DialableLandLineNumber getChoosenLandLineNumber (); + + /** + * Setter for choosen land-line number + *

+ * @param choosenLandLineNumber Choosen land-line number + */ + void setChoosenLandLineNumber (final DialableLandLineNumber choosenLandLineNumber); + /** * Getter for mobile number *

diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index f0f69c5e..7acabae0 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -393,7 +393,7 @@ ADMIN_LINK_DELETE_USER_TITLE=L\u00f6scht das Benutzeraccount (nach Best\u00e4tig CONTENT_TITLE_ADMIN_DELETE_USER=Benutzeraccount l\u00f6schen: PAGE_TITLE_ADMIN_DELETE_USER=Benutzeraccount l\u00f6schen ADMIN_HEADER_SHOW_MOBILE_DATA=Daten des Mobiltelefons: -ADMIN_SHOW_MOBILE_ID=Id-Nummer: +ADMIN_SHOW_PHONE_ID=Id-Nummer: ADMIN_SHOW_MOBILE_PROVIDER_NAME=Mobilanbieter: ADMIN_SHOW_MOBILE_NUMBER_COMPLETE=Komplette Nummer: ADMIN_SHOW_MOBILE_LINKS=Administrative Links: @@ -603,8 +603,8 @@ ADMIN_LIST_MOBILE_EMPTY=Es sind keine Mobilfunknummern gespeichert. ADMIN_MENU_PHONE_NUMBERS_TITLE=Telefonnummern: LINK_ADMIN_LIST_MOBILE_PHONE_NUMBERS=Handynummern ... LINK_ADMIN_LIST_MOBILE_PHONE_NUMBERS_TITLE=Alle Mobilfunknummern auflisten. -ADMIN_SHOW_MOBILE_CREATED=Erstellt: -ADMIN_SHOW_MOBILE_UPDATED=Zuletzt ge\u00e4ndert: +ADMIN_SHOW_PHONE_CREATED=Erstellt: +ADMIN_SHOW_PHONE_UPDATED=Zuletzt ge\u00e4ndert: ADMIN_EDIT_MOBILE_TITLE=Mobiltelefoneintrag editieren: ADMIN_MOBILE_DATA_LEGEND=Mobiltelefonnummerdaten editeren: ADMIN_EDIT_MOBILE_PROVIDER=Mobilfunkanbieter \u00e4ndern: @@ -646,3 +646,13 @@ ADMIN_SELECT_MOBILE=Mobilfunknummer ausw\u00e4hlen: BUTTON_ADMIN_LINK_ADD_CONTACT_MOBILE=Mobilfunknummer zum Kontakt hinzuf\u00fcgen ADMIN_OR_ENTER_CONTACT_NEW_MOBILE_DATA=... oder neue Mobilfunknummer eingeben: ERROR_USER_EMAIL_ADDRESS_NOT_FOUND=Die eingegebene Email-Addresse konnte nicht gefunden werden. +LINK_ADMIN_LIST_LAND_LINE_PHONE_NUMBERS=Festnetznummern ... +LINK_ADMIN_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Listet alle Festnetznummern auf. +LINK_ADMIN_LIST_FAX_PHONE_NUMBERS=Faxnummern ... +LINK_ADMIN_LIST_FAX_PHONE_NUMBERS_TITLE=Listet alle Faxnummern auf. +ADMIN_LIST_FAX_EMPTY=Es sind keine Faxnummern gelistet. +PAGE_TITLE_ADMIN_LIST_CONTACT_FAX=Faxnummern auflisten +CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX=Faxnummern auflisten: +PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE=Festnetznummern auflisten +CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE=Festnetznummern auflisten: +ADMIN_SHOW_PHONE_NUMBER=Festnetznummer: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index a6f09503..19a3711a 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -376,7 +376,7 @@ ADMIN_LINK_DELETE_USER_TITLE=Deletes user account (after confirmation). CONTENT_TITLE_ADMIN_DELETE_USER=Delete user account: PAGE_TITLE_ADMIN_DELETE_USER=Delete user account ADMIN_HEADER_SHOW_MOBILE_DATA=Data of mobile phone: -ADMIN_SHOW_MOBILE_ID=Id number: +ADMIN_SHOW_PHONE_ID=Id number: ADMIN_SHOW_MOBILE_PROVIDER_NAME=Mobile provider: ADMIN_SHOW_MOBILE_NUMBER_COMPLETE=Complete number: ADMIN_SHOW_MOBILE_LINKS=Administrative links: @@ -603,8 +603,8 @@ ADMIN_LIST_MOBILE_EMPTY=No mobile numbers are saved. ADMIN_MENU_PHONE_NUMBERS_TITLE=Phone numbers: LINK_ADMIN_LIST_MOBILE_PHONE_NUMBERS=Cell phone numbers ... LINK_ADMIN_LIST_MOBILE_PHONE_NUMBERS_TITLE=List all mobile numbers. -ADMIN_SHOW_MOBILE_CREATED=Created: -ADMIN_SHOW_MOBILE_UPDATED=Last changed: +ADMIN_SHOW_PHONE_CREATED=Created: +ADMIN_SHOW_PHONE_UPDATED=Last changed: ADMIN_EDIT_MOBILE_TITLE=Edit mobile entry: ADMIN_MOBILE_DATA_LEGEND=Edit mobile data: ADMIN_EDIT_MOBILE_PROVIDER=Change mobile phone provider: @@ -646,3 +646,13 @@ ADMIN_SELECT_MOBILE=Choose mobile number: BUTTON_ADMIN_LINK_ADD_CONTACT_MOBILE=Add mobile number to contact ADMIN_OR_ENTER_CONTACT_NEW_MOBILE_DATA=... or add new mobile number: ERROR_USER_EMAIL_ADDRESS_NOT_FOUND=Your entered email address could not befound. +LINK_ADMIN_LIST_LAND_LINE_PHONE_NUMBERS=Land-line numbers ... +LINK_ADMIN_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Lists all land-line numbers. +LINK_ADMIN_LIST_FAX_PHONE_NUMBERS=Fax numbers ... +LINK_ADMIN_LIST_FAX_PHONE_NUMBERS_TITLE=Lists all fax numbers. +ADMIN_LIST_FAX_EMPTY=There are no fax numbers listed. +PAGE_TITLE_ADMIN_LIST_CONTACT_FAX=List fax numbers +CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX=List fax numbers: +PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE=List land-line numbers +CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE=List land-line numbers: +ADMIN_SHOW_PHONE_NUMBER=Land-line number: diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 8ff914f5..9375fd1d 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -67,6 +67,14 @@ user_profile /user/user_profile.xhtml + + admin_list_fax + /admin/fax/admin_fax_list.xhtml + + + admin_list_landline + /admin/landline/admin_landline_list.xhtml + admin_list_mobile /admin/mobile/admin_mobile_list.xhtml @@ -121,6 +129,14 @@ admin_list_mobile_provider /admin/mobile_provider/admin_mobile_provider_list.xhtml + + admin_list_contact_fax + /admin/fax/admin_contact_fax_list.xhtml + + + admin_list_contact_landline + /admin/landline/admin_contact_landline_list.xhtml + admin_list_contact_mobile /admin/mobile/admin_contact_mobile_list.xhtml @@ -348,6 +364,38 @@ admin_show_mobile_provider /admin/mobile_provider/admin_mobile_provider_show.xhtml + + admin_edit_fax + /admin/fax/admin_fax_edit.xhtml + + + admin_delete_fax + /admin/fax/admin_fax_delete.xhtml + + + admin_unlink_contact_fax + /admin/fax/admin_contact_fax_unlink.xhtml + + + admin_show_fax + /admin/fax/admin_fax_show.xhtml + + + admin_edit_landline + /admin/landline/admin_landline_edit.xhtml + + + admin_delete_landline + /admin/landline/admin_landline_delete.xhtml + + + admin_unlink_contact_landline + /admin/landline/admin_contact_landline_unlink.xhtml + + + admin_show_landline + /admin/landline/admin_landline_show.xhtml + admin_edit_mobile /admin/mobile/admin_mobile_edit.xhtml @@ -365,6 +413,36 @@ /admin/mobile/admin_mobile_show.xhtml + + /admin/fax/admin_fax_list.xhtml + + admin_show_fax + /admin/fax/admin_fax_show.xhtml + + + admin_edit_fax + /admin/fax/admin_fax_edit.xhtml + + + admin_delete_fax + /admin/fax/admin_fax_delete.xhtml + + + + /admin/landline/admin_landline_list.xhtml + + admin_show_landline + /admin/landline/admin_landline_show.xhtml + + + admin_edit_landline + /admin/landline/admin_landline_edit.xhtml + + + admin_delete_landline + /admin/landline/admin_landline_delete.xhtml + + /admin/mobile/admin_mobile_list.xhtml @@ -380,6 +458,44 @@ /admin/mobile/admin_mobile_delete.xhtml + + /admin/fax/admin_fax_show.xhtml + + admin_edit_fax + /admin/fax/admin_fax_edit.xhtml + + + admin_delete_fax + /admin/fax/admin_fax_delete.xhtml + + + admin_unlink_contact_fax + /admin/fax/admin_contact_fax_unlink.xhtml + + + admin_show_contact + /admin/contact/admin_contact_show.xhtml + + + + /admin/landline/admin_landline_show.xhtml + + admin_edit_landline + /admin/landline/admin_landline_edit.xhtml + + + admin_delete_landline + /admin/landline/admin_landline_delete.xhtml + + + admin_unlink_contact_landline + /admin/landline/admin_contact_landline_unlink.xhtml + + + admin_show_contact + /admin/contact/admin_contact_show.xhtml + + /admin/mobile/admin_mobile_show.xhtml @@ -425,6 +541,20 @@ /admin/mobile_provider/admin_mobile_provider_show.xhtml + + /admin/fax/admin_contact_fax_unlink.xhtml + + admin_show_contact + /admin/contact/admin_contact_show.xhtml + + + + /admin/landline/admin_contact_landline_unlink.xhtml + + admin_show_contact + /admin/contact/admin_contact_show.xhtml + + /admin/mobile/admin_contact_mobile_unlink.xhtml diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl index 8a96da7e..731c3bf8 100644 --- a/web/WEB-INF/templates/admin/admin_menu.tpl +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -37,7 +37,9 @@

    +
  • +