From: Roland Häder Date: Fri, 1 Sep 2017 22:22:54 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e65f12ce17ad0dae9f12bc99ee7ed55580fe830;p=addressbook-war.git Please cherry-pick: - I accidently (oversaw it) used Converter which is JSF 2.3 (beta currently) way, now I could revert it, but better is to stay. - made all converters/validators that invoke business methods (EJB) managed so the annotation EJB will work again. Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookAdminBusinessDataWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookAdminBusinessDataWebRequestBean.java index 23297141..fc5558c2 100644 --- a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookAdminBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookAdminBusinessDataWebRequestBean.java @@ -24,19 +24,19 @@ import javax.faces.FacesException; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote; -import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; -import org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData; -import org.mxchange.jcontactsbusiness.employee.Employee; +import org.mxchange.jcontactsbusiness.model.basicdata.AdminBusinessDataSessionBeanRemote; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData; +import org.mxchange.jcontactsbusiness.model.employee.Employee; import org.mxchange.jcontactsbusiness.events.basicdata.added.AdminAddedBusinessBasicDataEvent; import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent; import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException; -import org.mxchange.jcontactsbusiness.headquarters.HeadquartersData; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.fax.FaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; import org.mxchange.jusercore.model.user.User; /** diff --git a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebSessionBean.java index 7ed08ab2..4be303ac 100644 --- a/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebSessionBean.java @@ -27,11 +27,11 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController; -import org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote; -import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; -import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote; import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent; -import org.mxchange.jcountry.data.Country; +import org.mxchange.jcontactsbusiness.model.basicdata.AdminBusinessDataSessionBeanRemote; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessDataSessionBeanRemote; +import org.mxchange.jcountry.model.data.Country; /** * A business contact bean (controller) @@ -140,12 +140,12 @@ public class AddressbookBusinessDataWebSessionBean extends BaseAddressbookContro } else if (event.getBasicData() == null) { // Throw NPE again throw new NullPointerException("event.basicData is null"); - } else if (event.getBasicData().getCompanyDataId() == null) { + } else if (event.getBasicData().getBasicDataId() == null) { // Throw NPE again - throw new NullPointerException("event.basicData.companyDataId is null"); - } else if (event.getBasicData().getCompanyDataId() < 1) { + throw new NullPointerException("event.basicData.basicDataId is null"); + } else if (event.getBasicData().getBasicDataId() < 1) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("event.basicData.companyDataId={0} is invalid", event.getBasicData().getCompanyDataId())); + throw new IllegalArgumentException(MessageFormat.format("event.basicData.basicDataId={0} is invalid", event.getBasicData().getBasicDataId())); } else if (event.getBasicData().getCompanyName() == null) { // Throw NPE again throw new NullPointerException("event.basicData.companyName is null"); diff --git a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookAdminCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookAdminCompanyEmployeeWebRequestBean.java index 230121f4..bd13f5af 100644 --- a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookAdminCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookAdminCompanyEmployeeWebRequestBean.java @@ -20,7 +20,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote; +import org.mxchange.jcontactsbusiness.model.employee.AdminCompanyEmployeeSessionBeanRemote; /** * A request-scoped bean for administrative purposes for company employees. diff --git a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java index 06c0b2ea..af67cbf0 100644 --- a/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java @@ -23,8 +23,8 @@ import javax.ejb.EJB; import javax.enterprise.context.SessionScoped; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote; -import org.mxchange.jcontactsbusiness.employee.Employee; +import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote; +import org.mxchange.jcontactsbusiness.model.employee.Employee; /** * A request-scoped bean for general purposes for company employees. diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java index 3e8ecd09..24b6c4ab 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java @@ -28,27 +28,27 @@ import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; -import org.mxchange.jcontacts.contact.ContactUtils; -import org.mxchange.jcontacts.contact.UserContact; -import org.mxchange.jcontacts.contact.title.PersonalTitle; import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent; import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.DialableNumber; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.fax.FaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote; +import org.mxchange.jcontacts.model.contact.ContactUtils; +import org.mxchange.jcontacts.model.contact.UserContact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jphone.model.phonenumbers.DialableNumber; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; /** * An administrative user bean (controller) diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java index 0e068df8..6a2c18b2 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java @@ -17,7 +17,7 @@ package org.mxchange.addressbook.beans.contact; import java.io.Serializable; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; /** * An administrative interface for user beans diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java index 2b4d7c07..234057b8 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java @@ -33,21 +33,21 @@ import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; -import org.mxchange.jcontacts.contact.ContactUtils; -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.jcountry.data.Country; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.fax.FaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote; +import org.mxchange.jcontacts.model.contact.ContactUtils; +import org.mxchange.jcontacts.model.contact.UserContact; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; import org.mxchange.jusercore.model.user.User; diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java index 91fc4276..c41847e0 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java @@ -18,7 +18,7 @@ package org.mxchange.addressbook.beans.contact; import java.io.Serializable; import java.util.List; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; /** * An interface for user beans diff --git a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java index 772bff39..f1d03576 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java @@ -27,7 +27,6 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestController; -import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; @@ -43,20 +42,21 @@ import org.mxchange.jcontacts.events.mobile.linked.AdminLinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; -import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote; -import org.mxchange.jcountry.data.Country; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.phone.AdminContactsPhoneSessionBeanRemote; +import org.mxchange.jcountry.model.data.Country; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent; import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent; import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException; import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.fax.FaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; /** diff --git a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java index 2d0fdfcf..c9a46394 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java @@ -28,19 +28,19 @@ import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionController; -import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent; import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent; import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent; -import org.mxchange.jphone.phonenumbers.DialableNumber; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.DialableNumber; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; /** diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java index b4cabfe7..496b64b1 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java @@ -27,9 +27,9 @@ import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jcountry.data.CountryData; -import org.mxchange.jcountry.data.CountrySingletonBeanRemote; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jcountry.model.data.CountryData; +import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote; import org.mxchange.jcountry.events.AdminAddedCountryEvent; import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent; import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException; diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationBean.java index 9a11b0ea..42377c4b 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationBean.java @@ -24,8 +24,8 @@ import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jcountry.data.CountrySingletonBeanRemote; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote; import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent; /** diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationController.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationController.java index e10e2023..a30298cb 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationController.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationController.java @@ -18,7 +18,7 @@ package org.mxchange.addressbook.beans.country; import java.io.Serializable; import java.util.List; -import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.model.data.Country; /** * An interface for country beans diff --git a/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationBean.java index 2e363f68..e22b1873 100644 --- a/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationBean.java @@ -21,8 +21,8 @@ import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcontacts.contact.title.TitleUtils; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; +import org.mxchange.jcontacts.model.contact.title.TitleUtils; /** * A gender and title bean diff --git a/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationController.java b/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationController.java index ec7ee4ee..3c0d6e00 100644 --- a/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationController.java +++ b/src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationController.java @@ -18,7 +18,7 @@ package org.mxchange.addressbook.beans.gender; import java.io.Serializable; import java.util.List; -import org.mxchange.jcontacts.contact.title.PersonalTitle; +import org.mxchange.jcontacts.model.contact.title.PersonalTitle; /** * An interface for gender and title (static data) beans diff --git a/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelperBean.java b/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelperBean.java index bed5ac52..bdba46c2 100644 --- a/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelperBean.java +++ b/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelperBean.java @@ -26,18 +26,18 @@ import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestC import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestController; import org.mxchange.addressbook.beans.user.AddressbookAdminUserWebRequestController; import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; -import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent; import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent; import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent; import org.mxchange.jphone.events.mobile.created.CreatedMobileNumberEvent; import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jusercore.events.user.created.CreatedUserEvent; import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent; import org.mxchange.jusercore.model.user.User; diff --git a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java index 467625e7..a766f0c6 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java @@ -27,13 +27,13 @@ import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.model.data.Country; import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent; import org.mxchange.jphone.events.mobileprovider.added.AdminMobileProviderAddedEvent; import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException; -import org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote; -import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.CellphoneProvider; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; /** * Administrative bean (controller) for mobile provider diff --git a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java index e4822277..7b34a89d 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java @@ -23,13 +23,10 @@ import javax.ejb.EJB; import javax.enterprise.context.SessionScoped; import javax.enterprise.event.Observes; import javax.inject.Named; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote; /** * A general bean for mobile providers @@ -102,7 +99,7 @@ public class AddressbookMobileProviderWebRequestBean extends BaseAddressbookCont @PostConstruct public void init () { // Init list of mobile providers - this.mobileProviders = this.mobileRemoteBean.allMobileProvider(); + this.mobileProviders = this.mobileRemoteBean.allMobileProviders(); } } diff --git a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java index ceb9e6be..0ca8b96e 100644 --- a/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java @@ -18,7 +18,7 @@ package org.mxchange.addressbook.beans.mobileprovider; import java.io.Serializable; import java.util.List; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; /** * An interface for general mobile provider controller diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java index 011b7a66..1425e38d 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java @@ -28,7 +28,7 @@ import javax.enterprise.inject.Any; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.model.data.Country; import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent; import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent; @@ -50,14 +50,14 @@ import org.mxchange.jphone.events.mobile.remove.AdminMobileNumberRemovedFromList import org.mxchange.jphone.events.mobile.remove.AdminRemoveMobileNumberFromListEvent; import org.mxchange.jphone.events.mobile.updated.AdminMobileNumberUpdatedEvent; import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.fax.FaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.mobile.MobileNumber; -import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; -import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber; +import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider; +import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote; /** * Administrative bean (controller) for phone numbers diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java index 44295c54..ab996357 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java @@ -26,22 +26,22 @@ import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; -import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent; import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent; import org.mxchange.jphone.events.landline.deleted.AdminDeletedLandLineNumberEvent; import org.mxchange.jphone.events.landline.updated.AdminUpdatedLandLineNumberEvent; import org.mxchange.jphone.events.mobile.deleted.AdminDeletedMobileNumberEvent; import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; /** diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java index 977061d7..2d2fb587 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java @@ -18,9 +18,9 @@ package org.mxchange.addressbook.beans.phone; import java.io.Serializable; import java.util.List; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; /** * An interface for a request web controller (bean) for administrative phone diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java index 6eb84170..4713ca3c 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java @@ -33,7 +33,7 @@ import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController; import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionController; import org.mxchange.addressbook.beans.localization.AddressbookLocalizationSessionController; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java index 008ee9c4..e9ae01c2 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java @@ -36,7 +36,7 @@ import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionContro import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController; import org.mxchange.addressbook.beans.localization.AddressbookLocalizationSessionController; import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent; import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent; diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java index 6490d48c..3809a656 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java @@ -18,7 +18,7 @@ package org.mxchange.addressbook.beans.user; import java.io.Serializable; import java.util.List; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; diff --git a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java index 26a37900..67a7c0c3 100644 --- a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java @@ -28,7 +28,7 @@ import javax.inject.Named; import org.mxchange.addressbook.beans.BaseAddressbookController; import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController; import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController; -import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; import org.mxchange.jusercore.model.email_address.EmailAddressChange; diff --git a/src/java/org/mxchange/addressbook/beans/user/register/AddressbookUserRegisterWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/register/AddressbookUserRegisterWebSessionBean.java index 98a2bc29..0040b6dc 100644 --- a/src/java/org/mxchange/addressbook/beans/user/register/AddressbookUserRegisterWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/register/AddressbookUserRegisterWebSessionBean.java @@ -28,8 +28,8 @@ import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionContro import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController; import org.mxchange.addressbook.beans.user.AddressbookAdminUserWebRequestController; import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.UserContact; +import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontacts.model.contact.UserContact; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jusercore.events.user.clear.password.ClearUserPasswordEvent; import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent; diff --git a/src/java/org/mxchange/addressbook/converter/business/basicdata/AddressbookBusinessContactConverter.java b/src/java/org/mxchange/addressbook/converter/business/basicdata/AddressbookBusinessContactConverter.java index c808bdd4..9c7ebb95 100644 --- a/src/java/org/mxchange/addressbook/converter/business/basicdata/AddressbookBusinessContactConverter.java +++ b/src/java/org/mxchange/addressbook/converter/business/basicdata/AddressbookBusinessContactConverter.java @@ -16,31 +16,29 @@ */ package org.mxchange.addressbook.converter.business.basicdata; -import java.text.MessageFormat; +import javax.ejb.EJB; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; -import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote; import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataNotFoundException; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessDataSessionBeanRemote; /** * Converter for contact id <-> valid business contact instance *

* @author Roland Häder */ -@FacesConverter (value = "BusinessContactConverter") +@FacesConverter ("BusinessContactConverter") public class AddressbookBusinessContactConverter implements Converter { /** * Business contact EJB */ - private static BusinessDataSessionBeanRemote BASIC_DATA_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote") + private BusinessDataSessionBeanRemote basicDataBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookBusinessContactConverter implements Converter * @author Roland Häder */ -@FacesConverter (value = "CompanyEmployeeConverter") +@FacesConverter ("CompanyEmployeeConverter") public class AddressbookCompanyEmployeeConverter implements Converter { /** * CompanyEmployee EJB */ - private static CompanyEmployeeSessionBeanRemote COMPANY_EMPLOYEE_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote") + private CompanyEmployeeSessionBeanRemote companyEmployeeBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookCompanyEmployeeConverter implements Converter return null; } - // Is the bean there? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookCompanyEmployeeConverter.COMPANY_EMPLOYEE_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and user controller - AddressbookCompanyEmployeeConverter.COMPANY_EMPLOYEE_BEAN = (CompanyEmployeeSessionBeanRemote) initialContext.lookup("java:global/addressbook-ejb/companyEmployee!org.mxchange.jcontactsbusiness.employee.CompanyEmployeeSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } - } - // Init instance Employee companyEmployee = null; @@ -83,7 +65,7 @@ public class AddressbookCompanyEmployeeConverter implements Converter Long employeeId = Long.valueOf(submittedValue); // Try to get user instance from it - companyEmployee = AddressbookCompanyEmployeeConverter.COMPANY_EMPLOYEE_BEAN.findCompanyEmployeeById(employeeId); + companyEmployee = this.companyEmployeeBean.findCompanyEmployeeById(employeeId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/addressbook/converter/business/headquarters/AddressbookCompanyHeadquartersConverter.java b/src/java/org/mxchange/addressbook/converter/business/headquarters/AddressbookCompanyHeadquartersConverter.java index 22ffa828..e26d48d7 100644 --- a/src/java/org/mxchange/addressbook/converter/business/headquarters/AddressbookCompanyHeadquartersConverter.java +++ b/src/java/org/mxchange/addressbook/converter/business/headquarters/AddressbookCompanyHeadquartersConverter.java @@ -16,31 +16,29 @@ */ package org.mxchange.addressbook.converter.business.headquarters; -import java.text.MessageFormat; +import javax.ejb.EJB; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; import org.mxchange.jcontactsbusiness.exceptions.headquarters.CompanyHeadquartersNotFoundException; -import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote; -import org.mxchange.jcontactsbusiness.headquarters.HeadquartersData; +import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote; +import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData; /** * Converter for converting company headquarters to and from id number *

* @author Roland Häder */ -@FacesConverter (value = "CompanyHeadquartersConverter") +@FacesConverter ("CompanyHeadquartersConverter") public class AddressbookCompanyHeadquartersConverter implements Converter { /** * CompanyEmployee EJB */ - private static CompanyHeadquartersSessionBeanRemote COMPANY_HEADQUARTERS_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/companyEmployee!org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote") + private CompanyHeadquartersSessionBeanRemote companyHeadquartersBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookCompanyHeadquartersConverter implements Converter valid contact instance *

* @author Roland Häder */ -@FacesConverter (value = "ContactConverter") +@FacesConverter ("ContactConverter") public class AddressbookContactConverter implements Converter { /** * User EJB */ - private static ContactSessionBeanRemote CONTACT_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote") + private ContactSessionBeanRemote contactBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookContactConverter implements Converter { return null; } - // Is the bean there? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookContactConverter.CONTACT_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and user controller - AddressbookContactConverter.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/addressbook-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 - } - } - // Init instance Contact contact = null; @@ -83,7 +65,7 @@ public class AddressbookContactConverter implements Converter { Long contactId = Long.valueOf(submittedValue); // Try to get user instance from it - contact = AddressbookContactConverter.CONTACT_BEAN.findContactById(contactId); + contact = this.contactBean.findContactById(contactId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/addressbook/converter/country/AddressbookCountryConverter.java b/src/java/org/mxchange/addressbook/converter/country/AddressbookCountryConverter.java index 000c87b6..43085de5 100644 --- a/src/java/org/mxchange/addressbook/converter/country/AddressbookCountryConverter.java +++ b/src/java/org/mxchange/addressbook/converter/country/AddressbookCountryConverter.java @@ -16,32 +16,30 @@ */ package org.mxchange.addressbook.converter.country; -import java.text.MessageFormat; import java.util.List; import java.util.Objects; +import javax.ejb.EJB; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jcountry.data.CountrySingletonBeanRemote; +import org.mxchange.jcountry.model.data.Country; +import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote; /** * Converter for country instance *

* @author Roland Häder */ -@FacesConverter (value = "CountryConverter") +@FacesConverter ("CountryConverter") public class AddressbookCountryConverter implements Converter { /** * Country bean */ - private static CountrySingletonBeanRemote COUNTRY_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote") + private CountrySingletonBeanRemote countryBean; /** * Default constructor @@ -60,24 +58,8 @@ public class AddressbookCountryConverter implements Converter { return null; } - // Is the bean there? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookCountryConverter.COUNTRY_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and country bean - AddressbookCountryConverter.COUNTRY_BEAN = (CountrySingletonBeanRemote) initialContext.lookup("java:global/addressbook-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 = AddressbookCountryConverter.COUNTRY_BEAN.allCountries(); + List countryList = this.countryBean.allCountries(); // Init value Country country = null; diff --git a/src/java/org/mxchange/addressbook/converter/fax/AddressbookFaxNumberConverter.java b/src/java/org/mxchange/addressbook/converter/fax/AddressbookFaxNumberConverter.java index 12999038..7f304aec 100644 --- a/src/java/org/mxchange/addressbook/converter/fax/AddressbookFaxNumberConverter.java +++ b/src/java/org/mxchange/addressbook/converter/fax/AddressbookFaxNumberConverter.java @@ -16,31 +16,29 @@ */ package org.mxchange.addressbook.converter.fax; -import java.text.MessageFormat; +import javax.ejb.EJB; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; +import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote; /** * Converter for fax id <-> valid fax number instance *

* @author Roland Häder */ -@FacesConverter (value = "FaxNumberConverter") +@FacesConverter ("FaxNumberConverter") public class AddressbookFaxNumberConverter implements Converter { /** * Phone EJB */ - private static PhoneSessionBeanRemote PHONE_BEAN; + @EJB(lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote") + private PhoneSessionBeanRemote phoneBean; /** * Default constructor @@ -62,22 +60,6 @@ public class AddressbookFaxNumberConverter implements Converter valid land-line number instance *

* @author Roland Häder */ -@FacesConverter (value = "LandLineNumberConverter") +@FacesConverter ("LandLineNumberConverter") public class AddressbookLandLineNumberConverter implements Converter { /** * Phone EJB */ - private static PhoneSessionBeanRemote PHONE_BEAN; + @EJB(lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote") + private PhoneSessionBeanRemote phoneBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookLandLineNumberConverter implements Converter valid mobile instance *

* @author Roland Häder */ -@FacesConverter (value = "MobileNumbnerConverter") +@FacesConverter ("MobileNumbnerConverter") public class AddressbookMobileNumberConverter implements Converter { /** * Phone EJB */ - private static PhoneSessionBeanRemote PHONE_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote") + private PhoneSessionBeanRemote phoneBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookMobileNumberConverter implements Converter providerList = AddressbookMobileProviderConverter.MOBILE_PROVIDER_BEAN.allMobileProvider(); + List providerList = this.mobileProviderBean.allMobileProviders(); // Init value MobileProvider provider = null; diff --git a/src/java/org/mxchange/addressbook/converter/user/AddressbookUserConverter.java b/src/java/org/mxchange/addressbook/converter/user/AddressbookUserConverter.java index 6864b6c7..1e8a4fdb 100644 --- a/src/java/org/mxchange/addressbook/converter/user/AddressbookUserConverter.java +++ b/src/java/org/mxchange/addressbook/converter/user/AddressbookUserConverter.java @@ -16,15 +16,12 @@ */ package org.mxchange.addressbook.converter.user; -import java.text.MessageFormat; +import javax.ejb.EJB; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; @@ -34,13 +31,14 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; *

* @author Roland Häder */ -@FacesConverter (value = "UserConverter") +@FacesConverter ("UserConverter") public class AddressbookUserConverter implements Converter { /** * User EJB */ - private static UserSessionBeanRemote USER_BEAN; + @EJB(lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote") + private UserSessionBeanRemote userBean; /** * Default constructor @@ -59,22 +57,6 @@ public class AddressbookUserConverter implements Converter { return null; } - // Is the bean there? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookUserConverter.USER_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and user controller - AddressbookUserConverter.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/addressbook-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 - } - } - // Init instance User user = null; @@ -83,7 +65,7 @@ public class AddressbookUserConverter implements Converter { Long userId = Long.valueOf(submittedValue); // Try to get user instance from it - user = AddressbookUserConverter.USER_BEAN.findUserById(userId); + user = this.userBean.findUserById(userId); } catch (final NumberFormatException ex) { // Throw again throw new ConverterException(ex); diff --git a/src/java/org/mxchange/addressbook/validator/business/basicdata/AddressbookCompanyNameValidator.java b/src/java/org/mxchange/addressbook/validator/business/basicdata/AddressbookCompanyNameValidator.java new file mode 100644 index 00000000..6fc5a143 --- /dev/null +++ b/src/java/org/mxchange/addressbook/validator/business/basicdata/AddressbookCompanyNameValidator.java @@ -0,0 +1,95 @@ +/* + * 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.addressbook.validator.business.basicdata; + +import java.text.MessageFormat; +import javax.ejb.EJB; +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.validator.FacesValidator; +import javax.faces.validator.ValidatorException; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessDataSessionBeanRemote; +import org.mxchange.jcoreee.validator.string.BaseStringValidator; + +/** + * A validator for company names + *

+ * @author Roland Häder + */ +@FacesValidator ("CompanyNameValidator") +public class AddressbookCompanyNameValidator extends BaseStringValidator { + + /** + * Serial number + */ + private static final long serialVersionUID = 57_283_657_476_561L; + + /** + * Business contact EJB + */ + @EJB (lookup = "java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote") + private BusinessDataSessionBeanRemote basicDataBean; + + @Override + public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { + // All accepted, required fields + 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; + + // Default is to check on existing names + Boolean checkExisting = Boolean.TRUE; + + // Is attribute "allowEmptyValue" set? + if (component.getAttributes().containsKey("checkExisting")) { //NOI18N + // Get attribute + Object attribute = component.getAttributes().get("checkExisting"); //NOI18N + + // Make sure, it is Boolean as no String is accepted anymore + if (!(attribute instanceof String)) { + // Not valid attribute, please use "true" or "false" (default) + throw new IllegalArgumentException("checkExisting must be of type String. Please use \"true\" or \"false\" for f:attribute value."); //NOI18N + } + + // Securely cast it + checkExisting = Boolean.parseBoolean((String) attribute); + } + + Boolean nameExists = this.basicDataBean.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); + + // 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); + + // Name already exists + throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message)); //NOI18N + } + } + +} diff --git a/src/java/org/mxchange/addressbook/validator/business/basicdata/FinancialsCompanyNameValidator.java b/src/java/org/mxchange/addressbook/validator/business/basicdata/FinancialsCompanyNameValidator.java deleted file mode 100644 index fa63003b..00000000 --- a/src/java/org/mxchange/addressbook/validator/business/basicdata/FinancialsCompanyNameValidator.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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.addressbook.validator.business.basicdata; - -import java.text.MessageFormat; -import javax.faces.application.FacesMessage; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.convert.ConverterException; -import javax.faces.validator.FacesValidator; -import javax.faces.validator.ValidatorException; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote; -import org.mxchange.jcoreee.validator.string.BaseStringValidator; - -/** - * A validator for company names - *

- * @author Roland Häder - */ -@FacesValidator ("CompanyNameValidator") -public class FinancialsCompanyNameValidator extends BaseStringValidator { - - /** - * Business contact EJB - */ - private static BusinessDataSessionBeanRemote BASIC_DATA_BEAN; - - /** - * Serial number - */ - private static final long serialVersionUID = 57_283_657_476_561L; - - @Override - public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // All accepted, required fields - 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; - - // Default is to check on existing names - Boolean checkExisting = Boolean.TRUE; - - // Is attribute "allowEmptyValue" set? - if (component.getAttributes().containsKey("checkExisting")) { //NOI18N - // Get attribute - Object attribute = component.getAttributes().get("checkExisting"); //NOI18N - - // Make sure, it is Boolean as no String is accepted anymore - if (!(attribute instanceof String)) { - // Not valid attribute, please use "true" or "false" (default) - throw new IllegalArgumentException("checkExisting must be of type String. Please use \"true\" or \"false\" for f:attribute value."); //NOI18N - } - - // Securely cast it - checkExisting = Boolean.parseBoolean((String) attribute); - } - - // Is the bean not yet set? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == FinancialsCompanyNameValidator.BASIC_DATA_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and user controller - FinancialsCompanyNameValidator.BASIC_DATA_BEAN = (BusinessDataSessionBeanRemote) initialContext.lookup("java:global/addressbook-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N - } - } - - // Check if name is already used - Boolean nameExists = FinancialsCompanyNameValidator.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); - - // 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); - - // Name already exists - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message)); //NOI18N - } - } - -} diff --git a/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java b/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java index a321f588..d5ef9c06 100644 --- a/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java +++ b/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java @@ -18,15 +18,13 @@ package org.mxchange.addressbook.validator.emailaddress; import java.text.MessageFormat; import java.util.regex.Pattern; +import javax.ejb.EJB; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.ValidatorException; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; +import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote; import org.mxchange.jcoreee.validator.string.BaseStringValidator; /** @@ -40,7 +38,8 @@ public class AddressbookEmailAddressValidator extends BaseStringValidator { /** * Contact session-scoped bean */ - private static ContactSessionBeanRemote CONTACT_BEAN; + @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote") + private ContactSessionBeanRemote contactBean; /** * Email pattern @@ -118,27 +117,11 @@ public class AddressbookEmailAddressValidator extends BaseStringValidator { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message)); } - // Is the bean not yet set? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookEmailAddressValidator.CONTACT_BEAN) { - // Try it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // Try to lookup - AddressbookEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/addressbook-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N - } catch (final NamingException ex) { - // Continue to throw it - throw new ValidatorException(new FacesMessage(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 = AddressbookEmailAddressValidator.CONTACT_BEAN.isEmailAddressRegistered(emailAddress); + Boolean isRegistered = this.contactBean.isEmailAddressRegistered(emailAddress); // Is the email address already registered? if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N diff --git a/src/java/org/mxchange/addressbook/validator/user/AddressbookUserIdValidator.java b/src/java/org/mxchange/addressbook/validator/user/AddressbookUserIdValidator.java index 61e6ab42..d97488d1 100644 --- a/src/java/org/mxchange/addressbook/validator/user/AddressbookUserIdValidator.java +++ b/src/java/org/mxchange/addressbook/validator/user/AddressbookUserIdValidator.java @@ -17,15 +17,12 @@ package org.mxchange.addressbook.validator.user; import java.text.MessageFormat; +import javax.ejb.EJB; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; -import javax.faces.convert.ConverterException; import javax.faces.validator.FacesValidator; import javax.faces.validator.ValidatorException; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; import org.mxchange.jcoreee.validator.number.BaseNumberValidator; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; @@ -38,14 +35,15 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; public class AddressbookUserIdValidator extends BaseNumberValidator { /** - * Remote bean + * Serial number */ - private static UserSessionBeanRemote USER_BEAN; + private static final long serialVersionUID = 12_869_569_314_764_690L; /** - * Serial number + * Remote bean */ - private static final long serialVersionUID = 12_869_569_314_764_690L; + @EJB (lookup = "java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote") + private UserSessionBeanRemote userBean; /** * Default constructor @@ -64,24 +62,8 @@ public class AddressbookUserIdValidator extends BaseNumberValidator { // Cast value Long userId = (Long) value; - // Is the bean not yet set? - // @TODO Requires this synchronization or is it (sync) confusing the container? - if (null == AddressbookUserIdValidator.USER_BEAN) { - // Try to get it - try { - // Get initial context - Context initialContext = new InitialContext(); - - // ... and user controller - AddressbookUserIdValidator.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/addressbook-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 = AddressbookUserIdValidator.USER_BEAN.ifUserIdExists(userId); + Boolean ifUserExists = this.userBean.ifUserIdExists(userId); // Is the user id valid? if (!ifUserExists) { diff --git a/web/admin/business_contacts/admin_business_contacts_list.xhtml b/web/admin/business_contacts/admin_business_contacts_list.xhtml index e64935f7..18725a11 100644 --- a/web/admin/business_contacts/admin_business_contacts_list.xhtml +++ b/web/admin/business_contacts/admin_business_contacts_list.xhtml @@ -23,8 +23,8 @@ - - + + @@ -38,7 +38,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -76,7 +76,7 @@ - +