From 76f4fe3f37ce6eacafd6592d4d108aedbd5a7a5d 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 --- .../FinancialsEmailAddressValidator.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/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java index 512a2148..5b5b6a42 100644 --- a/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java @@ -76,16 +76,19 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator impleme // 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 b6f5e13d..977c879c 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -813,50 +813,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 667e5b55..e748e486 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -794,36 +794,36 @@ LOGIN_FINANCIAL_ENTER_RECEIPT_ISSUED_TITLE=Please enter or select here the exact 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 b8264608..a9ce4fb6 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 652610d2..e5938a0e 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 @@ - +
- +
- +
- +