]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Tue, 17 Oct 2017 21:42:44 +0000 (23:42 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 17 Oct 2017 21:42:44 +0000 (23:42 +0200)
- switched converters/validators which are converting primary keys (id numbers)
  into entities from EJB-based lookup to backing-bean-based lookup as this is
  much better performing (EJB calls are relative "expensive")
- the backing bean will then check cache which is basically a distributed Map
  (Cache interface) where the primary key is also the key for cache entries
- a SomeEntityNotFoundException is being thrown when containsKey() returns
  false which is then caught by the calling method
- fixed imports from "renaming season" ;-)
- renamed contactsCache -> contactCache as other caches are named same way
- no need for company employee, basic data, branch offices and departments

Signed-off-by: Roland Häder <roland@mxchange.org>
59 files changed:
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestController.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestController.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestController.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java
src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionBean.java
src/java/org/mxchange/jfinancials/beans/localization/FinancialsLocalizationSessionController.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestController.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestController.java
src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java
src/java/org/mxchange/jfinancials/converter/business/branchoffice/FinancialsBranchOfficeConverter.java
src/java/org/mxchange/jfinancials/converter/business/company_employee/FinancialsCompanyEmployeeConverter.java [deleted file]
src/java/org/mxchange/jfinancials/converter/business/department/FinancialsCompanyDepartmentConverter.java [deleted file]
src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java
src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java
src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java
src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java
src/java/org/mxchange/jfinancials/converter/landline/FinancialsLandLineNumberConverter.java
src/java/org/mxchange/jfinancials/converter/mobile/FinancialsMobileNumberConverter.java
src/java/org/mxchange/jfinancials/converter/mobileprovider/FinancialsMobileProviderConverter.java
src/java/org/mxchange/jfinancials/converter/user/FinancialsUserConverter.java
src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java
src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java
src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/links.jsf.taglib.xml
web/WEB-INF/templates/admin/basic_company_data/admin_form_basic_company_data.tpl
web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl
web/WEB-INF/templates/admin/department/admin_form_department_data.tpl
web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl
web/admin/basic_company_data/admin_basic_company_data_list.xhtml
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/department/admin_department_list.xhtml
web/admin/employee/admin_employee_list.xhtml

index 3407f2c81355125b3f3483ec94ab5918ee817223..1c0760f77997162919bc3cf8c4dde0737fe94870 100644 (file)
@@ -25,11 +25,11 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.basicdata.added.AdminAddedBusinessBasicDataEvent;
 import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 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.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
@@ -74,7 +74,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
        /**
         * An employee as contact person with this company
         */
-       private Employee companyContactEmployee;
+       private Employable companyContactEmployee;
 
        /**
         * Companies (main) email address (example: info@company.example)
@@ -84,7 +84,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
        /**
         * Company founder
         */
-       private Employee companyFounder;
+       private Employable companyFounder;
 
        /**
         * Head quarter data for this company
@@ -165,7 +165,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
                }
 
                // Prepare entity
-               BusinessBasicData basicData = new CompanyBasicData(this.getCompanyName());
+               BasicData basicData = new BusinessBasicData(this.getCompanyName());
 
                // Set all opther remaining data
                basicData.setCompanyComments(this.getCompanyComments());
@@ -228,11 +228,11 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
                // Now try to send to EJB and get an updated version back
                try {
                        // Try it
-                       BusinessBasicData updatedBasicData = this.adminBasicCompanyDataBean.addCompanyBasicData(basicData);
+                       final BasicData updatedBasicData = this.adminBasicCompanyDataBean.addBusinessBasicData(basicData);
 
                        // Fire event
                        this.businessDataAddedEvent.fire(new AdminAddedBusinessBasicDataEvent(updatedBasicData));
-               } catch (final BasicCompanyDataAlreadyAddedException e) {
+               } catch (final BasicDataAlreadyAddedException e) {
                        // Does already exist
                        throw new FacesException(e);
                }
@@ -262,18 +262,18 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
        /**
         * Getter for employee as contact person
         * <p>
-        * @return Employee as contact person
+        * @return Employable as contact person
         */
-       public Employee getCompanyContactEmployee () {
+       public Employable getCompanyContactEmployee () {
                return this.companyContactEmployee;
        }
 
        /**
         * Setter for employee as contact person
         * <p>
-        * @param companyContactEmployee Employee as contact person
+        * @param companyContactEmployee Employable as contact person
         */
-       public void setCompanyContactEmployee (final Employee companyContactEmployee) {
+       public void setCompanyContactEmployee (final Employable companyContactEmployee) {
                this.companyContactEmployee = companyContactEmployee;
        }
 
@@ -300,7 +300,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
         * <p>
         * @return Company founder
         */
-       public Employee getCompanyFounder () {
+       public Employable getCompanyFounder () {
                return this.companyFounder;
        }
 
@@ -309,7 +309,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea
         * <p>
         * @param companyFounder Company founder
         */
-       public void setCompanyFounder (final Employee companyFounder) {
+       public void setCompanyFounder (final Employable companyFounder) {
                this.companyFounder = companyFounder;
        }
 
index afab9ec8a1890f241ddac5fe253128153dcf4043..913a2a398a257657cf23c645b712c8fd6eb684c0 100644 (file)
@@ -30,9 +30,10 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
 import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
@@ -60,14 +61,14 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
        /**
         * List of all basic company data
         */
-       private List<BusinessBasicData> allCompanyBasicData;
+       private List<BasicData> allBasicData;
 
        /**
         * A list of all registered companies (globally)
         */
        @Inject
        @NamedCache (cacheName = "basicDataCache")
-       private Cache<Long, BusinessBasicData> basicDataCache;
+       private Cache<Long, BasicData> basicDataCache;
 
        /**
         * EJB for general basic business data purposes
@@ -108,7 +109,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
        /**
         * List of filtered basic company data
         */
-       private List<BusinessBasicData> filteredBasicCompanyData;
+       private List<BasicData> filteredBasicCompanyData;
 
        /**
         * Area code for land-line number
@@ -139,7 +140,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
                super();
 
                // Init list
-               this.allCompanyBasicData = new LinkedList<>();
+               this.allBasicData = new LinkedList<>();
        }
 
        /**
@@ -172,7 +173,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
 
                // Add it to list
                this.basicDataCache.put(event.getBasicData().getBasicDataId(), event.getBasicData());
-               this.allCompanyBasicData.add(event.getBasicData());
+               this.allBasicData.add(event.getBasicData());
        }
 
        /**
@@ -181,8 +182,29 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
         * @return A list of all business contacts
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BusinessBasicData> allCompanyBasicData () {
-               return this.allCompanyBasicData;
+       public List<BasicData> allBasicData () {
+               return this.allBasicData;
+       }
+
+       @Override
+       public BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException {
+               // Validate parameter
+               if (null == basicDataId) {
+                       // Throw NPE
+                       throw new NullPointerException("basicDataId is null"); //NOI18N
+               } else if (basicDataId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("basicDataId=" + basicDataId + " is invalid"); //NOI18N
+               } else if (!this.basicDataCache.containsKey(basicDataId)) {
+                       // Not found
+                       throw new BasicDataNotFoundException(basicDataId);
+               }
+
+               // Get it from cache
+               final BasicData basicData = this.basicDataCache.get(basicDataId);
+
+               // Return it
+               return basicData;
        }
 
        /**
@@ -299,7 +321,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
         * @return Filtered basic company data
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BusinessBasicData> getFilteredBasicCompanyData () {
+       public List<BasicData> getFilteredBasicCompanyData () {
                return this.filteredBasicCompanyData;
        }
 
@@ -309,7 +331,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
         * @param filteredBasicCompanyData Filtered basic company data
         */
        @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredBasicCompanyData (final List<BusinessBasicData> filteredBasicCompanyData) {
+       public void setFilteredBasicCompanyData (final List<BasicData> filteredBasicCompanyData) {
                this.filteredBasicCompanyData = filteredBasicCompanyData;
        }
 
@@ -375,39 +397,44 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp
                // Is cache there?
                if (!this.basicDataCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<BusinessBasicData> basicDatas = this.businessDataBean.allCompanyBasicData();
+                       final List<BasicData> basicDatas = this.businessDataBean.allBusinessBasicData();
 
                        // Add all
-                       for (final BusinessBasicData basicData : basicDatas) {
+                       for (final BasicData basicData : basicDatas) {
                                // Add it to cache
                                this.basicDataCache.put(basicData.getBasicDataId(), basicData);
                        }
                }
 
                // Is cache there and list is not full?
-               if ((this.allCompanyBasicData.isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
+               if ((this.allBasicData.isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
                        // Get iterator
-                       final Iterator<Cache.Entry<Long, BusinessBasicData>> iterator = this.basicDataCache.iterator();
+                       final Iterator<Cache.Entry<Long, BasicData>> iterator = this.basicDataCache.iterator();
 
                        // Build up list
                        while (iterator.hasNext()) {
                                // GEt next element
-                               final Cache.Entry<Long, BusinessBasicData> next = iterator.next();
+                               final Cache.Entry<Long, BasicData> next = iterator.next();
 
                                // Add to list
-                               this.allCompanyBasicData.add(next.getValue());
+                               this.allBasicData.add(next.getValue());
                        }
 
                        // Sort list
-                       this.allCompanyBasicData.sort(new Comparator<BusinessBasicData>() {
+                       this.allBasicData.sort(new Comparator<BasicData>() {
                                @Override
-                               public int compare (final BusinessBasicData o1, final BusinessBasicData o2) {
+                               public int compare (final BasicData o1, final BasicData o2) {
                                        return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0;
                                }
                        });
                }
        }
 
+       @Override
+       public Boolean isCompanyNameUsed (String companyName) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
        /**
         * Clears this bean
         */
index 990aa91f5d364a2d791643e44523a7006df4e154..104922015fd948c9720275965c5a473263310cb6 100644 (file)
@@ -17,6 +17,8 @@
 package org.mxchange.jfinancials.beans.business.basicdata;
 
 import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An interface for session-scoped financial controller
@@ -25,4 +27,26 @@ import java.io.Serializable;
  */
 public interface FinancialsBusinessDataWebRequestController extends Serializable {
 
+       /**
+        * Retrieves a single business data entity for given id number or throws a
+        * proper exception if not found.
+        * <p>
+        * @param basicDataId Company basic data id to lookup
+        * <p>
+        * @return Business contact instance
+        * <p>
+        * @throws BasicDataNotFoundException If the id number could not be
+        * looked up and solved into an entity
+        */
+       BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
+
+       /**
+        * Checks whether given company name already exists
+        * <p>
+        * @param companyName Company name to check
+        * <p>
+        * @return Whether the company name exists
+        */
+       Boolean isCompanyNameUsed (final String companyName);
+
 }
index b80195406c962892dcf477499e662507156898ad..b3a069e8259b03ecbeff6006fef62858f9d74c40 100644 (file)
@@ -29,12 +29,10 @@ import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.BranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.ObservableBranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.AdminBranchOfficeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
-import org.mxchange.jcontactsbusiness.model.branchoffice.CompanyBranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
 import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek;
@@ -45,6 +43,8 @@ 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 org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An administrative bean for branch offices
@@ -74,12 +74,12 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
        /**
         * Assigned company for this branch office
         */
-       private BusinessBasicData branchCompany;
+       private BasicData branchCompany;
 
        /**
         * Contact person in branch office
         */
-       private Employee branchContactEmployee;
+       private Employable branchContactEmployee;
 
        /**
         * Country
@@ -308,7 +308,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         * <p>
         * @return Basic company data
         */
-       public BusinessBasicData getBranchCompany () {
+       public BasicData getBranchCompany () {
                return this.branchCompany;
        }
 
@@ -317,7 +317,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         * <p>
         * @param branchCompany Basic company data
         */
-       public void setBranchCompany (final BusinessBasicData branchCompany) {
+       public void setBranchCompany (final BasicData branchCompany) {
                this.branchCompany = branchCompany;
        }
 
@@ -326,7 +326,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         * <p>
         * @return Branch office contact person
         */
-       public Employee getBranchContactEmployee () {
+       public Employable getBranchContactEmployee () {
                return this.branchContactEmployee;
        }
 
@@ -335,7 +335,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         * <p>
         * @param branchContactEmployee Branch office contact person
         */
-       public void setBranchContactEmployee (final Employee branchContactEmployee) {
+       public void setBranchContactEmployee (final Employable branchContactEmployee) {
                this.branchContactEmployee = branchContactEmployee;
        }
 
@@ -748,7 +748,7 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         */
        private BranchOffice createBranchOffice () {
                // Create new branch office instance
-               final BranchOffice branchOffice = new CompanyBranchOffice(this.getBranchCity(), this.getBranchCompany(), this.getBranchCountry(), this.getBranchStreet(), this.getBranchZipCode(), this.getBranchHouseNumber());
+               final BranchOffice branchOffice = new BusinessBranchOffice(this.getBranchCity(), this.getBranchCompany(), this.getBranchCountry(), this.getBranchStreet(), this.getBranchZipCode(), this.getBranchHouseNumber());
 
                // Add all other fields, too
                branchOffice.setBranchContactEmployee(this.getBranchContactEmployee());
index 6121069254c09f01ebbdc00a3c14867951739b04..08c7a92ca8bf3ada58b926de3383d89f77b036b1 100644 (file)
@@ -30,6 +30,7 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.ObservableBranchOfficeAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
@@ -118,6 +119,27 @@ public class FinancialsBranchOfficeWebRequestBean extends BaseFinancialsBean imp
                return this.allBranchOffices;
        }
 
+       @Override
+       public BranchOffice findBranchOfficeById (final Long branchOfficeId) throws BranchOfficeNotFoundException {
+               // Validate parameter
+               if (null == branchOfficeId) {
+                       // Throw NPE
+                       throw new NullPointerException("branchOfficeId is null"); //NOI18N
+               } else if (branchOfficeId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("branchOfficeId=" + branchOfficeId + " is invalid"); //NOI18N
+               } else if (!this.branchOfficeCache.containsKey(branchOfficeId)) {
+                       // Not found
+                       throw new BranchOfficeNotFoundException(branchOfficeId);
+               }
+
+               // Get it from cache
+               final BranchOffice branchOffice = this.branchOfficeCache.get(branchOfficeId);
+
+               // Return it
+               return branchOffice;
+       }
+
        /**
         * Getter for a list of filtered branch offices
         * <p>
index b97fb75ef2387ddd045cae14ba7603432b6be0ba..7aae19451003050be6cc27f1b9f871df8d59a1f1 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.business.branchoffice;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 
 /**
@@ -34,4 +35,15 @@ public interface FinancialsBranchOfficeWebRequestController extends Serializable
         */
        List<BranchOffice> allBranchOffices ();
 
+       /**
+        * Tries to find a branch office with given id number
+        * <p>
+        * @param branchOfficeId Branch office id
+        * <p>
+        * @return A branch office instance
+        * <p>
+        * @throws BranchOfficeNotFoundException If the branch office was not found
+        */
+       BranchOffice findBranchOfficeById (final Long branchOfficeId) throws BranchOfficeNotFoundException;
+
 }
index 5d248a35aeb90aade3377132b275135e717442a3..81957206e1d8c24a798d3418c6631ae27ccca846 100644 (file)
@@ -26,16 +26,16 @@ import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.department.added.DepartmentAddedEvent;
 import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.department.CompanyDepartment;
+import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.department.Departments;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An administrative bean for departments
@@ -72,7 +72,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
        /**
         * Assigned company for this department
         */
-       private BusinessBasicData departmentCompany;
+       private BasicData departmentCompany;
 
        /**
         * A general department controller (backing bean)
@@ -88,7 +88,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
        /**
         * Lead person of this department
         */
-       private Employee departmentLead;
+       private Employable departmentLead;
 
        /**
         * Department name
@@ -168,7 +168,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
         * <p>
         * @return Basic company data
         */
-       public BusinessBasicData getDepartmentCompany () {
+       public BasicData getDepartmentCompany () {
                return this.departmentCompany;
        }
 
@@ -177,7 +177,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
         * <p>
         * @param departmentCompany Basic company data
         */
-       public void setDepartmentCompany (final BusinessBasicData departmentCompany) {
+       public void setDepartmentCompany (final BasicData departmentCompany) {
                this.departmentCompany = departmentCompany;
        }
 
@@ -204,7 +204,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
         * <p>
         * @return Department contact person
         */
-       public Employee getDepartmentLead () {
+       public Employable getDepartmentLead () {
                return this.departmentLead;
        }
 
@@ -213,7 +213,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
         * <p>
         * @param departmentLead Department contact person
         */
-       public void setDepartmentLead (final Employee departmentLead) {
+       public void setDepartmentLead (final Employable departmentLead) {
                this.departmentLead = departmentLead;
        }
 
@@ -262,7 +262,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
         */
        private Department createDepartment () {
                // Create new department instance
-               final Department department = new CompanyDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
+               final Department department = new BusinessDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
 
                // Add all optional fields
                department.setDepartmentHeadquarters(this.getDepartmentHeadquarters());
index da0b7f2232968251a0065f601eaf7a71be83d4b5..d308404f2cc9a1c9de561eefa8a407893a3d6da5 100644 (file)
@@ -30,6 +30,7 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
@@ -118,6 +119,27 @@ public class FinancialsDepartmentWebRequestBean extends BaseFinancialsBean imple
                return this.allDepartments;
        }
 
+       @Override
+       public Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException {
+               // Validate parameter
+               if (null == departmentId) {
+                       // Throw NPE
+                       throw new NullPointerException("departmentId is null"); //NOI18N
+               } else if (departmentId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("departmentId=" + departmentId + " is invalid"); //NOI18N
+               } else if (!this.departmentCache.containsKey(departmentId)) {
+                       // Not found
+                       throw new DepartmentNotFoundException(departmentId);
+               }
+
+               // Get it from cache
+               final Department department = this.departmentCache.get(departmentId);
+
+               // Return it
+               return department;
+       }
+
        /**
         * Getter for a list of filtered departments
         * <p>
index 8ff2f6ab875d1058e575e30535476ce3fe96cc34..0825c3a6b10a1a37dd95f271c9066c805b4133fc 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.business.department;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 
 /**
@@ -34,4 +35,17 @@ public interface FinancialsDepartmentWebRequestController extends Serializable {
         */
        List<Department> allDepartments ();
 
+       /**
+        * Retrieves a single company department entity for given id number or
+        * throws a proper exception if not found.
+        * <p>
+        * @param departmentId Company department id to lookup
+        * <p>
+        * @return Company department instance
+        * <p>
+        * @throws DepartmentNotFoundException If the id number could not be
+        * looked up and solved into an entity
+        */
+       Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException;
+
 }
index 1cb977ad54bd2fe718a39cf6433c81f0f945c26e..186da77fc9d5f87dd65f4b1598c47eeac002fc47 100644 (file)
@@ -24,17 +24,18 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.events.employee.added.ObservableEmployeeAddedEvent;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.employee.AdminCompanyEmployeeSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.employee.AdminEmployeeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.model.user.User;
 
 /**
- * A request-scoped bean for administrative purposes for company employees.
+ * A request-scoped bean for administrative purposes for administrative employee
+ * purposes.
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
@@ -57,18 +58,18 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
        /**
         * EJB for administrative company employee purposes
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/adminEmployee!org.mxchange.jcontactsbusiness.model.employee.AdminCompanyEmployeeSessionBeanRemote")
-       private AdminCompanyEmployeeSessionBeanRemote adminEmployeeBean;
+       @EJB (lookup = "java:global/jfinancials-ejb/adminEmployee!org.mxchange.jcontactsbusiness.model.employee.AdminEmployeeSessionBeanRemote")
+       private AdminEmployeeSessionBeanRemote adminEmployeeBean;
 
        /**
-        * Assigned branch office
+        * Assigned basic data instance
         */
-       private BranchOffice employeeBranchOffice;
+       private BasicData employeeBasicData;
 
        /**
-        * Assigned basic data instance
+        * Assigned branch office
         */
-       private BusinessBasicData employeeCompany;
+       private BranchOffice employeeBranchOffice;
 
        /**
         * Department where employee works (alternative to headquarters)
@@ -146,17 +147,17 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
         * <p>
         * @return Employee's assigned basic company data
         */
-       public BusinessBasicData getEmployeeCompany () {
-               return this.employeeCompany;
+       public BasicData getEmployeeCompany () {
+               return this.employeeBasicData;
        }
 
        /**
         * Setter for employee's assigned basic company data
         * <p>
-        * @param employeeCompany Employee's assigned basic company data
+        * @param employeeBasicData Employee's assigned basic company data
         */
-       public void setEmployeeCompany (final BusinessBasicData employeeCompany) {
-               this.employeeCompany = employeeCompany;
+       public void setEmployeeCompany (final BasicData employeeBasicData) {
+               this.employeeBasicData = employeeBasicData;
        }
 
        /**
index 49621af24b492351e7a827eb0d16a091a97b13b4..0cdbca49ae693d3da419abad3be54b5b35fda2f7 100644 (file)
@@ -30,8 +30,9 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.employee.added.ObservableEmployeeAddedEvent;
-import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.employee.EmployeeSessionBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 
 /**
@@ -51,25 +52,25 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
        /**
         * List of all employees
         */
-       private final List<Employee> allEmployees;
+       private final List<Employable> allEmployees;
 
        /**
         * EJB for general company employee purposes
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/employee!org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote")
-       private CompanyEmployeeSessionBeanRemote employeeBean;
+       @EJB (lookup = "java:global/jfinancials-ejb/employee!org.mxchange.jcontactsbusiness.model.employee.EmployeeSessionBeanRemote")
+       private EmployeeSessionBeanRemote employeeBean;
 
        /**
         * List of all company employees
         */
        @Inject
        @NamedCache (cacheName = "companyEmployeeCache")
-       private Cache<Long, Employee> employeeCache;
+       private Cache<Long, Employable> employeeCache;
 
        /**
         * A list of filtered employees
         */
-       private List<Employee> filteredEmployees;
+       private List<Employable> filteredEmployees;
 
        /**
         * Default constructor
@@ -114,17 +115,38 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
         * @return List of all company employees
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<Employee> allCompanyEmployees () {
+       public List<Employable> allEmployees () {
                return this.allEmployees;
        }
 
+       @Override
+       public Employable findEmployeeById (final Long employeeId) throws EmployeeNotFoundException {
+               // Validate parameter
+               if (null == employeeId) {
+                       // Throw NPE
+                       throw new NullPointerException("employeeId is null"); //NOI18N
+               } else if (employeeId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("employeeId=" + employeeId + " is invalid"); //NOI18N
+               } else if (!this.employeeCache.containsKey(employeeId)) {
+                       // Not found
+                       throw new EmployeeNotFoundException(employeeId);
+               }
+
+               // Get it from cache
+               final Employable employee = this.employeeCache.get(employeeId);
+
+               // Return it
+               return employee;
+       }
+
        /**
         * Getter for filtered list of employees
         * <p>
         * @return Filtered list of employees
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<Employee> getFilteredEmployees () { //NOI18N
+       public List<Employable> getFilteredEmployees () { //NOI18N
                return this.filteredEmployees;
        }
 
@@ -134,7 +156,7 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
         * @param filteredEmployees Filtered list of employees
         */
        @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredEmployees (final List<Employee> filteredEmployees) { //NOI18N
+       public void setFilteredEmployees (final List<Employable> filteredEmployees) { //NOI18N
                this.filteredEmployees = filteredEmployees;
        }
 
@@ -146,10 +168,10 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
                // Is cache there?
                if (!this.employeeCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<Employee> employees = this.employeeBean.allCompanyEmployees();
+                       final List<Employable> employees = this.employeeBean.allEmployees();
 
                        // Add all
-                       for (final Employee employee : employees) {
+                       for (final Employable employee : employees) {
                                // Add it to cache
                                this.employeeCache.put(employee.getEmployeeId(), employee);
                        }
@@ -158,21 +180,21 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
                // Is cache filled and list is empty
                if ((this.employeeCache.iterator().hasNext()) && (this.allEmployees.isEmpty())) {
                        // Get iterator
-                       final Iterator<Cache.Entry<Long, Employee>> iterator = this.employeeCache.iterator();
+                       final Iterator<Cache.Entry<Long, Employable>> iterator = this.employeeCache.iterator();
 
                        // Build up list
                        while (iterator.hasNext()) {
                                // GEt next element
-                               final Cache.Entry<Long, Employee> next = iterator.next();
+                               final Cache.Entry<Long, Employable> next = iterator.next();
 
                                // Add to list
                                this.allEmployees.add(next.getValue());
                        }
 
                        // Sort list
-                       this.allEmployees.sort(new Comparator<Employee>() {
+                       this.allEmployees.sort(new Comparator<Employable>() {
                                @Override
-                               public int compare (final Employee o1, final Employee o2) {
+                               public int compare (final Employable o1, final Employable o2) {
                                        return o1.getEmployeeId() > o2.getEmployeeId() ? 1 : o1.getEmployeeId() < o2.getEmployeeId() ? -1 : 0;
                                }
                        });
index e56f6fb52a44cbc8665762f75af017a56d857d85..ba07d24dc3e1a2e181b43956a7db5a3e0061cd54 100644 (file)
@@ -17,6 +17,8 @@
 package org.mxchange.jfinancials.beans.business.employee;
 
 import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
 /**
  * An interface for request-scoped general company employee beans
@@ -25,4 +27,15 @@ import java.io.Serializable;
  */
 public interface FinancialsEmployeeWebRequestController extends Serializable {
 
+       /**
+        * Finds a company employee by given employee id
+        * <p>
+        * @param employeeId Employable id to find company employee instance for
+        * <p>
+        * @return Company employee instance
+        * <p>
+        * @throws EmployeeNotFoundException If the company employee was not found
+        */
+       Employable findEmployeeById (final Long employeeId) throws EmployeeNotFoundException;
+
 }
index c5d8382e1b4222801bc1f1b71099c935a10e3577..7f0ef7c1a16ec4a4c6d1127d59bb3efbee988b8d 100644 (file)
@@ -30,6 +30,7 @@ import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.opening_time.added.ObservableOpeningTimeAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTimeSessionBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
@@ -114,6 +115,27 @@ public class FinancialsOpeningTimeWebRequestBean extends BaseFinancialsBean impl
                return this.allOpeningTimes;
        }
 
+       @Override
+       public OpeningTime findOpeningTimeById (final Long openingId) throws OpeningTimeNotFoundException {
+               // Validate parameter
+               if (null == openingId) {
+                       // Throw NPE
+                       throw new NullPointerException("openingId is null"); //NOI18N
+               } else if (openingId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("openingId=" + openingId + " is invalid"); //NOI18N
+               } else if (!this.openingTimesCache.containsKey(openingId)) {
+                       // Not found
+                       throw new OpeningTimeNotFoundException(openingId);
+               }
+
+               // Get it from cache
+               final OpeningTime opening = this.openingTimesCache.get(openingId);
+
+               // Return it
+               return opening;
+       }
+
        /**
         * Getter for a list of filtered opening times
         * <p>
index 442b15325d21c0bf02da3de6f739c98c21a7ac54..5a5e060b6702afeb2505fb13db1589dbbd0abfa8 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.business.opening_time;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 
 /**
@@ -34,4 +35,17 @@ public interface FinancialsOpeningTimeWebRequestController extends Serializable
         */
        List<OpeningTime> allOpeningTimes ();
 
+       /**
+        * Retrieves a single company department entity for given id number or
+        * throws a proper exception if not found.
+        * <p>
+        * @param openingId Company department id to lookup
+        * <p>
+        * @return Company department instance
+        * <p>
+        * @throws OpeningTimeNotFoundException If the id number could not be looked
+        * up and solved into an entity
+        */
+       OpeningTime findOpeningTimeById (final Long openingId) throws OpeningTimeNotFoundException;
+
 }
index f91ba1a6ce95e5dd1a61bd714490c1dd6f732e0c..334a4324acc33accdfd80141d7903e807f867811 100644 (file)
@@ -33,6 +33,7 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.model.contact.ContactUtils;
@@ -101,8 +102,8 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
         * Contact list
         */
        @Inject
-       @NamedCache (cacheName = "contactsCache")
-       private Cache<Long, Contact> contactsCache;
+       @NamedCache (cacheName = "contactCache")
+       private Cache<Long, Contact> contactCache;
 
        /**
         * Country instance
@@ -454,7 +455,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                final List<Contact> list = new LinkedList<>();
 
                // Get iterator
-               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactsCache.iterator();
+               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactCache.iterator();
 
                // Loop over all
                while (iterator.hasNext()) {
@@ -615,6 +616,27 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                return "contact_data_saved"; //NOI18N
        }
 
+       @Override
+       public Contact findContactById (final Long contactId) throws ContactNotFoundException {
+               // Validate parameter
+               if (null == contactId) {
+                       // Throw NPE
+                       throw new NullPointerException("contactId is null"); //NOI18N
+               } else if (contactId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("contactId=" + contactId + " is invalid"); //NOI18N
+               } else if (!this.contactCache.containsKey(contactId)) {
+                       // Not found
+                       throw new ContactNotFoundException(contactId);
+               }
+
+               // Get it from cache
+               final Contact contact = this.contactCache.get(contactId);
+
+               // Return it
+               return contact;
+       }
+
        /**
         * Getter for academic title
         * <p>
@@ -1027,14 +1049,14 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
        @PostConstruct
        public void init () {
                // Is cache there?
-               if (!this.contactsCache.iterator().hasNext()) {
+               if (!this.contactCache.iterator().hasNext()) {
                        // Get whole list
                        final List<Contact> contacts = this.contactBean.allContacts();
 
                        // Add all
                        for (final Contact contact : contacts) {
                                // Add it to cache
-                               this.contactsCache.put(contact.getContactId(), contact);
+                               this.contactCache.put(contact.getContactId(), contact);
                                this.emailAddressCache.put(contact.getContactId(), contact.getContactEmailAddress());
                        }
                } else if (this.selectableContactsCache.iterator().hasNext()) {
@@ -1046,7 +1068,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                final List<User> allUsers = this.userController.allUsers();
 
                // Get iterator from contacts cache
-               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactsCache.iterator();
+               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactCache.iterator();
 
                // Loop through all contacts
                while (iterator.hasNext()) {
@@ -1092,6 +1114,11 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                return ((this.emailAddressCache instanceof List) && (this.emailAddressCache.containsKey(contact.getContactId())));
        }
 
+       @Override
+       public boolean isEmailAddressRegistered (String emailAddress) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
        @Override
        public boolean isRequiredChangePersonalDataSet () {
                return ((this.getPersonalTitle() != null) &&
@@ -1132,7 +1159,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                final List<Contact> selectableContacts = new LinkedList<>();
 
                // Get iterator from cache
-               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactsCache.iterator();
+               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactCache.iterator();
 
                // Loop through all contacts
                while (iterator.hasNext()) {
@@ -1291,7 +1318,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                }
 
                // Remove from general list
-               if (!this.contactsCache.remove(contact.getContactId())) {
+               if (!this.contactCache.remove(contact.getContactId())) {
                        // Did not remove contact
                        throw new IllegalStateException(MessageFormat.format("contact {0} was not removed.", contact.getContactId())); //NOI18N
                }
@@ -1320,7 +1347,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                }
 
                // Get iterator from list
-               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactsCache.iterator();
+               final Iterator<Cache.Entry<Long, Contact>> iterator = this.contactCache.iterator();
 
                // "Walk" through all entries
                while (iterator.hasNext()) {
@@ -1336,7 +1363,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                }
 
                // Add contact to list
-               this.contactsCache.put(contact.getContactId(), contact);
+               this.contactCache.put(contact.getContactId(), contact);
        }
 
 }
index f323378f5d111f8eaf7e4e35081813678dbcdd4b..2d486bf162ecc608b92a72eba47ddb178312a338 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.contact;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcontacts.model.contact.Contact;
 
 /**
@@ -120,4 +121,26 @@ public interface FinancialsContactWebRequestController extends Serializable {
         */
        String doChangePersonalContactData ();
 
+       /**
+        * Returns a contact instance which has the given id number.
+        * <p>
+        * @param contactId Contact id
+        * <p>
+        * @return Contact instance
+        * <p>
+        * @throws ContactNotFoundException If the contact was not found
+        */
+       Contact findContactById (final Long contactId) throws ContactNotFoundException;
+
+       /**
+        * Checks whether the given email address is already registered. The email
+        * address should be validated by EmailAddressValidator before calling this
+        * method.
+        * <p>
+        * @param emailAddress Email address to check
+        * <p>
+        * @return Whether the email address is already registered
+        */
+       boolean isEmailAddressRegistered (final String emailAddress);
+
 }
index 767ed93f50e3fd3ab29fd68e8f0eb41a1fda7d53..fe61c992bd5779e170efb932e562f8d54012d144 100644 (file)
@@ -48,8 +48,8 @@ import org.mxchange.jfinancials.beans.phone.FinancialsAdminPhoneWebRequestContro
 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.exceptions.phone.PhoneNumberAlreadyLinkedException;
+import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
index 78d48e963d2dfd3ee601e7ca6289fb86bd9dcd9e..fcc196b4ed71e7ef3d3764636c2c368da8a18d1a 100644 (file)
@@ -26,12 +26,12 @@ import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcountry.events.AdminAddedCountryEvent;
-import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
+import org.mxchange.jcountry.events.added.AdminAddedCountryEvent;
+import org.mxchange.jcountry.events.added.ObservableAdminAddedCountryEvent;
 import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
+import org.mxchange.jcountry.model.data.AdminCountrySessionBeanRemote;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jcountry.model.data.CountryData;
-import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 
 /**
@@ -56,15 +56,15 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp
        private Event<ObservableAdminAddedCountryEvent> addedCountryEvent;
 
        /**
-        * Abroad dial prefix
+        * Remote country EJB
         */
-       private String countryAbroadDialPrefix;
+       @EJB (lookup = "java:global/jfinancials-ejb/adminCountry!org.mxchange.jcountry.model.data.AdminCountrySessionBeanRemote")
+       private AdminCountrySessionBeanRemote adminCountryBean;
 
        /**
-        * Remote country EJB
+        * Abroad dial prefix
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote")
-       private CountrySingletonBeanRemote countryBean;
+       private String countryAbroadDialPrefix;
 
        /**
         * 2-letter country code
@@ -136,7 +136,7 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp
 
                try {
                        // Send country to bean
-                       updatedCountry = this.countryBean.addCountry(country);
+                       updatedCountry = this.adminCountryBean.addCountry(country);
                } catch (final CountryAlreadyAddedException ex) {
                        // Throw again
                        throw new FaceletException(ex);
index 62db3b8546774142d01159613a1ceb38837538d8..9d3d76502f63c904d1eb9e3c724fc3256c48631b 100644 (file)
@@ -28,7 +28,8 @@ import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
+import org.mxchange.jcountry.events.added.ObservableAdminAddedCountryEvent;
+import org.mxchange.jcountry.exceptions.CountryNotFoundException;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
@@ -116,6 +117,27 @@ public class FinancialsCountryWebRequestBean extends BaseFinancialsBean implemen
                return list;
        }
 
+       @Override
+       public Country findCountryById (final Long countryId) throws CountryNotFoundException {
+               // Validate parameter
+               if (null == countryId) {
+                       // Throw NPE
+                       throw new NullPointerException("countryId is null"); //NOI18N
+               } else if (countryId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("countryId=" + countryId + " is invalid"); //NOI18N
+               } else if (!this.countryCache.containsKey(countryId)) {
+                       // Not found
+                       throw new CountryNotFoundException(countryId);
+               }
+
+               // Get it from cache
+               final Country country = this.countryCache.get(countryId);
+
+               // Return it
+               return country;
+       }
+
        /**
         * Post-construction method
         */
index f85f05571940c8234ecfc32d4aa4f92c0f3ede55..de2e8724e63c9b4fd7edd64665ebd675d69743ba 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.country;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcountry.exceptions.CountryNotFoundException;
 import org.mxchange.jcountry.model.data.Country;
 
 /**
@@ -34,4 +35,16 @@ public interface FinancialsCountryWebRequestController extends Serializable {
         */
        List<Country> allCountries ();
 
+       /**
+        * Returns a country instance found by given primary key. If not found, a
+        * proper exception is thrown.
+        * <p>
+        * @param countryId Primary key
+        * <p>
+        * @return Country data instance
+        * <p>
+        * @throws CountryNotFoundException If the primary key was not found
+        */
+       public Country findCountryById (final Long countryId) throws CountryNotFoundException;
+
 }
index 776b24a1cfff749429fc6e6af8c75ec037bcb050..674b63f8dcb7f9298d472e3c50544b53d28a193e 100644 (file)
@@ -27,10 +27,11 @@ import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEve
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
 import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
 import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent;
@@ -40,9 +41,11 @@ import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEv
 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.jproduct.model.product.Product;
 import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
 /**
  * A general helper for beans
@@ -53,11 +56,6 @@ import org.mxchange.jusercore.model.user.User;
 @RequestScoped
 public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implements FinancialsWebRequestHelperController {
 
-       /**
-        * Call-stack instance (5 may show BeanELResolver.getValue as caller)
-        */
-       private static final short THREAD_STACK = 5;
-
        /**
         * Serial number
         */
@@ -99,6 +97,12 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
        @Inject
        private Event<ObservableCreatedLandLineNumberEvent> landLineNumberCreatedEvent;
 
+       /**
+        * Localization controller
+        */
+       @Inject
+       private FinancialsLocalizationSessionController localizationController;
+
        /**
         * Mobile number
         */
@@ -152,8 +156,6 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
         * @param contact Contact instance
         */
        public void setContact (final Contact contact) {
-               // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
-               // System.out.println(MessageFormat.format("{0}: Setting contact={1}, previous: {2}, caller: {3}", this.getClass().getSimpleName(), contact, this.contact, caller));
                this.contact = contact;
        }
 
@@ -524,16 +526,16 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
         * Returns the employee's number, personal title, family name and name if
         * available. If null is provided, an empty string is returned.
         * <p>
-        * @param employee Employee instance
       * <p>
+        * @param employee Employable instance
+ <p>
         * @return Contact's full name
         */
-       public String renderEmployee (final Employee employee) {
+       public String renderEmployee (final Employable employee) {
                // Default is empty string, so let's get started
                final StringBuilder sb = new StringBuilder(20);
 
                // Is employee set?
-               if (employee instanceof Employee) {
+               if (employee instanceof Employable) {
                        // Then create name
                        sb.append(employee.getEmployeeNumber());
 
@@ -565,12 +567,12 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
        }
 
        /**
-        * Returns the headquarters' address. If null is provided, an empty string
-        * is returned.
+        * Returns the headquarters address. If null is provided, an empty string is
+        * returned.
         * <p>
         * @param headquarters Headquarters instance
         * <p>
-        * @return Headquarters' address
+        * @return Headquarters address
         */
        public String renderHeadquarters (final HeadquartersData headquarters) {
                // Default is empty string, so let's get started
@@ -609,6 +611,66 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
                return sb.toString();
        }
 
+       /**
+        * Returns the product name and price. If null is provided, an empty string
+        * is returned.
+        * <p>
+        * @param product Product instance
+        * <p>
+        * @return Product name
+        */
+       public String renderProduct (final Product product) {
+               // Default is empty string, so let's get started
+               final StringBuilder sb = new StringBuilder(10);
+
+               // Is a product set?
+               if (product instanceof Product) {
+                       // Add name and price
+                       sb.append(product.getProductTitle());
+                       sb.append(" ("); //NOI18N
+                       sb.append(this.localizationController.formatCurrency(product.getProductPrice()));
+                       sb.append(")"); //NOI18N
+               }
+
+               // Return it
+               return sb.toString();
+       }
+
+       /**
+        * Returns the receipt. If null is provided, an empty string
+        * is returned.
+        * <p>
+        * @param receipt Receipt instance
+        * <p>
+        * @return Product name
+        */
+       public String renderReceipt (final BillableReceipt receipt) {
+               // Default is empty string, so let's get started
+               final StringBuilder sb = new StringBuilder(10);
+
+               // Is receipt set?
+               if (receipt instanceof BillableReceipt) {
+                       // Add relevant data
+                       sb.append(this.getMessageFromBundle("RECEIPT_ISSUED")).append(" "); //NOI18N
+                       sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getI18nKey()));
+
+                       // Is receipt number included?
+                       if (receipt.getReceiptNumber() !=null) {
+                               // Append it
+                               sb.append(", ").append(this.getMessageFromBundle("RECEIPT_NUMBER")).append(" "); //NOI18N
+                               sb.append(receipt.getReceiptNumber());
+                       }
+
+                       // Add company (over branch office)
+                       sb.append(" ("); //NOI18N
+                       sb.append(receipt.getReceiptBranchOffice().getBranchCompany().getCompanyName());
+                       sb.append(")"); //NOI18N
+               }
+
+               // Return it
+               return sb.toString();
+       }
+
        /**
         * Set's all given contact's phone instances: land-line, mobile and
         * faxNumber
index 953909bf78d9f94f5555e358bd747a52650b2891..5d7c55fe9b967631520c6901753045c30dfa4c7a 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jfinancials.beans.localization;
 
 import java.text.MessageFormat;
+import java.text.NumberFormat;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Locale;
@@ -48,6 +49,11 @@ import org.mxchange.juserlogincore.events.logout.ObservableUserLogoutEvent;
 @SessionScoped
 public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implements FinancialsLocalizationSessionController {
 
+       /**
+        * Number format
+        */
+       private static NumberFormat NUMBER_FORMAT;
+
        /**
         * Serial number
         */
@@ -82,7 +88,7 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
                // Call super constructor
                super();
 
-               // Init list
+               // Init locale list
                this.supportedLocales = new LinkedHashMap<>(2);
        }
 
@@ -181,6 +187,15 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
 
                // Then change it
                this.changeLocale(newLocale, Boolean.TRUE);
+
+               // Change formatting
+               NUMBER_FORMAT = NumberFormat.getNumberInstance(newLocale);
+       }
+
+       @Override
+       public String formatCurrency (final Float amount) {
+               // Format amount
+               return NUMBER_FORMAT.format(amount);
        }
 
        /**
@@ -285,6 +300,9 @@ public class FinancialsLocalizationSessionBean extends BaseFinancialsBean implem
 
                // Change locale, may set same back in faces context, but triggers event
                this.changeLocale(requestLocale, Boolean.FALSE);
+
+               // Initial formatting, may change when user chooses other locale
+               NUMBER_FORMAT = NumberFormat.getNumberInstance(this.locale);
        }
 
        /**
index 9b84d0d6ad90fc24cd8f7f3f0bccc086d818e106..a273f8885277444a648e05a99b32bbdddee8ab44 100644 (file)
@@ -25,4 +25,13 @@ import java.io.Serializable;
  */
 public interface FinancialsLocalizationSessionController extends Serializable {
 
+       /**
+        * Formats a float into a currency, depending on current locale
+        * <p>
+        * @param amount Amount (price) to format
+        * <p>
+        * @return Formatted string
+        */
+       String formatCurrency (final Float amount);
+
 }
index 1e10d8b26955ec9fa604f574d2139bfd61888660..e48b4b6cf589b8993e41fa7c7c05774921361b2d 100644 (file)
@@ -30,7 +30,7 @@ import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 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.exceptions.mobileprovider.MobileProviderAlreadyAddedException;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.CellphoneProvider;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
index f1b0a41a276170d299d1f964e48e2751a2540cae..40a0b196579b24086c6266d68f2deb7ae63c798e 100644 (file)
@@ -31,6 +31,7 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent;
+import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
 
@@ -116,6 +117,27 @@ public class FinancialsMobileProviderWebRequestBean extends BaseFinancialsBean i
                return this.allMobileProviders;
        }
 
+       @Override
+       public MobileProvider findMobileProviderById (final Long mobileProviderId) throws MobileProviderNotFoundException {
+               // Validate parameter
+               if (null == mobileProviderId) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileProviderId is null"); //NOI18N
+               } else if (mobileProviderId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("mobileProviderId=" + mobileProviderId + " is invalid."); //NOI18N
+               } else if (!this.mobileProviderCache.containsKey(mobileProviderId)) {
+                       // Not found
+                       throw new MobileProviderNotFoundException(mobileProviderId);
+               }
+
+               // Get it from cache
+               final MobileProvider mobileProvider = this.mobileProviderCache.get(mobileProviderId);
+
+               // Return it
+               return mobileProvider;
+       }
+
        /**
         * Getter for filtered mobile provider list
         * <p>
index b222c50e4901a0b6a3ec9ee7e010ccad37ace7ff..778a8bf8552c3c75474c1cd551ce314f28c8056d 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.mobileprovider;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -27,6 +28,19 @@ import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
  */
 public interface FinancialsMobileProviderWebRequestController extends Serializable {
 
+       /**
+        * Returns a mobile provider instance by given primary key. If not found, a
+        * proper exception is thrown.
+        * <p>
+        * @param mobileProviderId Primary key
+        * <p>
+        * @return Mobile provider instance
+        * <p>
+        * @throws MobileProviderNotFoundException If the primary key could not be
+        * found
+        */
+       MobileProvider findMobileProviderById (final Long mobileProviderId) throws MobileProviderNotFoundException;
+
        /**
         * Returns a list of all mobile providers
         * <p>
index 30b1c68e24b2f7ec16e789abac8ff05ec1a2afc8..fe8d63597061b278e57e9c1643c051e83e09f479 100644 (file)
@@ -42,6 +42,7 @@ import org.mxchange.jphone.events.landline.deleted.AdminDeletedLandLineNumberEve
 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.exceptions.phone.PhoneEntityNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
@@ -254,25 +255,25 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getContact() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact is null");
+                       throw new NullPointerException("event.contact is null"); //NOI18N
                } else if (event.getContact().getContactId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId is null");
+                       throw new NullPointerException("event.contact.contactId is null"); //NOI18N
                } else if (event.getContact().getContactId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); //NOI18N
                } else if (event.getContact().getContactFaxNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactFaxNumber is null");
+                       throw new NullPointerException("event.contact.contactFaxNumber is null"); //NOI18N
                } else if (event.getContact().getContactFaxNumber().getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactFaxNumber.phoneId is null");
+                       throw new NullPointerException("event.contact.contactFaxNumber.phoneId is null"); //NOI18N
                } else if (event.getContact().getContactFaxNumber().getPhoneId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactFaxNumber.phoneId=" + event.getContact().getContactFaxNumber().getPhoneId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactFaxNumber.phoneId=" + event.getContact().getContactFaxNumber().getPhoneId() + " is invalid"); //NOI18N
                } else if (event.getLinkedFaxNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.linkedFaxNumer is null");
+                       throw new NullPointerException("event.linkedFaxNumer is null"); //NOI18N
                }
 
                // Is the id number in linked number not set?
@@ -295,25 +296,25 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getContact() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact is null");
+                       throw new NullPointerException("event.contact is null"); //NOI18N
                } else if (event.getContact().getContactId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId is null");
+                       throw new NullPointerException("event.contact.contactId is null"); //NOI18N
                } else if (event.getContact().getContactId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); //NOI18N
                } else if (event.getContact().getContactLandLineNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactLandLineNumber is null");
+                       throw new NullPointerException("event.contact.contactLandLineNumber is null"); //NOI18N
                } else if (event.getContact().getContactLandLineNumber().getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactLandLineNumber.phoneId is null");
+                       throw new NullPointerException("event.contact.contactLandLineNumber.phoneId is null"); //NOI18N
                } else if (event.getContact().getContactLandLineNumber().getPhoneId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactLandLineNumber.phoneId=" + event.getContact().getContactLandLineNumber().getPhoneId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactLandLineNumber.phoneId=" + event.getContact().getContactLandLineNumber().getPhoneId() + " is invalid"); //NOI18N
                } else if (event.getLinkedLandLineNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.linkedLandLineNumer is null");
+                       throw new NullPointerException("event.linkedLandLineNumer is null"); //NOI18N
                }
 
                // Is the id number in linked number not set?
@@ -336,25 +337,25 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getContact() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact is null");
+                       throw new NullPointerException("event.contact is null"); //NOI18N
                } else if (event.getContact().getContactId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId is null");
+                       throw new NullPointerException("event.contact.contactId is null"); //NOI18N
                } else if (event.getContact().getContactId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactId=" + event.getContact().getContactId() + " is invalid"); //NOI18N
                } else if (event.getContact().getContactMobileNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactMobileNumber is null");
+                       throw new NullPointerException("event.contact.contactMobileNumber is null"); //NOI18N
                } else if (event.getContact().getContactMobileNumber().getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactMobileNumber.phoneId is null");
+                       throw new NullPointerException("event.contact.contactMobileNumber.phoneId is null"); //NOI18N
                } else if (event.getContact().getContactMobileNumber().getPhoneId() < 1) {
                        // Throw again ...
-                       throw new NullPointerException("event.contact.contactMobileNumber.phoneId=" + event.getContact().getContactMobileNumber().getPhoneId() + " is invalid");
+                       throw new NullPointerException("event.contact.contactMobileNumber.phoneId=" + event.getContact().getContactMobileNumber().getPhoneId() + " is invalid"); //NOI18N
                } else if (event.getLinkedMobileNumber() == null) {
                        // Throw again ...
-                       throw new NullPointerException("event.linkedMobileNumer is null");
+                       throw new NullPointerException("event.linkedMobileNumer is null"); //NOI18N
                }
 
                // Is the id number in linked number not set?
@@ -546,6 +547,69 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                return list;
        }
 
+       @Override
+       public DialableFaxNumber findFaxNumberById (final Long faxNumberId) throws PhoneEntityNotFoundException {
+               // Validate paramter
+               if (null == faxNumberId) {
+                       // Throw NPE
+                       throw new NullPointerException("faxNumberId is null"); //NOI18N
+               } else if (faxNumberId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("faxNumberId=" + faxNumberId + " is invalid."); //NOI18N
+               } else if (!this.faxNumberCache.containsKey(faxNumberId)) {
+                       // Not found
+                       throw new PhoneEntityNotFoundException(faxNumberId);
+               }
+
+               // Get it from cache
+               final DialableFaxNumber faxNumber = this.faxNumberCache.get(faxNumberId);
+
+               // Return it
+               return faxNumber;
+       }
+
+       @Override
+       public DialableLandLineNumber findLandLineNumberById (final Long landLineNumberId) throws PhoneEntityNotFoundException {
+               // Validate paramter
+               if (null == landLineNumberId) {
+                       // Throw NPE
+                       throw new NullPointerException("landLineNumberId is null"); //NOI18N
+               } else if (landLineNumberId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("landLineNumberId=" + landLineNumberId + " is invalid."); //NOI18N
+               } else if (!this.landLineNumberCache.containsKey(landLineNumberId)) {
+                       // Not found
+                       throw new PhoneEntityNotFoundException(landLineNumberId);
+               }
+
+               // Get it from cache
+               final DialableLandLineNumber landLineNumber = this.landLineNumberCache.get(landLineNumberId);
+
+               // Return it
+               return landLineNumber;
+       }
+
+       @Override
+       public DialableMobileNumber findMobileNumberById (final Long mobileNumberId) throws PhoneEntityNotFoundException {
+               // Validate paramter
+               if (null == mobileNumberId) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileNumberId is null"); //NOI18N
+               } else if (mobileNumberId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("mobileNumberId=" + mobileNumberId + " is invalid."); //NOI18N
+               } else if (!this.mobileNumberCache.containsKey(mobileNumberId)) {
+                       // Not found
+                       throw new PhoneEntityNotFoundException(mobileNumberId);
+               }
+
+               // Get it from cache
+               final DialableMobileNumber mobileNumber = this.mobileNumberCache.get(mobileNumberId);
+
+               // Return it
+               return mobileNumber;
+       }
+
        /**
         * Post-construction method
         */
@@ -605,13 +669,13 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                // Make sure the parameter is valid
                if (null == faxNumber) {
                        // Throw NPE
-                       throw new NullPointerException("faxNumber is null");
+                       throw new NullPointerException("faxNumber is null"); //NOI18N
                } else if (faxNumber.getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("faxNumber.phoneId is null");
+                       throw new NullPointerException("faxNumber.phoneId is null"); //NOI18N
                } else if (faxNumber.getPhoneId() < 1) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid.", faxNumber.getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid.", faxNumber.getPhoneId())); //NOI18N
                }
 
                // First remove it
@@ -641,13 +705,13 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                // Make sure the parameter is valid
                if (null == landLineNumber) {
                        // Throw NPE
-                       throw new NullPointerException("landLineNumber is null");
+                       throw new NullPointerException("landLineNumber is null"); //NOI18N
                } else if (landLineNumber.getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("landLineNumber.phoneId is null");
+                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
                } else if (landLineNumber.getPhoneId() < 1) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid.", landLineNumber.getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid.", landLineNumber.getPhoneId())); //NOI18N
                }
 
                // First remove it
@@ -677,13 +741,13 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                // Make sure the parameter is valid
                if (null == mobileNumber) {
                        // Throw NPE
-                       throw new NullPointerException("mobileNumber is null");
+                       throw new NullPointerException("mobileNumber is null"); //NOI18N
                } else if (mobileNumber.getPhoneId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("mobileNumber.phoneId is null");
+                       throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
                } else if (mobileNumber.getPhoneId() < 1) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid.", mobileNumber.getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid.", mobileNumber.getPhoneId())); //NOI18N
                }
 
                // First remove it by object
@@ -712,10 +776,10 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements
                // Parameter must be valid
                if (null == contact) {
                        // Throw NPE
-                       throw new NullPointerException("contact is null");
+                       throw new NullPointerException("contact is null"); //NOI18N
                } else if (contact.getContactId() == null) {
                        // Throw again
-                       throw new NullPointerException("contact.contactId is null");
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
                } else if (contact.getContactId() < 1) {
                        // Id number is not valid
                }
index 42ceaa9b0e3cfb0fb120481d547a65675efa9dcb..194448c5801124d71410775ea92cb627f5720a7c 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.phone;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
@@ -60,4 +61,37 @@ public interface FinancialsPhoneWebRequestController extends Serializable {
         */
        List<DialableLandLineNumber> allLandLineNumbers ();
 
+       /**
+        * Finds a fax entry by given id number
+        * <p>
+        * @param faxNumberId Fax entry id number
+        * <p>
+        * @return A valid fax instance
+        * <p>
+        * @throws PhoneEntityNotFoundException If the entity was not found
+        */
+       DialableFaxNumber findFaxNumberById (final Long faxNumberId) throws PhoneEntityNotFoundException;
+
+       /**
+        * Finds a land-line entry by given id number
+        * <p>
+        * @param landLineNumberId Land-line entry id number
+        * <p>
+        * @return A valid land-line instance
+        * <p>
+        * @throws PhoneEntityNotFoundException If the entity was not found
+        */
+       DialableLandLineNumber findLandLineNumberById (final Long landLineNumberId) throws PhoneEntityNotFoundException;
+
+       /**
+        * Finds a mobile entry by given id number
+        * <p>
+        * @param mobileNumberId Mobile entry id number
+        * <p>
+        * @return A valid mobile instance
+        * <p>
+        * @throws PhoneEntityNotFoundException If the entity was not found
+        */
+       DialableMobileNumber findMobileNumberById (Long mobileNumberId) throws PhoneEntityNotFoundException;
+
 }
index 27ddc39a98c9cf855791936b07391200bf50eb63..a0a776c0374946beb3018af0c0f3075362f522be 100644 (file)
@@ -383,10 +383,10 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Is the parameter valid?
                if (null == event) {
                        // Throw NPE
-                       throw new NullPointerException("event is null");
+                       throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getLocale() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.locale is null");
+                       throw new NullPointerException("event.locale is null"); //NOI18N
                }
 
                // Set it here
@@ -575,7 +575,7 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Is it valid?
                if (null == event) {
                        // Throw NPE
-                       throw new NullPointerException("event is null");
+                       throw new NullPointerException("event is null"); //NOI18N
                }
 
                // Clear it
@@ -591,7 +591,7 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Is it valid?
                if (null == event) {
                        // Throw NPE
-                       throw new NullPointerException("event is null");
+                       throw new NullPointerException("event is null"); //NOI18N
                }
 
                // Clear it
@@ -706,6 +706,27 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                return "user_contact_data_saved"; //NOI18N
        }
 
+       @Override
+       public User findUserById (final Long userId) throws UserNotFoundException {
+               // Validate parameter
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
+               } else if (!this.userCache.containsKey(userId)) {
+                       // Not found
+                       throw new UserNotFoundException(userId);
+               }
+
+               // Get it from cache
+               final User user = this.userCache.get(userId);
+
+               // Return it
+               return user;
+       }
+
        /**
         * Getter for filtered users list
         * <p>
@@ -820,6 +841,24 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                                ((this.getUserPasswordRepeat() == null) || (this.getUserPasswordRepeat().isEmpty())));
        }
 
+       @Override
+       public boolean ifUserIdExists (final Long userId) {
+               // Validate parameter
+               if (null == userId) {
+                       // Throw NPE
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("userId=" + userId + " is invalid."); //NOI18N
+               }
+
+               // Check if key is there
+               boolean isFound = this.userCache.containsKey(userId);
+
+               // Return flag
+               return isFound;
+       }
+
        /**
         * Post-initialization of this class
         */
index ac8561f18b132ce694140eca7a5f718e2ec56ddf..16e49fab53d68abb6828cd34b9a6d57ec7a73e8d 100644 (file)
@@ -38,6 +38,27 @@ public interface FinancialsUserWebRequestController extends Serializable {
        @Deprecated
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
+       /**
+        * Returns a user instance by given primary key. If not found, a proper
+        * exception is thrown.
+        * <p>
+        * @param userId User id
+        * <p>
+        * @return User instance
+        * <p>
+        * @throws UserNotFoundException If the user is not found
+        */
+       User findUserById (final Long userId) throws UserNotFoundException;
+
+       /**
+        * Checks if given user id exists
+        * <p>
+        * @param userId User id to check
+        * <p>
+        * @return Whether the user id exists
+        */
+       boolean ifUserIdExists (final Long userId);
+
        /**
         * Getter for clear-text user password
         * <p>
@@ -72,9 +93,9 @@ public interface FinancialsUserWebRequestController extends Serializable {
        boolean isContactFound (final Contact contact);
 
        /**
-        * Checks whether given user instance's name is used
+        * Checks whether given user instance name is used
         * <p>
-        * @param user User instance's name to check
+        * @param user User instance name to check
         * <p>
         * @return Whether it is already used
         */
index 7c8d130ef2c68a3193e09d1ff6283ce3a0c12974..c88510f8e6664613a9c036a3043e7d4a74473800 100644 (file)
@@ -26,9 +26,9 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataNotFoundException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController;
 
 /**
  * Converter for basic company data id <-> valid basic company data instance
@@ -36,26 +36,26 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
  * @author Roland Häder<roland@mxchange.org>
  */
 @FacesConverter ("BasicCompanyDataConverter")
-public class FinancialsBasicCompanyDataConverter implements Converter<BusinessBasicData> {
+public class FinancialsBasicCompanyDataConverter implements Converter<BasicData> {
 
        /**
-        * Basic company data EJB
+        * Basic company data backing bean
         */
-       private static BasicCompanyDataSessionBeanRemote BASIC_DATA_BEAN;
+       private static FinancialsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
 
        @Override
-       public BusinessBasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+       public BasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (BASIC_DATA_BEAN == null) {
+               if (BASIC_DATA_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               BASIC_DATA_BEAN = (BasicCompanyDataSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote"); //NOI18N
+                               BASIC_DATA_CONTROLLER = (FinancialsBusinessDataWebRequestController) initial.lookup("java:module/basicCompanyDataController!org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController"); //NOI18N
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
                        }
                }
 
@@ -69,18 +69,18 @@ public class FinancialsBasicCompanyDataConverter implements Converter<BusinessBa
                }
 
                // Init instance
-               BusinessBasicData basicData = null;
+               BasicData basicData = null;
 
                try {
                        // Try to parse the value as long
                        final Long basicDataId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       basicData = BASIC_DATA_BEAN.findBasicDataById(basicDataId);
+                       basicData = BASIC_DATA_CONTROLLER.findBasicDataById(basicDataId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
-               } catch (final BasicCompanyDataNotFoundException ex) {
+               } catch (final BasicDataNotFoundException ex) {
                        // Debug message
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
@@ -90,7 +90,7 @@ public class FinancialsBasicCompanyDataConverter implements Converter<BusinessBa
        }
 
        @Override
-       public String getAsString (final FacesContext context, final UIComponent component, final BusinessBasicData value) {
+       public String getAsString (final FacesContext context, final UIComponent component, final BasicData value) {
                // Is the object null?
                if ((null == value) || (String.valueOf(value).isEmpty())) {
                        // Is null
index a231f86107bc73d1edc3c0d20fd2a7eb863c65f5..627e191216f4d1e4f83bbf527f36d1f2ae7df7a4 100644 (file)
@@ -28,7 +28,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote;
+import org.mxchange.jfinancials.beans.business.branchoffice.FinancialsBranchOfficeWebRequestController;
 
 /**
  * Converter for branch office id <-> valid basic company data instance
@@ -41,21 +41,21 @@ public class FinancialsBranchOfficeConverter implements Converter<BranchOffice>
        /**
         * Branch office EJB
         */
-       private static BranchOfficeSessionBeanRemote BRANCH_OFFICE_BEAN;
+       private static FinancialsBranchOfficeWebRequestController BRANCH_OFFICE_CONTROLLER;
 
        @Override
        public BranchOffice getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (BRANCH_OFFICE_BEAN == null) {
+               if (BRANCH_OFFICE_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               BRANCH_OFFICE_BEAN = (BranchOfficeSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/branchOffice!org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote");
+                               BRANCH_OFFICE_CONTROLLER = (FinancialsBranchOfficeWebRequestController) initial.lookup("java:module/branchOfficeController!org.mxchange.jfinancials.beans.business.branchoffice.FinancialsBranchOfficeWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -76,7 +76,7 @@ public class FinancialsBranchOfficeConverter implements Converter<BranchOffice>
                        final Long branchOfficeId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       branchOffice = BRANCH_OFFICE_BEAN.findBranchOfficeById(branchOfficeId);
+                       branchOffice = BRANCH_OFFICE_CONTROLLER.findBranchOfficeById(branchOfficeId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
diff --git a/src/java/org/mxchange/jfinancials/converter/business/company_employee/FinancialsCompanyEmployeeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/company_employee/FinancialsCompanyEmployeeConverter.java
deleted file mode 100644 (file)
index e086759..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.converter.business.company_employee;
-
-import javax.faces.application.FacesMessage;
-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.faces.validator.ValidatorException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-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 ("CompanyEmployeeConverter")
-public class FinancialsCompanyEmployeeConverter implements Converter<Employee> {
-
-       /**
-        * CompanyEmployee EJB
-        */
-       private static CompanyEmployeeSessionBeanRemote EMPLOYEE_BEAN;
-
-       @Override
-       public Employee getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the instance there?
-               if (EMPLOYEE_BEAN == null) {
-                       try {
-                               // Not yet, attempt lookup
-                               final Context initial = new InitialContext();
-
-                               // Lookup EJB
-                               EMPLOYEE_BEAN = (CompanyEmployeeSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/employee!org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote"); //NOI18N
-                       } catch (final NamingException ex) {
-                               // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
-                       }
-               }
-
-               // Is the value null or empty?
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Warning message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
-                       // Return null
-                       return null;
-               }
-
-               // Init instance
-               Employee companyEmployee = null;
-
-               try {
-                       // Try to parse the value as long
-                       final Long employeeId = Long.valueOf(submittedValue);
-
-                       // Try to get user instance from it
-                       companyEmployee = EMPLOYEE_BEAN.findCompanyEmployeeById(employeeId);
-               } catch (final NumberFormatException ex) {
-                       // Throw again
-                       throw new ConverterException(ex);
-               } catch (final CompanyEmployeeNotFoundException ex) {
-                       // Debug message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
-               }
-
-               // Return it
-               return companyEmployee;
-       }
-
-       @Override
-       public String getAsString (final FacesContext context, final UIComponent component, final Employee value) {
-               // Is the object null?
-               if ((null == value) || (String.valueOf(value).isEmpty())) {
-                       // Is null
-                       return ""; //NOI18N
-               }
-
-               // Return id number
-               return String.valueOf(value.getEmployeeId());
-       }
-
-}
diff --git a/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsCompanyDepartmentConverter.java b/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsCompanyDepartmentConverter.java
deleted file mode 100644 (file)
index 547f961..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.converter.business.department;
-
-import javax.faces.application.FacesMessage;
-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.faces.validator.ValidatorException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
-import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote;
-
-/**
- * Converter for company department id <-> instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter ("CompanyDepartmentConverter")
-public class FinancialsCompanyDepartmentConverter implements Converter<Department> {
-
-       /**
-        * Company department EJB
-        */
-       private static DepartmentSessionBeanRemote DEPARTMENT_BEAN;
-
-       @Override
-       public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the instance there?
-               if (DEPARTMENT_BEAN == null) {
-                       try {
-                               // Not yet, attempt lookup
-                               final Context initial = new InitialContext();
-
-                               // Lookup EJB
-                               DEPARTMENT_BEAN = (DepartmentSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/companyDepartment!org.mxchange.jcontactsbusiness.model.department.CompanyDepartmentSessionBeanRemote"); //NOI18N
-                       } catch (final NamingException ex) {
-                               // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
-                       }
-               }
-
-               // Is the value null or empty?
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Warning message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
-                       // Return null
-                       return null;
-               }
-
-               // Init instance
-               Department companyDepartment = null;
-
-               try {
-                       // Try to parse the value as long
-                       final Long departmentId = Long.valueOf(submittedValue);
-
-                       // Try to get user instance from it
-                       companyDepartment = DEPARTMENT_BEAN.findDepartmentById(departmentId);
-               } catch (final NumberFormatException ex) {
-                       // Throw again
-                       throw new ConverterException(ex);
-               } catch (final DepartmentNotFoundException ex) {
-                       // Debug message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
-               }
-
-               // Return it
-               return companyDepartment;
-       }
-
-       @Override
-       public String getAsString (final FacesContext context, final UIComponent component, final Department value) {
-               // Is the object null?
-               if ((null == value) || (String.valueOf(value).isEmpty())) {
-                       // Is null
-                       return ""; //NOI18N
-               }
-
-               // Return id number
-               return String.valueOf(value.getDepartmentId());
-       }
-
-}
diff --git a/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java b/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java
new file mode 100644 (file)
index 0000000..a2cb503
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.business.department;
+
+import javax.faces.application.FacesMessage;
+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.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jfinancials.beans.business.department.FinancialsDepartmentWebRequestController;
+
+/**
+ * Converter for company department id <-> instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("DepartmentConverter")
+public class FinancialsDepartmentConverter implements Converter<Department> {
+
+       /**
+        * Company department EJB
+        */
+       private static FinancialsDepartmentWebRequestController DEPARTMENT_CONTROLLER;
+
+       @Override
+       public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (DEPARTMENT_CONTROLLER == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               final Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               DEPARTMENT_CONTROLLER = (FinancialsDepartmentWebRequestController) initial.lookup("java:module/departmentController!org.mxchange.jfinancials.beans.business.department.FinancialsDepartmentWebRequestController"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
+                       }
+               }
+
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+                       // Return null
+                       return null;
+               }
+
+               // Init instance
+               Department companyDepartment = null;
+
+               try {
+                       // Try to parse the value as long
+                       final Long departmentId = Long.valueOf(submittedValue);
+
+                       // Try to get user instance from it
+                       companyDepartment = DEPARTMENT_CONTROLLER.findDepartmentById(departmentId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final DepartmentNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Return it
+               return companyDepartment;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Department value) {
+               // Is the object null?
+               if ((null == value) || (String.valueOf(value).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               }
+
+               // Return id number
+               return String.valueOf(value.getDepartmentId());
+       }
+
+}
diff --git a/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java
new file mode 100644 (file)
index 0000000..f18ded9
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.business.employee;
+
+import javax.faces.application.FacesMessage;
+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.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jfinancials.beans.business.employee.FinancialsEmployeeWebRequestController;
+
+/**
+ * Converter for converting company employee to and from id number
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("EmployeeConverter")
+public class FinancialsEmployeeConverter implements Converter<Employable> {
+
+       /**
+        * Employable EJB
+        */
+       private static FinancialsEmployeeWebRequestController EMPLOYEE_CONTROLLER;
+
+       @Override
+       public Employable getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (EMPLOYEE_CONTROLLER == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               final Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               EMPLOYEE_CONTROLLER = (FinancialsEmployeeWebRequestController) initial.lookup("java:module/!.FinancialsEmployeeWebRequestController"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
+                       }
+               }
+
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+                       // Return null
+                       return null;
+               }
+
+               // Init instance
+               Employable companyEmployee = null;
+
+               try {
+                       // Try to parse the value as long
+                       final Long employeeId = Long.valueOf(submittedValue);
+
+                       // Try to get user instance from it
+                       companyEmployee = EMPLOYEE_CONTROLLER.findEmployeeById(employeeId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final EmployeeNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Return it
+               return companyEmployee;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Employable value) {
+               // Is the object null?
+               if ((null == value) || (String.valueOf(value).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               }
+
+               // Return id number
+               return String.valueOf(value.getEmployeeId());
+       }
+
+}
index c27cba7a9fb82a4baa5a50c99be60a2278895f74..cb273d680e77deff18794c89ce7d4f592d6efd5c 100644 (file)
@@ -39,23 +39,24 @@ import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 public class FinancialsCompanyHeadquartersConverter implements Converter<HeadquartersData> {
 
        /**
-        * CompanyEmployee EJB
+        * Headquarters backing bean
+        * @TODO Undone
         */
-       private static CompanyHeadquartersSessionBeanRemote COMPANY_HEADQUARTERS_BEAN;
+       private static CompanyHeadquartersSessionBeanRemote HEADQUARTERS_CONTROLLER;
 
        @Override
        public HeadquartersData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (COMPANY_HEADQUARTERS_BEAN == null) {
+               if (HEADQUARTERS_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               COMPANY_HEADQUARTERS_BEAN = (CompanyHeadquartersSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/headquarters!org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote"); //NOI18N
+                               HEADQUARTERS_CONTROLLER = (CompanyHeadquartersSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/headquarters!org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote"); //NOI18N
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
                        }
                }
 
@@ -76,7 +77,7 @@ public class FinancialsCompanyHeadquartersConverter implements Converter<Headqua
                        final Long headquartersId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       companyHeadquarters = COMPANY_HEADQUARTERS_BEAN.findCompanyHeadquartersById(headquartersId);
+                       companyHeadquarters = HEADQUARTERS_CONTROLLER.findCompanyHeadquartersById(headquartersId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
diff --git a/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java
new file mode 100644 (file)
index 0000000..7434163
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.business.opening_time;
+
+import javax.faces.application.FacesMessage;
+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.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jfinancials.beans.business.opening_time.FinancialsOpeningTimeWebRequestController;
+
+/**
+ * Converter for opening time id <-> instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("OpeningTimeConverter")
+public class FinancialsCompanyOpeningTimeConverter implements Converter<OpeningTime> {
+
+       /**
+        * Opening time backing bean
+        */
+       private static FinancialsOpeningTimeWebRequestController DEPARTMENT_CONTROLLER;
+
+       @Override
+       public OpeningTime getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (DEPARTMENT_CONTROLLER == null) {
+                       try {
+                               // Not yet, attempt lookup
+                               final Context initial = new InitialContext();
+
+                               // Lookup EJB
+                               DEPARTMENT_CONTROLLER = (FinancialsOpeningTimeWebRequestController) initial.lookup("java:module/openingTimeController!org.mxchange.jfinancials.beans.business.opening_time.FinancialsOpeningTimeWebRequestController"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Throw it again
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
+                       }
+               }
+
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+                       // Return null
+                       return null;
+               }
+
+               // Init instance
+               OpeningTime openingTime = null;
+
+               try {
+                       // Try to parse the value as long
+                       final Long openingId = Long.valueOf(submittedValue);
+
+                       // Try to get user instance from it
+                       openingTime = DEPARTMENT_CONTROLLER.findOpeningTimeById(openingId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final OpeningTimeNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Return it
+               return openingTime;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final OpeningTime value) {
+               // Is the object null?
+               if ((null == value) || (String.valueOf(value).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               }
+
+               // Return id number
+               return String.valueOf(value.getOpeningId());
+       }
+
+}
index 259a24c887e526eb7de37ef2396a368eebaf622a..6e8adf10a552a5cd4de97961ca3115c29215c5ab 100644 (file)
@@ -28,7 +28,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
+import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 
 /**
  * Converter for contact id <-> valid contact instance
@@ -41,21 +41,21 @@ public class FinancialsContactConverter implements Converter<Contact> {
        /**
         * Contact EJB
         */
-       private static ContactSessionBeanRemote CONTACT_BEAN;
+       private static FinancialsContactWebRequestController CONTACT_CONTROLLER;
 
        @Override
        public Contact getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (CONTACT_BEAN == null) {
+               if (CONTACT_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote");
+                               CONTACT_CONTROLLER = (FinancialsContactWebRequestController) initial.lookup("java:module/contactController!org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -76,7 +76,7 @@ public class FinancialsContactConverter implements Converter<Contact> {
                        final Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       contact = CONTACT_BEAN.findContactById(contactId);
+                       contact = CONTACT_CONTROLLER.findContactById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 01e7aaaad24b72df747659bc0f91d825de569d8a..70171e4d404cccfda79eb9ea1373a0c6118d913b 100644 (file)
@@ -16,8 +16,6 @@
  */
 package org.mxchange.jfinancials.converter.country;
 
-import java.util.List;
-import java.util.Objects;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -28,8 +26,9 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import org.mxchange.jcountry.exceptions.CountryNotFoundException;
 import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
+import org.mxchange.jfinancials.beans.country.FinancialsCountryWebRequestController;
 
 /**
  * Converter for country instance
@@ -40,23 +39,23 @@ import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
 public class FinancialsCountryConverter implements Converter<Country> {
 
        /**
-        * Country bean
+        * Country backing bean
         */
-       private static CountrySingletonBeanRemote COUNTRY_BEAN;
+       private static FinancialsCountryWebRequestController COUNTRY_CONTROLLER;
 
        @Override
        public Country getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (COUNTRY_BEAN == null) {
+               if (COUNTRY_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               COUNTRY_BEAN = (CountrySingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote");
+                               COUNTRY_CONTROLLER = (FinancialsCountryWebRequestController) initial.lookup("java:module/countryController!org.mxchange.jfinancials.beans.country.FinancialsCountryWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -69,9 +68,6 @@ public class FinancialsCountryConverter implements Converter<Country> {
                        return null;
                }
 
-               // Get full list
-               final List<Country> countryList = COUNTRY_BEAN.allCountries();
-
                // Init value
                Country country = null;
 
@@ -80,21 +76,13 @@ public class FinancialsCountryConverter implements Converter<Country> {
                        // Convert it to long
                        final Long countryId = Long.parseLong(submittedValue);
 
-                       // Category id should not be below 1
-                       assert (countryId > 0) : "countryId is smaller than one: " + countryId; //NOI18N
-
                        // Try to find it
-                       for (final Country cntry : countryList) {
-                               // Is the id the same? (null-safe)
-                               if (Objects.equals(cntry.getCountryId(), countryId)) {
-                                       // Found it
-                                       country = cntry;
-                                       break;
-                               }
-                       }
+                       country = COUNTRY_CONTROLLER.findCountryById(countryId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
+               } catch (final CountryNotFoundException ex) {
+                       // Not handled
                }
 
                // Return it
index c1deb9dadb85096bee95aefa5d36a8df33c5a777..ec77d49b54ad4d3d05ea52117c8e19a9fa344021 100644 (file)
@@ -26,9 +26,9 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jfinancials.beans.phone.FinancialsPhoneWebRequestController;
+import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
 
 /**
  * Converter for fax id <-> valid fax number instance
@@ -41,21 +41,21 @@ public class FinancialsFaxNumberConverter implements Converter<DialableFaxNumber
        /**
         * Phone EJB
         */
-       private static PhoneSessionBeanRemote PHONE_BEAN;
+       private static FinancialsPhoneWebRequestController PHONE_CONTROLLER;
 
        @Override
        public DialableFaxNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_BEAN == null) {
+               if (PHONE_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote");
+                               PHONE_CONTROLLER = (FinancialsPhoneWebRequestController) initial.lookup("java:module/phoneController!org.mxchange.jphone.model.phonenumbers.phone.FinancialsPhoneWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -81,7 +81,7 @@ public class FinancialsFaxNumberConverter implements Converter<DialableFaxNumber
                        // 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 = PHONE_BEAN.findFaxNumberById(faxNumberId);
+                       faxNumber = PHONE_CONTROLLER.findFaxNumberById(faxNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index d54def7179a9ac84f545d52225150dcf33c316a2..467ed1522234afc4415de3b5e6fd5506675c3295 100644 (file)
@@ -26,9 +26,9 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jfinancials.beans.phone.FinancialsPhoneWebRequestController;
+import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
 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
@@ -41,21 +41,21 @@ public class FinancialsLandLineNumberConverter implements Converter<DialableLand
        /**
         * Phone EJB
         */
-       private static PhoneSessionBeanRemote PHONE_BEAN;
+       private static FinancialsPhoneWebRequestController PHONE_CONTROLLER;
 
        @Override
        public DialableLandLineNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_BEAN == null) {
+               if (PHONE_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote");
+                               PHONE_CONTROLLER = (FinancialsPhoneWebRequestController) initial.lookup("java:module/phoneController!org.mxchange.jphone.model.phonenumbers.phone.FinancialsPhoneWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -76,7 +76,7 @@ public class FinancialsLandLineNumberConverter implements Converter<DialableLand
                        final Long landLineNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       landLineNumber = PHONE_BEAN.findLandLineNumberById(landLineNumberId);
+                       landLineNumber = PHONE_CONTROLLER.findLandLineNumberById(landLineNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index eb4536061bc2b5cda2f142bddd67d8a24070e536..0b6d1d01d8e9f24f8442b2ada295f56c2d88ab9d 100644 (file)
@@ -26,9 +26,9 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jfinancials.beans.phone.FinancialsPhoneWebRequestController;
+import org.mxchange.jphone.exceptions.phone.PhoneEntityNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
 
 /**
  * Converter for mobile id <-> valid mobile instance
@@ -41,21 +41,21 @@ public class FinancialsMobileNumberConverter implements Converter<DialableMobile
        /**
         * Phone EJB
         */
-       private static PhoneSessionBeanRemote PHONE_BEAN;
+       private static FinancialsPhoneWebRequestController PHONE_CONTROLLER;
 
        @Override
        public DialableMobileNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_BEAN == null) {
+               if (PHONE_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               PHONE_BEAN = (PhoneSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote");
+                               PHONE_CONTROLLER = (FinancialsPhoneWebRequestController) initial.lookup("java:module/phoneController!org.mxchange.jfinancials.beans.phone.FinancialsPhoneWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -76,7 +76,7 @@ public class FinancialsMobileNumberConverter implements Converter<DialableMobile
                        final Long mobileNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       mobileNumber = PHONE_BEAN.findMobileNumberById(mobileNumberId);
+                       mobileNumber = PHONE_CONTROLLER.findMobileNumberById(mobileNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 01a758c4ef862b1f4375f768f4478ab279f99f8f..f349e9c876c0e8474019071f527c251279df4232 100644 (file)
@@ -16,8 +16,6 @@
  */
 package org.mxchange.jfinancials.converter.mobileprovider;
 
-import java.util.List;
-import java.util.Objects;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -27,8 +25,9 @@ import javax.faces.convert.FacesConverter;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.mobileprovider.FinancialsMobileProviderWebRequestController;
+import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderNotFoundException;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
-import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
 
 /**
  * Converter for SMS provider instance
@@ -39,23 +38,23 @@ import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingl
 public class FinancialsMobileProviderConverter implements Converter<MobileProvider> {
 
        /**
-        * Mobile provider bean
+        * Mobile provider backing bean
         */
-       private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN;
+       private static FinancialsMobileProviderWebRequestController MOBILE_PROVIDER_CONTROLLER;
 
        @Override
        public MobileProvider getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (MOBILE_PROVIDER_BEAN == null) {
+               if (MOBILE_PROVIDER_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initial.lookup("java:global/jfinancials-ejb/mobileProvider!org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote");
+                               MOBILE_PROVIDER_CONTROLLER = (FinancialsMobileProviderWebRequestController) initial.lookup("java:module/mobileProviderController!org.mxchange.jfinancials.beans.mobileprovider.FinancialsMobileProviderWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -68,36 +67,26 @@ public class FinancialsMobileProviderConverter implements Converter<MobileProvid
                        return null;
                }
 
-               // Get full list
-               final List<MobileProvider> providerList = MOBILE_PROVIDER_BEAN.allMobileProviders();
-
                // Init value
-               MobileProvider provider = null;
+               MobileProvider mobileProvider = null;
 
                // Try this better
                try {
                        // Convert it to long
                        final Long providerId = Long.parseLong(submittedValue);
 
-                       // Category id should not be below 1
-                       assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N
-
-                       // Try to find it
-                       for (final MobileProvider prov : providerList) {
-                               // Is the id the same? (null-safe)
-                               if (Objects.equals(prov.getProviderId(), providerId)) {
-                                       // Found it
-                                       provider = prov;
-                                       break;
-                               }
-                       }
+                       // Lookup of mobile provider
+                       mobileProvider = MOBILE_PROVIDER_CONTROLLER.findMobileProviderById(providerId);
                } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final MobileProviderNotFoundException ex) {
                        // Log exception (maybe to much?)
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logException(ex);
                }
 
                // Return it
-               return provider;
+               return mobileProvider;
        }
 
        @Override
index 8fc927410647556c6f4ef5172997c3aad1464a2e..b10d1d82e7bee01ff36fc475b7c5d4596b9842d9 100644 (file)
@@ -25,9 +25,9 @@ import javax.faces.convert.FacesConverter;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 
 /**
  * Converter for user id <-> valid user instance
@@ -38,23 +38,23 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 public class FinancialsUserConverter implements Converter<User> {
 
        /**
-        * User EJB
+        * User backing bean
         */
-       private static UserSessionBeanRemote USER_BEAN;
+       private static FinancialsUserWebRequestController USER_CONTROLLER;
 
        @Override
        public User getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (USER_BEAN == null) {
+               if (USER_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote");
+                               USER_CONTROLLER = (FinancialsUserWebRequestController) initial.lookup("java:module/userController!org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -75,7 +75,7 @@ public class FinancialsUserConverter implements Converter<User> {
                        final Long userId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       user = USER_BEAN.findUserById(userId);
+                       user = USER_CONTROLLER.findUserById(userId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index f784247d1a200f2fdc63aefd95a2f8694dc92eb8..c10dadae6cfba0986edd4818f6aaa4117369ac2e 100644 (file)
@@ -25,8 +25,8 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController;
 
 /**
  * A validator for company names
@@ -37,9 +37,9 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 public class FinancialsCompanyNameValidator extends BaseStringValidator {
 
        /**
-        * Business contact EJB
+        * Business basic data backing bean
         */
-       private static BasicCompanyDataSessionBeanRemote BASIC_DATA_BEAN;
+       private static FinancialsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
 
        /**
         * Serial number
@@ -49,16 +49,16 @@ public class FinancialsCompanyNameValidator extends BaseStringValidator {
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Is the instance there?
-               if (BASIC_DATA_BEAN == null) {
+               if (BASIC_DATA_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               BASIC_DATA_BEAN = (BasicCompanyDataSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote");
+                               BASIC_DATA_CONTROLLER = (FinancialsBusinessDataWebRequestController) initial.lookup("java:module/basicCompanyDataController!org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController"); //NOI18N
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -90,7 +90,7 @@ public class FinancialsCompanyNameValidator extends BaseStringValidator {
                }
 
                // Check if name is already used
-               final Boolean nameExists = BASIC_DATA_BEAN.isCompanyNameUsed(companyName);
+               final Boolean nameExists = BASIC_DATA_CONTROLLER.isCompanyNameUsed(companyName);
 
                // Is the user id valid?
                if ((!nameExists) && (checkExisting)) {
index a37c9ec19d80392fb40f8aac6a2ed1b2a4922002..36f8cc533039985b3f2c9a0d37b7f225154c3499 100644 (file)
@@ -26,8 +26,8 @@ import javax.faces.validator.ValidatorException;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 
 /**
  * A validator for email address validation
@@ -38,9 +38,9 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 public class FinancialsEmailAddressValidator extends BaseStringValidator {
 
        /**
-        * Contact session-scoped bean
+        * Contact backing bean
         */
-       private static ContactSessionBeanRemote CONTACT_BEAN;
+       private static FinancialsContactWebRequestController CONTACT_CONTROLLER;
 
        /**
         * Email pattern
@@ -60,16 +60,16 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator {
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Is the instance there?
-               if (CONTACT_BEAN == null) {
+               if (CONTACT_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               CONTACT_BEAN = (ContactSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote");
+                               CONTACT_CONTROLLER = (FinancialsContactWebRequestController) initial.lookup("java:module/contactController!org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -127,7 +127,7 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator {
                final String clientId = component.getClientId();
 
                // Is it registered?
-               final Boolean isRegistered = CONTACT_BEAN.isEmailAddressRegistered(emailAddress);
+               final Boolean isRegistered = CONTACT_CONTROLLER.isEmailAddressRegistered(emailAddress);
 
                // Is the email address already registered?
                if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
index 5243aecc63439277092680c22490615227d411c2..dbac7b31cd79be437f2e6e857192ef167b9879c1 100644 (file)
@@ -26,7 +26,7 @@ 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;
+import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 
 /**
  * A validator for user ids
@@ -37,9 +37,9 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 public class FinancialsUserIdValidator extends BaseNumberValidator {
 
        /**
-        * Remote bean
+        * User backing bean
         */
-       private static UserSessionBeanRemote USER_BEAN;
+       private static FinancialsUserWebRequestController USER_CONTROLLER;
 
        /**
         * Serial number
@@ -49,16 +49,16 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Is the instance there?
-               if (USER_BEAN == null) {
+               if (USER_CONTROLLER == null) {
                        try {
                                // Not yet, attempt lookup
                                final Context initial = new InitialContext();
 
                                // Lookup EJB
-                               USER_BEAN = (UserSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote");
+                               USER_CONTROLLER = (FinancialsUserWebRequestController) initial.lookup("java:module/userController!org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController");
                        } catch (final NamingException ex) {
                                // Throw it again
-                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+                               throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
                        }
                }
 
@@ -72,7 +72,7 @@ public class FinancialsUserIdValidator extends BaseNumberValidator {
                final Long userId = (Long) value;
 
                // Define variable
-               final Boolean ifUserExists = USER_BEAN.ifUserIdExists(userId);
+               final Boolean ifUserExists = USER_CONTROLLER.ifUserIdExists(userId);
 
                // Is the user id valid?
                if (!ifUserExists) {
index 8e8756481fb6bf6be2ce34a4d7bab8a658e19fd2..ac6b5bcaaa560a7d93068d58617baba312523853 100644 (file)
@@ -862,7 +862,7 @@ ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Kontaktperson der Filiale zuweisen:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND=Grunddaten der Filiale:
 #@TODO Please fix German umlauts!
 ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Geben Sie hier die Grunddaten der Filiale ein.
-ADMIN_ASSIGN_BRANCH_OFFICE_COMPANY=Filiale dem Unternehmen zuweisen:
+ADMIN_ASSIGN_BRANCH_OFFICE=Filiale dem Unternehmen zuweisen:
 PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=Filialen auflisten
 CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=Auflisten von Filialen:
 #@TODO Please fix German umlauts!
@@ -875,7 +875,7 @@ ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email-Addresse der Filiale:
 ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Telefonnummer eingeben:
 ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Faxnummer eingeben:
 #@TODO Please fix German umlauts!
-ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED=Bitte waehlen das zur Filiale gehoerende Unternehmen aus.
+ADMIN_BRANCH_OFFICE_REQUIRED=Bitte waehlen das zur Filiale gehoerende Unternehmen aus.
 ADMIN_BRANCH_OFFICE_STREET_NAME_REQUIRED=Bitte geben Sie die Strasse der Filiale ein.
 ADMIN_BRANCH_OFFICE_HOUSE_NUMBER_REQUIRED=Bitte geben Sie die Hausnummer der Filiale ein.
 #@TODO Please fix German umlauts!
index 23ed57980bd8315d9c940946ba1a4eb8d16489d4..22c600b84339da8a3e2ba8c0494d8356173c6855 100644 (file)
@@ -825,7 +825,7 @@ ADMIN_ASSIGN_BRANCH_OFFICE_USER_OWNER=Assign user to branch office:
 ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Assign contact person to branch office:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND=Branch office basic data:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Enter branch office basic data here.
-ADMIN_ASSIGN_BRANCH_OFFICE_COMPANY=Assign branch office to company:
+ADMIN_ASSIGN_BRANCH_OFFICE=Assign branch office to company:
 PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices
 CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices:
 ADMIN_EMPTY_LIST_BRANCH_OFFICES=There are no branch offices found in database. Or your search criteria doesn't match anything.
@@ -835,7 +835,7 @@ ADMIN_ADD_BRANCH_OFFICE_MINIMUM_DATA=Please at least choose assigned company, co
 ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email address of branch office:
 ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Enter land-line number:
 ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Enter fax number:
-ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED=Please choose a company that sohuld be assigned with the branch office.
+ADMIN_BRANCH_OFFICE_REQUIRED=Please choose a company that sohuld be assigned with the branch office.
 ADMIN_BRANCH_OFFICE_STREET_NAME_REQUIRED=Please enter street name of branch office.
 ADMIN_BRANCH_OFFICE_HOUSE_NUMBER_REQUIRED=Please enter house number of branch office.
 ENTERED_STORE_INVALID=The entered store is not valid.
index d07704b7ce9899254467cce4a2690f79f46f69d9..06af978746b7523ebc2341b6ceab3d4919b512f3 100644 (file)
@@ -217,7 +217,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                </attribute>
        </tag>
        <tag>
-               <tag-name>outputCompanyEmployeeAdminMiniLinks</tag-name>
+               <tag-name>outputEmployeeAdminMiniLinks</tag-name>
                <description>This tag renders administrative "mini-links" for given employee instance.</description>
                <source>resources/tags/admin/links/mini/employee/admin_employee_links.tpl</source>
                <attribute>
index 9ec478ea01e4e6defbec07eb685453721fee93c4..b7ffdec1e037900e6cf87e24f96def8f0ac4bf90 100644 (file)
@@ -56,9 +56,9 @@
                                        filter="true"
                                        filterMatchMode="contains"
                                        >
-                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                       <f:converter converterId="EmployeeConverter" />
                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
                                </p:selectOneMenu>
 
                                <p:outputLabel for="companyFounder" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER}" />
@@ -68,9 +68,9 @@
                                        filter="true"
                                        filterMatchMode="contains"
                                        >
-                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                       <f:converter converterId="EmployeeConverter" />
                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
                                </p:selectOneMenu>
 
                                <p:outputLabel for="companyHeadQuarters" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS}" />
index 7e2c72b777ce5b0c9dc721bd0a9049335a4d8bd9..dcaefd44bbe0b5f97762f1e5a33c1c897bf14585 100644 (file)
        -->
        <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_DATA_LEGEND}">
                <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
-                       <p:outputLabel for="branchCompany" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE_COMPANY}" />
+                       <p:outputLabel for="branchCompany" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE}" />
                        <p:selectOneMenu
                                id="branchCompany"
                                value="#{adminBranchOfficeController.branchCompany}"
                                filter="true"
                                filterMatchMode="contains"
                                required="true"
-                               requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED}"
+                               requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_REQUIRED}"
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="branchContactEmployee" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE}" />
@@ -33,9 +33,9 @@
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="CompanyEmployeeConverter" />
+                               <f:converter converterId="EmployeeConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                               <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                               <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="branchUserOwner" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE_USER_OWNER}" />
index e10b19579798d23fdc8e5c71792c40311de31663..cb76dbc674e816b66845ab56f021119681af19bc 100644 (file)
@@ -26,7 +26,7 @@
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="departmentBranchOffice" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE}" />
@@ -48,7 +48,7 @@
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="CompanyEmployeeConverter" />
+                               <f:converter converterId="EmployeeConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
                                <f:selectItems value="#{headquartersController.allHeadquarters()}" var="headquarters" itemValue="#{headquarters}" itemLabel="#{beanHelper.renderHeadquarters(headquarters)}" />
                        </p:selectOneMenu>
@@ -60,9 +60,9 @@
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="CompanyEmployeeConverter" />
+                               <f:converter converterId="EmployeeConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                               <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                               <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="departmentUserOwner" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_USER_OWNER}" />
index 8a2bf9179437cc5a9093de9fd9282bd219cbf2f0..5c0747a10834d2157cb00bb799257fbfd60478f7 100644 (file)
@@ -23,7 +23,7 @@
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="employeeBranchOffice" value="#{msg.ADMIN_ASSIGN_EMPLOYEE_BRANCH_OFFICE}" />
@@ -88,7 +88,7 @@
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="CompanyDepartmentConverter" />
+                               <f:converter converterId="DepartmentConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
                                <f:selectItems value="#{departmentController.allDepartments()}" var="department" itemValue="#{department}" itemLabel="#{beanHelper.renderDepartment(department)}" />
                        </p:selectOneMenu>
index 0fb9c237adec7cfcce141c31d798de76661828e1..ac3f5c4fa9d80a7527bc11f824fa61d48961a060 100644 (file)
@@ -21,7 +21,7 @@
                        <p:dataTable
                                id="table-list-basic-company-data"
                                var="basicData"
-                               value="#{basicCompanyDataController.allCompanyBasicData()}"
+                               value="#{basicCompanyDataController.allBasicData()}"
                                tableStyleClass="table table-full"
                                paginator="true"
                                paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
@@ -96,9 +96,9 @@
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                                       <f:converter converterId="EmployeeConverter" />
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                                       <f:converter converterId="EmployeeConverter" />
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
index ff66511940c13c3c9b7383622c094df8d33a771c..670fb3d0176cbbbc5a56798ac00b387825f68cb6 100644 (file)
@@ -89,7 +89,7 @@
                                                        title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
                                                        >
                                                        <f:converter converterId="BasicCompanyDataConverter" />
-                                                       <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                                                       <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                                       <f:converter converterId="EmployeeConverter" />
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
index 992a6acc15576c1dd53a9bd810b2011433c02c52..2b5bcc87bf957a3164b9c457936b9b820d7a3745 100644 (file)
@@ -68,7 +68,7 @@
                                                        title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
                                                        >
                                                        <f:converter converterId="BasicCompanyDataConverter" />
-                                                       <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                                                       <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="CompanyEmployeeConverter" />
+                                                       <f:converter converterId="EmployeeConverter" />
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
index 3ac1c7844a75859a98adf4c9393bec6d0a99c02e..3f84f68422387e149f577d1e80f23688376a1976 100644 (file)
@@ -21,7 +21,7 @@
                        <p:dataTable
                                id="table-list-company-employees"
                                var="employee"
-                               value="#{employeeController.allCompanyEmployees()}"
+                               value="#{employeeController.allEmployees()}"
                                tableStyleClass="table table-full"
                                paginator="true"
                                paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                        title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
                                                        >
                                                        <f:converter converterId="BasicCompanyDataConverter" />
-                                                       <f:selectItems value="#{basicCompanyDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                                                       <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false" filterable="false">
-                                       <links:outputCompanyEmployeeAdminMiniLinks employee="#{employee}" />
+                                       <links:outputEmployeeAdminMiniLinks employee="#{employee}" />
                                </p:column>
                        </p:dataTable>
                </h:form>
                                                        styleClass="submit"
                                                        type="submit"
                                                        value="#{msg.BUTTON_ADMIN_ADD_EMPLOYEE}"
-                                                       action="#{adminEmployeeController.addCompanyEmployee()}"
+                                                       action="#{adminEmployeeController.addEmployee()}"
                                                        update=":master:form-list-company-employees:table-list-company-employees"
                                                        />
                                        </p:panelGrid>