]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 1 Sep 2017 22:22:54 +0000 (00:22 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 9 Sep 2017 19:33:29 +0000 (21:33 +0200)
- I accidently (oversaw it) used Converter<MyPoji> 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 <roland@mxchange.org>
42 files changed:
src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookAdminBusinessDataWebRequestBean.java
src/java/org/mxchange/addressbook/beans/business/basicdata/AddressbookBusinessDataWebSessionBean.java
src/java/org/mxchange/addressbook/beans/business/employee/AddressbookAdminCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/addressbook/beans/business/employee/AddressbookCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java
src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java
src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationBean.java
src/java/org/mxchange/addressbook/beans/country/AddressbookCountryWebApplicationController.java
src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationBean.java
src/java/org/mxchange/addressbook/beans/gender/AddressbookGenderWebApplicationController.java
src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelperBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionController.java
src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java
src/java/org/mxchange/addressbook/beans/user/register/AddressbookUserRegisterWebSessionBean.java
src/java/org/mxchange/addressbook/converter/business/basicdata/AddressbookBusinessContactConverter.java
src/java/org/mxchange/addressbook/converter/business/company_employee/AddressbookCompanyEmployeeConverter.java
src/java/org/mxchange/addressbook/converter/business/headquarters/AddressbookCompanyHeadquartersConverter.java
src/java/org/mxchange/addressbook/converter/contact/AddressbookContactConverter.java
src/java/org/mxchange/addressbook/converter/country/AddressbookCountryConverter.java
src/java/org/mxchange/addressbook/converter/fax/AddressbookFaxNumberConverter.java
src/java/org/mxchange/addressbook/converter/landline/AddressbookLandLineNumberConverter.java
src/java/org/mxchange/addressbook/converter/mobile/AddressbookMobileNumberConverter.java
src/java/org/mxchange/addressbook/converter/mobileprovider/AddressbookMobileProviderConverter.java
src/java/org/mxchange/addressbook/converter/user/AddressbookUserConverter.java
src/java/org/mxchange/addressbook/validator/business/basicdata/AddressbookCompanyNameValidator.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/validator/business/basicdata/FinancialsCompanyNameValidator.java [deleted file]
src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java
src/java/org/mxchange/addressbook/validator/user/AddressbookUserIdValidator.java
web/admin/business_contacts/admin_business_contacts_list.xhtml

index 232971419af1a51aa84250f1165f348185020c85..fc5558c26046675702cb03b29e6677e264d7757e 100644 (file)
@@ -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;
 
 /**
index 7ed08ab21f4d230518ddc6671d6dba98d679d9c7..4be303acddccf39ef5f2aa23e1de7b5941743cec 100644 (file)
@@ -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");
index 230121f458b9a86c8bce9ce70f0cff4f1bfac74c..bd13f5af6e9cce09c30000013fab14dd86f31742 100644 (file)
@@ -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.
index 06c0b2ea8c7f1742fa48f61c4c9c93c80f07b42e..af67cbf0b7e77e18c83d50c830dcd1cf1d3f3501 100644 (file)
@@ -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.
index 3e8ecd0956b0a4e11535d4580c8d42d7428a7f7f..24b6c4ab746f74824d67e83a2bc06753f308eeb3 100644 (file)
@@ -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)
index 0e068df8f7d228126b87e4de826e0c2ab5d571d2..6a2c18b2e7d57a58f29b2dd6480d36f7c4da5799 100644 (file)
@@ -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
index 2b4d7c072ed3129fc264dcd32b80eaecd8515998..234057b8c9b2dc6327368e6d4ce1edc8484d516f 100644 (file)
@@ -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;
index 91fc42765db05a520a12ef10fdf8e0ea566dbff6..c41847e0d31b5d86e3f390dd4a77de42a0b6dc6a 100644 (file)
@@ -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
index 772bff39d0de2dd30d69e5949cf465745705315c..f1d03576c74a5192c069b1e5e9491cb22f1426d5 100644 (file)
@@ -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;
 
 /**
index 2d0fdfcf540d514b4ce2a0f36008e58e3f8f3af2..c9a46394fe0c143804ad12cedeb90ad1413efc99 100644 (file)
@@ -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;
 
 /**
index b4cabfe7b38c2bad8a0a50befa86d90e85eb90cd..496b64b1b82c27a812ec3416ee53d16bcf740095 100644 (file)
@@ -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;
index 9a11b0ea0b75e16bbd04fa9648204cf6e1734891..42377c4baa844b88d7912c5c824e12e956de2bec 100644 (file)
@@ -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;
 
 /**
index e10e202315470f503f64dc5e8894d7352a2fa552..a30298cb0759671bbcfed1943811d125da40808f 100644 (file)
@@ -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
index 2e363f68b7a7e8301daa1a905835840c42bcc510..e22b1873db117f02147b6004f8e80ff11b24594d 100644 (file)
@@ -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
index ec7ee4eec9899004e52fb778012b48c604360e66..3c0d6e00b516e14c1711d31b639f184bb87e807f 100644 (file)
@@ -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
index bed5ac5219f40b7f57e1cde21a236006cc0ddb18..bdba46c222846d7e395973282d73acc73582f14b 100644 (file)
@@ -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;
index 467625e745f6c19a8d85b89daf9c6a77524c4452..a766f0c61bff9639a9cf5a6e5114c48cdd9cf486 100644 (file)
@@ -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
index e48222773a6681e0c5540453c8024bc2f22961f3..7b34a89df0495c61176382c0593c787fb27574e7 100644 (file)
@@ -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();
        }
 
 }
index ceb9e6be389179fbb2383af44f02613e1a88ab62..0ca8b96e75c165810525ac716f2d8f2f6fee5252 100644 (file)
@@ -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
index 011b7a661a8e0088b87136d0e4a1f8e86b2eeb10..1425e38d604f278dccd5b1b5ff3ae10b89dab648 100644 (file)
@@ -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
index 44295c545c9851c0a9185672689e1716afa68f2c..ab996357eda7df0b1eb5a2a47921984f98cfe4f5 100644 (file)
@@ -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;
 
 /**
index 977061d7a0cfda1b1b4291c05742bb21fcd11774..2d2fb587dab98ebd7f6377b7111cd93c115b1d8b 100644 (file)
@@ -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
index 6eb841707921a4be794d26d89612cf015a993c96..4713ca3c9ac176985850a559d2cdd95a703f779c 100644 (file)
@@ -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;
index 008ee9c4986f7c95dd61ddf3ef5e198764350d7e..e9ae01c26574dc9d4ac6e50de3cd964957f027cc 100644 (file)
@@ -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;
index 6490d48c40849a7ec66e779b6c159885de6460cf..3809a656f91047c0dc6554c844d6c4760a0024be 100644 (file)
@@ -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;
index 26a37900601e1823579fbe182c66f3102391031c..67a7c0c38b1e6a6e32647f611e3ee661f8ecba46 100644 (file)
@@ -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;
index 98a2bc29db436d612894036a6789b0d36ab422e5..0040b6dcf50f296aac15e0c706f77425a7f38033 100644 (file)
@@ -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;
index c808bdd469d06cb86f891b2384f76381ed220a8f..9c7ebb95889f6d3f6eabf87f1bbf14a93b19386f 100644 (file)
  */
 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
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "BusinessContactConverter")
+@FacesConverter ("BusinessContactConverter")
 public class AddressbookBusinessContactConverter implements Converter<BusinessBasicData> {
 
        /**
         * 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<BusinessBa
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookBusinessContactConverter.BASIC_DATA_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               // ... and user controller
-                               AddressbookBusinessContactConverter.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
-                       }
-               }
-
                // Init instance
                BusinessBasicData businessContact = null;
 
@@ -83,7 +65,7 @@ public class AddressbookBusinessContactConverter implements Converter<BusinessBa
                        Long basicDataId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       businessContact = AddressbookBusinessContactConverter.BASIC_DATA_BEAN.findBasicDataById(basicDataId);
+                       businessContact = this.basicDataBean.findBasicDataById(basicDataId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
@@ -105,7 +87,7 @@ public class AddressbookBusinessContactConverter implements Converter<BusinessBa
                }
 
                // Return id number
-               return String.valueOf(value.getCompanyDataId());
+               return String.valueOf(value.getBasicDataId());
        }
 
 }
index abbc4dd1b43f15bb794a1547522f523fa61cfc17..b28ec60b52e7d29c6229a70fad2e5617a0fef103 100644 (file)
  */
 package org.mxchange.addressbook.converter.business.company_employee;
 
-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.employee.CompanyEmployeeSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.employee.Employee;
 import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.employee.Employee;
 
 /**
  * Converter for converting company employee to and from id number
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CompanyEmployeeConverter")
+@FacesConverter ("CompanyEmployeeConverter")
 public class AddressbookCompanyEmployeeConverter implements Converter<Employee> {
 
        /**
         * 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<Employee>
                        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<Employee>
                        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);
index 22ffa8286802e57efeef676830ee838ec9ec982e..e26d48d78c0165d3e5c5f185435784178d0e8dcb 100644 (file)
  */
 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
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CompanyHeadquartersConverter")
+@FacesConverter ("CompanyHeadquartersConverter")
 public class AddressbookCompanyHeadquartersConverter implements Converter<HeadquartersData> {
 
        /**
         * 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<Headqu
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookCompanyHeadquartersConverter.COMPANY_HEADQUARTERS_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               // ... and user controller
-                               AddressbookCompanyHeadquartersConverter.COMPANY_HEADQUARTERS_BEAN = (CompanyHeadquartersSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/companyEmployee!org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersSessionBeanRemote"); //NOI18N
-                       } catch (final NamingException ex) {
-                               // Continue to throw it
-                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                       }
-               }
-
                // Init instance
                HeadquartersData companyHeadquarters = null;
 
@@ -83,7 +65,7 @@ public class AddressbookCompanyHeadquartersConverter implements Converter<Headqu
                        Long headquartersId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       companyHeadquarters = AddressbookCompanyHeadquartersConverter.COMPANY_HEADQUARTERS_BEAN.findCompanyHeadquartersById(headquartersId);
+                       companyHeadquarters = this.companyHeadquartersBean.findCompanyHeadquartersById(headquartersId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 84ad9cdaae057ec522b6eb9c0eb9def9258cb057..e6faad1b5e4917046710d2959accdc85b10da4f0 100644 (file)
  */
 package org.mxchange.addressbook.converter.contact;
 
-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.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
 
 /**
  * Converter for contact id <-> valid contact instance
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "ContactConverter")
+@FacesConverter ("ContactConverter")
 public class AddressbookContactConverter implements Converter<Contact> {
 
        /**
         * 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<Contact> {
                        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<Contact> {
                        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);
index 000c87b6529758311f0afdef73bf85b9f0fe90a9..43085de5b910f613d53ea21e0520da0419bfe2ad 100644 (file)
  */
 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
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "CountryConverter")
+@FacesConverter ("CountryConverter")
 public class AddressbookCountryConverter implements Converter<Country> {
 
        /**
         * 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<Country> {
                        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<Country> countryList = AddressbookCountryConverter.COUNTRY_BEAN.allCountries();
+               List<Country> countryList = this.countryBean.allCountries();
 
                // Init value
                Country country = null;
index 1299903826fca25a29d40b9315a4bf626cac4ce2..7f304aec62559ec6efbf20ebc0708ce13dbed32d 100644 (file)
  */
 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
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "FaxNumberConverter")
+@FacesConverter ("FaxNumberConverter")
 public class AddressbookFaxNumberConverter implements Converter<DialableFaxNumber> {
 
        /**
         * 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<DialableFaxNumbe
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookFaxNumberConverter.PHONE_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               // ... and user controller
-                               AddressbookFaxNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/addressbook-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;
 
@@ -88,7 +70,7 @@ public class AddressbookFaxNumberConverter implements Converter<DialableFaxNumbe
                        // Log message
                        // @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 = AddressbookFaxNumberConverter.PHONE_BEAN.findFaxNumberById(faxNumberId);
+                       faxNumber = this.phoneBean.findFaxNumberById(faxNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 9705c4525e7257d53cafd648bcb041b5cf9186c5..94a9a7096a7e5bb69b523cacb82e3594ca0c8bbf 100644 (file)
  */
 package org.mxchange.addressbook.converter.landline;
 
-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.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
 
 /**
  * Converter for land-line id <-> valid land-line number instance
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "LandLineNumberConverter")
+@FacesConverter ("LandLineNumberConverter")
 public class AddressbookLandLineNumberConverter implements Converter<DialableLandLineNumber> {
 
        /**
         * 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<DialableLan
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookLandLineNumberConverter.PHONE_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               // ... and user controller
-                               AddressbookLandLineNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/addressbook-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;
 
@@ -83,7 +65,7 @@ public class AddressbookLandLineNumberConverter implements Converter<DialableLan
                        Long landLineNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       landLineNumber = AddressbookLandLineNumberConverter.PHONE_BEAN.findLandLineNumberById(landLineNumberId);
+                       landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 7561dcdd847b9e331d4536f4fe1145a6f9130a37..5431eea17c8e1758c7932a08389ffcdd1c7ebd96 100644 (file)
  */
 package org.mxchange.addressbook.converter.mobile;
 
-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.mobile.DialableMobileNumber;
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
 
 /**
  * Converter for mobile id <-> valid mobile instance
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "MobileNumbnerConverter")
+@FacesConverter ("MobileNumbnerConverter")
 public class AddressbookMobileNumberConverter implements Converter<DialableMobileNumber> {
 
        /**
         * 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<DialableMobil
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookMobileNumberConverter.PHONE_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               // ... and user controller
-                               AddressbookMobileNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/addressbook-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
-                       }
-               }
-
                // Init instance
                DialableMobileNumber mobile = null;
 
@@ -83,7 +65,7 @@ public class AddressbookMobileNumberConverter implements Converter<DialableMobil
                        Long mobileId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       mobile = AddressbookMobileNumberConverter.PHONE_BEAN.findMobileNumberById(mobileId);
+                       mobile = this.phoneBean.findMobileNumberById(mobileId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 9fa9c8146ccc5ccbf946a81bbfc73852ad57e505..937a6a4edf84f58f68398faf4a41a0c4c8476c02 100644 (file)
  */
 package org.mxchange.addressbook.converter.mobileprovider;
 
-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.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;
 
 /**
  * Converter for SMS provider instance
@@ -41,7 +37,8 @@ public class AddressbookMobileProviderConverter implements Converter<MobileProvi
        /**
         * Mobile provider bean
         */
-       private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN;
+       @EJB(lookup = "java:global/jfinancials-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote")
+       private MobileProviderSingletonBeanRemote mobileProviderBean;
 
        /**
         * Default constructor
@@ -60,24 +57,8 @@ public class AddressbookMobileProviderConverter implements Converter<MobileProvi
                        return null;
                }
 
-               // Is the bean there?
-               // @TODO Requires this synchronization or is it (sync) confusing the container?
-               if (null == AddressbookMobileProviderConverter.MOBILE_PROVIDER_BEAN) {
-                       // Try to get it
-                       try {
-                               // Get initial context
-                               Context initialContext = new InitialContext();
-
-                               /// and mobile provider controller
-                               AddressbookMobileProviderConverter.MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/addressbook-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<MobileProvider> providerList = AddressbookMobileProviderConverter.MOBILE_PROVIDER_BEAN.allMobileProvider();
+               List<MobileProvider> providerList = this.mobileProviderBean.allMobileProviders();
 
                // Init value
                MobileProvider provider = null;
index 6864b6c71ea2c269c1a59d663b5459ef6177e139..1e8a4fdb80cc2b2c798ada4dd7df23788b543910 100644 (file)
  */
 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;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@FacesConverter (value = "UserConverter")
+@FacesConverter ("UserConverter")
 public class AddressbookUserConverter implements Converter<User> {
 
        /**
         * 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<User> {
                        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<User> {
                        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 (file)
index 0000000..6fc5a14
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+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
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@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 (file)
index fa63003..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-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
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@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
-               }
-       }
-
-}
index a321f5880c297377258cbfa52589d9f525bfe131..d5ef9c063ee0f6c6ca9a28ec807217f257a1b0e4 100644 (file)
@@ -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
index 61e6ab420f88d8ce00f9c09aa41a9dcdea3056a3..d97488d192dc608fb49c5eb310e306da3cb4119e 100644 (file)
 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) {
index e64935f7552907d6770575494bbd7d63cb86aae2..18725a118b54189eedd112923041266045e21083 100644 (file)
@@ -23,8 +23,8 @@
                                        <h:outputText value="#{msg.ADMIN_BUSINESS_BASIC_DATA_ID}" />
                                </f:facet>
 
-                               <h:link outcome="admin_show_business_basic_data" title="#{msg.ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE}" value="#{companyData.companyDataId}">
-                                       <f:param name="companyDataId" value="#{companyData.companyDataId}" />
+                               <h:link outcome="admin_show_business_basic_data" title="#{msg.ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE}" value="#{companyData.basicDataId}">
+                                       <f:param name="basicDataId" value="#{companyData.basicDataId}" />
                                </h:link>
                        </h:column>
 
@@ -38,7 +38,7 @@
                                </h:link>
 
                                <h:link outcome="admin_assign_business_basic_data_owner" title="#{msg.ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty companyData.companyUserOwner}">
-                                       <f:param name="companyDataId" value="#{companyData.companyDataId}" />
+                                       <f:param name="basicDataId" value="#{companyData.basicDataId}" />
                                </h:link>
                        </h:column>
 
@@ -62,7 +62,7 @@
                                </h:link>
 
                                <h:link outcome="admin_assign_business_basic_data_contact" title="#{msg.ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_CONTACT_PERSON}" rendered="#{empty companyData.companyContactEmployee}">
-                                       <f:param name="companyDataId" value="#{companyData.companyDataId}" />
+                                       <f:param name="basicDataId" value="#{companyData.basicDataId}" />
                                </h:link>
                        </h:column>
 
@@ -76,7 +76,7 @@
                                </h:link>
 
                                <h:link outcome="admin_assign_business_basic_data_contact" title="#{msg.ADMIN_LINK_ASSIGN_BUSINESS_BASIC_DATA_COMPANY_FOUNDER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty companyData.companyFounder}">
-                                       <f:param name="companyDataId" value="#{companyData.companyDataId}" />
+                                       <f:param name="basicDataId" value="#{companyData.basicDataId}" />
                                </h:link>
                        </h:column>