]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 24 Mar 2018 16:09:34 +0000 (17:09 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 24 Mar 2018 18:20:39 +0000 (19:20 +0100)
- isEmailAddressRegistered() should always, like other public methods, validate
  their parameter
- introduced isCompanyNameUsed() which is similar to isEmailAddressRegistered()
  which will be used to check in JS107 cache if company name is already used
- make sure only non-null email addresses are added to emailAddressCache
- updated/changed copyright to Free Software Foundation
- added TODO to get rid of generateRandomUserName() business method is which
  deprecated anyway
- removed isPublicUserProfileEnabled()
- AdminBranchOfficeWebRequestBean is surely a request-scoped backing bean
- added to same bean properties for last house number and extension of branch
  office
- renamed bean field employeePersonalContact -> employeePersonalData
- fixed some leftovers from duplication of branch office controller for employees
- same with department bean
- used more MessageFormat.format() which prevents more String objects polluting
  both heaps
- injected feature backing bean into admin user bean
- added missing bean property for user's profile mode to same bean
- introduced private method createUserInstance() to same bean
- null-ed more fields in same bean in clear() method
- fixed imports of ContactUtils -> Contacts
- AdminHeadquarterWebRequestBean is surely a request-scoped backing bean
- added to same bean properties for last house number and extension of
  headquarter
- fixed some leftovers from duplication of branch office controller for headquarter

Signed-off-by: Roland Häder <roland@mxchange.org>
74 files changed:
src/java/org/mxchange/jfinancials/beans/BaseFinancialsBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestController.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/FinancialsAdminDepartmentWebRequestController.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/FinancialsAdminEmployeeWebRequestController.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/headquarter/FinancialsAdminHeadquarterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestController.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/FinancialsAdminContactWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestController.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/contact/phone/FinancialsAdminContactPhoneWebRequestController.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsContactPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/contact/phone/FinancialsContactPhoneWebRequestController.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestController.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/data/FinancialsDataWebApplicationBean.java
src/java/org/mxchange/jfinancials/beans/features/FinancialsFeatureWebApplicationBean.java
src/java/org/mxchange/jfinancials/beans/features/FinancialsFeaturesWebApplicationController.java
src/java/org/mxchange/jfinancials/beans/gender/FinancialsGenderWebApplicationBean.java
src/java/org/mxchange/jfinancials/beans/gender/FinancialsGenderWebApplicationController.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperController.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/FinancialsAdminMobileProviderWebRequestController.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/FinancialsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestController.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/profile/FinancialsUserProfileWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/confirmlink/FinancialsConfirmationLinkWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/email_address/FinancialsEmailChangeWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionController.java
src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/password/FinancialsUserPasswordWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestController.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestController.java

index 607a5b2ee2a2e1d9003d15969c36eccee8bf3880..a6f2829d5ae31eb9aff329b7dced426525279161 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index c0c3deba7423950190c84921ec213dd787c933ea..9becdef34a08e6d03a82785853fc4432d20dd1d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 52f84e52ad972bb8ad801b1eeafd6d6644d9d0ce..e0441b016888c2345366fd8a5dfecd5e4d123262 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 1de8415c9b46d8a0685a3d60a256981a07b8c571..230195e6c2668faba14bd2b339a1cbde9cbc4f1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -461,6 +461,15 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
 
        @Override
        public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Validate parameter
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
                // Default is not found
                boolean isFound = false;
 
index 5b28f52d48d18116f19e2d4d7b652aa215c1feb3..8822ce0ca9e6b3b9caebc6d01d9e8e472fc51c82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 99493c2329d79bd137654e6ac2a34f9f9e15b5e9..32e6fa40aef1058582ef90364f56f9c2570a1f94 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -21,7 +21,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 import javax.ejb.EJB;
-import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.inject.Inject;
@@ -52,7 +52,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("adminBranchOfficeController")
-@SessionScoped
+@RequestScoped
 public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBranchOfficeWebRequestController {
 
        /**
@@ -101,6 +101,16 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
         */
        private Short branchHouseNumber;
 
+       /**
+        * House number's extension (a,b,c,...)
+        */
+       private String branchHouseNumberExtension;
+
+       /**
+        * Last house number
+        */
+       private Short branchLastHouseNumber;
+
        /**
         * Number of branch office
         */
@@ -119,6 +129,11 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
        @Inject
        private FinancialsBranchOfficeWebRequestController branchOfficeController;
 
+       /**
+        * Owner/leader of branch office
+        */
+       private Employable branchOwner;
+
        /**
         * Store
         */
@@ -393,6 +408,42 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
                this.branchHouseNumber = branchHouseNumber;
        }
 
+       /**
+        * Getter for house number's extension
+        * <p>
+        * @return House number's extension
+        */
+       public String getBranchHouseNumberExtension () {
+               return this.branchHouseNumberExtension;
+       }
+
+       /**
+        * Setter for house number's extension
+        * <p>
+        * @param branchHouseNumberExtension House number's extension
+        */
+       public void setBranchHouseNumberExtension (final String branchHouseNumberExtension) {
+               this.branchHouseNumberExtension = branchHouseNumberExtension;
+       }
+
+       /**
+        * Getter for last house number
+        * <p>
+        * @return Last house number
+        */
+       public Short getBranchLastHouseNumber () {
+               return this.branchLastHouseNumber;
+       }
+
+       /**
+        * Setter for last house number
+        * <p>
+        * @param branchLastHouseNumber Last house number
+        */
+       public void setBranchLastHouseNumber (final Short branchLastHouseNumber) {
+               this.branchLastHouseNumber = branchLastHouseNumber;
+       }
+
        /**
         * Getter for branch office number
         * <p>
@@ -431,6 +482,24 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
                FinancialsAdminBranchOfficeWebRequestBean.branchOpeningTimes = branchOpeningTimes;
        }
 
+       /**
+        * Getter for branch office contact person
+        * <p>
+        * @return Branch office contact person
+        */
+       public Employable getBranchOwner () {
+               return this.branchOwner;
+       }
+
+       /**
+        * Setter for branch office contact person
+        * <p>
+        * @param branchOwner Branch office contact person
+        */
+       public void setBranchOwner (final Employable branchOwner) {
+               this.branchOwner = branchOwner;
+       }
+
        /**
         * Getter for store
         * <p>
@@ -716,13 +785,26 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
                this.setBranchCountry(null);
                this.setBranchEmailAddress(null);
                this.setBranchHouseNumber(null);
+               this.setBranchHouseNumberExtension(null);
+               this.setBranchLastHouseNumber(null);
                this.setBranchNumber(null);
+               this.setBranchOwner(null);
                this.setBranchStore(null);
                this.setBranchStreet(null);
                this.setBranchSuiteNumber(null);
                this.setBranchUserOwner(null);
                this.setBranchZipCode(null);
-               this.setBranchOpeningTimes(null);
+
+               // Opening times list
+               this.setBranchOpeningTimes(new ArrayList<OpeningTime>(1));
+
+               // Fax and land-line number
+               this.setFaxAreaCode(null);
+               this.setFaxCountry(null);
+               this.setFaxNumber(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineCountry(null);
+               this.setLandLineNumber(null);
 
                // Extra-clear opening time
                this.clearOpeningTime();
@@ -753,7 +835,10 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea
                // Add all other fields, too
                branchOffice.setBranchContactEmployee(this.getBranchContactEmployee());
                branchOffice.setBranchEmailAddress(this.getBranchEmailAddress());
+               branchOffice.setBranchHouseNumberExtension(this.getBranchHouseNumberExtension());
+               branchOffice.setBranchLastHouseNumber(this.getBranchLastHouseNumber());
                branchOffice.setBranchNumber(this.getBranchNumber());
+               branchOffice.setBranchOwnerEmployee(this.getBranchOwner());
                branchOffice.setBranchStore(this.getBranchStore());
                branchOffice.setBranchSuiteNumber(this.getBranchSuiteNumber());
                branchOffice.setBranchUserOwner(this.getBranchUserOwner());
index 38d708973c99392026afa01ed8efbfa32315a660..a499c4034de64c5e8543f52cc0b826fdfa7cc4d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index d1590740cbe0b50886147dfe22fe0c8ee01c11d4..9a287b16d03a9fc2ae9312d902c1655ce274a7c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -204,6 +204,15 @@ public class FinancialsBranchOfficeWebRequestBean extends BaseFinancialsBean imp
 
        @Override
        public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Validate parameter
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
                // Default is not found
                boolean isFound = false;
 
index 31ac9d31ed33561fa93021dc94fbcade59460596..5cc185fc17fcff7ff47e503dddd8627a4231fab1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 5d981d2540b1b43b2ad7f796556c17a972036b52..237b24f3c536099e0cb4febbdcaf17554a5c815e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -122,7 +122,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean
                // Is the department not created yet?
                if (this.isDepartmentCreatedByRequiredData(department)) {
                        // Then show proper faces message
-                       this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N
+                       this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N
                        return ""; //NOI18N
                }
 
index f960f39b2c1c58a767d9c78ab96ed4e133e8532f..f1755688cb0369f832da1663bae8b57f08e85c49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index d308404f2cc9a1c9de561eefa8a407893a3d6da5..5ecc8dcea2e17469f49e579bebf4eee8060f1bbb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 0825c3a6b10a1a37dd95f271c9066c805b4133fc..023e61c9533edb4102cee16c5fca2fe885483f67 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 8e33098aa0a739fc34df1fd6fa71a0414a6c4012..a463c3b958bdc5f3b985cb8f73b18fd67a4c5a39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 RRoland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -107,7 +107,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
        /**
         * Assigned personal data of the employee
         */
-       private Contact employeePersonalContact;
+       private Contact employeePersonalData;
 
        /**
         * Employee's phone extension (on top of a "main number")
@@ -163,7 +163,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
                        updatedOffice = this.adminEmployeeBean.addEmployee(employee);
                } catch (final EmployeeAlreadyAddedException ex) {
                        // Output message
-                       this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N
+                       this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -290,17 +290,17 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
         * <p>
         * @return Employee's personal contact data
         */
-       public Contact getEmployeePersonalContact () {
-               return this.employeePersonalContact;
+       public Contact getEmployeePersonalData () {
+               return this.employeePersonalData;
        }
 
        /**
         * Setter for employee's personal contact data
         * <p>
-        * @param employeePersonalContact Employee's personal contact data
+        * @param employeePersonalData Employee's personal contact data
         */
-       public void setEmployeePersonalContact (final Contact employeePersonalContact) {
-               this.employeePersonalContact = employeePersonalContact;
+       public void setEmployeePersonalData (final Contact employeePersonalData) {
+               this.employeePersonalData = employeePersonalData;
        }
 
        /**
@@ -385,7 +385,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
                this.setEmployeeDepartment(null);
                this.setEmployeeEmailAddress(null);
                this.setEmployeeHeadquarter(null);
-               this.setEmployeePersonalContact(null);
+               this.setEmployeePersonalData(null);
                this.setEmployeePhoneExtension(null);
                this.setEmployeeNumber(null);
                this.setEmployeeUserOwner(null);
@@ -398,7 +398,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im
         */
        private Employable createEmployee () {
                // Init instance
-               final Employable employee = new BusinessEmployee(this.getEmployeeCompany(), this.getEmployeeNumber(), this.getEmployeePersonalContact());
+               final Employable employee = new BusinessEmployee(this.getEmployeeCompany(), this.getEmployeeNumber(), this.getEmployeePersonalData());
 
                // Set all othewr data
                employee.setEmployeeBranchOffice(this.getEmployeeBranchOffice());
index 75d1f5a8a0cfd83667c4e3ac158dea62d2e0d8ee..e2a1a424d150739da3ee7066f699f7acc017f6b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index b4ec452fdea6ba89310855c082c83fbeca228e2c..e43bf182c9d69a3e564f2d62f5a77cc17ed4c590 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 RRoland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import javax.annotation.PostConstruct;
 import javax.cache.Cache;
 import javax.ejb.EJB;
@@ -123,7 +124,7 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
                        throw new NullPointerException("employeeId is null"); //NOI18N
                } else if (employeeId < 1) {
                        // Throw IAE
-                       throw new IllegalArgumentException("employeeId=" + employeeId + " is invalid"); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("employeeId={0} is invalid", employeeId)); //NOI18N
                } else if (!this.employeeCache.containsKey(employeeId)) {
                        // Not found
                        throw new EmployeeNotFoundException(employeeId);
@@ -142,7 +143,7 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
         * @return Filtered list of employees
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<Employable> getFilteredEmployees () { //NOI18N
+       public List<Employable> getFilteredEmployees () {
                return this.filteredEmployees;
        }
 
@@ -152,7 +153,7 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
         * @param filteredEmployees Filtered list of employees
         */
        @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredEmployees (final List<Employable> filteredEmployees) { //NOI18N
+       public void setFilteredEmployees (final List<Employable> filteredEmployees) {
                this.filteredEmployees = filteredEmployees;
        }
 
@@ -197,4 +198,32 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme
                }
        }
 
+       @Override
+       public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Validate parameter
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final Employable basicData : this.allEmployees()) {
+                       // Is email address used?
+                       if (Objects.equals(basicData.getEmployeeEmailAddress(), emailAddress)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
 }
index 59eb640ad22d80775a36ed5de27e0e54ca66512e..432f57da425399c982605cf695f7cedc1b06bc2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -28,6 +28,15 @@ import org.mxchange.jcontactsbusiness.model.employee.Employable;
  */
 public interface FinancialsEmployeeWebRequestController extends Serializable {
 
+       /**
+        * Validates if given email address is already in use by an employee
+        * <p>
+        * @param emailAddress Email address to be validated
+        * <p>
+        * @return Whether the email address is already used
+        */
+       Boolean isEmailAddressRegistered (final String emailAddress);
+
        /**
         * Returns a list of all company employees
         * <p>
index 994215aea820e97c3d6ebf2c256ffeef42ed5967..d69a8e639e8af92625d00f856b136c0f1214fa02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -21,7 +21,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 import javax.ejb.EJB;
-import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.inject.Inject;
@@ -51,7 +51,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("adminHeadquarterController")
-@SessionScoped
+@RequestScoped
 public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean implements FinancialsAdminHeadquarterWebRequestController {
 
        /**
@@ -97,6 +97,11 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
         */
        private String headquarterCity;
 
+       /**
+        * Headquarter's company name
+        */
+       private String headquarterCompanyName;
+
        /**
         * Contact person in headquarter
         */
@@ -123,6 +128,16 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
         */
        private Short headquarterHouseNumber;
 
+       /**
+        * House number's extension
+        */
+       private String headquarterHouseNumberExtension;
+
+       /**
+        * Last house number
+        */
+       private Short headquarterLastHouseNumber;
+
        /**
         * Store
         */
@@ -211,7 +226,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
                // Is the headquarter not created yet?
                if (this.isHeadquarterCreatedByRequiredData(headquarter)) {
                        // Then show proper faces message
-                       this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N
+                       this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -223,7 +238,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
                        updatedHeadquarter = this.adminHeadquarterBean.addHeadquarter(headquarter);
                } catch (final HeadquarterAlreadyAddedException ex) {
                        // Output message
-                       this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N
+                       this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N
                        return ""; //NOI18N
                }
 
@@ -234,7 +249,7 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
                this.clear();
 
                // Redirect to list
-               return "admin_list_headquarter_office"; //NOI18N
+               return "admin_list_headquarter"; //NOI18N
        }
 
        /**
@@ -346,6 +361,24 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
                this.headquarterCity = headquarterCity;
        }
 
+       /**
+        * Getter for headquarter's company name
+        * <p>
+        * @return Headquarter's company name
+        */
+       public String getHeadquarterCompanyName () {
+               return this.headquarterCompanyName;
+       }
+
+       /**
+        * Setter for headquarter's company name
+        * <p>
+        * @param headquarterCompanyName Headquarter's company name
+        */
+       public void setHeadquarterCompanyName (final String headquarterCompanyName) {
+               this.headquarterCompanyName = headquarterCompanyName;
+       }
+
        /**
         * Getter for headquarter contact person
         * <p>
@@ -418,6 +451,42 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
                this.headquarterHouseNumber = headquarterHouseNumber;
        }
 
+       /**
+        * Getter for house number's extension
+        * <p>
+        * @return House number's extension
+        */
+       public String getHeadquarterHouseNumberExtension () {
+               return this.headquarterHouseNumberExtension;
+       }
+
+       /**
+        * Setter for house number's extension
+        * <p>
+        * @param headquarterHouseNumberExtension House number's extension
+        */
+       public void setHeadquarterHouseNumberExtension (final String headquarterHouseNumberExtension) {
+               this.headquarterHouseNumberExtension = headquarterHouseNumberExtension;
+       }
+
+       /**
+        * Getter for last house number
+        * <p>
+        * @return Last house number
+        */
+       public Short getHeadquarterLastHouseNumber () {
+               return this.headquarterLastHouseNumber;
+       }
+
+       /**
+        * Setter for last house number
+        * <p>
+        * @param headquarterLastHouseNumber Last house number
+        */
+       public void setHeadquarterLastHouseNumber (final Short headquarterLastHouseNumber) {
+               this.headquarterLastHouseNumber = headquarterLastHouseNumber;
+       }
+
        /**
         * Getter for opening times of this headquarter
         * <p>
@@ -664,10 +733,13 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
        private void clear () {
                // Clear all headquarter data
                this.setHeadquarterCity(null);
+               this.setHeadquarterCompanyName(null);
                this.setHeadquarterContactEmployee(null);
                this.setHeadquarterCountry(null);
                this.setHeadquarterEmailAddress(null);
                this.setHeadquarterHouseNumber(null);
+               this.setHeadquarterHouseNumberExtension(null);
+               this.setHeadquarterLastHouseNumber(null);
                this.setHeadquarterStore(null);
                this.setHeadquarterStreet(null);
                this.setHeadquarterSuiteNumber(null);
@@ -699,11 +771,13 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean
         */
        private Headquarter createHeadquarter () {
                // Create new headquarter instance
-               final Headquarter headquarter = new BusinessHeadquarter(this.getHeadquarterCity(), this.getHeadquarterCountry(), this.getHeadquarterStreet(), this.getHeadquarterZipCode(), this.getHeadquarterHouseNumber());
+               final Headquarter headquarter = new BusinessHeadquarter(this.getHeadquarterCompanyName(), this.getHeadquarterCity(), this.getHeadquarterCountry(), this.getHeadquarterStreet(), this.getHeadquarterZipCode(), this.getHeadquarterHouseNumber());
 
                // Add all other fields, too
                headquarter.setHeadquarterContactEmployee(this.getHeadquarterContactEmployee());
                headquarter.setHeadquarterEmailAddress(this.getHeadquarterEmailAddress());
+               headquarter.setHeadquarterHouseNumberExtension(this.getHeadquarterHouseNumberExtension());
+               headquarter.setHeadquarterLastHouseNumber(this.getHeadquarterLastHouseNumber());
                headquarter.setHeadquarterStore(this.getHeadquarterStore());
                headquarter.setHeadquarterSuiteNumber(this.getHeadquarterSuiteNumber());
                headquarter.setHeadquarterUserOwner(this.getHeadquarterUserOwner());
index c5ffe143ae8e550547d4b1a57046b73bf221ba0e..57944e128b8d5c8c78e5277b9fbff1ff8a76c550 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 33612dc0d7c91841bce391c9fd7734848334b46a..fbbd45e941b740d546a96d6c4fd308b1f7f3a1fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -202,8 +202,45 @@ public class FinancialsHeadquarterWebRequestBean extends BaseFinancialsBean impl
                }
        }
 
+       @Override
+       public Boolean isCompanyNameUsed (final String companyName) {
+               // Validate parameter
+               if (null == companyName) {
+                       // Throw NPE
+                       throw new NullPointerException("companyName is null"); //NOI18N
+               } else if (companyName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("companyName is empty"); //NOI18N
+               }
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final Headquarter headquarter : this.allHeadquarter()) {
+                       // Is same company name?
+                       if (Objects.equals(headquarter.getHeadquarterCompanyName(), companyName)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
        @Override
        public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Validate parameter
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
                // Default is not found
                boolean isFound = false;
 
index e91c43720ddb9db6c93581996c5d91d8eefcf2a4..ab318fef7e94dec6f6d8997276026983f5c6a446 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -28,6 +28,15 @@ import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
  */
 public interface FinancialsHeadquarterWebRequestController extends Serializable {
 
+       /**
+        * 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);
+
        /**
         * Checks if given email address is already registered by an other
         * headquarter
index 85103d183f21ad35e83925153879ec031c58e875..203c17c1e68ddefa11150d317fb0cf15c37f5bbe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 168e2022f14a3c6e2434b218e21f895d7ba03625..43ae3757240cc736068dac003ab2929e92b882e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 7f0ef7c1a16ec4a4c6d1127d59bb3efbee988b8d..39611f61b8a17906ede41957ac993e1847b84832 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 5a5e060b6702afeb2505fb13db1589dbbd0abfa8..6b6013b10db58194be70ce464fa900cf7007c018 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 69d14feb784927684c1a5b9217bace8223caa752..5791012e1626310787026722e23a9cdd207bccf0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -36,7 +36,7 @@ import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.model.contact.ContactUtils;
+import org.mxchange.jcontacts.model.contact.Contacts;
 import org.mxchange.jcontacts.model.contact.UserContact;
 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
 import org.mxchange.jcountry.model.data.Country;
@@ -1116,7 +1116,7 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp
                        final Contact next = iterator.next();
 
                        // Is the same?
-                       if (ContactUtils.isSameContact(contact, next)) {
+                       if (Contacts.isSameContact(contact, next)) {
                                // Yes, then abort loop
                                IsFound = false;
                                break;
@@ -1158,13 +1158,13 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp
                contact.setContactCountry(this.getContactCountry());
 
                // Update contact's cmobile number
-               this.isMobileNumberUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
+               this.isMobileNumberUnlinked = Contacts.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               this.isLandLineUnlinked = Contacts.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
-               this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+               this.isFaxUnlinked = Contacts.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
        }
 
 }
index c1aafd8c22928ff55dfe6d17148a6268b57c48b0..963a1c31bafbcfe182b061d8c71f36d14477e9c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 0f00f682c76f7df0efc442548b65579149e519cf..35c5b6b1a8349d0d02d8c1a6ed818dfc730745b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -36,7 +36,7 @@ import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContac
 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;
+import org.mxchange.jcontacts.model.contact.Contacts;
 import org.mxchange.jcontacts.model.contact.UserContact;
 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
 import org.mxchange.jcountry.model.data.Country;
@@ -601,13 +601,13 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                contact.setContactCountry(this.getCountry());
 
                // Update contact's mobile number
-               this.isMobileUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
+               this.isMobileUnlinked = Contacts.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               this.isLandLineUnlinked = Contacts.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
-               this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+               this.isFaxUnlinked = Contacts.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Send it to the EJB
                this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
@@ -1057,7 +1057,12 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen
                        for (final Contact contact : contacts) {
                                // Add it to cache
                                this.contactCache.put(contact.getContactId(), contact);
-                               this.emailAddressCache.put(contact.getContactId(), contact.getContactEmailAddress());
+
+                               // Is email address given?
+                               if (contact.getContactEmailAddress() != null) {
+                                       // Set it, too
+                                       this.emailAddressCache.put(contact.getContactId(), contact.getContactEmailAddress());
+                               }
                        }
                } else if (this.selectableContactsCache.iterator().hasNext()) {
                        // Has already entries, avoid executing below code
index 2d486bf162ecc608b92a72eba47ddb178312a338..1758f7eb3447693541e7941525ef2449baa8068b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fe61c992bd5779e170efb932e562f8d54012d144..19927c1a987a7433142c1e518b78acc74edaeecf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 57b9add3b9019760fc0383bb7abf2bd9fad3e517..3f8f88590c7c92133d670d1e6bb77f241085cf96 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 24a3e32a2e5561fbf261a1b78d217d6a63b7c18a..455b7df0d498b28d591025dd59306eae5839a2e2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index f8233b315f5663076a2822926664c2888119f377..15e4e6861b277554cfa0242b4a1b72b6ef1697db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fcc196b4ed71e7ef3d3764636c2c368da8a18d1a..c9775bf45997ea7410f0c2b5b9962dba8260e76e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 768eacf85351b70cd4f9de156f86d33136d01157..42f82a4c6dd2cbcae3d89c450f7ed17bc77d4f75 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 9d3d76502f63c904d1eb9e3c724fc3256c48631b..bfa0098bfc9826460006d745d314c466ce00b940 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index de2e8724e63c9b4fd7edd64665ebd675d69743ba..050c3cb4f8babb0fd687addd7afdb5c18bd5b59a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 3b1853a2439a752f3783d6e74f3c74ca4be4d62f..6b5ae377936cb7bf5c1eed188f80d32726a91c05 100644 (file)
@@ -48,45 +48,45 @@ public class FinancialsDataWebApplicationBean extends BaseFinancialsBean {
        }
 
        /**
-        * Returns a list of all days of the week
+        * Returns an array of all days of the week
         * <p>
-        * @return A list of all days of the week
+        * @return An array of all days of the week
         */
        public DayOfTheWeek[] getDayOfTheWeek () {
                return DayOfTheWeek.values();
        }
 
        /**
-        * Returns a list of all payment types
+        * Returns an array of all payment types
         * <p>
-        * @return A list of all payment types
+        * @return An array of all payment types
         */
        public PaymentType[] getPaymentTypes () {
                return PaymentType.values();
        }
 
        /**
-        * Returns a list of all personal titles
+        * Returns an array of all personal titles
         * <p>
-        * @return A list of all personal titles
+        * @return An array of all personal titles
         */
        public PersonalTitle[] getPersonalTitles () {
                return PersonalTitle.values();
        }
 
        /**
-        * Returns a list of all profile modes <p
+        * Returns an array of all profile modes <p
         * <p>
-        * @return A list of all profile modes
+        * @return An array of all profile modes
         */
        public ProfileMode[] getProfileModes () {
                return ProfileMode.values();
        }
 
        /**
-        * Returns a list of all user account statuses
+        * Returns an array of all user account statuses
         * <p>
-        * @return A list of all user account statuses
+        * @return An array of all user account statuses
         */
        public UserAccountStatus[] getUserAccountStatuses () {
                return UserAccountStatus.values();
index fc5278d98d6ef2965693679bafbc0cb5e1029276..83a7ecadc40ecbd3472c48c29983c72d3f018e5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fa18edff2c77c649c271bcbdefd43c97d75faa8c..771a5aacbe5d3bcf8934d1e4965a1aa65850de25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 82f68f55fd43ffa7679d11e04c84fcd9612ca7aa..dc8ea6d081be2c7b5cfa34d8558f9a4afe0031e2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index ccf39c6691bd44991b9c06f9b5cfc97b1f5d28e6..0d4494bd3444f49d9f9dc908280d777a1ddc41a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index bae27edf8d58291d08f7fc7463e81a356ca97fb8..367f38ebeb53f860baf3d7bb714caf848f7d1618 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -26,6 +26,7 @@ import javax.inject.Named;
 import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent;
 import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
 import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
@@ -441,6 +442,39 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
                this.userCreatedEvent.fire(new CreatedUserEvent(this.getUser()));
        }
 
+       /**
+        * Renders data of basic company data
+        * <p>
+        * @param basicData Basic company data instance
+        * <p>
+        * @return Basic company data as string
+        */
+       public String renderBasicData (final BasicData basicData) {
+               // Default is empty string, so let's get started
+               final StringBuilder sb = new StringBuilder(30);
+
+               // Is basic company data set?
+               if (basicData instanceof BasicData) {
+                       // Add company name
+                       sb.append(basicData.getCompanyName()); //NOI18N
+
+                       // Is email address set?
+                       if (basicData.getCompanyEmailAddress() != null) {
+                               // Add it
+                               sb.append(", ").append(basicData.getCompanyEmailAddress()); //NOI18N
+                       }
+
+                       // Is tax number set?
+                       if (basicData.getCompanyTaxNumber() != null) {
+                               // Add it
+                               sb.append(", ").append(basicData.getCompanyTaxNumber()); //NOI18N
+                       }
+               }
+
+               // Return it
+               return sb.toString();
+       }
+
        /**
         * Returns the branch office's full address. If null is provided, an empty
         * string is returned.
@@ -455,6 +489,9 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
 
                // Is a branch office instance given?
                if (branchOffice instanceof BranchOffice) {
+                       // This should not happen:
+                       assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N
+
                        // Yes, then append all data
                        sb.append(branchOffice.getBranchCompany().getCompanyName());
                        sb.append(", "); //NOI18N
@@ -600,7 +637,7 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
         * returned.
         * <p>
         * @param headquarter Headquarter instance
- <p>
       * <p>
         * @return Headquarter address
         */
        public String renderHeadquarter (final Headquarter headquarter) {
index 48a8d03aa8e5c12cecd0e8dc69eb8b305abeaa87..4890ed6cc465dfd52c865dc5726b2857a6e0360c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 5d7c55fe9b967631520c6901753045c30dfa4c7a..4127e940930d2a3adc4c2acc8ad261a8d73fce7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index a273f8885277444a648e05a99b32bbdddee8ab44..f898239c0f22703799fe153bd3947785439e39db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index e48b4b6cf589b8993e41fa7c7c05774921361b2d..a023a82fe36cfcd30cbe47c9bcbef82f4d6ac98d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index f1b401c8db0290ed9906814a71a2d8915771dd81..c55308010513c491d6758b36378d3f83741ca071 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 40a0b196579b24086c6266d68f2deb7ae63c798e..a40c6c91b168901683f3f187b0dd5430f92c3435 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 778a8bf8552c3c75474c1cd551ce314f28c8056d..e88c4f2b3994ffc900fbb35b39c488eed4d27685 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index a7b21b768d2128be129d304ca5d60f513055b284..3731b3a215293fc32ae4c9a522aa4bd4ecb2fb58 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 6e03cdd2df2e8d08209ed22d5536f404fc948484..79cbec5400e7ab44b24191f779e95a1a88733da9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fe8d63597061b278e57e9c1643c051e83e09f479..8cd64781c04a6fe391b3ef09e64fe987c18701c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 194448c5801124d71410775ea92cb627f5720a7c..9983cf4d7e2f11481c896e6eb35def98058cffa5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index ee5c7f1b7153bdc13f1c6ab6df5d7e5c77db4954..45f7faf9f90f3e80437068a13d97dbd8abdb11bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 2639732a4e98738917fda26b1697694cd08df712..00101866da8fab5916d26933c571ae939841c524 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 3d5e7b5b4688602f54809324e30dc9d2ec55d543..64c40d0fce095df924897e63620d9c8059310b5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -34,6 +34,7 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsAdminContactWebRequestController;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
+import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -115,6 +116,12 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
        @Any
        private Event<ObservableAdminDeletedUserEvent> deleteUserEvent;
 
+       /**
+        * Features controller
+        */
+       @Inject
+       private FinancialsFeaturesWebApplicationController featureController;
+
        /**
         * An event fired when the administrator has updated a new user
         */
@@ -184,6 +191,11 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
         */
        private String userPasswordRepeat;
 
+       /**
+        * Whether the user wants a public profile
+        */
+       private ProfileMode userProfileMode;
+
        /**
         * Event being fired when administrator unlocks an account
         */
@@ -220,41 +232,11 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
                }
 
                // Create new user instance
-               final User newUser = new LoginUser();
-
-               // Set user name, CONFIRMED and INVISIBLE
-               newUser.setUserName(this.getUserName());
-               newUser.setUserMustChangePassword(this.getUserMustChangePassword());
-               newUser.setUserAccountStatus(UserAccountStatus.CONFIRMED);
-               newUser.setUserProfileMode(ProfileMode.INVISIBLE);
-
-               // Get locale from view-root
-               final Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-
-               // Copy user locale
-               newUser.setUserLocale(locale);
-
-               // Init instance
-               Contact userContact;
-
-               // Is a contact instance in helper set?
-               if (this.getContact() instanceof Contact) {
-                       // Then use it for contact linking
-                       userContact = this.getContact();
-               } else {
-                       // Create contact instance
-                       userContact = this.contactController.createContactInstance();
-               }
-
-               // Set contact in user
-               newUser.setUserContact(userContact);
-
-               // Init variable for password
-               String password = null;
+               final User newUser = this.createUserInstance();
 
                // Is the user name or email address used already?
                // @TODO Add password length check
-               if (this.userController.isUserNameRegistered(newUser)) {
+               if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userController.isUserNameRegistered(newUser))) {
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(newUser));
                } else if ((this.getContact() == null) && (this.contactController.isEmailAddressRegistered(newUser.getUserContact()))) {
@@ -267,24 +249,8 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
 
                        // Skip it
                        return ""; //NOI18N
-               } else if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) {
-                       // Empty password entered, then generate one
-                       password = UserLoginUtils.createRandomPassword(FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
-               } else if (!this.isSamePasswordEntered()) {
-                       // Both passwords don't match
-                       throw new FaceletException(new UserPasswordRepeatMismatchException(newUser));
-               } else {
-                       // Both match, so get it from this bean
-                       password = this.getUserPassword();
                }
 
-               // The password should not be null and at least 5 characters long
-               assert (password != null) : "password is null"; //NOI18N
-               assert (password.length() >= FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH) : "Password is not long enough."; //NOI18N
-
-               // Encrypt password and set it
-               newUser.setUserEncryptedPassword(UserLoginUtils.encryptPassword(password));
-
                try {
                        // Now, that all is set, call EJB
                        if (this.getContact() instanceof Contact) {
@@ -294,7 +260,7 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
                                // Fire event
                                this.userLinkedEvent.fire(new AdminLinkedUserEvent(updatedUser));
                        } else {
-                               // Add new contact
+                               // Add new user
                                final User updatedUser = this.adminUserBean.addUser(newUser);
 
                                // Fire event
@@ -624,6 +590,24 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
                this.userPasswordRepeat = userPasswordRepeat;
        }
 
+       /**
+        * Getter for user profile mode
+        * <p>
+        * @return User profile mode
+        */
+       public ProfileMode getUserProfileMode () {
+               return this.userProfileMode;
+       }
+
+       /**
+        * Setter for user profile mode
+        * <p>
+        * @param userProfileMode User profile mode
+        */
+       public void setUserProfileMode (final ProfileMode userProfileMode) {
+               this.userProfileMode = userProfileMode;
+       }
+
        /**
         * Locks selected user's account. This method makes sure that a lock reason
         * is provided that th user later can read on login attempts.
@@ -734,9 +718,65 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem
        private void clear () {
                // Clear all data
                this.setContact(null);
+               this.setUserDeleteReason(null);
+               this.setUser(null);
                this.setUserLockReason(null);
                this.setUserMustChangePassword(null);
                this.setUserName(null);
+               this.setUserPassword(null);
+               this.setUserPasswordRepeat(null);
+               this.setUserProfileMode(null);
+
+       }
+
+       /**
+        * Creates a new user instance from all currently saved data from this bean
+        * <p>
+        * @return New user instance
+        */
+       private User createUserInstance () {
+               // Init variable for password
+               String password = null;
+
+               // Init instance
+               final Contact userContact;
+
+               // Is a contact instance in helper set?
+               if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) {
+                       // Empty password entered, then generate one
+                       password = UserLoginUtils.createRandomPassword(FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
+               } else if (!this.isSamePasswordEntered()) {
+                       // Both passwords don't match
+                       throw new FaceletException(new UserPasswordRepeatMismatchException());
+               } else {
+                       // Both match, so get it from this bean
+                       password = this.getUserPassword();
+               }
+
+               // The password should not be null and at least 5 characters long
+               assert (password != null) : "password is null"; //NOI18N
+               assert (password.length() >= FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH) : "Password is not long enough."; //NOI18N
+
+               // Is contact instance given? Else create one
+               if (this.getContact() instanceof Contact) {
+                       // Then use it for contact linking
+                       userContact = this.getContact();
+               } else {
+                       // Create contact instance
+                       userContact = this.contactController.createContactInstance();
+               }
+
+               // Create new instance
+               final User newUser = new LoginUser(this.getUserName(), this.getUserProfileMode(), this.getUserMustChangePassword(), UserLoginUtils.encryptPassword(password), UserAccountStatus.CONFIRMED, userContact);
+
+               // Get locale from view-root
+               final Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
+
+               // Copy user locale
+               newUser.setUserLocale(locale);
+
+               // Return it
+               return newUser;
        }
 
        /**
index c3a5c90575aac351d5462e6b1d78b32ccae2cb57..b172363407ad400738bd8b31285af5725489d83f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index a0a776c0374946beb3018af0c0f3075362f522be..d8ee7baac4f2d6ed4f1c395ffd8a5448b88e7fdc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -609,14 +609,15 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                // Is user name required?
                if (!this.isUserNameRequired()) {
                        // Generate pseudo-random user name
-                       String randomName = this.userBean.generateRandomUserName();
+                       // @TODO Refacture this to avoid EJB call
+                       final String randomName = this.userBean.generateRandomUserName();
 
                        // Set it and inivisible profile
                        this.setUserName(randomName);
                        this.setUserProfileMode(ProfileMode.INVISIBLE);
 
                        // Generate random password
-                       String randomPassword = UserLoginUtils.createRandomPassword(FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
+                       final String randomPassword = UserLoginUtils.createRandomPassword(FinancialsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
 
                        // Set random password
                        this.setUserPassword(randomPassword);
@@ -938,24 +939,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
                return isFound;
        }
 
-       @Override
-       public boolean isPublicUserProfileEnabled () {
-               // Get context parameter
-               final String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_public_profile_enabled"); //NOI18N
-
-               // Is it set?
-               final boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
-
-               // This requires user names being enabled, too.
-               if ((isEnabled) && (!this.isUserNameRequired())) {
-                       // Not valid state, users must be able to modify their profile, especially when it is public
-                       throw new IllegalStateException("Public user profiles are enabled but user name requirement is disabled, this is not possible."); //NOI18N
-               }
-
-               // Return value
-               return isEnabled;
-       }
-
        @Override
        public boolean isRequiredChangePersonalDataSet () {
                return ((this.getUserProfileMode() != null) &&
index 16e49fab53d68abb6828cd34b9a6d57ec7a73e8d..ff244dd13f07b81dfe3eda3d384be5d3083f59d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -186,12 +186,4 @@ public interface FinancialsUserWebRequestController extends Serializable {
         */
        boolean isUserNameRequired ();
 
-       /**
-        * Checks wether public user profiles are enabled. This requires that user
-        * names are also enabled.
-        * <p>
-        * @return Whether public user profiles are enabled
-        */
-       boolean isPublicUserProfileEnabled ();
-
 }
index 62eaa504d2d2a085eb1280af1cefeaebeaff0b60..6fc8b771e139e79525a7ac293daa2e8fbd7f8874 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index a6ea444b682fe144662c90a32ca739931973220d..231f10db2677f5199a1102b45aa453eaf94763fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 5863b799facd2df113afc73b1d83629ffcfd4b26..f9612e37ace4430ff02dd918012574ef49abcacf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 054e116a5b22a3e576b062cfea377fd38c2d5b39..2f0cb2e328d470f9e86b4d20f88d8b8b8ff5790c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 2903b2378e34019ae8e0097230b8036c810956b3..0246577988b7cac858a768f5fb303ac87ceea6cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index c45224019bc16dc2b4b993cbacc9b3f7979f4e66..f9ea920a00db656a1efc5b9c67aae204f1d045c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index e98d925327d7501c9d503a2f6a8c77848f40f6b6..cc4aac9684b11fabfdf0931b5f02c0a7f08f8eaf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 47873d15568eb5072293ed26a750443caf631eb0..1e0a6dbadee1cf8e9445337317d934fe82128574 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index c92a32a65fccc2245eab57fb41d4c9b503661d3d..eadd7ac96ac65b55beda025bfd1e11434b9d0fb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 87e915873bf014be232307cb3b3c24f27a300305..42c79fdcc1bc3203f5754a726e04c6bca31be120 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index ed6ceaaf91d7306053b4601ab6a7b8b782bc0e7a..15cd26d32457881e7d32a47619fca1780c6949ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index dcf5fdaa66b66d0b1698e2962cc56298996e8657..04a998504d9173ef4530eaef330bc383ffd4c87c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fdcf1e93393774703611475f9f5d9d31dae56c8f..883915ae2e25f8e153bf23edaf0a27f759ab957e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 4ad42c602a0115a3881652702187771bab4bb8d0..5fbcce7ff777ea5e40f6f311980bec86b99aacf5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as