From 63046d175704adcb6bdd126db1ce6fc5bc400e1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 5 Sep 2017 00:27:47 +0200 Subject: [PATCH] Please cherry-pick: - added backing bean for general and administrative purposes for branch offices - added template + JSF page for branch offices - renamed business_contacts -> basic_company_data, more declarative - including JSF page and folder - all h:commandButton ids are now prefixed with "button_" - TitleUtils.allPersonalTitlesAsList() is now deprecated as it does the same as invoking Arrays.asList() - used more 'final' where possible, to prevent accidently assigned new values also known as "side effects" - renaming season has started again: now renamed some i18n strings to become generalized - removed noisy debug lines that are really no longer needed - some lesser local variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../localization/bundle_de_DE.properties | 83 ++-- .../localization/bundle_en_US.properties | 82 ++-- .../PizzaAdminBusinessDataWebRequestBean.java | 2 +- .../PizzaBusinessDataWebRequestBean.java | 6 +- .../PizzaAdminBranchOfficeWebRequestBean.java | 448 ++++++++++++++++++ ...AdminBranchOfficeWebRequestController.java | 28 ++ .../PizzaBranchOfficeWebRequestBean.java | 115 +++++ ...PizzaBranchOfficeWebRequestController.java | 28 ++ .../PizzaCompanyEmployeeWebRequestBean.java | 6 +- .../PizzaAdminContactWebRequestBean.java | 46 +- .../contact/PizzaContactWebRequestBean.java | 10 +- .../PizzaAdminContactPhoneWebRequestBean.java | 42 +- .../PizzaContactPhoneWebRequestBean.java | 12 +- .../PizzaAdminCountryWebRequestBean.java | 10 +- .../country/PizzaCountryWebRequestBean.java | 6 +- .../PizzaFeatureWebApplicationBean.java | 3 +- .../gender/PizzaGenderWebApplicationBean.java | 15 +- .../helper/PizzaWebRequestHelperBean.java | 2 +- .../PizzaLocalizationSessionBean.java | 18 +- .../PizzaMobileProviderWebRequestBean.java | 6 +- .../beans/phone/PizzaPhoneWebRequestBean.java | 18 +- .../PizzaUserProfileWebRequestBean.java | 10 +- .../PizzaProfileModeWebApplicationBean.java | 8 - .../user/PizzaAdminUserWebRequestBean.java | 20 +- .../beans/user/PizzaUserWebRequestBean.java | 50 +- .../user/PizzaUserWebRequestController.java | 1 + .../PizzaUserActivityWebRequestBean.java | 8 +- .../PizzaConfirmationLinkWebRequestBean.java | 10 +- .../PizzaEmailChangeWebRequestBean.java | 10 +- .../login/PizzaUserLoginWebSessionBean.java | 10 +- .../PizzaUserPasswordWebRequestBean.java | 6 +- .../PizzaUserRegisterWebRequestBean.java | 16 +- .../PizzaResendLinkWebRequestBean.java | 6 +- ...va => PizzaBasicCompanyDataConverter.java} | 4 +- .../PizzaCompanyEmployeeConverter.java | 8 +- .../PizzaCompanyHeadquartersConverter.java | 4 +- .../contact/PizzaContactConverter.java | 6 +- .../country/PizzaCountryConverter.java | 6 +- .../fax/PizzaFaxNumberConverter.java | 4 +- .../PizzaLandLineNumberConverter.java | 4 +- .../mobile/PizzaMobileNumberConverter.java | 4 +- .../PizzaMobileProviderConverter.java | 8 +- .../converter/user/PizzaUserConverter.java | 4 +- .../birthday/PizzaBirthdayValidator.java | 4 +- .../basicdata/PizzaCompanyNameValidator.java | 14 +- .../PizzaEmailAddressValidator.java | 18 +- .../validator/names/PizzaNameValidator.java | 2 +- .../password/PizzaUserPasswordValidator.java | 2 +- .../abroad/PizzaAbroadDialValidator.java | 6 +- .../number/PizzaPhoneNumberValidator.java | 2 +- .../PizzaPrivacyTermsCheckboxValidator.java | 2 +- .../validator/url/PizzaUrlValidator.java | 6 +- .../validator/user/PizzaUserIdValidator.java | 8 +- web/WEB-INF/faces-config.xml | 33 +- .../contact/admin_form_contact_data.tpl | 12 +- web/WEB-INF/templates/admin/admin_menu.tpl | 9 +- .../admin_form_basic_company_data.tpl} | 38 +- .../admin_form_branch_offices_data.tpl | 257 ++++++++++ .../templates/contact/form_contact_data.tpl | 10 +- .../register/guest_form_register_page1.tpl | 2 +- .../register/guest_form_register_single.tpl | 2 +- web/WEB-INF/web.xml | 2 +- .../admin_basic_company_data_list.xhtml | 115 +++++ .../admin_branch_offices_list.xhtml | 115 +++++ .../admin_business_contacts_list.xhtml | 115 ----- web/admin/contact/admin_contact_delete.xhtml | 2 +- web/admin/contact/admin_contact_edit.xhtml | 2 +- web/admin/contact/admin_contact_export.xhtml | 2 +- web/admin/contact/admin_contact_list.xhtml | 2 +- .../unlink/admin_contact_fax_unlink.xhtml | 2 +- .../admin_contact_landline_unlink.xhtml | 2 +- .../unlink/admin_contact_mobile_unlink.xhtml | 2 +- web/admin/country/admin_country_list.xhtml | 2 +- web/admin/fax/admin_fax_delete.xhtml | 2 +- web/admin/fax/admin_fax_edit.xhtml | 2 +- .../landline/admin_landline_delete.xhtml | 2 +- web/admin/landline/admin_landline_edit.xhtml | 2 +- web/admin/mobile/admin_mobile_delete.xhtml | 2 +- web/admin/mobile/admin_mobile_edit.xhtml | 2 +- .../admin_mobile_provider_list.xhtml | 2 +- web/admin/user/admin_user_delete.xhtml | 2 +- web/admin/user/admin_user_edit.xhtml | 2 +- web/admin/user/admin_user_export.xhtml | 2 +- web/admin/user/admin_user_list.xhtml | 2 +- web/guest/user/user_resend_link.xhtml | 2 +- .../login_user_change_email_address.xhtml | 2 +- web/user/login_user_change_password.xhtml | 2 +- .../login_user_change_personal_data.xhtml | 2 +- 88 files changed, 1507 insertions(+), 506 deletions(-) create mode 100644 src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestController.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestController.java rename src/java/org/mxchange/pizzaapplication/converter/business/basicdata/{PizzaBusinessContactConverter.java => PizzaBasicCompanyDataConverter.java} (95%) rename web/WEB-INF/templates/admin/{business_basic_data/admin_form_business_basic_data.tpl => basic_company_data/admin_form_basic_company_data.tpl} (86%) create mode 100644 web/WEB-INF/templates/admin/branch_offices/admin_form_branch_offices_data.tpl create mode 100644 web/admin/basic_company_data/admin_basic_company_data_list.xhtml create mode 100644 web/admin/branch_offices/admin_branch_offices_list.xhtml delete mode 100644 web/admin/business_contacts/admin_business_contacts_list.xhtml diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 9a7eed4c..9f0483ec 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -61,13 +61,13 @@ PERSONAL_DATA_MINIMUM_NOTICE=Bitte geben Sie mindestens Name, Anschrift und Tele PERSONAL_DATA_PERSONAL_TITLE=Anrede: PERSONAL_DATA_FIRST_NAME=Vorname: PERSONAL_DATA_FAMILY_NAME=Nachname: -PERSONAL_DATA_STREET=Stra\u00dfe: -PERSONAL_DATA_HOUSE_NUMBER=Hausnummer: -PERSONAL_DATA_ZIP_CODE=Postleitzahl: +DATA_STREET_NAME=Stra\u00dfe: +DATA_HOUSE_NUMBER=Hausnummer: +DATA_ZIP_CODE=Postleitzahl: PERSONAL_DATA_PHONE_NUMBER=Telefon: PERSONAL_DATA_FAX_NUMBER=Faxnummer: PERSONAL_DATA_MOBILE_NUMBER=Mobil: -PERSONAL_DATA_CITY=Ort: +DATA_CITY=Ort: PERSONAL_DATA_LEGEND_TITLE=Bitte geben Sie Ihre Daten ein. PERSONAL_DATA_LEGEND=Bitte Ihre Daten eingeben: PAGE_TITLE_USER_LOGIN=Einloggen @@ -246,11 +246,11 @@ ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE=Geben Sie hier die pers\u00f6nlichen Da ADMIN_PERSONAL_DATA_PERSONAL_TITLE=Anrede ausw\u00e4hlen: ADMIN_PERSONAL_DATA_FIRST_NAME=Vorname: ADMIN_PERSONAL_DATA_FAMILY_NAME=Familienname: -ADMIN_PERSONAL_DATA_STREET=Strassenname: -ADMIN_PERSONAL_DATA_HOUSE_NUMBER=Hausnummer: -ADMIN_PERSONAL_DATA_ZIP_CODE=Postleitzahl: -ADMIN_PERSONAL_DATA_CITY=Wohnort: -ADMIN_PERSONAL_DATA_COUNTRY_CODE=Land ausw\u00e4hlen: +ADMIN_DATA_STREET_NAME=Strassenname: +ADMIN_DATA_HOUSE_NUMBER=Hausnummer: +ADMIN_DATA_ZIP_CODE=Postleitzahl: +ADMIN_DATA_CITY=Wohnort: +ADMIN_SELECT_COUNTRY=Land ausw\u00e4hlen: ADMIN_PERSONAL_DATA_PHONE_NUMBER=Telefonnummer: ADMIN_PERSONAL_DATA_FAX_NUMBER=Faxnummer: ADMIN_PERSONAL_DATA_MOBILE_NUMBER=Handynummer: @@ -553,8 +553,8 @@ LOGIN_USER_LOGOUT_TITLE=Aus Benutzerbereich ausloggen? LOGIN_USER_LOGOUT_NOTICE=M\u00f6chten Sie sich aus dem Benutzerbereich ausloggen? Dies sollten Sie immer an einem Rechner tun, den auch andere nutzen (z.B. Internetcafe). BUTTON_USER_LOGOUT=Ausloggen ADMIN_CONTACT_HOUSE_NUMBER_EXTENSION=Hausnummererweiterung: -ADMIN_PERSONAL_DATA_HOUSE_NUMBER_EXTENSION=Hausnummererweiterung: -PERSONAL_DATA_HOUSE_NUMBER_EXTENSION=Anhang: +ADMIN_DATA_HOUSE_NUMBER_EXTENSION=Hausnummererweiterung: +DATA_HOUSE_NUMBER_EXTENSION=Anhang: ERROR_PARAMETER_FILE_TYPE_NOT_SET=Fehler: Parameter 'fileType' nicht gesetzt. ADMIN_COUNTRY_PHONE_CODE_REQUIRED=Bitte geben Sie die Vorwahl dieses Landes ein (z.B. 49 f\u00fcr Deutschland). ADMIN_COUNTRY_EXTERNAL_DIAL_PREFIX_REQUIRED=Bitte geben Sie die Vorwahl f\u00fcr Gespr\u00e4che ausserhalb des Ortes ein (meistens 0). @@ -787,45 +787,45 @@ 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_BUSINESS_BASIC_DATA_TITLE=Geschaeftliche Kontakte -LINK_ADMIN_LIST_BUSINESS_BASIC_DATA=Stammdaten auflisten -LINK_ADMIN_LIST_BUSINESS_BASIC_DATA_TITLE=Listet Stammdaten auf -LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA=Stammdaten exportieren -LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA_TITLE=Exportiert Stammdaten -PAGE_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Stammdaten auflisten +ADMIN_MENU_BUSINESS_CONTACTS_TITLE=Geschaeftliche Kontakte +LINK_ADMIN_LIST_BASIC_COMPANY_DATA=Stammdaten auflisten +LINK_ADMIN_LIST_BASIC_COMPANY_DATA_TITLE=Listet Stammdaten auf +LINK_ADMIN_EXPORT_BASIC_COMPANY_DATA=Stammdaten exportieren +LINK_ADMIN_EXPORT_BASIC_COMPANY_DATA_TITLE=Exportiert Stammdaten +PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Stammdaten auflisten #@TODO Please fix German umlauts! -CONTENT_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Auflisten von Stammdaten +CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Auflisten von Stammdaten #@TODO Please fix German umlauts! -ADMIN_BUSINESS_BASIC_DATA_LIST_EMPTY=Es befinden sich keine Stammdaten in der Datenbank. +ADMIN_BASIC_COMPANY_DATA_LIST_EMPTY=Es befinden sich keine Stammdaten in der Datenbank. #@TODO Please fix German umlauts! -TABLE_SUMMARY_ADMIN_LIST_BUSINESS_BASIC_DATA=Tabelle listet Stammdaten auf. -ADMIN_BUSINESS_BASIC_DATA_ID=Id-Nummer: +TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=Tabelle listet Stammdaten auf. +ADMIN_BASIC_COMPANY_DATA_ID=Id-Nummer: #@TODO Please fix German umlauts! ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Details des Stammdatens anzeigen. -ADMIN_BUSINESS_BASIC_DATA_OWNER_ID=Zugew. Benutzer: -ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. +ADMIN_BASIC_COMPANY_DATA_OWNER_ID=Zugew. Benutzer: +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. ADMIN_LINK_ASSIGN=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Stammdaten 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 +ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Stammdaten einen Benutzeraccount zuweisen. +ADMIN_BASIC_COMPANY_DATA_COMPANY_NAME=Firmenname: +ADMIN_BASIC_COMPANY_DATA_CONTACT_PERSON=Ansprechpartner: +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. +ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. +ADMIN_LINK_ASSIGN_BASIC_COMPANY_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_BUSINESS_BASIC_DATA_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen -ADMIN_ADD_BUSINESS_BASIC_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein. +ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen +ADMIN_ADD_BASIC_COMPANY_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_BUSINESS_BASIC_DATA_LEGEND=Basisdaten fuer geschaeftlichen Kontakt: +ADMIN_BASIC_COMPANY_DATA_LEGEND=Basisdaten fuer geschaeftlichen Kontakt: #@TODO Please fix German umlauts! -ADMIN_BUSINESS_BASIC_DATA_LEGEND_TITLE=Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. +ADMIN_BASIC_COMPANY_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): @@ -853,11 +853,20 @@ ADMIN_SELECT_BUSINESS_DATA_COMPANY_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperso ADMIN_SELECT_BUSINESS_DATA_COMPANY_HEADQUARTERS=Daten des Hauptsitzesz auswaehlen: LINK_COMPANY_WEBSITE_URL_TITLE=Zur Unternehmenswebseite (neues Fenster) surfen #@TODO Please fix German umlauts! -ADMIN_BUSINESS_BASIC_DATA_COMPANY_FOUNDER=Gruender +ADMIN_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Gruender #@TODO Please fix German umlauts! -ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen. +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen. #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu. -ADMIN_BUSINESS_BASIC_DATA_CREATED=Eintrag erstellt +ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu. +ADMIN_BASIC_COMPANY_DATA_CREATED=Eintrag erstellt ADMIN_USER_NAME_IS_REQUIRED=Bitte vergeben Sie einen Benutzernamen. Dieser muss unique sein. NO_WEBSITE_URL_ENTERED=Keine URL eingegeben +LINK_ADMIN_LIST_BRANCH_OFFICES=Filialen auflisten +ADMIN_DATA_STORE=Etage: +ADMIN_DATA_SUITE_NUMBER=Appartmentnummer: +ADMIN_SELECT_BRANCH_OFFICE_USER_OWNER=Filiale einem Benutzer zuweisen: +ADMIN_SELECT_BRANCH_OFFICE_CONTACT_EMPLOYEE=Kontaktperson der Filiale zuweisen: +ADMIN_BRANCH_OFFICE_LEGEND=Grunddaten der Filiale: +#@TODO Please fix German umlauts! +ADMIN_BRANCH_OFFICE_LEGEND_TITLE=Geben Sie hier die Grunddaten der Filiale ein. +ADMIN_SELECT_BRANCH_OFFICE_COMPANY=Filiale einem Unternehmen zuweisen: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 167b0a97..b76e51e6 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -61,13 +61,13 @@ PERSONAL_DATA_MINIMUM_NOTICE=Please enter at least your name, address and phone PERSONAL_DATA_PERSONAL_TITLE=Salutation: PERSONAL_DATA_FIRST_NAME=First name: PERSONAL_DATA_FAMILY_NAME=Family name: -PERSONAL_DATA_STREET=Street: -PERSONAL_DATA_HOUSE_NUMBER=House number: -PERSONAL_DATA_ZIP_CODE=ZIP code: +DATA_STREET_NAME=Street: +DATA_HOUSE_NUMBER=House number: +DATA_ZIP_CODE=ZIP code: PERSONAL_DATA_PHONE_NUMBER=Phone: PERSONAL_DATA_FAX_NUMBER=Fax: PERSONAL_DATA_MOBILE_NUMBER=Mobile: -PERSONAL_DATA_CITY=City: +DATA_CITY=City: PERSONAL_DATA_LEGEND_TITLE=Please enter your data. PERSONAL_DATA_LEGEND=Please enter your data: PAGE_TITLE_USER_LOGIN=Login @@ -229,11 +229,11 @@ ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE=Here you can enter the personal data of ADMIN_PERSONAL_DATA_PERSONAL_TITLE=Select title: ADMIN_PERSONAL_DATA_FIRST_NAME=First name: ADMIN_PERSONAL_DATA_FAMILY_NAME=Family name: -ADMIN_PERSONAL_DATA_STREET=Name of street: -ADMIN_PERSONAL_DATA_HOUSE_NUMBER=House number: -ADMIN_PERSONAL_DATA_ZIP_CODE=ZIP code: -ADMIN_PERSONAL_DATA_CITY=City: -ADMIN_PERSONAL_DATA_COUNTRY_CODE=Select country: +ADMIN_DATA_STREET_NAME=Name of street: +ADMIN_DATA_HOUSE_NUMBER=House number: +ADMIN_DATA_ZIP_CODE=ZIP code: +ADMIN_DATA_CITY=City: +ADMIN_SELECT_COUNTRY=Select country: ADMIN_PERSONAL_DATA_PHONE_NUMBER=Phone number: ADMIN_PERSONAL_DATA_FAX_NUMBER=Fax number: ADMIN_PERSONAL_DATA_MOBILE_NUMBER=Mobile number: @@ -547,8 +547,8 @@ LOGIN_USER_LOGOUT_TITLE=Logout from user area? LOGIN_USER_LOGOUT_NOTICE=Do you want to logout from user area? You should always do this when you share the same computer with others (e.g. Internet cafe). BUTTON_USER_LOGOUT=Logout ADMIN_CONTACT_HOUSE_NUMBER_EXTENSION=House number extension: -ADMIN_PERSONAL_DATA_HOUSE_NUMBER_EXTENSION=House number extension: -PERSONAL_DATA_HOUSE_NUMBER_EXTENSION=Extension: +ADMIN_DATA_HOUSE_NUMBER_EXTENSION=House number extension: +DATA_HOUSE_NUMBER_EXTENSION=Extension: ERROR_PARAMETER_FILE_TYPE_NOT_SET=Error: Parameter 'fileType' is not set. ADMIN_COUNTRY_PHONE_CODE_REQUIRED=Please enter dial prefix for this country (e.g. 1 for U.S.A.). ADMIN_COUNTRY_EXTERNAL_DIAL_PREFIX_REQUIRED=Please enter dial prefix for calls outside the current city. @@ -779,36 +779,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_BUSINESS_BASIC_DATA_TITLE=Business contacts -LINK_ADMIN_LIST_BUSINESS_BASIC_DATA=List basic company data -LINK_ADMIN_LIST_BUSINESS_BASIC_DATA_TITLE=Lists basic company data -LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA=Export basic company data -LINK_ADMIN_EXPORT_BUSINESS_BASIC_DATA_TITLE=Exports basic company data -PAGE_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=List basic company data -CONTENT_TITLE_ADMIN_LIST_BUSINESS_BASIC_DATA=Lists basic company data -ADMIN_BUSINESS_BASIC_DATA_LIST_EMPTY=There are currently no basic company data in database. -TABLE_SUMMARY_ADMIN_LIST_BUSINESS_BASIC_DATA=This table lists basic company data. -ADMIN_BUSINESS_BASIC_DATA_ID=Id Number: +ADMIN_MENU_BUSINESS_CONTACTS_TITLE=Business contacts +LINK_ADMIN_LIST_BASIC_COMPANY_DATA=List basic company data +LINK_ADMIN_LIST_BASIC_COMPANY_DATA_TITLE=Lists basic company data +LINK_ADMIN_EXPORT_BASIC_COMPANY_DATA=Export basic company data +LINK_ADMIN_EXPORT_BASIC_COMPANY_DATA_TITLE=Exports basic company data +PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=List basic company data +CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Lists basic company data +ADMIN_BASIC_COMPANY_DATA_LIST_EMPTY=There are currently no basic company data in database. +TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=This table lists basic company data. +ADMIN_BASIC_COMPANY_DATA_ID=Id Number: ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Show details of this business contact. -ADMIN_BUSINESS_BASIC_DATA_OWNER_ID=Assigned user: -ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_OWNER_USER_TITLE=Shows assigned user profile. +ADMIN_BASIC_COMPANY_DATA_OWNER_ID=Assigned user: +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Shows assigned user profile. ADMIN_LINK_ASSIGN=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_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account. +ADMIN_BASIC_COMPANY_DATA_COMPANY_NAME=Company name: +ADMIN_BASIC_COMPANY_DATA_CONTACT_PERSON=Contact person: +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. +ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Assign +ADMIN_LINK_ASSIGN_BASIC_COMPANY_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_BUSINESS_BASIC_DATA_TITLE=Add new business contact -ADMIN_ADD_BUSINESS_BASIC_DATA_MINIMUM_DATA=Please enter at least company name including legal status. +ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Add new business contact +ADMIN_ADD_BASIC_COMPANY_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_BUSINESS_BASIC_DATA_LEGEND=Basic data for business contact: +ADMIN_BASIC_COMPANY_DATA_LEGEND=Basic data for business contact: #Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. -ADMIN_BUSINESS_BASIC_DATA_LEGEND_TITLE=Enter basic data for a business contact. +ADMIN_BASIC_COMPANY_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.): @@ -828,9 +828,17 @@ URL_NOT_MATCHING_REGULAR_EXPRESSION=The entered URL does not match the common fo ADMIN_SELECT_BUSINESS_DATA_COMPANY_CONTACT_EMPLOYEE=Choose employee as contact person: ADMIN_SELECT_BUSINESS_DATA_COMPANY_HEADQUARTERS=Choose headquarters: LINK_COMPANY_WEBSITE_URL_TITLE=Surf to company's web site (new window) -ADMIN_BUSINESS_BASIC_DATA_COMPANY_FOUNDER=Founder -ADMIN_LINK_SHOW_BUSINESS_BASIC_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder. -ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry. -ADMIN_BUSINESS_BASIC_DATA_CREATED=Entry created +ADMIN_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Founder +ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder. +ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry. +ADMIN_BASIC_COMPANY_DATA_CREATED=Entry created ADMIN_USER_NAME_IS_REQUIRED=Please enter a user name. This must be unique. NO_WEBSITE_URL_ENTERED=No URL entered +LINK_ADMIN_LIST_BRANCH_OFFICES=List branch offices +ADMIN_DATA_STORE=Store: +ADMIN_DATA_SUITE_NUMBER=Suite number: +ADMIN_SELECT_BRANCH_OFFICE_USER_OWNER=Assign branch office to user: +ADMIN_SELECT_BRANCH_OFFICE_CONTACT_EMPLOYEE=Select contact person to branch office: +ADMIN_BRANCH_OFFICE_LEGEND=Branch office basic data: +ADMIN_BRANCH_OFFICE_LEGEND_TITLE=Enter branch office basic data here. +ADMIN_SELECT_BRANCH_OFFICE_COMPANY=Assign branch office to company: diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaAdminBusinessDataWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaAdminBusinessDataWebRequestBean.java index 8aa667d9..0a7795eb 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaAdminBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaAdminBusinessDataWebRequestBean.java @@ -238,7 +238,7 @@ public class PizzaAdminBusinessDataWebRequestBean extends BasePizzaController im } // Continue to list again - return "admin_list_business_contacts"; //NOI18N + return "admin_list_basic_company_data"; //NOI18N } /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java index 6e0f01c1..568c4699 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/business/basicdata/PizzaBusinessDataWebRequestBean.java @@ -166,10 +166,10 @@ public class PizzaBusinessDataWebRequestBean extends BasePizzaController impleme @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allCompanyBasicData () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.basicDataCache.iterator(); + final Iterator> iterator = this.basicDataCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -354,7 +354,7 @@ public class PizzaBusinessDataWebRequestBean extends BasePizzaController impleme // Is cache there? if (!this.basicDataCache.iterator().hasNext()) { // Get whole list - List list = this.businessDataBean.allCompanyBasicData(); + final List list = this.businessDataBean.allCompanyBasicData(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestBean.java new file mode 100644 index 00000000..4bf0fc32 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestBean.java @@ -0,0 +1,448 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.business.branchoffice; + +import javax.ejb.EJB; +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; +import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.branchoffice.AdminBranchOfficeSessionBeanRemote; +import org.mxchange.jcontactsbusiness.employee.Employee; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jfinancials.beans.BasePizzaController; +import org.mxchange.jusercore.model.user.User; + +/** + * An administrative bean for branch offices + *

+ * @author Roland Häder + */ +@Named ("adminBranchOfficeController") +@RequestScoped +public class PizzaAdminBranchOfficeWebRequestBean extends BasePizzaController implements PizzaAdminBranchOfficeWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 5_028_697_360_461L; + + /** + * EJB for administrative purposes + */ + @EJB (lookup = "java:global/jfinancials-ejb/adminBranchOffice!org.mxchange.jcontactsbusiness.branchoffice.AdminBranchOfficeSessionBeanRemote") + private AdminBranchOfficeSessionBeanRemote adminBranchOfficeBean; + + /** + * City + */ + private String branchCity; + + /** + * Assigned company for this branch office + */ + private BusinessBasicData branchCompany; + + /** + * Contact person in branch office + */ + private Employee branchContactEmployee; + + /** + * Country + */ + private Country branchCountry; + + /** + * Email address + */ + private String branchEmailAddress; + + /** + * House number + */ + private Short branchHouseNumber; + + /** + * Store + */ + private Short branchStore; + + /** + * Branch office street name + */ + private String branchStreet; + + /** + * Suite number + */ + private Short branchSuiteNumber; + + /** + * Owning user instance (which this branch office is assigned to) + */ + private User branchUserOwner; + + /** + * ZIP code + */ + private Integer branchZipCode; + + /** + * Area code for fax number + */ + private Integer faxAreaCode; + + /** + * Country for fax number + */ + private Country faxCountry; + + /** + * Dial number for fax number + */ + private Long faxNumber; + + /** + * Area code for land-line number + */ + private Integer landLineAreaCode; + + /** + * Country for land-line number + */ + private Country landLineCountry; + + /** + * Dial number for land-line number + */ + private Long landLineNumber; + + /** + * Default constructor + */ + public PizzaAdminBranchOfficeWebRequestBean () { + // Call super constructor + super(); + } + + /** + * Getter for city + *

+ * @return City + */ + public String getBranchCity () { + return this.branchCity; + } + + /** + * Setter for city + *

+ * @param branchCity City + */ + public void setBranchCity (final String branchCity) { + this.branchCity = branchCity; + } + + /** + * Getter for basic company data + *

+ * @return Basic company data + */ + public BusinessBasicData getBranchCompany () { + return this.branchCompany; + } + + /** + * Setter for basic company data + *

+ * @param branchCompany Basic company data + */ + public void setBranchCompany (final BusinessBasicData branchCompany) { + this.branchCompany = branchCompany; + } + + /** + * Getter for branch office contact person + *

+ * @return Branch office contact person + */ + public Employee getBranchContactEmployee () { + return this.branchContactEmployee; + } + + /** + * Setter for branch office contact person + *

+ * @param branchContactEmployee Branch office contact person + */ + public void setBranchContactEmployee (final Employee branchContactEmployee) { + this.branchContactEmployee = branchContactEmployee; + } + + /** + * Getter for country + *

+ * @return Country + */ + public Country getBranchCountry () { + return this.branchCountry; + } + + /** + * Setter for country + *

+ * @param branchCountry Country + */ + public void setBranchCountry (final Country branchCountry) { + this.branchCountry = branchCountry; + } + + /** + * Getter for email address + *

+ * @return Email address + */ + public String getBranchEmailAddress () { + return this.branchEmailAddress; + } + + /** + * Getter for email address + *

+ * @param branchEmailAddress Email address + */ + public void setBranchEmailAddress (final String branchEmailAddress) { + this.branchEmailAddress = branchEmailAddress; + } + + /** + * Getter for house number + *

+ * @return House number + */ + public Short getBranchHouseNumber () { + return this.branchHouseNumber; + } + + /** + * Setter for house number + *

+ * @param branchHouseNumber House number + */ + public void setBranchHouseNumber (final Short branchHouseNumber) { + this.branchHouseNumber = branchHouseNumber; + } + + /** + * Getter for store + *

+ * @return Store + */ + public Short getBranchStore () { + return this.branchStore; + } + + /** + * Setter for store + *

+ * @param branchStore Store + */ + public void setBranchStore (final Short branchStore) { + this.branchStore = branchStore; + } + + /** + * Getter for street name + *

+ * @return Street name + */ + public String getBranchStreet () { + return this.branchStreet; + } + + /** + * Setter for street name + *

+ * @param branchStreet Street name + */ + public void setBranchStreet (final String branchStreet) { + this.branchStreet = branchStreet; + } + + /** + * Getter for suite number + *

+ * @return Suite number + */ + public Short getBranchSuiteNumber () { + return this.branchSuiteNumber; + } + + /** + * Setter for suite number + *

+ * @param branchSuiteNumber Suite number + */ + public void setBranchSuiteNumber (final Short branchSuiteNumber) { + this.branchSuiteNumber = branchSuiteNumber; + } + + /** + * Getter for owning user instance + *

+ * @return Owning user instance + */ + public User getBranchUserOwner () { + return this.branchUserOwner; + } + + /** + * Setter for owning user instance + *

+ * @param branchUserOwner Owning user instance + */ + public void setBranchUserOwner (final User branchUserOwner) { + this.branchUserOwner = branchUserOwner; + } + + /** + * Getter for ZIP code\ + *

+ * @return ZIP code + */ + public Integer getBranchZipCode () { + return this.branchZipCode; + } + + /** + * Setter for ZIP code\ + *

+ * @param branchZipCode ZIP code + */ + public void setBranchZipCode (final Integer branchZipCode) { + this.branchZipCode = branchZipCode; + } + + /** + * Getter for fax number's area code + *

+ * @return Fax number's area code + */ + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + /** + * Setter for fax number's area code + *

+ * @param faxAreaCode Fax number's area code + */ + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + /** + * Getter for fax's country instance + *

+ * @return Fax' country instance + */ + public Country getFaxCountry () { + return this.faxCountry; + } + + /** + * Setter for fax's country instance + *

+ * @param faxCountry Fax' country instance + */ + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + /** + * Getter for fax number + *

+ * @return Fax number + */ + public Long getFaxNumber () { + return this.faxNumber; + } + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + public void setFaxNumber (final Long faxNumber) { + this.faxNumber = faxNumber; + } + + /** + * Getter for land-line number's area code + *

+ * @return Land-line number's area code + */ + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; + } + + /** + * Setter for land-line number's area code + *

+ * @param landLineAreaCode Land-line number's area code + */ + public void setLandLineAreaCode (final Integer landLineAreaCode) { + this.landLineAreaCode = landLineAreaCode; + } + + /** + * Getter for land-line number's country instance + *

+ * @return Land-line number's country instance + */ + public Country getLandLineCountry () { + return this.landLineCountry; + } + + /** + * Setter for land-line number's country instance + *

+ * @param landLineCountry Land-line number's country instance + */ + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; + } + + /** + * Getter for land-line number + *

+ * @return Land-line number + */ + public Long getLandLineNumber () { + return this.landLineNumber; + } + + /** + * Setter for land-line number + *

+ * @param landLineNumber Land-line number + */ + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; + } + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestController.java new file mode 100644 index 00000000..dcb31485 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaAdminBranchOfficeWebRequestController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.business.branchoffice; + +import java.io.Serializable; + +/** + * An interface for administrative branch office controller + *

+ * @author Roland Häder + */ +public interface PizzaAdminBranchOfficeWebRequestController extends Serializable { + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestBean.java new file mode 100644 index 00000000..05564793 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestBean.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.business.branchoffice; + +import fish.payara.cdi.jsr107.impl.NamedCache; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.cache.Cache; +import javax.ejb.EJB; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.inject.Named; +import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; +import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote; +import org.mxchange.pizzaapplication.beans.BasePizzaController; + +/** + * A general bean for branch offices + *

+ * @author Roland Häder + */ +@Named ("branchOfficeController") +@RequestScoped +public class PizzaBranchOfficeWebRequestBean extends BasePizzaController implements PizzaBranchOfficeWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 5_028_697_360_461L; + + /** + * EJB for administrative purposes + */ + @EJB (lookup = "java:global/jfinancials-ejb/branchOffice!org.mxchange.jcontactsbusiness.branchoffice.BranchOfficeSessionBeanRemote") + private BranchOfficeSessionBeanRemote branchOfficeBean; + + /** + * A list of all branch offices (globally) + */ + @Inject + @NamedCache (cacheName = "branchOfficeCache") + private Cache branchOfficeCache; + + /** + * Default constructor + */ + public PizzaBranchOfficeWebRequestBean () { + // Call super constructor + super(); + } + + /** + * Returns a list of all branch offices + *

+ * @return A list of all branch offices + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allBranchOffices () { + // Init list + final List list = new LinkedList<>(); + + // Get iterator + final Iterator> iterator = this.branchOfficeCache.iterator(); + + // Loop over all + while (iterator.hasNext()) { + // Get next entry + final Cache.Entry next = iterator.next(); + + // Add value to list + list.add(next.getValue()); + } + + // Return it + return list; + } + + /** + * Initializer method + */ + @PostConstruct + public void initializeList () { + // Is cache there? + if (!this.branchOfficeCache.iterator().hasNext()) { + // Get whole list + final List list = this.branchOfficeBean.allBranchOffices(); + + // Add all + for (final Iterator iterator = list.iterator(); iterator.hasNext();) { + // Get next element + final BranchOffice next = iterator.next(); + + // Add it to cache + this.branchOfficeCache.put(next.getBranchId(), next); + } + } + } + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestController.java new file mode 100644 index 00000000..6a10272f --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/business/branchoffice/PizzaBranchOfficeWebRequestController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.business.branchoffice; + +import java.io.Serializable; + +/** + * An interface for general branch office controller + *

+ * @author Roland Häder + */ +public interface PizzaBranchOfficeWebRequestController extends Serializable { + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java index f129bbdd..b6cf024a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/business/employee/PizzaCompanyEmployeeWebRequestBean.java @@ -73,10 +73,10 @@ public class PizzaCompanyEmployeeWebRequestBean extends BasePizzaController impl @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allCompanyEmployees () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.companyEmployeeCache.iterator(); + final Iterator> iterator = this.companyEmployeeCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -99,7 +99,7 @@ public class PizzaCompanyEmployeeWebRequestBean extends BasePizzaController impl // Is cache there? if (!this.companyEmployeeCache.iterator().hasNext()) { // Get whole list - List list = this.companyEmployeeBean.allCompanyEmployees(); + final List list = this.companyEmployeeBean.allCompanyEmployees(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java index 59993f97..2865d5f4 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java @@ -270,7 +270,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Create new contact instance - Contact contact = this.createContactInstance(); + final Contact contact = this.createContactInstance(); // Default is not same contact if (this.isSameContactFound(contact)) { @@ -279,7 +279,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Init contact - Contact updatedContact; + final Contact updatedContact; // Try to call EJB try { @@ -326,7 +326,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Get contact instance from event - Contact contact = event.getCreatedContact(); + final Contact contact = event.getCreatedContact(); // Set all fields: contact this.setContactId(contact.getContactId()); @@ -395,12 +395,12 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Generate phone number - DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); - DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); - DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); + final DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); + final DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); + final DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); // Create new instance - Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName()); + final Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName()); // Is contact id set? if (this.getContactId() instanceof Long) { @@ -491,7 +491,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme */ public String editContactData () { // Get contact instance - Contact contact = this.createContactInstance(); + final Contact contact = this.createContactInstance(); // Check if contact instance is in helper and valid if (null == contact) { @@ -509,7 +509,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme this.updateContactData(contact); // Call EJB for updating contact data - Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileNumberUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked); + final Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileNumberUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked); // Fire event this.updatedContactEvent.fire(new AdminUpdatedContactEvent(updatedContact)); @@ -536,12 +536,12 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Get all data - String number = String.format( - "%s%d%d", //NOI18N - mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(), - mobileNumber.getMobileProvider().getProviderDialPrefix(), - mobileNumber.getPhoneNumber() - ); + final String number = String.format( + "%s%d%d", //NOI18N + mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(), + mobileNumber.getMobileProvider().getProviderDialPrefix(), + mobileNumber.getPhoneNumber() + ); // Return it return number; @@ -563,12 +563,12 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme } // Generate it - String number = String.format( - "%s%d%d", //NOI18N - phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(), - phoneNumber.getPhoneAreaCode(), - phoneNumber.getPhoneNumber() - ); + final String number = String.format( + "%s%d%d", //NOI18N + phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(), + phoneNumber.getPhoneAreaCode(), + phoneNumber.getPhoneNumber() + ); // Return it return number; @@ -1120,12 +1120,12 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme boolean IsFound = false; // Get iterator - Iterator iterator = this.contactController.allContacts().iterator(); + final Iterator iterator = this.contactController.allContacts().iterator(); // Loop through all while (iterator.hasNext()) { // Get next contact - Contact next = iterator.next(); + final Contact next = iterator.next(); // Is the same? if (ContactUtils.isSameContact(contact, next)) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java index beb6b4a5..df120863 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebRequestBean.java @@ -431,7 +431,7 @@ public class PizzaContactWebRequestBean extends BasePizzaController implements P } // Get user instance - Contact registeredContact = event.getRegisteredUser().getUserContact(); + final Contact registeredContact = event.getRegisteredUser().getUserContact(); // Copy all data from registered->user this.copyContact(registeredContact); @@ -450,10 +450,10 @@ public class PizzaContactWebRequestBean extends BasePizzaController implements P @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allContacts () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.contactsCache.iterator(); + final Iterator> iterator = this.contactsCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -1307,12 +1307,12 @@ public class PizzaContactWebRequestBean extends BasePizzaController implements P } // Get iterator from list - Iterator> iterator = this.contactsCache.iterator(); + final Iterator> iterator = this.contactsCache.iterator(); // "Walk" through all entries while (iterator.hasNext()) { // Get next element - Cache.Entry next = iterator.next(); + final Cache.Entry next = iterator.next(); // Is id number the same? if (Objects.equals(contact.getContactId(), next.getKey())) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java index b804ab1b..5176f703 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaAdminContactPhoneWebRequestBean.java @@ -331,7 +331,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Get fax number from event - DialableFaxNumber number = event.getFaxNumber(); + final DialableFaxNumber number = event.getFaxNumber(); // Copy all data to this bean this.setPhoneId(number.getPhoneId()); @@ -365,7 +365,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Get fax number from event - DialableLandLineNumber number = event.getLandLineNumber(); + final DialableLandLineNumber number = event.getLandLineNumber(); // Copy all data to this bean this.setPhoneId(number.getPhoneId()); @@ -399,7 +399,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Get fax number from event - DialableMobileNumber number = event.getMobileNumber(); + final DialableMobileNumber number = event.getMobileNumber(); // Copy all data to this bean this.setPhoneId(number.getPhoneId()); @@ -416,7 +416,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String doLinkMainFaxNumber () { // Get contact from helper - Contact targetContact = this.getContact(); + final Contact targetContact = this.getContact(); // Is all data properly set? if (null == targetContact) { @@ -452,8 +452,8 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init instances - Contact updatedContact; - DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); + final Contact updatedContact; + final DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); // Try it again try { @@ -480,7 +480,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String doLinkMainLandLineNumber () { // Get contact from helper - Contact targetContact = this.getContact(); + final Contact targetContact = this.getContact(); // Is all data properly set? if (null == targetContact) { @@ -516,8 +516,8 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init instance - Contact updatedContact; - DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); + final Contact updatedContact; + final DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); // Try it again try { @@ -543,7 +543,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String doLinkMainMobileNumber () { // Get contact from helper - Contact targetContact = this.getContact(); + final Contact targetContact = this.getContact(); // Is all data properly set? if (null == targetContact) { @@ -573,8 +573,8 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init instance - Contact updatedContact; - DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); + final Contact updatedContact; + final DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); // Try it again try { @@ -780,7 +780,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String unlinkFaxContactData () { // Create fax number instance - DialableFaxNumber number = this.createFaxNumber(); + final DialableFaxNumber number = this.createFaxNumber(); // Is all data set if (number == null) { @@ -810,7 +810,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init contact instance - Contact updatedContact; + final Contact updatedContact; try { // Unlink it and return contact without fax instance @@ -835,7 +835,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String unlinkLandLineContactData () { // Create fax number instance - DialableLandLineNumber number = this.createLandLineNumber(); + final DialableLandLineNumber number = this.createLandLineNumber(); // Is all data set if (number == null) { @@ -865,7 +865,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init contact instance - Contact updatedContact; + final Contact updatedContact; try { // Unlink it and return contact without landLine instance @@ -890,7 +890,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ public String unlinkMobileContactData () { // Create fax number instance - DialableMobileNumber number = this.createMobileNumber(); + final DialableMobileNumber number = this.createMobileNumber(); // Is all data set if (number == null) { @@ -929,7 +929,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im } // Init contact instance - Contact updatedContact; + final Contact updatedContact; try { // Unlink it and return contact without mobile instance @@ -961,7 +961,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ private DialableFaxNumber createFaxNumber () { // Instanciate it - DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); + final DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); // Set all other fields number.setPhoneEntryCreated(this.getPhoneEntryCreated()); @@ -985,7 +985,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ private DialableLandLineNumber createLandLineNumber () { // Initialize it - DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); + final DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); // Add all other data number.setPhoneEntryCreated(this.getPhoneEntryCreated()); @@ -1009,7 +1009,7 @@ public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController im */ private DialableMobileNumber createMobileNumber () { // Initialize it - DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); + final DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); // Add all other data number.setPhoneEntryCreated(this.getPhoneEntryCreated()); diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java index f8179638..d7100d3c 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java @@ -340,7 +340,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme */ public List allCurrentFaxNumberContacts () { // Get id - DialableFaxNumber number = this.getFaxNumber(); + final DialableFaxNumber number = this.getFaxNumber(); // Is cache there? if (this.contactsPhoneCache.containsKey(number)) { @@ -348,7 +348,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme return this.contactsPhoneCache.get(number); } else { // Ask bean - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // "Walk" through all contacts for (final Contact contact : this.contactController.allContacts()) { @@ -374,7 +374,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme */ public List allCurrentLandLineNumberContacts () { // Get id - DialableLandLineNumber number = this.getLandLineNumber(); + final DialableLandLineNumber number = this.getLandLineNumber(); // Is cache there? if (this.contactsPhoneCache.containsKey(number)) { @@ -382,7 +382,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme return this.contactsPhoneCache.get(number); } else { // Ask bean - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // "Walk" through all contacts for (final Contact contact : this.contactController.allContacts()) { @@ -408,7 +408,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme */ public List allCurrentMobileNumberContacts () { // Get id - DialableMobileNumber number = this.getMobileNumber(); + final DialableMobileNumber number = this.getMobileNumber(); // Is cache there? if (this.contactsPhoneCache.containsKey(number)) { @@ -416,7 +416,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme return this.contactsPhoneCache.get(number); } else { // Ask bean - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // "Walk" through all contacts for (final Contact contact : this.contactController.allContacts()) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java index c9d5917c..8654dbc0 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java @@ -115,7 +115,7 @@ public class PizzaAdminCountryWebRequestBean extends BasePizzaController impleme */ public String addCountry () { // Create new country object - Country country = new CountryData(); + final Country country = new CountryData(); // Add all data country.setCountryAbroadDialPrefix(this.getCountryAbroadDialPrefix()); @@ -132,7 +132,7 @@ public class PizzaAdminCountryWebRequestBean extends BasePizzaController impleme } // Init variable - Country updatedCountry = null; + final Country updatedCountry; try { // Send country to bean @@ -288,15 +288,15 @@ public class PizzaAdminCountryWebRequestBean extends BasePizzaController impleme boolean isAdded = false; // Now get whole ist - List countries = this.countryController.allCountries(); + final List countries = this.countryController.allCountries(); // Get iterator from it - Iterator iterator = countries.iterator(); + final Iterator iterator = countries.iterator(); // Check whole list while (iterator.hasNext()) { // Get next country - Country next = iterator.next(); + final Country next = iterator.next(); // Is country code or i18n the same? if ((Objects.equals(country.getCountryCode(), next.getCountryCode())) || (Objects.equals(country.getCountryI18nKey(), next.getCountryI18nKey()))) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java index 16a09c03..c02b0495 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebRequestBean.java @@ -98,10 +98,10 @@ public class PizzaCountryWebRequestBean extends BasePizzaController implements P @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allCountries () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.countryCache.iterator(); + final Iterator> iterator = this.countryCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -124,7 +124,7 @@ public class PizzaCountryWebRequestBean extends BasePizzaController implements P // Is cache there? if (!this.countryCache.iterator().hasNext()) { // Get whole list - List list = this.countryBean.allCountries(); + final List list = this.countryBean.allCountries(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java index c4a3f540..910c5c58 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java @@ -65,8 +65,7 @@ public class PizzaFeatureWebApplicationBean extends BasePizzaController implemen boolean isEnabled = false; // Get value from property - String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N - //System.out.println(MessageFormat.format("isFeatureSet: feature={0},contextParameter[]={1}", feature, Objects.toString(contextParameter))); //NOI18N + final String contextParameter = this.getStringContextParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N // Is the context parameter found? if (contextParameter instanceof String) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java index d2070d32..3dbe7151 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java @@ -16,12 +16,11 @@ */ package org.mxchange.pizzaapplication.beans.gender; +import java.util.Arrays; import java.util.List; -import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.mxchange.jcontacts.model.contact.title.PersonalTitle; -import org.mxchange.jcontacts.model.contact.title.TitleUtils; import org.mxchange.pizzaapplication.beans.BasePizzaController; /** @@ -54,18 +53,8 @@ public class PizzaGenderWebApplicationBean extends BasePizzaController implement @Override public List getSelectableGenders () { - // Init array - List genders = TitleUtils.allPersonalTitlesAsList(); - // Return it - return genders; - } - - /** - * Post-construction method - */ - @PostConstruct - public void init () { + return Arrays.asList(PersonalTitle.values()); } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelperBean.java b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelperBean.java index 67ba8f44..169f86c3 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelperBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelperBean.java @@ -517,7 +517,7 @@ public class PizzaWebRequestHelperBean implements PizzaWebRequestHelperControlle } // Get contact - Contact userContact = this.getUser().getUserContact(); + final Contact userContact = this.getUser().getUserContact(); // Set contact here, too. This avoids parameters that cannot auto-complete in IDEs. this.setContact(userContact); diff --git a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java index 2eebd934..2cf13e06 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java @@ -110,7 +110,7 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements // Is the locale set? if (event.getLoggedInUser().getUserLocale() instanceof Locale) { // Get user local - Locale userLocale = event.getLoggedInUser().getUserLocale(); + final Locale userLocale = event.getLoggedInUser().getUserLocale(); // Change locale this.changeLocale(userLocale, Boolean.TRUE); @@ -159,8 +159,8 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements Locale newLocale = null; // Iterate over whole map - for (Map.Entry entry : this.getSupportedLocales().entrySet()) { - Locale foundLocale = entry.getValue(); + for (final Map.Entry entry : this.getSupportedLocales().entrySet()) { + final Locale foundLocale = entry.getValue(); // Does the language match? if (Objects.equals(foundLocale.toString(), this.getLocaleCode())) { @@ -236,13 +236,13 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements @PostConstruct public void init () { // Get default locale - Locale defaultLocale = FacesContext.getCurrentInstance().getApplication().getDefaultLocale(); + final Locale defaultLocale = FacesContext.getCurrentInstance().getApplication().getDefaultLocale(); // Add it to list this.getSupportedLocales().put(defaultLocale.toString(), defaultLocale); // Get iterator from faces context - Iterator iterator = FacesContext.getCurrentInstance().getApplication().getSupportedLocales(); + final Iterator iterator = FacesContext.getCurrentInstance().getApplication().getSupportedLocales(); // Add all locales while (iterator.hasNext()) { @@ -259,13 +259,13 @@ public class PizzaLocalizationSessionBean extends BasePizzaController implements // Is no country code found? if (requestLocale.getCountry().isEmpty()) { // Then try to find one, get language from it - String language = requestLocale.getLanguage(); + final String language = requestLocale.getLanguage(); Boolean found = Boolean.FALSE; // Iterate over whole map - for (Map.Entry entry : this.getSupportedLocales().entrySet()) { - String languageCode = entry.getKey(); - Locale foundLocale = entry.getValue(); + for (final Map.Entry entry : this.getSupportedLocales().entrySet()) { + final String languageCode = entry.getKey(); + final Locale foundLocale = entry.getValue(); // Does the language match? if (languageCode.startsWith(language)) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java index 1929e20f..660e71a7 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java @@ -98,10 +98,10 @@ public class PizzaMobileProviderWebRequestBean extends BasePizzaController imple @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allMobileProviders () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.mobileProviderCache.iterator(); + final Iterator> iterator = this.mobileProviderCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -124,7 +124,7 @@ public class PizzaMobileProviderWebRequestBean extends BasePizzaController imple // Is cache there? if (!this.mobileProviderCache.iterator().hasNext()) { // Get whole list - List list = this.mobileProviderBean.allMobileProviders(); + final List list = this.mobileProviderBean.allMobileProviders(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java index 4cbf5f83..46ad1608 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaPhoneWebRequestBean.java @@ -484,10 +484,10 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allFaxNumbers () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.faxNumberCache.iterator(); + final Iterator> iterator = this.faxNumberCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -506,10 +506,10 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allLandLineNumbers () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.landLineNumberCache.iterator(); + final Iterator> iterator = this.landLineNumberCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -528,10 +528,10 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allMobileNumbers () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.mobileNumberCache.iterator(); + final Iterator> iterator = this.mobileNumberCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -554,7 +554,7 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz // Is cache there? if (!this.faxNumberCache.iterator().hasNext()) { // Get whole list - List list = this.phoneBean.allFaxNumbers(); + final List list = this.phoneBean.allFaxNumbers(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { @@ -569,7 +569,7 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz // Is cache there? if (!this.landLineNumberCache.iterator().hasNext()) { // Get whole list - List list = this.phoneBean.allLandLineNumbers(); + final List list = this.phoneBean.allLandLineNumbers(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { @@ -584,7 +584,7 @@ public class PizzaPhoneWebRequestBean extends BasePizzaController implements Piz // Is cache there? if (!this.mobileNumberCache.iterator().hasNext()) { // Get whole list - List list = this.phoneBean.allMobileNumbers(); + final List list = this.phoneBean.allMobileNumbers(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java index 863614f4..1a6cb6d4 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java @@ -17,7 +17,6 @@ package org.mxchange.pizzaapplication.beans.profile; import java.text.MessageFormat; -import javax.annotation.PostConstruct; import javax.enterprise.context.RequestScoped; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -63,13 +62,6 @@ public class PizzaUserProfileWebRequestBean extends BasePizzaController implemen super(); } - /** - * Post-construction method - */ - @PostConstruct - public void init () { - } - @Override public boolean isProfileLinkVisibleById (final Long userId) { // Init user instance @@ -123,7 +115,7 @@ public class PizzaUserProfileWebRequestBean extends BasePizzaController implemen } // Get profile mode from user instance (safe now) - ProfileMode profileMode = user.getUserProfileMode(); + final ProfileMode profileMode = user.getUserProfileMode(); // Check all conditions (except for admin) return ((profileMode.equals(ProfileMode.PUBLIC)) || diff --git a/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationBean.java index 762aeb23..be191181 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.pizzaapplication.beans.profilemode; -import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; @@ -50,11 +49,4 @@ public class PizzaProfileModeWebApplicationBean extends BasePizzaController impl return ProfileMode.values(); } - /** - * Post-construction method - */ - @PostConstruct - public void init () { - } - } diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java index 7f6240f1..639c1d11 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java @@ -227,7 +227,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Create new user instance - User newUser = new LoginUser(); + final User newUser = new LoginUser(); // Set user name, CONFIRMED and INVISIBLE newUser.setUserName(this.getUserName()); @@ -236,7 +236,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements newUser.setUserProfileMode(ProfileMode.INVISIBLE); // Get locale from view-root - Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); + final Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); // Copy user locale newUser.setUserLocale(locale); @@ -296,13 +296,13 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements // Now, that all is set, call EJB if (this.getContact() instanceof Contact) { // Link contact with this user - User updatedUser = this.adminUserBean.linkUser(newUser); + final User updatedUser = this.adminUserBean.linkUser(newUser); // Fire event this.userLinkedEvent.fire(new AdminLinkedUserEvent(updatedUser)); } else { // Add new contact - User updatedUser = this.adminUserBean.addUser(newUser); + final User updatedUser = this.adminUserBean.addUser(newUser); // Fire event this.addedUserEvent.fire(new AdminAddedUserEvent(updatedUser)); @@ -371,7 +371,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Get user instance - User registeredUser = event.getRegisteredUser(); + final User registeredUser = event.getRegisteredUser(); // @TODO Nothing to do with the user here? // Clear all data @@ -478,7 +478,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Call EJB for updating user data - User updatedUser = this.userBean.updateUserData(this.getUser()); + final User updatedUser = this.userBean.updateUserData(this.getUser()); // Fire event this.updatedUserDataEvent.fire(new AdminUpdatedUserDataEvent(updatedUser)); @@ -663,11 +663,11 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Init updated user instance - User updatedUser; + final User updatedUser; try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Call EJB to lock account updatedUser = this.adminUserBean.lockUserAccount(this.getUser(), this.getUserLockReason(), baseUrl); @@ -712,11 +712,11 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Init updated user instance - User updatedUser; + final User updatedUser; try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Call EJB to unlock account updatedUser = this.adminUserBean.unlockUserAccount(this.getUser(), baseUrl); diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java index af507220..73aa1c99 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestBean.java @@ -360,7 +360,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz } // Get user instance - User user = event.getCreatedUser(); + final User user = event.getCreatedUser(); // Set all fields here this.copyUser(user); @@ -433,7 +433,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz } // "Cache" user instance - User loggedInUser = event.getLoggedInUser(); + final User loggedInUser = event.getLoggedInUser(); // Copy all data to this bean this.copyUser(loggedInUser); @@ -484,7 +484,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz } // Get user instance - User registeredUser = event.getRegisteredUser(); + final User registeredUser = event.getRegisteredUser(); // Copy all data from registered->user this.copyUser(registeredUser); @@ -557,10 +557,10 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allUsers () { // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Get iterator - Iterator> iterator = this.userCache.iterator(); + final Iterator> iterator = this.userCache.iterator(); // Loop over all while (iterator.hasNext()) { @@ -609,14 +609,11 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz @Override public User createUserInstance (final boolean createContactData) { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: CALLED!", this.getClass().getSimpleName())); - // Required personal data must be set assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N // Create new user instance - User user = new LoginUser(); + final User user = new LoginUser(); // Is user name required? if (!this.isUserNameRequired()) { @@ -643,25 +640,18 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz // Is multiple registration page if ((createContactData) || (!this.featureController.isFeatureEnabled("user_register_multiple_page"))) { //NOI18N // Create contact instance - Contact contact = this.contactController.createContactInstance(); + final Contact contact = this.contactController.createContactInstance(); - // Debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: contact={1}", this.getClass().getSimpleName(), contact)); // Set contact in user user.setUserContact(contact); } - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createUserInstance: user={1} - EXIT!", this.getClass().getSimpleName(), user)); // Return it return user; } @Override public User createUserLogin () { - // Trace message - //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: CALLED!", this.getClass().getSimpleName())); - // Is all data set? if (this.getUserName() == null) { // Throw NPE @@ -672,13 +662,11 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz } // Create new user instance - User user = new LoginUser(); + final User user = new LoginUser(); // Update all data ... user.setUserName(this.getUserName()); - // Trace message - //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: user={1} - EXIT!", this.getClass().getSimpleName(), user)); // Return the new instance return user; } @@ -701,7 +689,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz } // Get user instance - User user = this.userLoginController.getLoggedInUser(); + final User user = this.userLoginController.getLoggedInUser(); // Copy contact data to contact instance this.contactController.updateContactDataFromController(user.getUserContact()); @@ -718,7 +706,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz user.setUserProfileMode(this.getUserProfileMode()); // Send it to the EJB - User updatedUser = this.userBean.updateUserPersonalData(user); + final User updatedUser = this.userBean.updateUserPersonalData(user); // Fire event this.updatedPersonalDataEvent.fire(new UpdatedUserPersonalDataEvent(updatedUser)); @@ -829,7 +817,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz // Is cache there? if (!this.userCache.iterator().hasNext()) { // Get whole list - List list = this.userBean.allUsers(); + final List list = this.userBean.allUsers(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { @@ -861,12 +849,12 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz boolean isFound = false; // Get iterator - Iterator iterator = this.allUsers().iterator(); + final Iterator iterator = this.allUsers().iterator(); // Loop through all entries while (iterator.hasNext()) { // Get user - User next = iterator.next(); + final User next = iterator.next(); // Compare both objects if (Objects.equals(contact, next.getUserContact())) { @@ -883,10 +871,10 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz @Override public boolean isPublicUserProfileEnabled () { // Get context parameter - String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_public_profile_enabled"); //NOI18N + final String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_public_profile_enabled"); //NOI18N // Is it set? - boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N + final boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N // This requires user names being enabled, too. if ((isEnabled) && (!this.isUserNameRequired())) { @@ -938,10 +926,10 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz @Override public boolean isUserNameRequired () { // Get context parameter - String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_user_login_require_user_name"); //NOI18N + final String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_user_login_require_user_name"); //NOI18N // Is it set? - boolean isRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N + final boolean isRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N // Return value return isRequired; @@ -964,7 +952,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz // Try to lookup it in visible user list for (final Iterator> iterator = this.userCache.iterator(); iterator.hasNext();) { // Get next user - Cache.Entry next = iterator.next(); + final Cache.Entry next = iterator.next(); // Contact should be set if (next.getValue().getUserContact() == null) { @@ -1010,7 +998,7 @@ public class PizzaUserWebRequestBean extends BasePizzaController implements Pizz // Try to lookup it in visible user list for (final Iterator> iterator = this.userCache.iterator(); iterator.hasNext();) { // Get next user - Cache.Entry next = iterator.next(); + final Cache.Entry next = iterator.next(); // Is the user id found? if (Objects.equals(next.getKey(), userId)) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java index 665ffb88..6e3004ce 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebRequestController.java @@ -35,6 +35,7 @@ public interface PizzaUserWebRequestController extends Serializable { *

* @deprecated Better set as context parameter */ + @Deprecated public static final Integer MINIMUM_PASSWORD_LENGTH = 5; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java index 48fa139f..23a16b78 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/activity/PizzaUserActivityWebRequestBean.java @@ -505,7 +505,7 @@ public class PizzaUserActivityWebRequestBean extends BasePizzaController impleme } // Init list - List list = new LinkedList<>(); + final List list = new LinkedList<>(); // Is the user set? if (this.userActivityCache.containsKey(this.getUser())) { @@ -545,7 +545,7 @@ public class PizzaUserActivityWebRequestBean extends BasePizzaController impleme @PostConstruct public void init () { // Get whole list - List list = this.userActivityBean.fetchAllUserActivityLog(); + final List list = this.userActivityBean.fetchAllUserActivityLog(); // Put all in map, per-user for (final LogableUserActivity userActivity : list) { @@ -589,7 +589,7 @@ public class PizzaUserActivityWebRequestBean extends BasePizzaController impleme } // Create new activity object - LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName()); + final LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName()); // Call bean to add it this.userActivityBean.addUserActivityLog(userActivity); @@ -631,7 +631,7 @@ public class PizzaUserActivityWebRequestBean extends BasePizzaController impleme } // Create new activity object - LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName()); + final LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName()); // Call bean to add it this.userActivityBean.addUserActivityLog(userActivity); diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/confirmlink/PizzaConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/confirmlink/PizzaConfirmationLinkWebRequestBean.java index c88c4c15..4dd63dd2 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/confirmlink/PizzaConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/confirmlink/PizzaConfirmationLinkWebRequestBean.java @@ -124,10 +124,10 @@ public class PizzaConfirmationLinkWebRequestBean extends BasePizzaController imp } // Now try to find the user in user list, first get the whole list - List users = this.userController.allUsers(); + final List users = this.userController.allUsers(); // Get iterator from it - Iterator iterator = users.iterator(); + final Iterator iterator = users.iterator(); // Init instance User user = null; @@ -135,7 +135,7 @@ public class PizzaConfirmationLinkWebRequestBean extends BasePizzaController imp // Then loop through all while (iterator.hasNext()) { // Get next user - User next = iterator.next(); + final User next = iterator.next(); // Same confirmation key? if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) { @@ -186,11 +186,11 @@ public class PizzaConfirmationLinkWebRequestBean extends BasePizzaController imp } // Updated user instance - User updatedUser; + final User updatedUser; try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Confirm account updatedUser = this.userBean.confirmAccount(user, baseUrl); diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java index 239ea9a6..bffba676 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/email_address/PizzaEmailChangeWebRequestBean.java @@ -123,7 +123,7 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaController implemen } // Get user instance - User user = this.userLoginController.getLoggedInUser(); + final User user = this.userLoginController.getLoggedInUser(); // It should be there, so run some tests on it assert (user instanceof User) : "Instance userLoginController.loggedInUser is null"; //NOI18N @@ -145,10 +145,10 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaController implemen } // Create change object, to save EJB calls, the hash is not generated here - ChangeableEmailAddress emailChange = new EmailAddressChange(user, this.getEmailAddress()); + final ChangeableEmailAddress emailChange = new EmailAddressChange(user, this.getEmailAddress()); // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Call EJB this.emailChangeBean.enqueueEmailAddressForChange(emailChange, baseUrl); @@ -204,7 +204,7 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaController implemen // Is cache there? if (!this.queuedEmailCache.iterator().hasNext()) { // Get whole list - List list = this.emailChangeBean.allQueuedAddresses(); + final List list = this.emailChangeBean.allQueuedAddresses(); // Add all for (final Iterator iterator = list.iterator(); iterator.hasNext();) { @@ -253,7 +253,7 @@ public class PizzaEmailChangeWebRequestBean extends BasePizzaController implemen } // Check EJB - boolean isQueued = this.emailChangeBean.isEmailAddressEnqueued(emailAddress); + final boolean isQueued = this.emailChangeBean.isEmailAddressEnqueued(emailAddress); // Is it there? if (isQueued) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/login/PizzaUserLoginWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/login/PizzaUserLoginWebSessionBean.java index 8789c3a5..cec9cced 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/login/PizzaUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/login/PizzaUserLoginWebSessionBean.java @@ -205,14 +205,14 @@ public class PizzaUserLoginWebSessionBean extends BasePizzaController implements */ public String doUserLogin () { // Get user instance - User user = this.userController.createUserLogin(); + final User user = this.userController.createUserLogin(); // Create login container - LoginContainer loginContainer = new UserLoginContainer(user, this.userController.getUserPassword()); + final LoginContainer loginContainer = new UserLoginContainer(user, this.userController.getUserPassword()); try { // Call bean - User confirmedUser = this.userLoginBean.validateUserAccountStatus(loginContainer); + final User confirmedUser = this.userLoginBean.validateUserAccountStatus(loginContainer); // All fine here so set it here this.setLoggedInUser(confirmedUser); @@ -335,7 +335,7 @@ public class PizzaUserLoginWebSessionBean extends BasePizzaController implements } // Create "container" - LoginContainer container = new UserLoginContainer(this.getLoggedInUser(), this.getUserCurrentPassword()); + final LoginContainer container = new UserLoginContainer(this.getLoggedInUser(), this.getUserCurrentPassword()); // Now check if it matches return UserLoginUtils.ifPasswordMatches(container, this.getLoggedInUser()); @@ -365,7 +365,7 @@ public class PizzaUserLoginWebSessionBean extends BasePizzaController implements // Init variables int count = 1; - int maxEntries = this.getIntegerContextParameter("max_user_password_history"); //NOI18N + final int maxEntries = this.getIntegerContextParameter("max_user_password_history"); //NOI18N // Check all passwords for (final PasswordHistory entry : this.getUserPasswordHistory()) { diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/password/PizzaUserPasswordWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/password/PizzaUserPasswordWebRequestBean.java index c2d3eb52..500f0897 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/password/PizzaUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/password/PizzaUserPasswordWebRequestBean.java @@ -161,17 +161,17 @@ public class PizzaUserPasswordWebRequestBean extends BasePizzaController impleme } // Get user instance - User user = this.userLoginController.getLoggedInUser(); + final User user = this.userLoginController.getLoggedInUser(); // Encrypt password - String encryptedPassword = UserLoginUtils.encryptPassword(this.getUserPassword()); + final String encryptedPassword = UserLoginUtils.encryptPassword(this.getUserPassword()); // Set it in user user.setUserEncryptedPassword(encryptedPassword); try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // All is set, then update password PasswordHistory passwordHistory = this.userBean.updateUserPassword(user, baseUrl); diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java index e7dfd6bb..2ac294f2 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/register/PizzaUserRegisterWebRequestBean.java @@ -143,7 +143,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme } // Get user instance - User user = this.userController.createUserInstance(true); + final User user = this.userController.createUserInstance(true); // Null random password means registration requires user-entered password String randomPassword = null; @@ -200,7 +200,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme randomPassword = UserLoginUtils.createRandomPassword(PizzaUserWebRequestController.MINIMUM_PASSWORD_LENGTH); // Generate (ignored) password-history - PasswordHistory passwordHistory = new UserPasswordHistory(randomPassword, user); + final PasswordHistory passwordHistory = new UserPasswordHistory(randomPassword, user); // Fire event this.userPasswordChangedEvent.fire(new UpdatedUserPasswordEvent(passwordHistory, randomPassword)); @@ -208,7 +208,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme } // Encrypt password - String encryptedPassword = UserLoginUtils.encryptPassword(this.userController.getUserPassword()); + final String encryptedPassword = UserLoginUtils.encryptPassword(this.userController.getUserPassword()); // Set it here user.setUserEncryptedPassword(encryptedPassword); @@ -222,7 +222,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme user.setUserAccountStatus(UserAccountStatus.UNCONFIRMED); // Ask EJB for generating a not-existing confirmation key - String confirmKey = this.registerBean.generateConfirmationKey(user); + final String confirmKey = this.registerBean.generateConfirmationKey(user); // Set it in user user.setUserConfirmKey(confirmKey); @@ -230,10 +230,10 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Call bean - User registeredUser = this.registerBean.registerUser(user, baseUrl, randomPassword); + final User registeredUser = this.registerBean.registerUser(user, baseUrl, randomPassword); // The id number should be set assert (registeredUser.getUserId() instanceof Long) : "registeredUser.userId is null after registerUser() was called."; //NOI18N @@ -264,7 +264,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme } // Get user instance - User user = this.userController.createUserInstance(false); + final User user = this.userController.createUserInstance(false); // First check if user is not null and user name is not used + if same email address is entered if (null == user) { @@ -305,7 +305,7 @@ public class PizzaUserRegisterWebRequestBean extends BasePizzaController impleme } // Create half contact instance with email address - Contact contact = new UserContact(); + final Contact contact = new UserContact(); contact.setContactEmailAddress(this.contactController.getEmailAddress()); // Set contact in user diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java index 386794d8..d900ce72 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/resendlink/PizzaResendLinkWebRequestBean.java @@ -130,7 +130,7 @@ public class PizzaResendLinkWebRequestBean extends BasePizzaController implement } // Init user instance - User user; + final User user; try { // Is the email address really not used? @@ -165,11 +165,11 @@ public class PizzaResendLinkWebRequestBean extends BasePizzaController implement } // Init managed user instance - User managedUser; + final User managedUser; try { // Get base URL - String baseUrl = FacesUtils.generateBaseUrl(); + final String baseUrl = FacesUtils.generateBaseUrl(); // Call EJB and return redirect target managedUser = this.resendLinkBean.resendConfirmationLink(user, this.getLocale(), baseUrl); diff --git a/src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBusinessContactConverter.java b/src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBasicCompanyDataConverter.java similarity index 95% rename from src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBusinessContactConverter.java rename to src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBasicCompanyDataConverter.java index b2d7f090..e5370975 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBusinessContactConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/business/basicdata/PizzaBasicCompanyDataConverter.java @@ -35,7 +35,7 @@ import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote; * @author Roland Häder */ @FacesConverter ("BusinessContactConverter") -public class PizzaBusinessContactConverter implements Converter { +public class PizzaBasicCompanyDataConverter implements Converter { /** * Business contact EJB @@ -75,7 +75,7 @@ public class PizzaBusinessContactConverter implements Converter { if (COMPANY_EMPLOYEE_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB COMPANY_EMPLOYEE_BEAN = (CompanyEmployeeSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote"); @@ -73,7 +73,7 @@ public class PizzaCompanyEmployeeConverter implements Converter { try { // Try to parse the value as long - Long employeeId = Long.valueOf(submittedValue); + final Long employeeId = Long.valueOf(submittedValue); // Try to get user instance from it companyEmployee = COMPANY_EMPLOYEE_BEAN.findCompanyEmployeeById(employeeId); diff --git a/src/java/org/mxchange/pizzaapplication/converter/business/headquarters/PizzaCompanyHeadquartersConverter.java b/src/java/org/mxchange/pizzaapplication/converter/business/headquarters/PizzaCompanyHeadquartersConverter.java index 59dc0148..e3712f91 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/business/headquarters/PizzaCompanyHeadquartersConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/business/headquarters/PizzaCompanyHeadquartersConverter.java @@ -49,7 +49,7 @@ public class PizzaCompanyHeadquartersConverter implements Converter { if (CONTACT_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); @@ -73,10 +73,10 @@ public class PizzaContactConverter implements Converter { try { // Try to parse the value as long - Long contactId = Long.valueOf(submittedValue); + final Long contactId = Long.valueOf(submittedValue); // Try to get user instance from it - contact = this.CONTACT_BEAN.findContactById(contactId); + contact = CONTACT_BEAN.findContactById(contactId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java b/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java index 542b631e..3ca6d5cc 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java @@ -50,7 +50,7 @@ public class PizzaCountryConverter implements Converter { if (COUNTRY_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB COUNTRY_BEAN = (CountrySingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); @@ -70,7 +70,7 @@ public class PizzaCountryConverter implements Converter { } // Get full list - List countryList = COUNTRY_BEAN.allCountries(); + final List countryList = COUNTRY_BEAN.allCountries(); // Init value Country country = null; @@ -78,7 +78,7 @@ public class PizzaCountryConverter implements Converter { // Try this better try { // Convert it to long - Long countryId = Long.parseLong(submittedValue); + final Long countryId = Long.parseLong(submittedValue); // Category id should not be below 1 assert (countryId > 0) : "countryId is smaller than one: " + countryId; //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/converter/fax/PizzaFaxNumberConverter.java b/src/java/org/mxchange/pizzaapplication/converter/fax/PizzaFaxNumberConverter.java index 1e031fca..de185616 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/fax/PizzaFaxNumberConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/fax/PizzaFaxNumberConverter.java @@ -49,7 +49,7 @@ public class PizzaFaxNumberConverter implements Converter { if (PHONE_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); @@ -76,7 +76,7 @@ public class PizzaFaxNumberConverter implements Converter { try { // Try to parse the value as long - Long faxNumberId = Long.valueOf(submittedValue); + final Long faxNumberId = Long.valueOf(submittedValue); // Log message // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/converter/landline/PizzaLandLineNumberConverter.java b/src/java/org/mxchange/pizzaapplication/converter/landline/PizzaLandLineNumberConverter.java index 0fc2270c..92467591 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/landline/PizzaLandLineNumberConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/landline/PizzaLandLineNumberConverter.java @@ -49,7 +49,7 @@ public class PizzaLandLineNumberConverter implements Converter * @author Roland Häder */ -@FacesConverter (value = "MobileProviderConverter") +@FacesConverter ( "MobileProviderConverter") public class PizzaMobileProviderConverter implements Converter { /** @@ -49,7 +49,7 @@ public class PizzaMobileProviderConverter implements Converter { if (MOBILE_PROVIDER_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); @@ -69,7 +69,7 @@ public class PizzaMobileProviderConverter implements Converter { } // Get full list - List providerList = this.MOBILE_PROVIDER_BEAN.allMobileProviders(); + final List providerList = MOBILE_PROVIDER_BEAN.allMobileProviders(); // Init value MobileProvider provider = null; @@ -77,7 +77,7 @@ public class PizzaMobileProviderConverter implements Converter { // Try this better try { // Convert it to long - Long providerId = Long.parseLong(submittedValue); + final Long providerId = Long.parseLong(submittedValue); // Category id should not be below 1 assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java b/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java index bcdee373..d79d4345 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java @@ -48,7 +48,7 @@ public class PizzaUserConverter implements Converter { if (USER_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); @@ -72,7 +72,7 @@ public class PizzaUserConverter implements Converter { try { // Try to parse the value as long - Long userId = Long.valueOf(submittedValue); + final Long userId = Long.valueOf(submittedValue); // Try to get user instance from it user = USER_BEAN.findUserById(userId); diff --git a/src/java/org/mxchange/pizzaapplication/validator/birthday/PizzaBirthdayValidator.java b/src/java/org/mxchange/pizzaapplication/validator/birthday/PizzaBirthdayValidator.java index a730a0d8..b11f22d1 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/birthday/PizzaBirthdayValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/birthday/PizzaBirthdayValidator.java @@ -39,13 +39,13 @@ public class PizzaBirthdayValidator extends BaseDateValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // All accepted, required fields - String[] requiredFields = {"birthday", "contactBirthday"}; //NOI18N + final String[] requiredFields = {"birthday", "contactBirthday"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); // Cast value - Date birthday = (Date) value; + final Date birthday = (Date) value; // @TODO Finish this, e.g. load maximum,minimum birthday from properties file } diff --git a/src/java/org/mxchange/pizzaapplication/validator/business/basicdata/PizzaCompanyNameValidator.java b/src/java/org/mxchange/pizzaapplication/validator/business/basicdata/PizzaCompanyNameValidator.java index 3c9f5572..00b1799d 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/business/basicdata/PizzaCompanyNameValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/business/basicdata/PizzaCompanyNameValidator.java @@ -52,7 +52,7 @@ public class PizzaCompanyNameValidator extends BaseStringValidator { if (BASIC_DATA_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB BASIC_DATA_BEAN = (BusinessDataSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote"); @@ -63,13 +63,13 @@ public class PizzaCompanyNameValidator extends BaseStringValidator { } // All accepted, required fields - String[] requiredFields = {"companyName"}; //NOI18N + final String[] requiredFields = {"companyName"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); // Convert name to string (now securely checked in BaseStringValidator) - String companyName = (String) value; + final String companyName = (String) value; // Default is to check on existing names Boolean checkExisting = Boolean.TRUE; @@ -77,7 +77,7 @@ public class PizzaCompanyNameValidator extends BaseStringValidator { // Is attribute "allowEmptyValue" set? if (component.getAttributes().containsKey("checkExisting")) { //NOI18N // Get attribute - Object attribute = component.getAttributes().get("checkExisting"); //NOI18N + final Object attribute = component.getAttributes().get("checkExisting"); //NOI18N // Make sure, it is Boolean as no String is accepted anymore if (!(attribute instanceof String)) { @@ -90,18 +90,18 @@ public class PizzaCompanyNameValidator extends BaseStringValidator { } // Check if name is already used - Boolean nameExists = BASIC_DATA_BEAN.isCompanyNameUsed(companyName); + final Boolean nameExists = BASIC_DATA_BEAN.isCompanyNameUsed(companyName); // Is the user id valid? if ((!nameExists) && (checkExisting)) { // Format message - String message = MessageFormat.format("No basic data found with comany name {0}.", companyName); + final String message = MessageFormat.format("No basic data found with comany name {0}.", companyName); // Name does not exist throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message)); //NOI18N } else if ((nameExists) && (!checkExisting)) { // Format message - String message = MessageFormat.format("Found basic data with comany name {0}.", companyName); + final String message = MessageFormat.format("Found basic data with comany name {0}.", companyName); // Name already exists throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message)); //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/validator/emailaddress/PizzaEmailAddressValidator.java b/src/java/org/mxchange/pizzaapplication/validator/emailaddress/PizzaEmailAddressValidator.java index 2035efee..c28468e7 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/emailaddress/PizzaEmailAddressValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/emailaddress/PizzaEmailAddressValidator.java @@ -63,7 +63,7 @@ public class PizzaEmailAddressValidator extends BaseStringValidator { if (CONTACT_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); @@ -74,7 +74,7 @@ public class PizzaEmailAddressValidator extends BaseStringValidator { } // The required field - String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N + final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N // Default is to reject empty email address fields Boolean allowEmptyValue = Boolean.FALSE; @@ -82,7 +82,7 @@ public class PizzaEmailAddressValidator extends BaseStringValidator { // Is attribute "allowEmptyValue" set? if (component.getAttributes().containsKey("allowEmptyValue")) { //NOI18N // Get attribute - Object attribute = component.getAttributes().get("allowEmptyValue"); //NOI18N + final Object attribute = component.getAttributes().get("allowEmptyValue"); //NOI18N // Make sure, it is Boolean as no String is accepted anymore if (!(attribute instanceof String)) { @@ -108,11 +108,11 @@ public class PizzaEmailAddressValidator extends BaseStringValidator { // Get string from object ... ;-) // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat - String emailAddress = String.valueOf(value).trim(); + final 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 = PATTERN_MATCHER.matcher(emailAddress).matches(); //NOI18N + final boolean matches = PATTERN_MATCHER.matcher(emailAddress).matches(); //NOI18N // Is the email address valid? if (!matches) { @@ -124,21 +124,21 @@ public class PizzaEmailAddressValidator extends BaseStringValidator { } // Get client id (aka form id) - String clientId = component.getClientId(); + final String clientId = component.getClientId(); // Is it registered? - Boolean isRegistered = CONTACT_BEAN.isEmailAddressRegistered(emailAddress); + final Boolean isRegistered = CONTACT_BEAN.isEmailAddressRegistered(emailAddress); // Is the email address already registered? if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N // Generate message - String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N + final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N // Generate message - String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N + final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); diff --git a/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java b/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java index a28a03dd..ba974db6 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/names/PizzaNameValidator.java @@ -38,7 +38,7 @@ public class PizzaNameValidator extends BaseStringValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // All accepted, required fields - String[] requiredFields = {"firstName", "familyName", "city", "street"}; //NOI18N + final String[] requiredFields = {"firstName", "familyName", "city", "street"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); diff --git a/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java b/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java index 31835c2c..0358f1ae 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/password/PizzaUserPasswordValidator.java @@ -56,7 +56,7 @@ public class PizzaUserPasswordValidator extends BaseStringValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // The required field - String[] requiredFields = {"currentPassword"}; //NOI18N + final String[] requiredFields = {"currentPassword"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); diff --git a/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java b/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java index c0fd9144..e05050a8 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/phone/abroad/PizzaAbroadDialValidator.java @@ -40,20 +40,20 @@ public class PizzaAbroadDialValidator extends BaseNumberValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // The required field - String[] requiredFields = {"countryAbroadDialPrefix"}; //NOI18N + final String[] requiredFields = {"countryAbroadDialPrefix"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, true); // Parse value as string first - String dialNumber = String.valueOf(value); + final String dialNumber = String.valueOf(value); // Is it not +? if (!dialNumber.equals("+")) { //NOI18N // No, then try to ... try { // ..parse as number - Long number = Long.parseLong(dialNumber); + final Long number = Long.parseLong(dialNumber); // Not valid range? (1 - 99, very rude) if (number < 1 || number > 99) { diff --git a/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java b/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java index 7585da39..d6008904 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/phone/number/PizzaPhoneNumberValidator.java @@ -38,7 +38,7 @@ public class PizzaPhoneNumberValidator extends BaseNumberValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // The required field - String[] requiredFields = {"landLineAreaCode", "landLineNumber", "faxAreaCode", "faxNumber", "mobileNumber"}; //NOI18N + final String[] requiredFields = {"landLineAreaCode", "landLineNumber", "faxAreaCode", "faxNumber", "mobileNumber"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, true); diff --git a/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java b/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java index 48fb3c87..e36e97f1 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/privacy_terms/PizzaPrivacyTermsCheckboxValidator.java @@ -38,7 +38,7 @@ public class PizzaPrivacyTermsCheckboxValidator extends BaseBooleanValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // All accepted, required fields - String[] requiredFields = {"privacy", "terms"}; //NOI18N + final String[] requiredFields = {"privacy", "terms"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); diff --git a/src/java/org/mxchange/pizzaapplication/validator/url/PizzaUrlValidator.java b/src/java/org/mxchange/pizzaapplication/validator/url/PizzaUrlValidator.java index 579d9c08..7a985142 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/url/PizzaUrlValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/url/PizzaUrlValidator.java @@ -52,7 +52,7 @@ public class PizzaUrlValidator extends BaseStringValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // The required field - String[] requiredFields = {"companyWebsiteUrl"}; //NOI18N + final String[] requiredFields = {"companyWebsiteUrl"}; //NOI18N // Default is to reject empty email address fields Boolean allowEmptyValue = Boolean.FALSE; @@ -85,11 +85,11 @@ public class PizzaUrlValidator extends BaseStringValidator { } // Get string from object ... ;-) - String url = String.valueOf(value).trim(); + final String url = String.valueOf(value).trim(); // Checks if the email address matches a regex ("low-level" check) // @TODO Should also be done by ) - boolean matches = PATTERN_MATCHER.matcher(url).matches(); //NOI18N + final boolean matches = PATTERN_MATCHER.matcher(url).matches(); //NOI18N // Is the email address valid? if (!matches) { diff --git a/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java b/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java index bb8dda7e..4eb7ea1a 100644 --- a/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java @@ -52,7 +52,7 @@ public class PizzaUserIdValidator extends BaseNumberValidator { if (USER_BEAN == null) { try { // Not yet, attempt lookup - Context initial = new InitialContext(); + final Context initial = new InitialContext(); // Lookup EJB USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); @@ -63,16 +63,16 @@ public class PizzaUserIdValidator extends BaseNumberValidator { } // All accepted, required fields - String[] requiredFields = {"userId"}; //NOI18N + final String[] requiredFields = {"userId"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); // Cast value - Long userId = (Long) value; + final Long userId = (Long) value; // Define variable - Boolean ifUserExists = USER_BEAN.ifUserIdExists(userId); + final Boolean ifUserExists = USER_BEAN.ifUserIdExists(userId); // Is the user id valid? if (!ifUserExists) { diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index de07c814..fc3eadc9 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -109,12 +109,16 @@ /admin/contact/admin_contact_export.xhtml - admin_list_business_contacts - /admin/business_contacts/admin_business_contacts_list.xhtml + admin_list_basic_company_data + /admin/basic_company_data/admin_basic_company_data_list.xhtml - admin_export_business_contacts - /admin/business_contacts/admin_business_contacts_export.xhtml + admin_export_basic_company_data + /admin/basic_company_data/admin_basic_company_data_export.xhtml + + + admin_list_branch_offices + /admin/branch_offices/admin_branch_offices_list.xhtml admin_list_user @@ -707,24 +711,27 @@ - /admin/business_contacts/admin_business_contacts_list.xhtml + /admin/basic_company_data/admin_basic_company_data_list.xhtml - admin_show_business_basic_data - /admin/business_contacts/admin_business_contacts_assign.xhtml + admin_show_basic_company_data + /admin/basic_company_data/admin_basic_company_data_assign.xhtml - admin_assign_business_basic_data_contact - /admin/business_contacts/admin_business_contacts_assign_contact.xhtml + admin_assign_basic_company_data_contact + /admin/basic_company_data/admin_basic_company_data_assign_contact.xhtml - admin_assign_business_basic_data_founder - /admin/business_contacts/admin_business_contacts_assign_founder.xhtml + admin_assign_basic_company_data_founder + /admin/basic_company_data/admin_basic_company_data_assign_founder.xhtml - admin_assign_business_basic_data_owner - /admin/business_contacts/admin_business_contacts_assign_owner.xhtml + admin_assign_basic_company_data_owner + /admin/basic_company_data/admin_basic_company_data_assign_owner.xhtml + + /admin/branch_offices/admin_branch_offices_list.xhtml +