From c5081875aa28935bb1a02e5c4713ed6209eee1f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 11 Jul 2016 18:03:32 +0200 Subject: [PATCH] Closed internal TODO: (please cherry-pick this) - house numbers may have extensions like 'a', so the full number can be e.g. '123a' which should be better splitted into number and extension - expanded templates for above stuff - expanded controllers for this - added missing i18n strings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- .../JobsAdminContactWebRequestBean.java | 16 ++ .../JobsAdminContactWebRequestController.java | 15 ++ .../contact/JobsContactWebSessionBean.java | 19 ++ .../JobsContactWebSessionController.java | 15 ++ .../JobsAdminCountryWebRequestBean.java | 4 +- .../beans/helper/JobsWebRequestHelper.java | 1 + ... JobsAdminContactPhoneWebRequestBean.java} | 4 +- ...dminContactPhoneWebRequestController.java} | 2 +- ...PizzaFeaturesWebApplicationController.java | 39 ---- .../admin/contact/admin_contact_data.tpl | 220 +++++++++--------- .../admin/contact/admin_form_contact_data.tpl | 14 ++ .../templates/contact/form_contact_data.tpl | 14 ++ 12 files changed, 212 insertions(+), 151 deletions(-) rename src/java/org/mxchange/jjobs/beans/phone/{JobsAdminContactPhoneWebSessionBean.java => JobsAdminContactPhoneWebRequestBean.java} (95%) rename src/java/org/mxchange/jjobs/beans/phone/{JobsAdminContactPhoneWebSessionController.java => JobsAdminContactPhoneWebRequestController.java} (97%) delete mode 100644 src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java index ea6ad966..420ae887 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java @@ -174,6 +174,11 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement */ private Short houseNumber; + /** + * House number extension + */ + private String houseNumberExtension; + /** * Whether a cellphone entry has been unlinked */ @@ -636,6 +641,16 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement this.houseNumber = houseNumber; } + @Override + public String getHouseNumberExtension () { + return this.houseNumberExtension; + } + + @Override + public void setHouseNumberExtension (final String houseNumberExtension) { + this.houseNumberExtension = houseNumberExtension; + } + @Override public Long getLandLineId () { return this.landLineId; @@ -802,6 +817,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement contact.setContactFamilyName(this.getFamilyName()); contact.setContactStreet(this.getStreet()); contact.setContactHouseNumber(this.getHouseNumber()); + contact.setContactHouseNumberExtension(this.getHouseNumberExtension()); contact.setContactZipCode(this.getZipCode()); contact.setContactCity(this.getCity()); contact.setContactCountry(this.getCountry()); diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java index 8df27e4d..af2c64b7 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java @@ -313,6 +313,21 @@ public interface JobsAdminContactWebRequestController extends Serializable { */ void setHouseNumber (final Short houseNumber); + /** + * Getter for house number extension, example: 123a 'a' is then the + * extension and 123 is the house number. + *

+ * @return House number extension + */ + String getHouseNumberExtension (); + + /** + * Setter for house number extension + *

+ * @param houseNumberExtension House number extension + */ + void setHouseNumberExtension (final String houseNumberExtension); + /** * Getter for phone number's area code *

diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index 92c9c236..f40bb6f3 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -162,6 +162,11 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job */ private Short houseNumber; + /** + * House number extension + */ + private String houseNumberExtension; + /** * Whether a cellphone entry has been unlinked */ @@ -439,6 +444,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName()); contact.setContactStreet(this.getStreet()); contact.setContactHouseNumber(this.getHouseNumber()); + contact.setContactHouseNumberExtension(this.getHouseNumberExtension()); contact.setContactZipCode(this.getZipCode()); contact.setContactCity(this.getCity()); contact.setContactCountry(this.getCountry()); @@ -542,6 +548,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job contact.setContactFamilyName(this.getFamilyName()); contact.setContactStreet(this.getStreet()); contact.setContactHouseNumber(this.getHouseNumber()); + contact.setContactHouseNumberExtension(this.getHouseNumberExtension()); contact.setContactZipCode(this.getZipCode()); contact.setContactCity(this.getCity()); contact.setContactCountry(this.getCountry()); @@ -725,6 +732,16 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job this.houseNumber = houseNumber; } + @Override + public String getHouseNumberExtension () { + return this.houseNumberExtension; + } + + @Override + public void setHouseNumberExtension (final String houseNumberExtension) { + this.houseNumberExtension = houseNumberExtension; + } + @Override public Integer getPhoneAreaCode () { return this.phoneAreaCode; @@ -958,6 +975,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job this.setFamilyName(null); this.setStreet(null); this.setHouseNumber(null); + this.setHouseNumberExtension(null); this.setZipCode(null); this.setCity(null); this.setCountry(null); @@ -1004,6 +1022,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job this.setFamilyName(contact.getContactFamilyName()); this.setStreet(contact.getContactStreet()); this.setHouseNumber(contact.getContactHouseNumber()); + this.setHouseNumberExtension(contact.getContactHouseNumberExtension()); this.setZipCode(contact.getContactZipCode()); this.setCity(contact.getContactCity()); this.setCountry(contact.getContactCountry()); diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java index ad0a0e42..cb8a6c29 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java @@ -345,6 +345,21 @@ public interface JobsContactWebSessionController extends Serializable { */ void setHouseNumber (final Short houseNumber); + /** + * Getter for house number extension, example: 123a 'a' is then the + * extension and 123 is the house number. + *

+ * @return House number extension + */ + String getHouseNumberExtension (); + + /** + * Setter for house number extension + *

+ * @param houseNumberExtension House number extension + */ + void setHouseNumberExtension (final String houseNumberExtension); + /** * Getter for phone number's area code *

diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java index 51eb57e0..9b6117fe 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java @@ -124,7 +124,7 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsController implement country.setCountryAbroadDialPrefix(this.getCountryAbroadDialPrefix()); country.setCountryCode(this.getCountryCode()); country.setCountryExternalDialPrefix(this.getCountryExternalDialPrefix()); - country.setCountryI18nkey(this.getCountryI18nKey()); + country.setCountryI18nKey(this.getCountryI18nKey()); country.setCountryIsLocalPrefixRequired(this.getCountryIsLocalPrefixRequired()); country.setCountryPhoneCode(this.getCountryPhoneCode()); @@ -247,7 +247,7 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsController implement Country next = iterator.next(); // Is country code or i18n the same? - if ((Objects.equals(country.getCountryCode(), next.getCountryCode())) || (Objects.equals(country.getCountryI18nkey(), next.getCountryI18nkey()))) { + if ((Objects.equals(country.getCountryCode(), next.getCountryCode())) || (Objects.equals(country.getCountryI18nKey(), next.getCountryI18nKey()))) { // Yes, then abort search isAdded = true; break; diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelper.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelper.java index 3cf2f558..5c3d16fb 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelper.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelper.java @@ -22,6 +22,7 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController; +import org.mxchange.jjobs.beans.phone.JobsAdminContactPhoneWebRequestController; import org.mxchange.jjobs.beans.user.JobsUserWebSessionController; import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestBean.java similarity index 95% rename from src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionBean.java rename to src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestBean.java index 80a42699..917025ff 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestBean.java @@ -39,7 +39,7 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; */ @Named ("adminPhoneController") @RequestScoped -public class JobsAdminContactPhoneWebSessionBean extends BaseJobsController implements JobsAdminContactPhoneWebSessionController { +public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController implements JobsAdminContactPhoneWebRequestController { /** * Serial number @@ -86,7 +86,7 @@ public class JobsAdminContactPhoneWebSessionBean extends BaseJobsController impl /** * Default constructor */ - public JobsAdminContactPhoneWebSessionBean () { + public JobsAdminContactPhoneWebRequestBean () { // Try it try { // Get initial context diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionController.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestController.java similarity index 97% rename from src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionController.java rename to src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestController.java index 989f9894..5094b321 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminContactPhoneWebRequestController.java @@ -29,7 +29,7 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; *

* @author Roland Haeder */ -public interface JobsAdminContactPhoneWebSessionController extends Serializable { +public interface JobsAdminContactPhoneWebRequestController extends Serializable { /** * Getter for all contacts having current cellphone instance linked diff --git a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java b/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java deleted file mode 100644 index 05892d05..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 org.mxchange.pizzaapplication.beans.features; - -import java.io.Serializable; -import javax.ejb.Local; - -/** - * An interface for country beans - *

- * @author Roland Haeder - */ -@Local -public interface PizzaFeaturesWebApplicationController extends Serializable { - - /** - * Checks if given feature is enabled. - *

- * @param feature Feature to be checked - *

- * @return Whether given feature is enabled - */ - boolean isFeatureEnabled (final String feature); - -} diff --git a/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl index 5e29f6f6..0cf4cfd1 100644 --- a/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl +++ b/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl @@ -1,107 +1,113 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl index 8de92120..23f196aa 100644 --- a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl +++ b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl @@ -99,6 +99,20 @@ +

+
+ +
+ +
+ +
+ +
+
+ + +
diff --git a/web/WEB-INF/templates/contact/form_contact_data.tpl b/web/WEB-INF/templates/contact/form_contact_data.tpl index 51455c98..dc990a7b 100644 --- a/web/WEB-INF/templates/contact/form_contact_data.tpl +++ b/web/WEB-INF/templates/contact/form_contact_data.tpl @@ -114,6 +114,20 @@
+
+
+ +
+ +
+ +
+ +
+
+ + +
-- 2.39.5