]> git.mxchange.org Git - jjobs-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>
Sun, 21 Jul 2019 05:58:21 +0000 (07:58 +0200)
- 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/jjobs/beans/BaseJobsBean.java
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsBranchOfficeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsBranchOfficeWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/department/JobsDepartmentWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/department/JobsDepartmentWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebSessionController.java
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/opening_time/JobsOpeningTimeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/opening_time/JobsOpeningTimeWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestController.java
src/java/org/mxchange/jjobs/beans/data/JobsDataWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/features/JobsFeaturesWebApplicationController.java
src/java/org/mxchange/jjobs/beans/gender/JobsGenderWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/gender/JobsGenderWebApplicationController.java
src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java
src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java
src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java
src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionController.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestController.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/profile/JobsUserProfileWebRequestBean.java
src/java/org/mxchange/jjobs/beans/profile/JobsUserProfileWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestController.java

index 6c863e2ddfa37c54b6cf602eb84dba1cf50e1784..68dd4091119f98003bee97bb4254d9f1fb194d7d 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 ee1912d4575c2bba287dd213b76e523d8116bb58..db6428ed7929944420d729490a10e93c8617bf4c 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 371c0f87f101b33f0047ebc275728ef80ae15c8e..c3a9784a9ecf4238dad1d2a9f8f155eb459de93c 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 e2097dda9e5ec4178e19f33182cf9174dd7c9396..124244d95ad7ea894a7be458f93afc06c3a015ad 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 JobsBasicDataWebRequestBean extends BaseJobsBean implements JobsBas
 
        @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 056dc96907533f0fe14adf7874ae326a18049ca6..c801fbddf3b01f597a4076854c8f05a0dac632b9 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 c28d15c7df57d7af4db31821e1a0839c950b8523..f37c725befa238c69447f6e387605ef9cb77e4ee 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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements JobsAdminBranchOfficeWebRequestController {
 
        /**
@@ -101,6 +101,16 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
         */
        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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
        @Inject
        private JobsBranchOfficeWebRequestController branchOfficeController;
 
+       /**
+        * Owner/leader of branch office
+        */
+       private Employable branchOwner;
+
        /**
         * Store
         */
@@ -393,6 +408,42 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                JobsAdminBranchOfficeWebRequestBean.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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                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 JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                // 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 437663501b35f34fc48ed84c95046c032d8dee87..c817db445e0c0ec2120a7675761bc37153ff222a 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 26ec02e42c99e89cd4af24a8d5162694acce6973..f7fa0ea97118e6d0dc91ca4a159e363937bdb6cd 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 JobsBranchOfficeWebRequestBean extends BaseJobsBean implements Jobs
 
        @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 ad50bac0e95b81777d3046e84706f889852e08e4..2a60ccef4d4a362e5014ee707361a9314d1b2e32 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 cc8c41e78649d3421540e015b24bb6c7b0c38dd0..1431e179f1b055581554d7295875ab0636fde48c 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 JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
                // 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 5e9fe0911f5b762b9e27f2bc7ccdf5ce26250863..62458c8a4686199e42b2bfec828c6a3a63b85840 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 196b61421fa50e8e4b60a3da6db41116a43f4cb4..e57dac3b3ac6449b4836ef40b51400f2c7f651f1 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 896f28640ec5a111657fdaa2e84c4caacd93403e..8f68a8e24ac4b0b0185455d188d182400ae862fa 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 931c11660ca77456119524969b443369be65e078..384644484d49bda193581ba95b90cdbe3638af04 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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
        /**
         * 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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
                        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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
         * <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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
                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 JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
         */
        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 c8f55a7b4748c65567af812fe14ef128300dd8af..00a5932ac77256ba0275d322e06a197a48a70404 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 ef3409b68da3299f46f84b4be2fe4513f4dd451c..36e056aeac5e799a059262cde6dd0013e142284e 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 JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
                        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 JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
         * @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 JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
         * @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 JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
                }
        }
 
+       @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 1e8d42b3e598a7b2ccb16a7b53e839d08060a2e0..a11f0bd41f8d0dd6103ab87c00ec80df3342f193 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 JobsEmployeeWebRequestController 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 2d55dd3237462285d97603977ed5fa5148681462..5ccf6e3129430a23eab8e8d8444757a5d3ef94bc 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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements JobsAdminHeadquarterWebRequestController {
 
        /**
@@ -97,6 +97,11 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
         */
        private String headquarterCity;
 
+       /**
+        * Headquarter's company name
+        */
+       private String headquarterCompanyName;
+
        /**
         * Contact person in headquarter
         */
@@ -123,6 +128,16 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
         */
        private Short headquarterHouseNumber;
 
+       /**
+        * House number's extension
+        */
+       private String headquarterHouseNumberExtension;
+
+       /**
+        * Last house number
+        */
+       private Short headquarterLastHouseNumber;
+
        /**
         * Store
         */
@@ -211,7 +226,7 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
                // 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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
                        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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
                this.clear();
 
                // Redirect to list
-               return "admin_list_headquarter_office"; //NOI18N
+               return "admin_list_headquarter"; //NOI18N
        }
 
        /**
@@ -346,6 +361,24 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
                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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
                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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
        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 JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements
         */
        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 f4e91336da331080f65d1b7b46fc00957b2c64ee..b918af26185a1935900a2b0593867f22b9a0016a 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 892c951e98fcdde1fa6810bdf703203877e1cb67..ac6abea73826f2abbfe4e55793b098e76c42b8da 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 JobsHeadquarterWebRequestBean extends BaseJobsBean implements JobsH
                }
        }
 
+       @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 9d65fbad69c4028c66783950d0207405af705631..ae7afd7d8b2f487a21ae45820e896a211407c692 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 JobsHeadquarterWebRequestController 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 7d29fe842f610754b0c105d9e4c2d20dbe565763..7e9976c1bd8d85796a20bd79299503519d510e7d 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 2d18e151eaadb73acd71f33c7417e5074238b760..f3de43d67fd567f4ff0a6df39153b8b7486ac2ec 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 55a3cd5a98ccda914f2ac604b0d791d5e66db9d8..5010e67fbed381f1d407c58c8f4faa5818185f1e 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 f13d8209bac64b05058cec04198338a56eb3e507..e0de25c73dcb8dc860fa9689cc979ab9c8806f0b 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 4b28be06592a0d19b9cc3e370c1a4c5829c9acf4..7ea8c86b6fc12d83e89db826687fb69233f63799 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 JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs
                        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 JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs
                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 20ebac458a8ff619ffffabf022a6926903050721..6c6ca87ce271d67783ef3129fa60bd845b92010c 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 35ae96aac60ecc18865029b560187f1599cdd7a0..d6a58e07396e509c3858b291ae1eb283676b26c6 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 JobsContactWebRequestBean extends BaseJobsBean implements JobsConta
                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 JobsContactWebRequestBean extends BaseJobsBean implements JobsConta
                        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 f31b1f2fd6c1867229a7b0b965162c4c34128ef4..fae16169e7e66f574f6b3374b04367e35628ae21 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 70f713920b052a0f7d5d7827628135f1b75aeb3b..fada1d5b638f5454212391aa0e37865519202fb3 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 5e598b86c08448c175eaf62a9e63c41ebb504025..853974a777c2d1eb5940a53ad6dce9a60413407f 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 14647f8d6ac6fefc4b1929a145d3d82426db4813..a0a34128fb228d6ad4ab4de628433cdac1baa512 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 99ae852ac3f0335a9d4d1a6cc193494db4ac77a8..ae95149e65a96f27af6bd0bee623da1e4ab69e40 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 698e52834e8cf22bb868ca68d933dac89a9ca7bc..1f97a96820db1ee3a53b6da777d0a4846dd6c75b 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 21d02d1f5d7eba3be9832ad40a6f56a8759aef4f..b2a04a590ff8ddd13f0c16b31e58e2d057c8ccf7 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 5a7acef542548ee66979c444b796b1a7082c3da9..a60f9d2c859057dfe18a9c214731aa33bfa7f427 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 db908dfad1cae719017cf56c15e0e04c808bc7cf..d04ad37e47485806c3c3da2946ed0a076d13009f 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 93cb98410dc2a56aad8d6a3eca9bd9569b43a54b..6e29c400eb520739d8be04b61fe102b38f18495f 100644 (file)
@@ -48,45 +48,45 @@ public class JobsDataWebApplicationBean extends BaseJobsBean {
        }
 
        /**
-        * 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 2e63d0137d5ec1ff6eea2f25969acc04827137d8..81dab2edc4298204985bacb197551be784886920 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 5afb23145196526d21a095901c1c1720aeb00179..90c44b4d33cbea665f302c3225a8b0fdc32f1279 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 4d028c3b7b710e2f347a6a2afdd7bbb26eaf7ee2..4b692aa87e97ac80a82501b319738b84eb79556b 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 9188b321effc2b3c9810fadf02bbcf9292d56967..1363767986058c993b868aa5df075966298e3ecc 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 5bc0b0fcf968cfe5d6606663eb6ef433c1d73c49..15dccd049bf1aa4041fbfae07b7268c2c859ab09 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
@@ -25,6 +25,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;
@@ -440,6 +441,39 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq
                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.
@@ -454,6 +488,9 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq
 
                // 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
index 3fd3b517a5de54333d14d4779b3812294a2c04f5..48ecaf37b3093ad936e5fae9b68c8d8edd97ee04 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 132ec1cba50794d6c922bc9c335f9e40f2deb11c..cc698199c0decb4402a9259c4540ec325a5aa140 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 5abf20e4581f2ab5db4962852a6b84a8fdf0e5cb..517a2ce0a2c4db51ee956d5f3e2c9c9e6111bdfb 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 b0b5f4062a94fbb71943454cf42f9a8e41a9e4e9..578b05b3758a72d933199ac1f2627d8afc9109c8 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 5535088d36f441a8d5483a01a5250baf70f5ce90..8177b8dcf03ddde19f80c3a638a8a41594e116cc 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 ee4630163fce54ef80978e8bb1303fb9c61d017c..f02d24aa8417d5cf49ac54d98bd2f5fe287308ca 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 0b5ff1eb9679be68808551ce51096d515f8de8fb..d00da4bd645d62af650d575a6d71e4f866e227e2 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 0a521a0e6dc6e3ff7f9a7107dae4f81f6acbfa65..b83666a304085740c2bcd45c2f6b7c9d316303fb 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 8e22d2d041fe34be4a2f1b57fdd6120441a44921..9392e14d08376f861a7af12bd4b41a5f56fd4077 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 dcb2ed6c5c28346b807efae75b549ad6e3010bf4..316f2ae94afbb7b8abd51e3d5ccf6c29ac1cd477 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 acca9a3a924e0b4d0027b51fc89738651fc7b817..fd860aa2ffb0b699ba68d98b482114c55e170c8f 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 9c2fcfb75e760f9bf0ca16c0c7ee7452a6da0e64..0b93f40cffe2c0208e55cf3788b7a38bdf7c9685 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 0173ce637af570dea82c31b9123940ffd4cad2d7..b2b46b982576ee684bf6a50b83c719baa460b86b 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 39db1e8dd492ce4250700231b42d071f6ff37549..faeba8eed0665c6fc7474143d082d787855278a3 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.jjobs.beans.BaseJobsBean;
 import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
+import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
@@ -116,10 +117,10 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
        private Event<ObservableAdminDeletedUserEvent> deleteUserEvent;
 
        /**
-        * Localization controller
+        * Features controller
         */
        @Inject
-       private JobsLocalizationSessionController localizationController;
+       private JobsFeaturesWebApplicationController featureController;
 
        /**
         * An event fired when the administrator has updated a new user
@@ -190,6 +191,11 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
         */
        private String userPasswordRepeat;
 
+       /**
+        * Whether the user wants a public profile
+        */
+       private ProfileMode userProfileMode;
+
        /**
         * Event being fired when administrator unlocks an account
         */
@@ -226,41 +232,11 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
                }
 
                // 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()))) {
@@ -273,24 +249,8 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
 
                        // 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(JobsUserWebRequestController.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() >= JobsUserWebRequestController.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) {
@@ -300,7 +260,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
                                // Fire event
                                this.userLinkedEvent.fire(new AdminLinkedUserEvent(updatedUser));
                        } else {
-                               // Add new contact
+                               // Add new user
                                final User updatedUser = this.adminUserBean.addUser(newUser);
 
                                // Fire event
@@ -630,6 +590,24 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
                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.
@@ -740,9 +718,65 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm
        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(JobsUserWebRequestController.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() >= JobsUserWebRequestController.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 3674d192ca5385450c1f1b5d4bf9a07444a5b442..458b7fac564a19800bb210501b1ad1370efb4399 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 d587679622864085b22144da0252e20261e1f6e4..fb9721e8cde9077ad0a4a363ca6c113f474ef1a4 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 JobsUserWebRequestBean extends BaseJobsBean implements JobsUserWebR
                // 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(JobsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
+                       final String randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebRequestController.MINIMUM_PASSWORD_LENGTH);
 
                        // Set random password
                        this.setUserPassword(randomPassword);
@@ -938,24 +939,6 @@ public class JobsUserWebRequestBean extends BaseJobsBean implements JobsUserWebR
                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 dc1b1f461039ce76876ea8b308e95308b51aa122..3a421c403e864633d8fbc155da655b5af34f6485 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 JobsUserWebRequestController 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 a5d6e377224a81eac4ca02f7298b2584e0999217..bb3429146955a6f3162586797626ec8a9f6ba1fd 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 4e4837cddcca852998ba06fb5b368e567984bfcb..29f94c1519d9b23227f35557aac54987bb826e4a 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 cb9943de88e8b33cd400f5ffdf86aa4121667a93..0fee5aef260bbb2d9b09b658edfcb28e746ca1d9 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 7d621901f2ef58c080f2176c613c210f9c00ac3e..959ffa815abaa057b0201d420072e201557f5afb 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 3ccd41535fec3698c92f538c5e3df7cfc7992abe..47ba864397066ad2055e20ef1f4335201eabee74 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 f31fda049c96caa8293f6ea6af7f0da4e3cbc6ee..68a76507a52842d3742995bc00a9583404447985 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 4255d4f8cc38d9e7c74f7ef3f62975e964e22e16..256ce8131cad4d0b3049784afb2a5c914b33ea1d 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 d76afcc724c3c713a5370e4ffe990d7a846af0ae..84964e9db2e50283edbaa8bce8fbb9c574ae59b9 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 72c5ffb4f77c442a72e81b95a894104b3383f408..cb71066dfbb4bc76a3476ca1177e5bf1fef44311 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 57680e7d4eb471451c4981f2d7d762c7799bf353..70a2c51a4b1b5f450bf29d50f43613adefb3d632 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 3bdf7f5ec127469db303bf75632632ac4ddd93dc..e1afa115226842cac9433d90a3afb3a2aef294a9 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 2dad7c6b35bbca054f4aef41f1257d9106df11a9..bfade8119814f8c8b8b39e7f2ad6cd8534383534 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 5b4d7ad3c20e2a22d302f53ac8b2bacf08cfb413..643c51edb705e70e042e68dc8e5cd92c684758a8 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 134fd1750a1907db949d602f7959797952820b0d..30c3c097035a2d83589799ed0ef83c97385fc99f 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