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;
/**
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)
} 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");
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.
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.
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)
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
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;
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
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;
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;
/**
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;
/**
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;
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;
/**
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
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
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
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;
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
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
@PostConstruct
public void init () {
// Init list of mobile providers
- this.mobileProviders = this.mobileRemoteBean.allMobileProvider();
+ this.mobileProviders = this.mobileRemoteBean.allMobileProviders();
}
}
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
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;
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
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;
/**
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
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;
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;
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;
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;
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;
*/
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
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;
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);
}
// Return id number
- return String.valueOf(value.getCompanyDataId());
+ return String.valueOf(value.getBasicDataId());
}
}
*/
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
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;
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);
*/
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
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;
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);
*/
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
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;
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);
*/
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
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;
*/
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
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;
// 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);
*/
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
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;
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);
*/
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
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;
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);
*/
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
/**
* 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
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;
*/
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;
* <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
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;
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);
--- /dev/null
+/*
+ * 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
+ }
+ }
+
+}
+++ /dev/null
-/*
- * 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
- }
- }
-
-}
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;
/**
/**
* 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
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
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;
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
// 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) {
<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>
</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>
</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>
</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>