From 4e6fd8144883e55abc21df97b28145cfd025c26b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 24 Jul 2017 23:20:36 +0200 Subject: [PATCH] Please cherry-pick (Massive rewrite): MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Only jcontacts-business-core: - added administrative session-scoped bean (aka. "controller") for business data - added initial JSF view and template for above bean, added also first form fields - added option to enable (default) or disable business contacts in admin menu In general: - removed h:outputText where it was not needed as the parent JSF tag can do it, too - still I'm a bit undecided about where the attribute styleClass is used - fixed i18n key, was a copy-paste mistake - added missing for-attribute - phoneId was long time ago valid, now that there are 2 numbers, land-line and fax, the ids should be named accordingly - added validator for email address validation - removed id-attribute where it was not really needed or might cause harm to the rendering engine (?) - h:message should be always outside, h:panelGroup, not really required by JSF but by design (consistency) - added validatorMessage-attribute for email address fields - added context parameter (thanks to BalusC for the idea) for making all empty strings being interpreted as null - added missing i18n strings Performance rewrites: - rewrote converters and validators, they seem to be re-instanciated after each use, so the set EJB instances must be static to be loaded and set on-demand - still this may ask for a lot room for improvement as the EJB is still called each time the converter/validator is being used - also the Pattern instance for email validator should be "static cached" because it will use a lot CPU cycles and will then slow-down the application Signed-off-by: Roland Häder --- ...alsAdminBusinessContactWebSessionBean.java | 321 ++++++++++++++++++ ...inBusinessContactWebSessionController.java | 39 +++ ...nancialsBusinessContactWebSessionBean.java | 245 ++++++++++++- ...lsBusinessContactWebSessionController.java | 9 - .../FinancialsContactWebSessionBean.java | 6 +- ...FinancialsContactWebSessionController.java | 6 +- .../FinancialsReceiptWebSessionBean.java | 16 +- .../FinancialsBusinessContactConverter.java | 41 ++- .../contact/FinancialsContactConverter.java | 29 +- .../country/FinancialsCountryConverter.java | 31 +- .../fax/FinancialsFaxNumberConverter.java | 54 ++- .../FinancialsLandLineNumberConverter.java | 46 ++- .../FinancialsMobileNumberConverter.java | 29 +- .../FinancialsMobileProviderConverter.java | 31 +- .../user/FinancialsUserConverter.java | 29 +- .../FinancialsEmailAddressValidator.java | 68 ++-- .../user/FinancialsUserIdValidator.java | 29 +- .../localization/bundle_de_DE.properties | 41 +++ .../localization/bundle_en_US.properties | 27 ++ web/WEB-INF/faces-config.xml | 8 + web/WEB-INF/templates/admin/admin_menu.tpl | 11 + .../admin/contact/admin_form_contact_data.tpl | 14 +- .../admin_form_contact_business_data.tpl | 126 +++++++ .../templates/admin/fax/admin_fax_links.tpl | 6 +- .../admin/landline/admin_landline_links.tpl | 6 +- .../admin/mobile/admin_mobile_data.tpl | 4 +- .../admin/mobile/admin_mobile_links.tpl | 6 +- .../guest_email_address_repeat_fields.tpl | 14 +- ...ser_change_email_address_repeat_fields.tpl | 14 +- .../templates/user/user_profile_link.tpl | 4 +- web/WEB-INF/web.xml | 12 +- web/admin/contact/admin_contact_show.xhtml | 2 +- .../unlink/admin_contact_fax_unlink.xhtml | 3 +- .../admin_contact_landline_unlink.xhtml | 3 +- .../unlink/admin_contact_mobile_unlink.xhtml | 3 +- .../admin_contact_business_list.xhtml | 97 ++++++ web/admin/fax/admin_fax_list.xhtml | 3 +- web/admin/fax/admin_fax_show.xhtml | 3 +- web/admin/landline/admin_landline_list.xhtml | 3 +- web/admin/landline/admin_landline_show.xhtml | 4 +- web/admin/mobile/admin_mobile_list.xhtml | 6 +- web/admin/mobile/admin_mobile_show.xhtml | 3 +- .../login_financials_add_receipt.xhtml | 2 +- 43 files changed, 1159 insertions(+), 295 deletions(-) create mode 100644 src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionController.java create mode 100644 web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl create mode 100644 web/admin/contact_business/admin_contact_business_list.xhtml diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionBean.java new file mode 100644 index 00000000..d213b854 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionBean.java @@ -0,0 +1,321 @@ +/* + * Copyright (C) 2016, 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.jfinancials.beans.businesscontact; + +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcontactsbusiness.BusinessBasicData; +import org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jfinancials.beans.BaseFinancialsController; + +/** + * An administrative business contact bean (controller) + *

+ * @author Roland Häder + */ +@Named ("adminBusinessDataController") +@SessionScoped +public class FinancialsAdminBusinessContactWebSessionBean extends BaseFinancialsController implements FinancialsAdminBusinessContactWebSessionController { + + /** + * Serial number + */ + private static final long serialVersionUID = 56_189_028_928_374L; + + /** + * Remote contact bean + */ + private BusinessDataAdminSessionBeanRemote adminBusinessDataBean; + + /** + * A list of all registered companies (globally) + */ + private List businessContacts; + + /** + * Comments for this company + */ + private String companyComments; + + /** + * Companies (main) email address (example: info@company.example) + */ + private String companyEmailAddress; + + /** + * Company legal status (example: Incorporated, GmbH) + */ + private String companyLegalStatus; + + /** + * Company name + */ + private String companyName; + + /** + * 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; + + /** + * Constructor + */ + public FinancialsAdminBusinessContactWebSessionBean () { + // Call super constructor + super(); + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allBusinessContacts () { + return this.businessContacts; + } + + /** + * Getter for comments + *

+ * @return Comments + */ + public String getCompanyComments () { + return this.companyComments; + } + + /** + * Setter for comments + *

+ * @param companyComments Comments + */ + public void setCompanyComments (final String companyComments) { + this.companyComments = companyComments; + } + + /** + * Getter for company's (main) email address + *

+ * @return Company's (main) email address + */ + public String getCompanyEmailAddress () { + return this.companyEmailAddress; + } + + /** + * Setter for company's (main) email address + *

+ * @param companyEmailAddress Company's (main) email address + */ + public void setCompanyEmailAddress (final String companyEmailAddress) { + this.companyEmailAddress = companyEmailAddress; + } + + /** + * Getter for company's legal status + *

+ * @return Company's legal status + */ + public String getCompanyLegalStatus () { + return this.companyLegalStatus; + } + + /** + * Setter for company's legal status + *

+ * @param companyLegalStatus Company's legal status + */ + public void setCompanyLegalStatus (final String companyLegalStatus) { + this.companyLegalStatus = companyLegalStatus; + } + + /** + * Getter for company name + *

+ * @return Company name + */ + public String getCompanyName () { + return this.companyName; + } + + /** + * Setter for company name + *

+ * @param companyName Company name + */ + public void setCompanyName (final String companyName) { + this.companyName = companyName; + } + + /** + * 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; + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + + // Init user's contact list + this.businessContacts = this.adminBusinessDataBean.allBusinessContacts(); + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionController.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionController.java new file mode 100644 index 00000000..29e959d3 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebSessionController.java @@ -0,0 +1,39 @@ +/* + * 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.jfinancials.beans.businesscontact; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Local; +import org.mxchange.jcontactsbusiness.BusinessBasicData; + +/** + * An interface for session-scoped financial controller + *

+ * @author Roland Häder + */ +@Local +public interface FinancialsAdminBusinessContactWebSessionController extends Serializable { + + /** + * Returns a list of all business contacts + *

+ * @return A list of all business contacts + */ + List allBusinessContacts (); + +} diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java index 5c2c045d..76c04b59 100644 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java @@ -16,8 +16,6 @@ */ package org.mxchange.jfinancials.beans.businesscontact; -import java.util.Collections; -import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.faces.view.facelets.FaceletException; @@ -26,8 +24,8 @@ import javax.inject.Named; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import org.mxchange.jcontactsbusiness.BusinessContact; -import org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote; +import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote; +import org.mxchange.jcountry.data.Country; import org.mxchange.jfinancials.beans.BaseFinancialsController; import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController; @@ -36,7 +34,7 @@ import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionCo *

* @author Roland Häder */ -@Named ("businessContactController") +@Named ("businessDataController") @SessionScoped public class FinancialsBusinessContactWebSessionBean extends BaseFinancialsController implements FinancialsBusinessContactWebSessionController { @@ -48,12 +46,57 @@ public class FinancialsBusinessContactWebSessionBean extends BaseFinancialsContr /** * Remote contact bean */ - private BusinessContactSessionBeanRemote businessContactBean; + private BusinessDataSessionBeanRemote businessDataBean; /** - * A list of all registered companies (globally) + * Comments for this company */ - private List registeredCompanies; + private String companyComments; + + /** + * Companies (main) email address (example: info@company.example) + */ + private String companyEmailAddress; + + /** + * Company legal status (example: Incorporated, GmbH) + */ + private String companyLegalStatus; + + /** + * Company name + */ + private String companyName; + + /** + * 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; /** * User instance @@ -69,9 +112,184 @@ public class FinancialsBusinessContactWebSessionBean extends BaseFinancialsContr super(); } - @Override - public List allRegisteredCompanies () { - return Collections.unmodifiableList(this.registeredCompanies); + /** + * Getter for comments + *

+ * @return Comments + */ + public String getCompanyComments () { + return this.companyComments; + } + + /** + * Setter for comments + *

+ * @param companyComments Comments + */ + public void setCompanyComments (final String companyComments) { + this.companyComments = companyComments; + } + + /** + * Getter for company's (main) email address + *

+ * @return Company's (main) email address + */ + public String getCompanyEmailAddress () { + return this.companyEmailAddress; + } + + /** + * Setter for company's (main) email address + *

+ * @param companyEmailAddress Company's (main) email address + */ + public void setCompanyEmailAddress (final String companyEmailAddress) { + this.companyEmailAddress = companyEmailAddress; + } + + /** + * Getter for company's legal status + *

+ * @return Company's legal status + */ + public String getCompanyLegalStatus () { + return this.companyLegalStatus; + } + + /** + * Setter for company's legal status + *

+ * @param companyLegalStatus Company's legal status + */ + public void setCompanyLegalStatus (final String companyLegalStatus) { + this.companyLegalStatus = companyLegalStatus; + } + + /** + * Getter for company name + *

+ * @return Company name + */ + public String getCompanyName () { + return this.companyName; + } + + /** + * Setter for company name + *

+ * @param companyName Company name + */ + public void setCompanyName (final String companyName) { + this.companyName = companyName; + } + + /** + * 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; } /** @@ -85,10 +303,7 @@ public class FinancialsBusinessContactWebSessionBean extends BaseFinancialsContr Context context = new InitialContext(); // Try to lookup - this.businessContactBean = (BusinessContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N - - // Init list - this.registeredCompanies = this.businessContactBean.allBusinessContacts(); + this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e); diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java index 6d418e74..2e982db0 100644 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java +++ b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java @@ -17,9 +17,7 @@ package org.mxchange.jfinancials.beans.businesscontact; import java.io.Serializable; -import java.util.List; import javax.ejb.Local; -import org.mxchange.jcontactsbusiness.BusinessContact; /** * An interface for session-scoped financial controller @@ -29,11 +27,4 @@ import org.mxchange.jcontactsbusiness.BusinessContact; @Local public interface FinancialsBusinessContactWebSessionController extends Serializable { - /** - * Returns a list of all registered companies - *

- * @return A list of all registered companies - */ - List allRegisteredCompanies (); - } diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java index 7c492136..09d01d0d 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java @@ -39,7 +39,7 @@ import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.title.PersonalTitle; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; -import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException; +import org.mxchange.jcontactsbusiness.exceptions.BusinessDataNotFoundException; import org.mxchange.jcountry.data.Country; import org.mxchange.jfinancials.beans.BaseFinancialsController; import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController; @@ -931,7 +931,7 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im } @Override - public Contact lookupContactById (final Long contactId) throws BusinessContactNotFoundException { + public Contact lookupContactById (final Long contactId) throws BusinessDataNotFoundException { // Init variable Contact localContact = null; @@ -954,7 +954,7 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im // Is it still null? if (null == localContact) { // Not visible for the current user - throw new BusinessContactNotFoundException(contactId); + throw new BusinessDataNotFoundException(contactId); } // Copy all data to this bean diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java index 9918818c..e89f6dbe 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java @@ -22,7 +22,7 @@ import java.util.List; import javax.ejb.Local; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException; +import org.mxchange.jcontactsbusiness.exceptions.BusinessDataNotFoundException; import org.mxchange.jcountry.data.Country; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; @@ -61,9 +61,9 @@ public interface FinancialsContactWebSessionController extends Serializable { *

* @return Contact instance *

- * @throws BusinessContactNotFoundException If the user is not found + * @throws BusinessDataNotFoundException If the user is not found */ - Contact lookupContactById (final Long contactId) throws BusinessContactNotFoundException; + Contact lookupContactById (final Long contactId) throws BusinessDataNotFoundException; /** * Creates an instance from all properties diff --git a/src/java/org/mxchange/jfinancials/beans/financial/receipt/FinancialsReceiptWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/financial/receipt/FinancialsReceiptWebSessionBean.java index afc79303..3b5e9119 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/receipt/FinancialsReceiptWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/receipt/FinancialsReceiptWebSessionBean.java @@ -30,7 +30,6 @@ import javax.inject.Named; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import org.mxchange.jcontactsbusiness.BusinessContact; import org.mxchange.jfinancials.beans.BaseFinancialsController; import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController; import org.mxchange.jfinancials.exceptions.ReceiptAlreadyAddedException; @@ -39,6 +38,7 @@ import org.mxchange.jfinancials.model.receipt.BillableReceipt; import org.mxchange.jfinancials.model.receipt.FinancialReceipt; import org.mxchange.jproduct.model.payment.PaymentType; import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent; +import org.mxchange.jcontactsbusiness.BusinessBasicData; /** * An administrative financial receipt bean (controller) @@ -67,7 +67,7 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im /** * Recipient issuing company (for example where the user went shopping to) */ - private BusinessContact receiptCompany; + private BusinessBasicData receiptCompany; /** * Date/time the receipt has been issued @@ -125,12 +125,12 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im } else if (this.getReceiptCompany() == null) { // Is not set throw new NullPointerException("this.receiptCompany is not set."); //NOI18N - } else if (this.getReceiptCompany().getBusinessContactId() == null) { + } else if (this.getReceiptCompany().getBusinessDataId() == null) { // It must be an already peristed instance throw new NullPointerException("this.receiptCompany.businessContactId is not set."); //NOI18N - } else if (this.getReceiptCompany().getBusinessContactId() < 1) { + } else if (this.getReceiptCompany().getBusinessDataId() < 1) { // It must be an already peristed instance - throw new IllegalArgumentException(MessageFormat.format("this.receiptCompany.businessContactId={0} is not valid.", this.getReceiptCompany().getBusinessContactId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("this.receiptCompany.businessContactId={0} is not valid.", this.getReceiptCompany().getBusinessDataId())); //NOI18N } else if (this.getPaymentType() == null) { // Is not set throw new NullPointerException("this.paymentType is not set."); //NOI18N @@ -144,7 +144,7 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im if (this.isReceiptAdded(receipt)) { // Receipt has already been added - throw new FaceletException(MessageFormat.format("Receipt for receiptCompany={0},receiptIssued={1},receiptNumber={2} has already been added.", this.getReceiptCompany().getBusinessContactId(), this.getReceiptIssued().toString(), this.getReceiptNumber())); //NOI18N + throw new FaceletException(MessageFormat.format("Receipt for receiptCompany={0},receiptIssued={1},receiptNumber={2} has already been added.", this.getReceiptCompany().getBusinessDataId(), this.getReceiptIssued().toString(), this.getReceiptNumber())); //NOI18N } // Init variable @@ -221,7 +221,7 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im *

* @return Receipt issuing company */ - public BusinessContact getReceiptCompany () { + public BusinessBasicData getReceiptCompany () { return this.receiptCompany; } @@ -230,7 +230,7 @@ public class FinancialsReceiptWebSessionBean extends BaseFinancialsController im *

* @param receiptCompany Receipt issuing company */ - public void setReceiptCompany (final BusinessContact receiptCompany) { + public void setReceiptCompany (final BusinessBasicData receiptCompany) { this.receiptCompany = receiptCompany; } diff --git a/src/java/org/mxchange/jfinancials/converter/businesscontact/FinancialsBusinessContactConverter.java b/src/java/org/mxchange/jfinancials/converter/businesscontact/FinancialsBusinessContactConverter.java index 398ade5b..8444ce20 100644 --- a/src/java/org/mxchange/jfinancials/converter/businesscontact/FinancialsBusinessContactConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/businesscontact/FinancialsBusinessContactConverter.java @@ -26,9 +26,9 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontactsbusiness.BusinessContact; -import org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote; -import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException; +import org.mxchange.jcontactsbusiness.BusinessBasicData; +import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote; +import org.mxchange.jcontactsbusiness.exceptions.BusinessDataNotFoundException; /** * Converter for contact id <-> valid business contact instance @@ -41,7 +41,7 @@ public class FinancialsBusinessContactConverter implements Converter { /** * Business contact EJB */ - private BusinessContactSessionBeanRemote businessContactBean; + private static BusinessDataSessionBeanRemote BUSINESS_CONTACT_BEAN; /** * Initialization of this converter @@ -60,36 +60,35 @@ public class FinancialsBusinessContactConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.businessContactBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsBusinessContactConverter.BUSINESS_CONTACT_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); - // ... and user controller - this.businessContactBean = (BusinessContactSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // ... and user controller + FinancialsBusinessContactConverter.BUSINESS_CONTACT_BEAN = (BusinessDataSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } // Init instance - BusinessContact businessContact = null; + BusinessBasicData businessContact = null; try { // Try to parse the value as long Long contactId = Long.valueOf(submittedValue); // Try to get user instance from it - businessContact = this.businessContactBean.findBusinessContactById(contactId); + businessContact = FinancialsBusinessContactConverter.BUSINESS_CONTACT_BEAN.findBusinessDataById(contactId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); - } catch (final BusinessContactNotFoundException ex) { + } catch (final BusinessDataNotFoundException ex) { // Debug message // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N } @@ -110,7 +109,7 @@ public class FinancialsBusinessContactConverter implements Converter { } // Return category id - return String.valueOf(((BusinessContact) value).getBusinessContactId()); + return String.valueOf(((BusinessBasicData) value).getBusinessDataId()); } } diff --git a/src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java b/src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java index a90e831e..5a2501e4 100644 --- a/src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java @@ -40,7 +40,7 @@ public class FinancialsContactConverter implements Converter { /** * Contact EJB */ - private ContactSessionBeanRemote contactBean; + private static ContactSessionBeanRemote CONTACT_BEAN; /** * Initialization of this converter @@ -59,20 +59,19 @@ public class FinancialsContactConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.contactBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsContactConverter.CONTACT_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); - // ... and user controller - this.contactBean = (ContactSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // ... and user controller + FinancialsContactConverter.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } @@ -84,7 +83,7 @@ public class FinancialsContactConverter implements Converter { Long contactId = Long.valueOf(submittedValue); // Try to get user instance from it - contact = this.contactBean.findContactById(contactId); + contact = FinancialsContactConverter.CONTACT_BEAN.findContactById(contactId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java index fcfbae8f..1b5978da 100644 --- a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java @@ -41,7 +41,7 @@ public class FinancialsCountryConverter implements Converter { /** * Country bean */ - private CountrySingletonBeanRemote countryBean = null; + private static CountrySingletonBeanRemote COUNTRY_BEAN; /** * Initialization of this converter @@ -60,25 +60,24 @@ public class FinancialsCountryConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.countryBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and country bean - this.countryBean = (CountrySingletonBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsCountryConverter.COUNTRY_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); + + // ... and country bean + FinancialsCountryConverter.COUNTRY_BEAN = (CountrySingletonBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } // Get full list - List countryList = this.countryBean.allCountries(); + List countryList = FinancialsCountryConverter.COUNTRY_BEAN.allCountries(); // Init value Country country = null; diff --git a/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java b/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java index fca11c6c..3bb2bf25 100644 --- a/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java @@ -25,8 +25,6 @@ import javax.faces.convert.FacesConverter; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import org.mxchange.jcoreeelogger.beans.local.logger.Log; -import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException; import org.mxchange.jphone.phonenumbers.DialableNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; @@ -40,51 +38,47 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; @FacesConverter (value = "FaxNumberConverter") public class FinancialsFaxNumberConverter implements Converter { - /** - * Logger instance - */ - @Log - private LoggerBeanLocal loggerBeanLocal; - /** * Phone EJB */ - private PhoneSessionBeanRemote phoneBean; + private static PhoneSessionBeanRemote PHONE_BEAN; /** * Initialization of this converter */ public FinancialsFaxNumberConverter () { - // Try to get it - try { - // Get initial context - Context context = new InitialContext(); - - // Lookup logger - this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N - - // ... and user controller - this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } } @Override public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Log message - this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N + // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { // Warning message - this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N + // @TODO Not possible here: this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N // Return null return null; } + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsFaxNumberConverter.PHONE_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); + + // ... and user controller + FinancialsFaxNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + // Init instance DialableFaxNumber faxNumber = null; @@ -93,21 +87,19 @@ public class FinancialsFaxNumberConverter implements Converter { Long faxNumberId = Long.valueOf(submittedValue); // Log message - this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N - + // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N // Try to get mobile instance from it - faxNumber = this.phoneBean.findFaxNumberById(faxNumberId); + faxNumber = FinancialsFaxNumberConverter.PHONE_BEAN.findFaxNumberById(faxNumberId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); } catch (final PhoneEntityNotFoundException ex) { // Debug message - this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N + // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N } // Log message - this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N - + // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N // Return it return faxNumber; } diff --git a/src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java b/src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java index c81c4fb8..aa641262 100644 --- a/src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java @@ -25,8 +25,6 @@ import javax.faces.convert.FacesConverter; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import org.mxchange.jcoreeelogger.beans.local.logger.Log; -import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException; import org.mxchange.jphone.phonenumbers.DialableNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; @@ -40,35 +38,15 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; @FacesConverter (value = "LandLineNumberConverter") public class FinancialsLandLineNumberConverter implements Converter { - /** - * Logger instance - */ - @Log - private LoggerBeanLocal loggerBeanLocal; - /** * Phone EJB */ - private PhoneSessionBeanRemote phoneBean; + private static PhoneSessionBeanRemote PHONE_BEAN; /** * Initialization of this converter */ public FinancialsLandLineNumberConverter () { - // Try to get it - try { - // Get initial context - Context context = new InitialContext(); - - // Lookup logger - this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N - - // ... and user controller - this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } } @Override @@ -76,12 +54,28 @@ public class FinancialsLandLineNumberConverter implements Converter { // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { // Warning message - this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N + // @TODO Not possible here: this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N // Return null return null; } + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsLandLineNumberConverter.PHONE_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); + + // ... and user controller + FinancialsLandLineNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N + } + } + // Init instance DialableLandLineNumber landLineNumber = null; @@ -90,13 +84,13 @@ public class FinancialsLandLineNumberConverter implements Converter { Long landLineNumberId = Long.valueOf(submittedValue); // Try to get mobile instance from it - landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId); + landLineNumber = FinancialsLandLineNumberConverter.PHONE_BEAN.findLandLineNumberById(landLineNumberId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); } catch (final PhoneEntityNotFoundException ex) { // Debug message - this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N + // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N } // Return it diff --git a/src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java b/src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java index c2fd838b..e5d99653 100644 --- a/src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java @@ -41,7 +41,7 @@ public class FinancialsMobileNumberConverter implements Converter { /** * Phone EJB */ - private PhoneSessionBeanRemote phoneBean; + private static PhoneSessionBeanRemote PHONE_BEAN; /** * Initialization of this converter @@ -60,20 +60,19 @@ public class FinancialsMobileNumberConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.phoneBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsMobileNumberConverter.PHONE_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); - // ... and user controller - this.phoneBean = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // ... and user controller + FinancialsMobileNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } @@ -85,7 +84,7 @@ public class FinancialsMobileNumberConverter implements Converter { Long mobileId = Long.valueOf(submittedValue); // Try to get mobile instance from it - mobile = this.phoneBean.findMobileNumberById(mobileId); + mobile = FinancialsMobileNumberConverter.PHONE_BEAN.findMobileNumberById(mobileId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/jfinancials/converter/mobileprovider/FinancialsMobileProviderConverter.java b/src/java/org/mxchange/jfinancials/converter/mobileprovider/FinancialsMobileProviderConverter.java index 58788ff4..845ebab5 100644 --- a/src/java/org/mxchange/jfinancials/converter/mobileprovider/FinancialsMobileProviderConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/mobileprovider/FinancialsMobileProviderConverter.java @@ -41,7 +41,7 @@ public class FinancialsMobileProviderConverter implements Converter { /** * Mobile provider bean */ - private MobileProviderSingletonBeanRemote mobileRemoteBean; + private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN; /** * Initialization of this converter @@ -60,25 +60,24 @@ public class FinancialsMobileProviderConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.mobileRemoteBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - /// and mobile provider controller - this.mobileRemoteBean = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsMobileProviderConverter.MOBILE_PROVIDER_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); + + /// and mobile provider controller + FinancialsMobileProviderConverter.MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } // Get full list - List providerList = this.mobileRemoteBean.allMobileProvider(); + List providerList = FinancialsMobileProviderConverter.MOBILE_PROVIDER_BEAN.allMobileProvider(); // Init value MobileProvider provider = null; diff --git a/src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java b/src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java index c0d49b11..17c29fa8 100644 --- a/src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java @@ -40,7 +40,7 @@ public class FinancialsUserConverter implements Converter { /** * User EJB */ - private UserSessionBeanRemote userBean; + private static UserSessionBeanRemote USER_BEAN; /** * Initialization of this converter @@ -59,20 +59,19 @@ public class FinancialsUserConverter implements Converter { return null; } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.userBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); + // Is the bean there? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsUserConverter.USER_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); - // ... and user controller - this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new RuntimeException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // ... and user controller + FinancialsUserConverter.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } @@ -84,7 +83,7 @@ public class FinancialsUserConverter implements Converter { Long userId = Long.valueOf(submittedValue); // Try to get user instance from it - user = this.userBean.findUserById(userId); + user = FinancialsUserConverter.USER_BEAN.findUserById(userId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java index 7b8e2964..512a2148 100644 --- a/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java @@ -17,7 +17,6 @@ package org.mxchange.jfinancials.validator.emailaddress; import java.text.MessageFormat; -import java.util.List; import java.util.regex.Pattern; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; @@ -41,19 +40,24 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator; public class FinancialsEmailAddressValidator extends BaseStringValidator implements Validator { /** - * Serial number + * Contact session-scoped bean */ - private static final long serialVersionUID = 187_536_745_607_192L; + private static ContactSessionBeanRemote CONTACT_BEAN; /** - * Contact session-scoped bean + * Pattern matcher */ - private ContactSessionBeanRemote contactBean; + private static final Pattern EMAIL_PATTERN = Pattern.compile(FinancialsEmailAddressValidator.EMAIL_REGEX); /** - * Cached list of all email addresses + * Email pattern */ - private List emailAddresses; + private static final String EMAIL_REGEX = "([^.@]+)(\\\\.[^.@]+)*@([^.@]+\\\\.)+([^.@]+)"; //NOI18N + + /** + * Serial number + */ + private static final long serialVersionUID = 187_536_745_607_192L; /** * Default constructor @@ -66,16 +70,25 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator impleme // The required field String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N + // Check if allowNull is given, otherwise assume "not allowed" + Boolean allowEmpty = (component.getAttributes().containsKey("allowEmpty") ? Boolean.parseBoolean((String) component.getAttributes().get("allowEmpty")) : Boolean.FALSE); //NOI18N + // Pre-validation (example: not null, not a string, empty string ...) - super.preValidate(context, component, value, requiredFields, false); + super.preValidate(context, component, value, requiredFields, allowEmpty); // Get string from object ... ;-) // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat String emailAddress = String.valueOf(value); + // Is the email address empty and allowed? + if (emailAddress.isEmpty() && allowEmpty) { + // Then accept this here + return; + } + // Checks if the email address matches a regex ("low-level" check) // @TODO Should also be done by ) - boolean matches = Pattern.matches("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", emailAddress); //NOI18N + boolean matches = EMAIL_PATTERN.matcher(emailAddress).matches(); //NOI18N // Is the email address valid? if (!matches) { @@ -86,37 +99,36 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator impleme throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message)); } - synchronized (this) { - // Is the EJB instanciated? - if (null == this.contactBean) { - // Try it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // Try to lookup - this.contactBean = (ContactSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N - - // Get whole list of email addresses - this.emailAddresses = this.contactBean.getEmailAddressList(); - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // Is the bean not yet set? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsEmailAddressValidator.CONTACT_BEAN) { + // Try it + try { + // Get initial context + Context initialContext = new InitialContext(); + + // Try to lookup + FinancialsEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } // Get client id (aka form id) String clientId = component.getClientId(); + // Is it registered? + Boolean isRegistered = FinancialsEmailAddressValidator.CONTACT_BEAN.isEmailAddressRegistered(emailAddress); + // Is the email address already registered? - if ((!clientId.endsWith("resendEmailAddress")) && (this.emailAddresses.contains(emailAddress))) { //NOI18N + if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N // Generate message 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")) && (!this.emailAddresses.contains(emailAddress))) { //NOI18N + } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N // Generate message String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N diff --git a/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java b/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java index 26dceeb5..71474874 100644 --- a/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java @@ -46,7 +46,7 @@ public class FinancialsUserIdValidator extends BaseLongValidator implements Vali /** * Remote bean */ - private UserSessionBeanRemote userBean; + private static UserSessionBeanRemote USER_BEAN; /** * Initialization of this converter @@ -65,25 +65,24 @@ public class FinancialsUserIdValidator extends BaseLongValidator implements Vali // Cast value Long userId = (Long) value; - synchronized (this) { - // Is the EJB instanciated? - if (null == this.userBean) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); + // Is the bean not yet set? + // @TODO Requires this synchronization or is it (sync) confusing the container? + if (null == FinancialsUserIdValidator.USER_BEAN) { + // Try to get it + try { + // Get initial context + Context initialContext = new InitialContext(); - // ... and user controller - this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } + // ... and user controller + FinancialsUserIdValidator.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N } } // Define variable - Boolean ifUserExists = this.userBean.ifUserIdExists(userId); + Boolean ifUserExists = FinancialsUserIdValidator.USER_BEAN.ifUserIdExists(userId); // Is the user id valid? if (!ifUserExists) { diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index d972721f..056d5a38 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -812,3 +812,44 @@ GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Bitte geben Sie ein Passwort ein. Dies m #@TODO Please fix German umlauts! GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Bitte wiederholen Sie das eingegebene Passwort. Dies wird zur Bestaetigung benoetigt. PAGE_TITLE_ADMIN_AREA=Administration +#@TODO Please fix German umlauts! +ADMIN_MENU_CONTACT_BUSINESS_TITLE=Geschaeftliche Kontakte +#@TODO Please fix German umlauts! +LINK_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftskontakte auflisten +#@TODO Please fix German umlauts! +LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Listet geschaeftliche Kontakte auf +#@TODO Please fix German umlauts! +LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Geschaeftliche Kontakte exportieren +#@TODO Please fix German umlauts! +LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exportiert geschaeftliche Kontakte +#@TODO Please fix German umlauts! +PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftliche Kontakte auflisten +#@TODO Please fix German umlauts! +CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Auflisten von geschaeftlichen Kontakt +#@TODO Please fix German umlauts! +ADMIN_CONTACT_BUSINESS_LIST_EMPTY=Es befinden sich keine geschaeftlichen Kontakte in der Datenbank. +#@TODO Please fix German umlauts! +TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=Tabelle listet geschaeftliche Kontakte auf. +ADMIN_CONTACT_BUSINESS_ID=Id-Nummer: +#@TODO Please fix German umlauts! +ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Details des geschaeftlichen Kontaktes anzeigen. +ADMIN_CONTACT_BUSINESS_OWNER_ID=Zugew. Benutzer: +ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Zuweisen +#@TODO Please fix German umlauts! +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Geschaeftlichen Kontakt einen Benutzeraccount zuweisen. +ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Firmenname: +ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Ansprechpartner: +ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Zuweisen +#@TODO Please fix German umlauts! +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. +ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Zeigt das komplette Kontaktprofil an. +ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Anmerkungen: +ADMIN_BUSINESS_DATA_PHONE_NUMBER=Haupttelefonnummer: +ADMIN_BUSINESS_DATA_FAX_NUMBER=Hauptfaxnummer: +#@TODO Please fix German umlauts! +ADMIN_ADD_CONTACT_BUSINESS_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen +ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Bitte mindestens Firmennamen mit Rechtsstand ein. +#@TODO Please fix German umlauts! +ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 82e61db8..beb16f42 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -794,3 +794,30 @@ LOGIN_FINANCIAL_ENTER_RECEIPT_ISSUED_TITLE=Please enter or select here the exact GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Please enter a password. This must match with security rules. GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Please repeat the entered password. This done to confirm the password. PAGE_TITLE_ADMIN_AREA=Administration +ADMIN_MENU_CONTACT_BUSINESS_TITLE=Business Contacts +LINK_ADMIN_LIST_CONTACT_BUSINESS=List business contacts +LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Lists business contacts +LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Export business contacts +LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exports business contacts +PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=List business contacts +CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Lists business contacts +ADMIN_CONTACT_BUSINESS_LIST_EMPTY=There are currently no business contacts in database. +TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=This table lists business contacts. +ADMIN_CONTACT_BUSINESS_ID=Id Number: +ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Show details of this business contact. +ADMIN_CONTACT_BUSINESS_OWNER_ID=Assigned user: +ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Shows assigned user profile. +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Assign +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Assigns this business contact to a user account. +ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Company name: +ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Contact person: +ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Assign +ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact. +ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Shows complete contact profile. +ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Comments: +ADMIN_BUSINESS_DATA_PHONE_NUMBER=Main phone number: +ADMIN_BUSINESS_DATA_FAX_NUMBER=Main fax number: +ADMIN_ADD_CONTACT_BUSINESS_TITLE=Add new business contact +ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Please enter at least company name and legal status. +ENTERED_EMAIL_ADDRESS_IS_INVALID=Your entered email address is not valid. diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 7fdfa16b..a7fc0766 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -108,6 +108,14 @@ admin_export_contact /admin/contact/admin_contact_export.xhtml + + admin_list_contact_business + /admin/contact_business/admin_contact_business_list.xhtml + + + admin_export_contact_business + /admin/contact_business/admin_contact_business_export.xhtml + admin_list_user /admin/user/admin_user_list.xhtml diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl index b865ba02..12d3bb23 100644 --- a/web/WEB-INF/templates/admin/admin_menu.tpl +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -33,6 +33,17 @@

  • + + + +
      +
    • +
    • +
    +
    + diff --git a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl index 5b015a0d..8ed4e71e 100644 --- a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl +++ b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl @@ -182,14 +182,14 @@
    - +
    - + - + @@ -206,14 +206,14 @@
    - +
    - + @@ -254,7 +254,9 @@
    - + + +
    diff --git a/web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl b/web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl new file mode 100644 index 00000000..86937027 --- /dev/null +++ b/web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl @@ -0,0 +1,126 @@ + + + +
    +
    + + + + + +
    + +
    + +
    + +
    + +
    +
    + + + + + + +
    + +
    + +
    + +
    + +
    +
    + + + + + + +
    + +
    + +
    + + + + +
    + +
    +
    + + + + + + +
    + +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    + + + + + + + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    diff --git a/web/WEB-INF/templates/admin/fax/admin_fax_links.tpl b/web/WEB-INF/templates/admin/fax/admin_fax_links.tpl index 61e466e1..33c33bcf 100644 --- a/web/WEB-INF/templates/admin/fax/admin_fax_links.tpl +++ b/web/WEB-INF/templates/admin/fax/admin_fax_links.tpl @@ -16,16 +16,14 @@
      diff --git a/web/WEB-INF/templates/admin/landline/admin_landline_links.tpl b/web/WEB-INF/templates/admin/landline/admin_landline_links.tpl index 6ffb7660..4292e6dd 100644 --- a/web/WEB-INF/templates/admin/landline/admin_landline_links.tpl +++ b/web/WEB-INF/templates/admin/landline/admin_landline_links.tpl @@ -16,16 +16,14 @@
        diff --git a/web/WEB-INF/templates/admin/mobile/admin_mobile_data.tpl b/web/WEB-INF/templates/admin/mobile/admin_mobile_data.tpl index 95cfde3f..f579fab2 100644 --- a/web/WEB-INF/templates/admin/mobile/admin_mobile_data.tpl +++ b/web/WEB-INF/templates/admin/mobile/admin_mobile_data.tpl @@ -30,9 +30,9 @@ - + + - diff --git a/web/WEB-INF/templates/admin/mobile/admin_mobile_links.tpl b/web/WEB-INF/templates/admin/mobile/admin_mobile_links.tpl index 33d5ed3a..48d218af 100644 --- a/web/WEB-INF/templates/admin/mobile/admin_mobile_links.tpl +++ b/web/WEB-INF/templates/admin/mobile/admin_mobile_links.tpl @@ -16,16 +16,14 @@
          diff --git a/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl b/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl index 0a47f71b..0f512b25 100644 --- a/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl +++ b/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl @@ -12,16 +12,16 @@
    - +
    +
    - - - + + @@ -34,9 +34,9 @@
    +
    - - - + + diff --git a/web/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl b/web/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl index 83cd2cc8..ee216c37 100644 --- a/web/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl +++ b/web/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl @@ -12,16 +12,16 @@
    - +
    + - - - + + @@ -34,9 +34,9 @@
    +
    - - - + + diff --git a/web/WEB-INF/templates/user/user_profile_link.tpl b/web/WEB-INF/templates/user/user_profile_link.tpl index e85accf1..1ddb6de7 100644 --- a/web/WEB-INF/templates/user/user_profile_link.tpl +++ b/web/WEB-INF/templates/user/user_profile_link.tpl @@ -14,8 +14,8 @@ - - + + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 1d420288..dccd96e4 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -1,6 +1,6 @@ - An application to handle all your receipts and do some calculation with it + An application to handle all your receipts and do some calculation with it. JFinancials Application v1.0 Project stage. @@ -12,6 +12,11 @@ javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE true + + All empty strings should be converted to null. + javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL + true + Whether the multi-page registration page or a single registration page is active is_feature_user_register_multiple_page_enabled @@ -102,6 +107,11 @@ is_feature_allow_user_registration_empty_password_enabled false + + Whether business contacts are used in this project. + is_feature_business_contacts_enabled + true + Maximum passwords that must be different. max_user_password_history diff --git a/web/admin/contact/admin_contact_show.xhtml b/web/admin/contact/admin_contact_show.xhtml index ee4b6a73..0b018ccb 100644 --- a/web/admin/contact/admin_contact_show.xhtml +++ b/web/admin/contact/admin_contact_show.xhtml @@ -11,7 +11,7 @@ - + diff --git a/web/admin/contact/unlink/admin_contact_fax_unlink.xhtml b/web/admin/contact/unlink/admin_contact_fax_unlink.xhtml index b2bb1eb9..8d1ee9b9 100644 --- a/web/admin/contact/unlink/admin_contact_fax_unlink.xhtml +++ b/web/admin/contact/unlink/admin_contact_fax_unlink.xhtml @@ -35,8 +35,7 @@
    - - +
    diff --git a/web/admin/contact/unlink/admin_contact_landline_unlink.xhtml b/web/admin/contact/unlink/admin_contact_landline_unlink.xhtml index 28d1ed27..aa4a24a4 100644 --- a/web/admin/contact/unlink/admin_contact_landline_unlink.xhtml +++ b/web/admin/contact/unlink/admin_contact_landline_unlink.xhtml @@ -35,8 +35,7 @@
    - - +
    diff --git a/web/admin/contact/unlink/admin_contact_mobile_unlink.xhtml b/web/admin/contact/unlink/admin_contact_mobile_unlink.xhtml index eb4c5c5c..7b020fff 100644 --- a/web/admin/contact/unlink/admin_contact_mobile_unlink.xhtml +++ b/web/admin/contact/unlink/admin_contact_mobile_unlink.xhtml @@ -35,8 +35,7 @@
    - - +
    diff --git a/web/admin/contact_business/admin_contact_business_list.xhtml b/web/admin/contact_business/admin_contact_business_list.xhtml new file mode 100644 index 00000000..8bfc600b --- /dev/null +++ b/web/admin/contact_business/admin_contact_business_list.xhtml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
    +
    +
    +
    + diff --git a/web/admin/fax/admin_fax_list.xhtml b/web/admin/fax/admin_fax_list.xhtml index e6606f80..e9573610 100644 --- a/web/admin/fax/admin_fax_list.xhtml +++ b/web/admin/fax/admin_fax_list.xhtml @@ -23,8 +23,7 @@ - - + diff --git a/web/admin/fax/admin_fax_show.xhtml b/web/admin/fax/admin_fax_show.xhtml index f091d402..0d285212 100644 --- a/web/admin/fax/admin_fax_show.xhtml +++ b/web/admin/fax/admin_fax_show.xhtml @@ -38,8 +38,7 @@ - - + diff --git a/web/admin/landline/admin_landline_list.xhtml b/web/admin/landline/admin_landline_list.xhtml index 354478e6..b1584ff5 100644 --- a/web/admin/landline/admin_landline_list.xhtml +++ b/web/admin/landline/admin_landline_list.xhtml @@ -23,8 +23,7 @@ - - + diff --git a/web/admin/landline/admin_landline_show.xhtml b/web/admin/landline/admin_landline_show.xhtml index 7259c587..e900d982 100644 --- a/web/admin/landline/admin_landline_show.xhtml +++ b/web/admin/landline/admin_landline_show.xhtml @@ -38,8 +38,8 @@ - - + + diff --git a/web/admin/mobile/admin_mobile_list.xhtml b/web/admin/mobile/admin_mobile_list.xhtml index 6c4dcad1..5230f8b7 100644 --- a/web/admin/mobile/admin_mobile_list.xhtml +++ b/web/admin/mobile/admin_mobile_list.xhtml @@ -23,8 +23,7 @@ - - + @@ -34,9 +33,8 @@ - + - diff --git a/web/admin/mobile/admin_mobile_show.xhtml b/web/admin/mobile/admin_mobile_show.xhtml index 887adbec..df52fa86 100644 --- a/web/admin/mobile/admin_mobile_show.xhtml +++ b/web/admin/mobile/admin_mobile_show.xhtml @@ -38,8 +38,7 @@ - - + diff --git a/web/user/financials/login_financials_add_receipt.xhtml b/web/user/financials/login_financials_add_receipt.xhtml index 97d54822..02631959 100644 --- a/web/user/financials/login_financials_add_receipt.xhtml +++ b/web/user/financials/login_financials_add_receipt.xhtml @@ -31,7 +31,7 @@
    - +
    -- 2.39.5