From 055097806f5b4a1a6414141f83bce9bed6ff4b0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 19 Aug 2017 18:24:32 +0200 Subject: [PATCH] Please cherry-pick: - renamed business_data -> business_basic_data - renamed CONTACT_BUSINESS -> BUSINESS_BASIC_DATA and prevented double _DATA - need to check on value, not converted email address: if e.g. an empty email address is submitted, JSF seem to handle it as NULL, not empty, which makes sense here at the converter, as 'value' is of type Object and not String MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../JobsEmailAddressValidator.java | 13 ++++-- .../localization/bundle_de_DE.properties | 46 +++++++++---------- .../localization/bundle_en_US.properties | 46 +++++++++---------- web/WEB-INF/faces-config.xml | 8 ++-- web/WEB-INF/templates/admin/admin_menu.tpl | 6 +-- .../admin_form_business_basic_data.tpl} | 4 +- .../admin_business_basic_data_list.xhtml} | 36 +++++++-------- 7 files changed, 81 insertions(+), 78 deletions(-) rename web/WEB-INF/templates/admin/{business_data/admin_form_business_data.tpl => business_basic_data/admin_form_business_basic_data.tpl} (97%) rename web/admin/{business_data/admin_business_data_list.xhtml => business_basic_data/admin_business_basic_data_list.xhtml} (52%) diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java index 4afd8e1d..c4a820bb 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java @@ -76,16 +76,19 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, allowEmpty); - // Get string from object ... ;-) - // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat - String emailAddress = String.valueOf(value); - // Is the email address empty and allowed? - if (emailAddress.isEmpty() && allowEmpty) { + if (null == value && allowEmpty) { // Then accept this here return; + } else if (null == value) { + // Abort here + throw new ValidatorException(new FacesMessage("No empty email address allowed.")); //NOI18N } + // Get string from object ... ;-) + // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat + String emailAddress = String.valueOf(value).trim(); + // Checks if the email address matches a regex ("low-level" check) // @TODO Should also be done by ) boolean matches = EMAIL_PATTERN.matcher(emailAddress).matches(); //NOI18N diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index aba99ffe..75c3bb4e 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -809,50 +809,50 @@ GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Bitte geben Sie ein Passwort ein. Dies m GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Bitte wiederholen Sie das eingegebene Passwort. Dies wird zur Bestaetigung benoetigt. PAGE_TITLE_ADMIN_AREA=Administration #@TODO Please fix German umlauts! -ADMIN_MENU_CONTACT_BUSINESS_TITLE=Geschaeftliche Kontakte +ADMIN_MENU_BUSINESS_BASIC_DATA_TITLE=Geschaeftliche Kontakte #@TODO Please fix German umlauts! -LINK_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftskontakte auflisten +LINK_ADMIN_LIST_BUSINESS_BASIC_DATA=Geschaeftskontakte auflisten #@TODO Please fix German umlauts! -LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Listet geschaeftliche Kontakte auf +LINK_ADMIN_LIST_BUSINESS_BASIC_DATA_TITLE=Listet geschaeftliche Kontakte auf #@TODO Please fix German umlauts! -LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Geschaeftliche Kontakte exportieren +LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA=Geschaeftliche Kontakte exportieren #@TODO Please fix German umlauts! -LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exportiert geschaeftliche Kontakte +LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA_TITLE=Exportiert geschaeftliche Kontakte #@TODO Please fix German umlauts! -PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftliche Kontakte auflisten +PAGE_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Geschaeftliche Kontakte auflisten #@TODO Please fix German umlauts! -CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Auflisten von geschaeftlichen Kontakt +CONTENT_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Auflisten von geschaeftlichen Kontakt #@TODO Please fix German umlauts! -ADMIN_CONTACT_BUSINESS_LIST_EMPTY=Es befinden sich keine geschaeftlichen Kontakte in der Datenbank. +ADMIN_BUSINESS_BASIC_DATA_LIST_EMPTY=Es befinden sich keine geschaeftlichen Kontakte in der Datenbank. #@TODO Please fix German umlauts! -TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=Tabelle listet geschaeftliche Kontakte auf. -ADMIN_CONTACT_BUSINESS_ID=Id-Nummer: +TABLE_SUMMARY_ADMIN_LIST_BUSINESS_BASIC_DATA=Tabelle listet geschaeftliche Kontakte auf. +ADMIN_BUSINESS_BASIC_DATA_ID=Id-Nummer: #@TODO Please fix German umlauts! ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Details des geschaeftlichen Kontaktes anzeigen. -ADMIN_CONTACT_BUSINESS_OWNER_ID=Zugew. Benutzer: -ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Zuweisen +ADMIN_BUSINESS_BASIC_DATA_OWNER_ID=Zugew. Benutzer: +ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Geschaeftlichen Kontakt einen Benutzeraccount zuweisen. -ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Firmenname: -ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Ansprechpartner: -ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Zuweisen +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Geschaeftlichen Kontakt einen Benutzeraccount zuweisen. +ADMIN_BUSINESS_BASIC_DATA_COMPANY_NAME=Firmenname: +ADMIN_BUSINESS_BASIC_DATA_CONTACT_PERSON=Ansprechpartner: +ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Zeigt das komplette Kontaktprofil an. ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Anmerkungen: ADMIN_BUSINESS_DATA_PHONE_NUMBER=Haupttelefonnummer: ADMIN_BUSINESS_DATA_FAX_NUMBER=Hauptfaxnummer: #@TODO Please fix German umlauts! -ADMIN_ADD_CONTACT_BUSINESS_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen -ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein. +ADMIN_ADD_BUSINESS_BASIC_DATA_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen +ADMIN_ADD_BUSINESS_BASIC_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein. #@TODO Please fix German umlauts! ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format. #@TODO Please fix German umlauts! -ADMIN_CONTACT_BUSINESS_DATA_LEGEND=Basisdaten fuer geschaeftlichen Kontakt: +ADMIN_BUSINESS_BASIC_DATA_LEGEND=Basisdaten fuer geschaeftlichen Kontakt: #@TODO Please fix German umlauts! -ADMIN_CONTACT_BUSINESS_DATA_LEGEND_TITLE=Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. +ADMIN_BUSINESS_BASIC_DATA_LEGEND_TITLE=Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. ADMIN_BUSINESS_DATA_COMPANY_NAME=Firmenname: ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Bitte geben Sie den Firmennamen inklusive Rechtsform ein. ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS=Rechtsform (z.B. GmbH): diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 01b0805f..96a5070c 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -803,36 +803,36 @@ GUEST_REGISTRATION_USER_PASSWORDS_EMPTY_NOT_ALLOWED=You have to enter an own pas GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Please enter a password. This must match with security rules. GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Please repeat the entered password. This done to confirm the password. PAGE_TITLE_ADMIN_AREA=Administration -ADMIN_MENU_CONTACT_BUSINESS_TITLE=Business Contacts -LINK_ADMIN_LIST_CONTACT_BUSINESS=List business contacts -LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Lists business contacts -LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Export business contacts -LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exports business contacts -PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=List business contacts -CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Lists business contacts -ADMIN_CONTACT_BUSINESS_LIST_EMPTY=There are currently no business contacts in database. -TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=This table lists business contacts. -ADMIN_CONTACT_BUSINESS_ID=Id Number: +ADMIN_MENU_BUSINESS_BASIC_DATA_TITLE=Business Contacts +LINK_ADMIN_LIST_BUSINESS_BASIC_DATA=List business contacts +LINK_ADMIN_LIST_BUSINESS_BASIC_DATA_TITLE=Lists business contacts +LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA=Export business contacts +LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA_TITLE=Exports business contacts +PAGE_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=List business contacts +CONTENT_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Lists business contacts +ADMIN_BUSINESS_BASIC_DATA_LIST_EMPTY=There are currently no business contacts in database. +TABLE_SUMMARY_ADMIN_LIST_BUSINESS_BASIC_DATA=This table lists business contacts. +ADMIN_BUSINESS_BASIC_DATA_ID=Id Number: ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Show details of this business contact. -ADMIN_CONTACT_BUSINESS_OWNER_ID=Assigned user: -ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Shows assigned user profile. -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Assign -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Assigns this business contact to a user account. -ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Company name: -ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Contact person: -ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Assign -ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact. +ADMIN_BUSINESS_BASIC_DATA_OWNER_ID=Assigned user: +ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Shows assigned user profile. +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER=Assign +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account. +ADMIN_BUSINESS_BASIC_DATA_COMPANY_NAME=Company name: +ADMIN_BUSINESS_BASIC_DATA_CONTACT_PERSON=Contact person: +ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON=Assign +ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact. ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Shows complete contact profile. ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Comments: ADMIN_BUSINESS_DATA_PHONE_NUMBER=Main phone number: ADMIN_BUSINESS_DATA_FAX_NUMBER=Main fax number: -ADMIN_ADD_CONTACT_BUSINESS_TITLE=Add new business contact -ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Please enter at least company name including legal status. +ADMIN_ADD_BUSINESS_BASIC_DATA_TITLE=Add new business contact +ADMIN_ADD_BUSINESS_BASIC_DATA_MINIMUM_DATA=Please enter at least company name including legal status. ENTERED_EMAIL_ADDRESS_IS_INVALID=Your entered email address is not valid. -ADMIN_CONTACT_BUSINESS_DATA_LEGEND=Basic data for business contact: +ADMIN_BUSINESS_BASIC_DATA_LEGEND=Basic data for business contact: #Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. -ADMIN_CONTACT_BUSINESS_DATA_LEGEND_TITLE=Enter basic data for a business contact. +ADMIN_BUSINESS_BASIC_DATA_LEGEND_TITLE=Enter basic data for a business contact. ADMIN_BUSINESS_DATA_COMPANY_NAME=Company name: ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED=Please enter the company's name including legal status. ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS=Legal status (e.g. Inc.): diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 99fd5d65..41a4db7e 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -109,12 +109,12 @@ /admin/contact/admin_contact_export.xhtml - admin_list_business_data - /admin/business_data/admin_business_data_list.xhtml + admin_list_business_basic_data + /admin/business_basic_data/admin_business_basic_data_list.xhtml - admin_export_business_data - /admin/business_data/admin_business_data_export.xhtml + admin_export_business_basic_data + /admin/business_basic_data/admin_business_basic_data_export.xhtml admin_list_user diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl index 05270cc2..13b0cfd4 100644 --- a/web/WEB-INF/templates/admin/admin_menu.tpl +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -35,12 +35,12 @@
    -
  • -
  • +
  • +
diff --git a/web/WEB-INF/templates/admin/business_data/admin_form_business_data.tpl b/web/WEB-INF/templates/admin/business_basic_data/admin_form_business_basic_data.tpl similarity index 97% rename from web/WEB-INF/templates/admin/business_data/admin_form_business_data.tpl rename to web/WEB-INF/templates/admin/business_basic_data/admin_form_business_basic_data.tpl index af9c01b8..fda8dc4f 100644 --- a/web/WEB-INF/templates/admin/business_data/admin_form_business_data.tpl +++ b/web/WEB-INF/templates/admin/business_basic_data/admin_form_business_basic_data.tpl @@ -7,8 +7,8 @@
- - + + diff --git a/web/admin/business_data/admin_business_data_list.xhtml b/web/admin/business_basic_data/admin_business_basic_data_list.xhtml similarity index 52% rename from web/admin/business_data/admin_business_data_list.xhtml rename to web/admin/business_basic_data/admin_business_basic_data_list.xhtml index 3527e775..ab2de3f3 100644 --- a/web/admin/business_data/admin_business_data_list.xhtml +++ b/web/admin/business_basic_data/admin_business_basic_data_list.xhtml @@ -6,45 +6,45 @@ xmlns:f="http://xmlns.jcp.org/jsf/core"> - + - + - + - + - + - + - + - + - + - + @@ -52,17 +52,17 @@ - + - + - + - + @@ -71,17 +71,17 @@ - +
- +
- +
- +