]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 3 Nov 2017 23:56:18 +0000 (00:56 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 21 Jul 2019 05:47:10 +0000 (07:47 +0200)
- removed company from "basic_company_data" (and class names) as there will be
  no other basic data
- added view for headquarter listing (administrative)
- used more beanHelper's renderFoo(foo) methods as this is much easier to debug
- renamed ADMIN_SHOW_PHONE_NUMBER to ADMIN_SHOW_<FAX|LAND_LINE|MOBILE>_NUMBER
- added menu for headquarters (administrative)
- added custom JSF tag for administrative "mini-links" for headquarters
- added templates for form and opening times of headquarters
- fixed employee link outcomes, was copy-paste mistake (ops)
- renamed more headquarters -> headquarter
- addEmployee() is now "basically finished"
- changed h:outputLink to p:link which suits better here
- added missing navigation rules for headquarters/employees
- isCompanyNameUsed() and isEmailAddressRegistered() should be "basically
  finished"
- still one isEmailAddressRegistered() is left in generic contactController
- first value, then variable on comparison (null == someVariable)
- lot's more fixes/improvements I cannot remember ...

Signed-off-by: Roland Häder <roland@mxchange.org>
64 files changed:
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestBean.java [deleted file]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestController.java [deleted file]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java [deleted file]
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestController.java [deleted file]
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.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/employee/JobsAdminCompanyEmployeeWebRequestBean.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 [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java
src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java
src/java/org/mxchange/jjobs/converter/business/branchoffice/JobsBranchOfficeConverter.java
src/java/org/mxchange/jjobs/converter/business/department/JobsCompanyDepartmentConverter.java
src/java/org/mxchange/jjobs/converter/business/employee/JobsEmployeeConverter.java
src/java/org/mxchange/jjobs/converter/business/headquarter/JobsHeadquarterConverter.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/converter/business/opening_time/JobsCompanyOpeningTimeConverter.java
src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java
src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java
src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java
src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java
src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java
src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java
src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java
src/java/org/mxchange/jjobs/validator/business/basicdata/JobsCompanyNameValidator.java
src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java
src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java
src/java/org/mxchange/localization/generic_de_DE.properties
src/java/org/mxchange/localization/generic_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/links.jsf.taglib.xml
web/WEB-INF/resources/tags/admin/links/mini/employee/admin_employee_links.tpl
web/WEB-INF/resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/admin_menu.tpl
web/WEB-INF/templates/admin/basic_company_data/admin_form_basic_company_data.tpl [deleted file]
web/WEB-INF/templates/admin/basic_data/admin_form_basic_data.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl
web/WEB-INF/templates/admin/branch_office/admin_form_branch_opening_time.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl [deleted file]
web/WEB-INF/templates/admin/department/admin_form_department_data.tpl
web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl
web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_opening_time.tpl [new file with mode: 0644]
web/WEB-INF/web.xml
web/admin/basic_company_data/admin_basic_company_data_list.xhtml [deleted file]
web/admin/basic_data/admin_basic_data_list.xhtml [new file with mode: 0644]
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/employee/admin_employee_list.xhtml
web/admin/fax/admin_fax_list.xhtml
web/admin/headquarter/admin_headquarter_list.xhtml [new file with mode: 0644]
web/admin/landline/admin_landline_list.xhtml

diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java
new file mode 100644 (file)
index 0000000..ee1912d
--- /dev/null
@@ -0,0 +1,514 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.basicdata;
+
+import javax.ejb.EJB;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.faces.FacesException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.basicdata.added.AdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An administrative business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminBasicCompanyDataController")
+@RequestScoped
+public class JobsAdminBasicDataWebRequestBean extends BaseJobsBean implements JobsAdminBasicDataWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 56_189_028_928_374L;
+
+       /**
+        * EJB for administrative purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/adminBasicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote")
+       private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
+
+       /**
+        * An event being fired when basic business data has been added
+        */
+       @Inject
+       @Any
+       private Event<ObservableAdminAddedBusinessBasicDataEvent> businessDataAddedEvent;
+
+       /**
+        * Comments for this company
+        */
+       private String companyComments;
+
+       /**
+        * An employee as contact person with this company
+        */
+       private Employable companyContactEmployee;
+
+       /**
+        * Companies (main) email address (example: info@company.example)
+        */
+       private String companyEmailAddress;
+
+       /**
+        * Company founder
+        */
+       private Employable companyFounder;
+
+       /**
+        * Headquarter data for this company
+        */
+       private Headquarter companyHeadQuarter;
+
+       /**
+        * Company name
+        */
+       private String companyName;
+
+       /**
+        * Tax number
+        */
+       private String companyTaxNumber;
+
+       /**
+        * Owning user instance (which this company is assigned to)
+        */
+       private User companyUserOwner;
+
+       /**
+        * Web site URL
+        */
+       private String companyWebsiteUrl;
+
+       /**
+        * Area code for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Dial number for fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * Area code for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Dial number for land-line number
+        */
+       private Long landLineNumber;
+
+       /**
+        * Default constructor
+        */
+       public JobsAdminBasicDataWebRequestBean () {
+               // Call super constructor
+               super();
+       }
+
+       /**
+        * Adds a basic business data entry, if not yet found.
+        * <p>
+        * @return Redirect outcome
+        */
+       public String addBusinessBasicData () {
+               // First, validate all parameter
+               if (this.getCompanyName() == null) {
+                       // Is null
+                       throw new NullPointerException("this.companyName is null"); //NOI18N
+               } else if (this.getCompanyName().isEmpty()) {
+                       // Is null
+                       throw new IllegalArgumentException("this.companyName is empty"); //NOI18N
+               }
+
+               // Prepare entity
+               BasicData basicData = new BusinessBasicData(this.getCompanyName());
+
+               // Set all opther remaining data
+               basicData.setCompanyComments(this.getCompanyComments());
+               basicData.setCompanyContactEmployee(this.getCompanyContactEmployee());
+               basicData.setCompanyEmailAddress(this.getCompanyEmailAddress());
+               basicData.setCompanyFounder(this.getCompanyFounder());
+               basicData.setCompanyHeadquarterData(this.getCompanyHeadQuarter());
+               basicData.setCompanyTaxNumber(this.getCompanyTaxNumber());
+               basicData.setCompanyUserOwner(this.getCompanyUserOwner());
+               basicData.setCompanyWebsiteUrl(this.getCompanyWebsiteUrl());
+
+               // Set logo instance
+               // @TODO basicData.setCompanyLogo();
+               // Generate phone number
+               DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+
+               // Don't set null or wrong references
+               if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
+                       // Now the number must be given
+                       if (landLine.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
+                       } else if (landLine.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (landLine.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
+                       } else if (landLine.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
+                       }
+
+                       // Set phone number
+                       basicData.setCompanyLandLineNumber(landLine);
+               }
+
+               // Don't set null or wrong references
+               if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
+                       // Now the number must be given
+                       if (fax.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
+                       } else if (fax.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (fax.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
+                       } else if (fax.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
+                       }
+
+                       // Set fax number
+                       basicData.setCompanyFaxNumber(fax);
+               }
+
+               // Now try to send to EJB and get an updated version back
+               try {
+                       // Try it
+                       final BasicData updatedBasicData = this.adminBasicCompanyDataBean.addBusinessBasicData(basicData);
+
+                       // Fire event
+                       this.businessDataAddedEvent.fire(new AdminAddedBusinessBasicDataEvent(updatedBasicData));
+               } catch (final BasicDataAlreadyAddedException e) {
+                       // Does already exist
+                       throw new FacesException(e);
+               }
+
+               // Continue to list again
+               return "admin_list_basic_data"; //NOI18N
+       }
+
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
+
+       /**
+        * Setter for comments
+        * <p>
+        * @param companyComments Comments
+        */
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
+       }
+
+       /**
+        * Getter for employee as contact person
+        * <p>
+        * @return Employable as contact person
+        */
+       public Employable getCompanyContactEmployee () {
+               return this.companyContactEmployee;
+       }
+
+       /**
+        * Setter for employee as contact person
+        * <p>
+        * @param companyContactEmployee Employable as contact person
+        */
+       public void setCompanyContactEmployee (final Employable companyContactEmployee) {
+               this.companyContactEmployee = companyContactEmployee;
+       }
+
+       /**
+        * Getter for company's (main) email address
+        * <p>
+        * @return Company's (main) email address
+        */
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
+
+       /**
+        * Setter for company's (main) email address
+        * <p>
+        * @param companyEmailAddress Company's (main) email address
+        */
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
+
+       /**
+        * Getter for company founder
+        * <p>
+        * @return Company founder
+        */
+       public Employable getCompanyFounder () {
+               return this.companyFounder;
+       }
+
+       /**
+        * Setter for company founder
+        * <p>
+        * @param companyFounder Company founder
+        */
+       public void setCompanyFounder (final Employable companyFounder) {
+               this.companyFounder = companyFounder;
+       }
+
+       /**
+        * Getter for headquarter data
+        * <p>
+        * @return Headquarter data
+        */
+       public Headquarter getCompanyHeadQuarter () {
+               return this.companyHeadQuarter;
+       }
+
+       /**
+        * Setter for headquarter data
+        * <p>
+        * @param companyHeadQuarter Headquarter data
+        */
+       public void setCompanyHeadQuarter (final Headquarter companyHeadQuarter) {
+               this.companyHeadQuarter = companyHeadQuarter;
+       }
+
+       /**
+        * Getter for company name
+        * <p>
+        * @return Company name
+        */
+       public String getCompanyName () {
+               return this.companyName;
+       }
+
+       /**
+        * Setter for company name
+        * <p>
+        * @param companyName Company name
+        */
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
+       }
+
+       /**
+        * Getter for company tax number
+        * <p>
+        * @return Company tax number
+        */
+       public String getCompanyTaxNumber () {
+               return this.companyTaxNumber;
+       }
+
+       /**
+        * Setter for company tax number
+        * <p>
+        * @param companyTaxNumber Company tax number
+        */
+       public void setCompanyTaxNumber (final String companyTaxNumber) {
+               this.companyTaxNumber = companyTaxNumber;
+       }
+
+       /**
+        * Getter for owning user instance
+        * <p>
+        * @return Owning user instance
+        */
+       public User getCompanyUserOwner () {
+               return this.companyUserOwner;
+       }
+
+       /**
+        * Setter for owning user instance
+        * <p>
+        * @param companyUserOwner Owning user instance
+        */
+       public void setCompanyUserOwner (final User companyUserOwner) {
+               this.companyUserOwner = companyUserOwner;
+       }
+
+       /**
+        * Getter for company web site URL
+        * <p>
+        * @return Company web site URL
+        */
+       public String getCompanyWebsiteUrl () {
+               return this.companyWebsiteUrl;
+       }
+
+       /**
+        * Getter for company web site URL
+        * <p>
+        * @param companyWebsiteUrl Company web site URL
+        */
+       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
+               this.companyWebsiteUrl = companyWebsiteUrl;
+       }
+
+       /**
+        * Getter for fax number's area code
+        * <p>
+        * @return Fax number's area code
+        */
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
+       }
+
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax's country instance
+        * <p>
+        * @param faxCountry Fax' country instance
+        */
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
+       }
+
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line number's area code
+        * <p>
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line number's country instance
+        * <p>
+        * @param landLineCountry Land-line number's country instance
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestController.java
new file mode 100644 (file)
index 0000000..371c0f8
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.basicdata;
+
+import java.io.Serializable;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsAdminBasicDataWebRequestController extends Serializable {
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestBean.java
deleted file mode 100644 (file)
index 542a1ed..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.business.basicdata;
-
-import javax.ejb.EJB;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-import javax.faces.FacesException;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.basicdata.added.AdminAddedBusinessBasicDataEvent;
-import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
-import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * An administrative business contact bean (controller)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("adminBasicCompanyDataController")
-@RequestScoped
-public class JobsAdminBusinessDataWebRequestBean extends BaseJobsBean implements JobsAdminBusinessDataWebRequestController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 56_189_028_928_374L;
-
-       /**
-        * EJB for administrative purposes
-        */
-       @EJB (lookup = "java:global/jjobs-ejb/adminBasicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote")
-       private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
-
-       /**
-        * An event being fired when basic business data has been added
-        */
-       @Inject
-       @Any
-       private Event<ObservableAdminAddedBusinessBasicDataEvent> businessDataAddedEvent;
-
-       /**
-        * Comments for this company
-        */
-       private String companyComments;
-
-       /**
-        * An employee as contact person with this company
-        */
-       private Employable companyContactEmployee;
-
-       /**
-        * Companies (main) email address (example: info@company.example)
-        */
-       private String companyEmailAddress;
-
-       /**
-        * Company founder
-        */
-       private Employable companyFounder;
-
-       /**
-        * Head quarter data for this company
-        */
-       private HeadquartersData companyHeadQuarters;
-
-       /**
-        * Company name
-        */
-       private String companyName;
-
-       /**
-        * Tax number
-        */
-       private String companyTaxNumber;
-
-       /**
-        * Owning user instance (which this company is assigned to)
-        */
-       private User companyUserOwner;
-
-       /**
-        * Web site URL
-        */
-       private String companyWebsiteUrl;
-
-       /**
-        * Area code for fax number
-        */
-       private Integer faxAreaCode;
-
-       /**
-        * Country for fax number
-        */
-       private Country faxCountry;
-
-       /**
-        * Dial number for fax number
-        */
-       private Long faxNumber;
-
-       /**
-        * Area code for land-line number
-        */
-       private Integer landLineAreaCode;
-
-       /**
-        * Country for land-line number
-        */
-       private Country landLineCountry;
-
-       /**
-        * Dial number for land-line number
-        */
-       private Long landLineNumber;
-
-       /**
-        * Default constructor
-        */
-       public JobsAdminBusinessDataWebRequestBean () {
-               // Call super constructor
-               super();
-       }
-
-       /**
-        * Adds a basic business data entry, if not yet found.
-        * <p>
-        * @return Redirect outcome
-        */
-       public String addBusinessBasicData () {
-               // First, validate all parameter
-               if (this.getCompanyName() == null) {
-                       // Is null
-                       throw new NullPointerException("this.companyName is null"); //NOI18N
-               } else if (this.getCompanyName().isEmpty()) {
-                       // Is null
-                       throw new IllegalArgumentException("this.companyName is empty"); //NOI18N
-               }
-
-               // Prepare entity
-               BasicData basicData = new BusinessBasicData(this.getCompanyName());
-
-               // Set all opther remaining data
-               basicData.setCompanyComments(this.getCompanyComments());
-               basicData.setCompanyContactEmployee(this.getCompanyContactEmployee());
-               basicData.setCompanyEmailAddress(this.getCompanyEmailAddress());
-               basicData.setCompanyFounder(this.getCompanyFounder());
-               basicData.setCompanyHeadQuartersData(this.getCompanyHeadQuarters());
-               basicData.setCompanyTaxNumber(this.getCompanyTaxNumber());
-               basicData.setCompanyUserOwner(this.getCompanyUserOwner());
-               basicData.setCompanyWebsiteUrl(this.getCompanyWebsiteUrl());
-
-               // Set logo instance
-               // @TODO basicData.setCompanyLogo();
-               // Generate phone number
-               DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
-               DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
-
-               // Don't set null or wrong references
-               if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
-                       // Now the number must be given
-                       if (landLine.getPhoneAreaCode() == null) {
-                               // Is null
-                               throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
-                       } else if (landLine.getPhoneAreaCode() < 1) {
-                               // Abort here
-                               throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
-                       } else if (landLine.getPhoneNumber() == null) {
-                               // Is null
-                               throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
-                       } else if (landLine.getPhoneNumber() < 1) {
-                               // Abort here
-                               throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
-                       }
-
-                       // Set phone number
-                       basicData.setCompanyLandLineNumber(landLine);
-               }
-
-               // Don't set null or wrong references
-               if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
-                       // Now the number must be given
-                       if (fax.getPhoneAreaCode() == null) {
-                               // Is null
-                               throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
-                       } else if (fax.getPhoneAreaCode() < 1) {
-                               // Abort here
-                               throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
-                       } else if (fax.getPhoneNumber() == null) {
-                               // Is null
-                               throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
-                       } else if (fax.getPhoneNumber() < 1) {
-                               // Abort here
-                               throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
-                       }
-
-                       // Set fax number
-                       basicData.setCompanyFaxNumber(fax);
-               }
-
-               // Now try to send to EJB and get an updated version back
-               try {
-                       // Try it
-                       final BasicData updatedBasicData = this.adminBasicCompanyDataBean.addBusinessBasicData(basicData);
-
-                       // Fire event
-                       this.businessDataAddedEvent.fire(new AdminAddedBusinessBasicDataEvent(updatedBasicData));
-               } catch (final BasicDataAlreadyAddedException e) {
-                       // Does already exist
-                       throw new FacesException(e);
-               }
-
-               // Continue to list again
-               return "admin_list_basic_company_data"; //NOI18N
-       }
-
-       /**
-        * Getter for comments
-        * <p>
-        * @return Comments
-        */
-       public String getCompanyComments () {
-               return this.companyComments;
-       }
-
-       /**
-        * Setter for comments
-        * <p>
-        * @param companyComments Comments
-        */
-       public void setCompanyComments (final String companyComments) {
-               this.companyComments = companyComments;
-       }
-
-       /**
-        * Getter for employee as contact person
-        * <p>
-        * @return Employable as contact person
-        */
-       public Employable getCompanyContactEmployee () {
-               return this.companyContactEmployee;
-       }
-
-       /**
-        * Setter for employee as contact person
-        * <p>
-        * @param companyContactEmployee Employable as contact person
-        */
-       public void setCompanyContactEmployee (final Employable companyContactEmployee) {
-               this.companyContactEmployee = companyContactEmployee;
-       }
-
-       /**
-        * Getter for company's (main) email address
-        * <p>
-        * @return Company's (main) email address
-        */
-       public String getCompanyEmailAddress () {
-               return this.companyEmailAddress;
-       }
-
-       /**
-        * Setter for company's (main) email address
-        * <p>
-        * @param companyEmailAddress Company's (main) email address
-        */
-       public void setCompanyEmailAddress (final String companyEmailAddress) {
-               this.companyEmailAddress = companyEmailAddress;
-       }
-
-       /**
-        * Getter for company founder
-        * <p>
-        * @return Company founder
-        */
-       public Employable getCompanyFounder () {
-               return this.companyFounder;
-       }
-
-       /**
-        * Setter for company founder
-        * <p>
-        * @param companyFounder Company founder
-        */
-       public void setCompanyFounder (final Employable companyFounder) {
-               this.companyFounder = companyFounder;
-       }
-
-       /**
-        * Getter for headquarters data
-        * <p>
-        * @return Headquarters data
-        */
-       public HeadquartersData getCompanyHeadQuarters () {
-               return this.companyHeadQuarters;
-       }
-
-       /**
-        * Setter for headquarters data
-        * <p>
-        * @param companyHeadQuarters Headquarters data
-        */
-       public void setCompanyHeadQuarters (final HeadquartersData companyHeadQuarters) {
-               this.companyHeadQuarters = companyHeadQuarters;
-       }
-
-       /**
-        * Getter for company name
-        * <p>
-        * @return Company name
-        */
-       public String getCompanyName () {
-               return this.companyName;
-       }
-
-       /**
-        * Setter for company name
-        * <p>
-        * @param companyName Company name
-        */
-       public void setCompanyName (final String companyName) {
-               this.companyName = companyName;
-       }
-
-       /**
-        * Getter for company tax number
-        * <p>
-        * @return Company tax number
-        */
-       public String getCompanyTaxNumber () {
-               return this.companyTaxNumber;
-       }
-
-       /**
-        * Setter for company tax number
-        * <p>
-        * @param companyTaxNumber Company tax number
-        */
-       public void setCompanyTaxNumber (final String companyTaxNumber) {
-               this.companyTaxNumber = companyTaxNumber;
-       }
-
-       /**
-        * Getter for owning user instance
-        * <p>
-        * @return Owning user instance
-        */
-       public User getCompanyUserOwner () {
-               return this.companyUserOwner;
-       }
-
-       /**
-        * Setter for owning user instance
-        * <p>
-        * @param companyUserOwner Owning user instance
-        */
-       public void setCompanyUserOwner (final User companyUserOwner) {
-               this.companyUserOwner = companyUserOwner;
-       }
-
-       /**
-        * Getter for company web site URL
-        * <p>
-        * @return Company web site URL
-        */
-       public String getCompanyWebsiteUrl () {
-               return this.companyWebsiteUrl;
-       }
-
-       /**
-        * Getter for company web site URL
-        * <p>
-        * @param companyWebsiteUrl Company web site URL
-        */
-       public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
-               this.companyWebsiteUrl = companyWebsiteUrl;
-       }
-
-       /**
-        * Getter for fax number's area code
-        * <p>
-        * @return Fax number's area code
-        */
-       public Integer getFaxAreaCode () {
-               return this.faxAreaCode;
-       }
-
-       /**
-        * Setter for fax number's area code
-        * <p>
-        * @param faxAreaCode Fax number's area code
-        */
-       public void setFaxAreaCode (final Integer faxAreaCode) {
-               this.faxAreaCode = faxAreaCode;
-       }
-
-       /**
-        * Getter for fax's country instance
-        * <p>
-        * @return Fax' country instance
-        */
-       public Country getFaxCountry () {
-               return this.faxCountry;
-       }
-
-       /**
-        * Setter for fax's country instance
-        * <p>
-        * @param faxCountry Fax' country instance
-        */
-       public void setFaxCountry (final Country faxCountry) {
-               this.faxCountry = faxCountry;
-       }
-
-       /**
-        * Getter for fax number
-        * <p>
-        * @return Fax number
-        */
-       public Long getFaxNumber () {
-               return this.faxNumber;
-       }
-
-       /**
-        * Setter for fax number
-        * <p>
-        * @param faxNumber Fax number
-        */
-       public void setFaxNumber (final Long faxNumber) {
-               this.faxNumber = faxNumber;
-       }
-
-       /**
-        * Getter for land-line number's area code
-        * <p>
-        * @return Land-line number's area code
-        */
-       public Integer getLandLineAreaCode () {
-               return this.landLineAreaCode;
-       }
-
-       /**
-        * Setter for land-line number's area code
-        * <p>
-        * @param landLineAreaCode Land-line number's area code
-        */
-       public void setLandLineAreaCode (final Integer landLineAreaCode) {
-               this.landLineAreaCode = landLineAreaCode;
-       }
-
-       /**
-        * Getter for land-line number's country instance
-        * <p>
-        * @return Land-line number's country instance
-        */
-       public Country getLandLineCountry () {
-               return this.landLineCountry;
-       }
-
-       /**
-        * Setter for land-line number's country instance
-        * <p>
-        * @param landLineCountry Land-line number's country instance
-        */
-       public void setLandLineCountry (final Country landLineCountry) {
-               this.landLineCountry = landLineCountry;
-       }
-
-       /**
-        * Getter for land-line number
-        * <p>
-        * @return Land-line number
-        */
-       public Long getLandLineNumber () {
-               return this.landLineNumber;
-       }
-
-       /**
-        * Setter for land-line number
-        * <p>
-        * @param landLineNumber Land-line number
-        */
-       public void setLandLineNumber (final Long landLineNumber) {
-               this.landLineNumber = landLineNumber;
-       }
-
-}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBusinessDataWebRequestController.java
deleted file mode 100644 (file)
index 3154e41..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.business.basicdata;
-
-import java.io.Serializable;
-
-/**
- * An interface for session-scoped basic data controller
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface JobsAdminBusinessDataWebRequestController extends Serializable {
-
-}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java
new file mode 100644 (file)
index 0000000..e2097dd
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.basicdata;
+
+import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
+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;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
+
+/**
+ * A business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("basicCompanyDataController")
+@RequestScoped
+public class JobsBasicDataWebRequestBean extends BaseJobsBean implements JobsBasicDataWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 56_189_028_928_371L;
+
+       /**
+        * EJB for administrative basic business data purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/adminBasicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote", description = "A stateless session bean for administrative purposes.")
+       private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
+
+       /**
+        * List of all basic company data
+        */
+       private final List<BasicData> allBasicData;
+
+       /**
+        * A list of all registered companies (globally)
+        */
+       @Inject
+       @NamedCache (cacheName = "basicDataCache")
+       private Cache<Long, BasicData> basicDataCache;
+
+       /**
+        * EJB for general basic business data purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
+       private BasicCompanyDataSessionBeanRemote businessDataBean;
+
+       /**
+        * Comments for this company
+        */
+       private String companyComments;
+
+       /**
+        * Companies (main) email address (example: info@company.example)
+        */
+       private String companyEmailAddress;
+
+       /**
+        * Company cacheName
+        */
+       private String companyName;
+
+       /**
+        * Area code for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Dial number for fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * List of filtered basic company data
+        */
+       private List<BasicData> filteredBasicCompanyData;
+
+       /**
+        * Area code for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Dial number for land-line number
+        */
+       private Long landLineNumber;
+
+       /**
+        * User instance
+        */
+       @Inject
+       private JobsUserLoginWebSessionController userLoginController;
+
+       /**
+        * Constructor
+        */
+       public JobsBasicDataWebRequestBean () {
+               // Call super constructor
+               super();
+
+               // Init list
+               this.allBasicData = new LinkedList<>();
+       }
+
+       /**
+        * Observers events being fired when an administrator has added company
+        * basic data.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedBasicCompanyDataEvent (@Observes final ObservableAdminAddedBusinessBasicDataEvent event) {
+               // Is the parameter valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getBasicData() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData is null"); //NOI18N
+               } else if (event.getBasicData().getBasicDataId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData.basicDataId is null"); //NOI18N
+               } else if (event.getBasicData().getBasicDataId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("event.basicData.basicDataId={0} is invalid", event.getBasicData().getBasicDataId())); //NOI18N
+               } else if (event.getBasicData().getCompanyName() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData.companyName is null"); //NOI18N
+               } else if (event.getBasicData().getCompanyName().isEmpty()) {
+                       // Throw IAE again
+                       throw new IllegalArgumentException("event.basicData.companyName is empty"); //NOI18N
+               }
+
+               // Add it to list
+               this.basicDataCache.put(event.getBasicData().getBasicDataId(), event.getBasicData());
+               this.allBasicData.add(event.getBasicData());
+       }
+
+       /**
+        * Getter for a list of all business contacts
+        * <p>
+        * @return A list of all business contacts
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BasicData> allBasicData () {
+               return this.allBasicData;
+       }
+
+       @Override
+       public BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException {
+               // Validate parameter
+               if (null == basicDataId) {
+                       // Throw NPE
+                       throw new NullPointerException("basicDataId is null"); //NOI18N
+               } else if (basicDataId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("basicDataId={0} is invalid", basicDataId)); //NOI18N
+               } else if (!this.basicDataCache.containsKey(basicDataId)) {
+                       // Not found
+                       throw new BasicDataNotFoundException(basicDataId);
+               }
+
+               // Get it from cache
+               final BasicData basicData = this.basicDataCache.get(basicDataId);
+
+               // Return it
+               return basicData;
+       }
+
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
+
+       /**
+        * Setter for comments
+        * <p>
+        * @param companyComments Comments
+        */
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
+       }
+
+       /**
+        * Getter for company's (main) email address
+        * <p>
+        * @return Company's (main) email address
+        */
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
+
+       /**
+        * Setter for company's (main) email address
+        * <p>
+        * @param companyEmailAddress Company's (main) email address
+        */
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
+
+       /**
+        * Getter for company cacheName
+        * <p>
+        * @return Company cacheName
+        */
+       public String getCompanyName () {
+               return this.companyName;
+       }
+
+       /**
+        * Setter for company cacheName
+        * <p>
+        * @param companyName Company cacheName
+        */
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
+       }
+
+       /**
+        * Getter for fax number's area code
+        * <p>
+        * @return Fax number's area code
+        */
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
+       }
+
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax's country instance
+        * <p>
+        * @param faxCountry Fax' country instance
+        */
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
+       }
+
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for filtered basic company data
+        * <p>
+        * @return Filtered basic company data
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BasicData> getFilteredBasicCompanyData () {
+               return this.filteredBasicCompanyData;
+       }
+
+       /**
+        * Setter for filtered basic company data
+        * <p>
+        * @param filteredBasicCompanyData Filtered basic company data
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setFilteredBasicCompanyData (final List<BasicData> filteredBasicCompanyData) {
+               this.filteredBasicCompanyData = filteredBasicCompanyData;
+       }
+
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line number's area code
+        * <p>
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line number's country instance
+        * <p>
+        * @param landLineCountry Land-line number's country instance
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+       /**
+        * Initializer method
+        */
+       @PostConstruct
+       public void initializeList () {
+               // Is cache there?
+               if (!this.basicDataCache.iterator().hasNext()) {
+                       // Get whole list
+                       final List<BasicData> basicDatas = this.businessDataBean.allBusinessBasicData();
+
+                       // Add all
+                       for (final BasicData basicData : basicDatas) {
+                               // Add it to cache
+                               this.basicDataCache.put(basicData.getBasicDataId(), basicData);
+                       }
+               }
+
+               // Is cache there and list is not full?
+               if ((this.allBasicData.isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
+                       // Get iterator
+                       final Iterator<Cache.Entry<Long, BasicData>> iterator = this.basicDataCache.iterator();
+
+                       // Build up list
+                       while (iterator.hasNext()) {
+                               // GEt next element
+                               final Cache.Entry<Long, BasicData> next = iterator.next();
+
+                               // Add to list
+                               this.allBasicData.add(next.getValue());
+                       }
+
+                       // Sort list
+                       this.allBasicData.sort(new Comparator<BasicData>() {
+                               @Override
+                               public int compare (final BasicData o1, final BasicData o2) {
+                                       return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0;
+                               }
+                       });
+               }
+       }
+
+       @Override
+       public Boolean isCompanyNameUsed (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 BasicData basicData : this.allBasicData()) {
+                       // Is same company name?
+                       if (Objects.equals(basicData.getCompanyName(), companyName)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+       @Override
+       public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final BasicData basicData : this.allBasicData()) {
+                       // Is email address used?
+                       if (Objects.equals(basicData.getCompanyEmailAddress(), emailAddress)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+       /**
+        * Clears this bean
+        */
+       private void clear () {
+               // Clear all data:
+               this.setCompanyComments(null);
+               this.setCompanyEmailAddress(null);
+               this.setCompanyName(null);
+               this.setFaxAreaCode(null);
+               this.setFaxCountry(null);
+               this.setFaxNumber(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineCountry(null);
+               this.setLandLineNumber(null);
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestController.java
new file mode 100644 (file)
index 0000000..056dc96
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.basicdata;
+
+import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsBasicDataWebRequestController extends Serializable {
+
+       /**
+        * Checks if given email address is already registered by other basic
+        * company data
+        * <p>
+        * @param emailAddress Email address
+        * <p>
+        * @return Whether the email address has been already registered
+        */
+       Boolean isEmailAddressRegistered (final String emailAddress);
+
+       /**
+        * Retrieves a single business data entity for given id number or throws a
+        * proper exception if not found.
+        * <p>
+        * @param basicDataId Company basic data id to lookup
+        * <p>
+        * @return Business contact instance
+        * <p>
+        * @throws BasicDataNotFoundException If the id number could not be looked
+        * up and solved into an entity
+        */
+       BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
+
+       /**
+        * Checks whether given company name already exists
+        * <p>
+        * @param companyName Company name to check
+        * <p>
+        * @return Whether the company name exists
+        */
+       Boolean isCompanyNameUsed (final String companyName);
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java
deleted file mode 100644 (file)
index 574e740..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.business.basicdata;
-
-import fish.payara.cdi.jsr107.impl.NamedCache;
-import java.text.MessageFormat;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.cache.Cache;
-import javax.ejb.EJB;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
-import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-
-/**
- * A business contact bean (controller)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("basicCompanyDataController")
-@RequestScoped
-public class JobsBusinessDataWebRequestBean extends BaseJobsBean implements JobsBusinessDataWebRequestController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 56_189_028_928_371L;
-
-       /**
-        * EJB for administrative basic business data purposes
-        */
-       @EJB (lookup = "java:global/jjobs-ejb/adminBasicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote", description = "A stateless session bean for administrative purposes.")
-       private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
-
-       /**
-        * List of all basic company data
-        */
-       private final List<BasicData> allBasicData;
-
-       /**
-        * A list of all registered companies (globally)
-        */
-       @Inject
-       @NamedCache (cacheName = "basicDataCache")
-       private Cache<Long, BasicData> basicDataCache;
-
-       /**
-        * EJB for general basic business data purposes
-        */
-       @EJB (lookup = "java:global/jjobs-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
-       private BasicCompanyDataSessionBeanRemote businessDataBean;
-
-       /**
-        * Comments for this company
-        */
-       private String companyComments;
-
-       /**
-        * Companies (main) email address (example: info@company.example)
-        */
-       private String companyEmailAddress;
-
-       /**
-        * Company cacheName
-        */
-       private String companyName;
-
-       /**
-        * Area code for fax number
-        */
-       private Integer faxAreaCode;
-
-       /**
-        * Country for fax number
-        */
-       private Country faxCountry;
-
-       /**
-        * Dial number for fax number
-        */
-       private Long faxNumber;
-
-       /**
-        * List of filtered basic company data
-        */
-       private List<BasicData> filteredBasicCompanyData;
-
-       /**
-        * Area code for land-line number
-        */
-       private Integer landLineAreaCode;
-
-       /**
-        * Country for land-line number
-        */
-       private Country landLineCountry;
-
-       /**
-        * Dial number for land-line number
-        */
-       private Long landLineNumber;
-
-       /**
-        * User instance
-        */
-       @Inject
-       private JobsUserLoginWebSessionController userLoginController;
-
-       /**
-        * Constructor
-        */
-       public JobsBusinessDataWebRequestBean () {
-               // Call super constructor
-               super();
-
-               // Init list
-               this.allBasicData = new LinkedList<>();
-       }
-
-       /**
-        * Observers events being fired when an administrator has added company
-        * basic data.
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterAdminAddedBasicCompanyDataEvent (@Observes final ObservableAdminAddedBusinessBasicDataEvent event) {
-               // Is the parameter valid?
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null");
-               } else if (event.getBasicData() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData is null");
-               } else if (event.getBasicData().getBasicDataId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData.basicDataId is null");
-               } else if (event.getBasicData().getBasicDataId() < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("event.basicData.basicDataId={0} is invalid", event.getBasicData().getBasicDataId()));
-               } else if (event.getBasicData().getCompanyName() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData.companyName is null");
-               } else if (event.getBasicData().getCompanyName().isEmpty()) {
-                       // Throw IAE again
-                       throw new IllegalArgumentException("event.basicData.companyName is empty");
-               }
-
-               // Add it to list
-               this.basicDataCache.put(event.getBasicData().getBasicDataId(), event.getBasicData());
-               this.allBasicData.add(event.getBasicData());
-       }
-
-       /**
-        * Getter for a list of all business contacts
-        * <p>
-        * @return A list of all business contacts
-        */
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BasicData> allBasicData () {
-               return this.allBasicData;
-       }
-
-       @Override
-       public BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException {
-               // Validate parameter
-               if (null == basicDataId) {
-                       // Throw NPE
-                       throw new NullPointerException("basicDataId is null"); //NOI18N
-               } else if (basicDataId < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("basicDataId=" + basicDataId + " is invalid"); //NOI18N
-               } else if (!this.basicDataCache.containsKey(basicDataId)) {
-                       // Not found
-                       throw new BasicDataNotFoundException(basicDataId);
-               }
-
-               // Get it from cache
-               final BasicData basicData = this.basicDataCache.get(basicDataId);
-
-               // Return it
-               return basicData;
-       }
-
-       /**
-        * Getter for comments
-        * <p>
-        * @return Comments
-        */
-       public String getCompanyComments () {
-               return this.companyComments;
-       }
-
-       /**
-        * Setter for comments
-        * <p>
-        * @param companyComments Comments
-        */
-       public void setCompanyComments (final String companyComments) {
-               this.companyComments = companyComments;
-       }
-
-       /**
-        * Getter for company's (main) email address
-        * <p>
-        * @return Company's (main) email address
-        */
-       public String getCompanyEmailAddress () {
-               return this.companyEmailAddress;
-       }
-
-       /**
-        * Setter for company's (main) email address
-        * <p>
-        * @param companyEmailAddress Company's (main) email address
-        */
-       public void setCompanyEmailAddress (final String companyEmailAddress) {
-               this.companyEmailAddress = companyEmailAddress;
-       }
-
-       /**
-        * Getter for company cacheName
-        * <p>
-        * @return Company cacheName
-        */
-       public String getCompanyName () {
-               return this.companyName;
-       }
-
-       /**
-        * Setter for company cacheName
-        * <p>
-        * @param companyName Company cacheName
-        */
-       public void setCompanyName (final String companyName) {
-               this.companyName = companyName;
-       }
-
-       /**
-        * Getter for fax number's area code
-        * <p>
-        * @return Fax number's area code
-        */
-       public Integer getFaxAreaCode () {
-               return this.faxAreaCode;
-       }
-
-       /**
-        * Setter for fax number's area code
-        * <p>
-        * @param faxAreaCode Fax number's area code
-        */
-       public void setFaxAreaCode (final Integer faxAreaCode) {
-               this.faxAreaCode = faxAreaCode;
-       }
-
-       /**
-        * Getter for fax's country instance
-        * <p>
-        * @return Fax' country instance
-        */
-       public Country getFaxCountry () {
-               return this.faxCountry;
-       }
-
-       /**
-        * Setter for fax's country instance
-        * <p>
-        * @param faxCountry Fax' country instance
-        */
-       public void setFaxCountry (final Country faxCountry) {
-               this.faxCountry = faxCountry;
-       }
-
-       /**
-        * Getter for fax number
-        * <p>
-        * @return Fax number
-        */
-       public Long getFaxNumber () {
-               return this.faxNumber;
-       }
-
-       /**
-        * Setter for fax number
-        * <p>
-        * @param faxNumber Fax number
-        */
-       public void setFaxNumber (final Long faxNumber) {
-               this.faxNumber = faxNumber;
-       }
-
-       /**
-        * Getter for filtered basic company data
-        * <p>
-        * @return Filtered basic company data
-        */
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BasicData> getFilteredBasicCompanyData () {
-               return this.filteredBasicCompanyData;
-       }
-
-       /**
-        * Setter for filtered basic company data
-        * <p>
-        * @param filteredBasicCompanyData Filtered basic company data
-        */
-       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredBasicCompanyData (final List<BasicData> filteredBasicCompanyData) {
-               this.filteredBasicCompanyData = filteredBasicCompanyData;
-       }
-
-       /**
-        * Getter for land-line number's area code
-        * <p>
-        * @return Land-line number's area code
-        */
-       public Integer getLandLineAreaCode () {
-               return this.landLineAreaCode;
-       }
-
-       /**
-        * Setter for land-line number's area code
-        * <p>
-        * @param landLineAreaCode Land-line number's area code
-        */
-       public void setLandLineAreaCode (final Integer landLineAreaCode) {
-               this.landLineAreaCode = landLineAreaCode;
-       }
-
-       /**
-        * Getter for land-line number's country instance
-        * <p>
-        * @return Land-line number's country instance
-        */
-       public Country getLandLineCountry () {
-               return this.landLineCountry;
-       }
-
-       /**
-        * Setter for land-line number's country instance
-        * <p>
-        * @param landLineCountry Land-line number's country instance
-        */
-       public void setLandLineCountry (final Country landLineCountry) {
-               this.landLineCountry = landLineCountry;
-       }
-
-       /**
-        * Getter for land-line number
-        * <p>
-        * @return Land-line number
-        */
-       public Long getLandLineNumber () {
-               return this.landLineNumber;
-       }
-
-       /**
-        * Setter for land-line number
-        * <p>
-        * @param landLineNumber Land-line number
-        */
-       public void setLandLineNumber (final Long landLineNumber) {
-               this.landLineNumber = landLineNumber;
-       }
-
-       /**
-        * Initializer method
-        */
-       @PostConstruct
-       public void initializeList () {
-               // Is cache there?
-               if (!this.basicDataCache.iterator().hasNext()) {
-                       // Get whole list
-                       final List<BasicData> basicDatas = this.businessDataBean.allBusinessBasicData();
-
-                       // Add all
-                       for (final BasicData basicData : basicDatas) {
-                               // Add it to cache
-                               this.basicDataCache.put(basicData.getBasicDataId(), basicData);
-                       }
-               }
-
-               // Is cache there and list is not full?
-               if ((this.allBasicData.isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
-                       // Get iterator
-                       final Iterator<Cache.Entry<Long, BasicData>> iterator = this.basicDataCache.iterator();
-
-                       // Build up list
-                       while (iterator.hasNext()) {
-                               // GEt next element
-                               final Cache.Entry<Long, BasicData> next = iterator.next();
-
-                               // Add to list
-                               this.allBasicData.add(next.getValue());
-                       }
-
-                       // Sort list
-                       this.allBasicData.sort(new Comparator<BasicData>() {
-                               @Override
-                               public int compare (final BasicData o1, final BasicData o2) {
-                                       return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0;
-                               }
-                       });
-               }
-       }
-
-       @Override
-       public Boolean isCompanyNameUsed (String companyName) {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
-       /**
-        * Clears this bean
-        */
-       private void clear () {
-               // Clear all data:
-               this.setCompanyComments(null);
-               this.setCompanyEmailAddress(null);
-               this.setCompanyName(null);
-               this.setFaxAreaCode(null);
-               this.setFaxCountry(null);
-               this.setFaxNumber(null);
-               this.setLandLineAreaCode(null);
-               this.setLandLineCountry(null);
-               this.setLandLineNumber(null);
-       }
-
-}
diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestController.java
deleted file mode 100644 (file)
index 89dbc77..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.business.basicdata;
-
-import java.io.Serializable;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-
-/**
- * An interface for session-scoped basic data controller
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface JobsBusinessDataWebRequestController extends Serializable {
-
-       /**
-        * Retrieves a single business data entity for given id number or throws a
-        * proper exception if not found.
-        * <p>
-        * @param basicDataId Company basic data id to lookup
-        * <p>
-        * @return Business contact instance
-        * <p>
-        * @throws BasicDataNotFoundException If the id number could not be
-        * looked up and solved into an entity
-        */
-       BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
-
-       /**
-        * Checks whether given company name already exists
-        * <p>
-        * @param companyName Company name to check
-        * <p>
-        * @return Whether the company name exists
-        */
-       Boolean isCompanyNameUsed (final String companyName);
-
-}
index fa0a5261e02d0fd5d859104cd961adc03b1abeb8..c28d15c7df57d7af4db31821e1a0839c950b8523 100644 (file)
@@ -29,10 +29,12 @@ import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.BranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.ObservableBranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.AdminBranchOfficeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek;
@@ -43,8 +45,6 @@ import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An administrative bean for branch offices
@@ -55,6 +55,11 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 @SessionScoped
 public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements JobsAdminBranchOfficeWebRequestController {
 
+       /**
+        * Opening times of this branch office
+        */
+       private static List<OpeningTime> branchOpeningTimes;
+
        /**
         * Serial number
         */
@@ -114,11 +119,6 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
        @Inject
        private JobsBranchOfficeWebRequestController branchOfficeController;
 
-       /**
-        * Opening times of this branch office
-        */
-       private static List<OpeningTime> branchOpeningTimes;
-
        /**
         * Store
         */
index e78247893cb44d90e1e2403ea55660f6d75e4708..26ec02e42c99e89cd4af24a8d5162694acce6973 100644 (file)
@@ -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;
@@ -201,4 +202,23 @@ public class JobsBranchOfficeWebRequestBean extends BaseJobsBean implements Jobs
                }
        }
 
+       @Override
+       public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final BranchOffice branchOffice : this.allBranchOffices()) {
+                       // Is email address used?
+                       if (Objects.equals(branchOffice.getBranchEmailAddress(), emailAddress)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
 }
index ed37432bf9787f2e2bc71dde9fa1b05848645925..ad50bac0e95b81777d3046e84706f889852e08e4 100644 (file)
@@ -28,6 +28,16 @@ import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
  */
 public interface JobsBranchOfficeWebRequestController extends Serializable {
 
+       /**
+        * Checks if given email address is already registered by an other branch
+        * office
+        * <p>
+        * @param emailAddress Email address
+        * <p>
+        * @return Whether the email address has been already registered
+        */
+       Boolean isEmailAddressRegistered (final String emailAddress);
+
        /**
         * Returns a list of all branch offices
         * <p>
index e88d4fef9c14c6d3a99798f81fc64dfb98921b8a..cc8c41e78649d3421540e015b24bb6c7b0c38dd0 100644 (file)
@@ -26,16 +26,16 @@ import javax.inject.Named;
 import org.mxchange.jcontactsbusiness.events.department.added.DepartmentAddedEvent;
 import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.department.Departments;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An administrative bean for departments
@@ -49,7 +49,7 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
        /**
         * Serial number
         */
-       private static final long serialVersionUID = 5_028_697_360_462L;
+       private static final long serialVersionUID = 5_028_697_360_464L;
 
        /**
         * EJB for administrative purposes
@@ -81,19 +81,19 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
        private JobsDepartmentWebRequestController departmentController;
 
        /**
-        * Assigned headquarters (if apply-able)
+        * Assigned headquarter (if apply-able)
         */
-       private HeadquartersData departmentHeadquarters;
+       private Headquarter departmentHeadquarter;
 
        /**
-        * Lead person of this department
+        * Department name
         */
-       private Employable departmentLead;
+       private String departmentI18nKey;
 
        /**
-        * Department name
+        * Lead person of this department
         */
-       private String departmentI18nKey;
+       private Employable departmentLead;
 
        /**
         * Owning user instance (which this department is assigned to)
@@ -182,57 +182,57 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
        }
 
        /**
-        * Getter for assigned headquarters data
+        * Getter for assigned headquarter data
         * <p>
-        * @return Headquarters data
+        * @return Headquarter data
         */
-       public HeadquartersData getDepartmentHeadquarters () {
-               return this.departmentHeadquarters;
+       public Headquarter getDepartmentHeadquarter () {
+               return this.departmentHeadquarter;
        }
 
        /**
-        * Setter for assigned headquarters data
+        * Setter for assigned headquarter data
         * <p>
-        * @param departmentHeadquarters Headquarters data
+        * @param departmentHeadquarter Headquarter data
         */
-       public void setDepartmentHeadquarters (final HeadquartersData departmentHeadquarters) {
-               this.departmentHeadquarters = departmentHeadquarters;
+       public void setDepartmentHeadquarter (final Headquarter departmentHeadquarter) {
+               this.departmentHeadquarter = departmentHeadquarter;
        }
 
        /**
-        * Getter for department contact person
+        * Getter for department name
         * <p>
-        * @return Department contact person
+        * @return Department name
         */
-       public Employable getDepartmentLead () {
-               return this.departmentLead;
+       public String getDepartmentI18nKey () {
+               return this.departmentI18nKey;
        }
 
        /**
-        * Setter for department contact person
+        * Setter for department name
         * <p>
-        * @param departmentLead Department contact person
+        * @param departmentI18nKey Department name
         */
-       public void setDepartmentLead (final Employable departmentLead) {
-               this.departmentLead = departmentLead;
+       public void setDepartmentI18nKey (final String departmentI18nKey) {
+               this.departmentI18nKey = departmentI18nKey;
        }
 
        /**
-        * Getter for department name
+        * Getter for department contact person
         * <p>
-        * @return Department name
+        * @return Department contact person
         */
-       public String getDepartmentI18nKey () {
-               return this.departmentI18nKey;
+       public Employable getDepartmentLead () {
+               return this.departmentLead;
        }
 
        /**
-        * Setter for department name
+        * Setter for department contact person
         * <p>
-        * @param departmentI18nKey Department name
+        * @param departmentLead Department contact person
         */
-       public void setDepartmentI18nKey (final String departmentI18nKey) {
-               this.departmentI18nKey = departmentI18nKey;
+       public void setDepartmentLead (final Employable departmentLead) {
+               this.departmentLead = departmentLead;
        }
 
        /**
@@ -265,7 +265,7 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
                final Department department = new BusinessDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
 
                // Add all optional fields
-               department.setDepartmentHeadquarters(this.getDepartmentHeadquarters());
+               department.setDepartmentHeadquarter(this.getDepartmentHeadquarter());
                department.setDepartmentBranchOffice(this.getDepartmentBranchOffice());
                department.setDepartmentLead(this.getDepartmentLead());
                department.setDepartmentUserOwner(this.getDepartmentUserOwner());
index 47c9777edfe4401e0c50f85c5e8208bcbbc56961..931c11660ca77456119524969b443369be65e078 100644 (file)
@@ -23,13 +23,20 @@ import javax.enterprise.inject.Any;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontactsbusiness.events.employee.added.EmployeeAddedEvent;
 import org.mxchange.jcontactsbusiness.events.employee.added.ObservableEmployeeAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeAlreadyAddedException;
 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.AdminEmployeeSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.employee.Employees;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.model.user.User;
 
@@ -72,7 +79,13 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
        private BranchOffice employeeBranchOffice;
 
        /**
-        * Department where employee works (alternative to headquarters)
+        * General employee controller
+        */
+       @Inject
+       private JobsEmployeeWebRequestController employeeController;
+
+       /**
+        * Department where employee works (alternative to headquarter)
         */
        private Department employeeDepartment;
 
@@ -82,24 +95,24 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
        private String employeeEmailAddress;
 
        /**
-        * Employee's Headquarters data, if he is working there
+        * Employee's Headquarter data, if he is working there
         */
-       private HeadquartersData employeeHeadquarters;
+       private Headquarter employeeHeadquarter;
 
        /**
-        * Assigned personal data of the employee
+        * Employee's staff number
         */
-       private Contact employeePersonalContact;
+       private String employeeNumber;
 
        /**
-        * Employee's phone extension (on top of a "main number")
+        * Assigned personal data of the employee
         */
-       private Long employeePhoneExtension;
+       private Contact employeePersonalContact;
 
        /**
-        * Employee's staff number
+        * Employee's phone extension (on top of a "main number")
         */
-       private Long employeeStaffNumber;
+       private Integer employeePhoneExtension;
 
        /**
         * Assigned user account
@@ -124,6 +137,46 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
                super();
        }
 
+       /**
+        * Adds branch office with all data from this backing bean. First this
+        * action method will validate if the branch office's address is already
+        * registered and if found, it will output a proper faces message.
+        * <p>
+        * @return Redirect outcome
+        */
+       public String addEmployee () {
+               // Get instance
+               final Employable employee = this.createEmployee();
+
+               // Is the branch office not created yet?
+               if (this.isEmployeeCreatedByRequiredData(employee)) {
+                       // Then show proper faces message
+                       this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N
+                       return ""; //NOI18N
+               }
+
+               // Delcare updated instance
+               final Employable updatedOffice;
+
+               try {
+                       // Try to call EJB
+                       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
+                       return ""; //NOI18N
+               }
+
+               // Fire event
+               this.addedEmployeeEvent.fire(new EmployeeAddedEvent(updatedOffice));
+
+               // Clear this bean
+               this.clear();
+
+               // Redirect to list
+               return "admin_list_branch_office"; //NOI18N
+       }
+
        /**
         * Getter for employee's assigned branch office
         * <p>
@@ -197,21 +250,39 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
        }
 
        /**
-        * Getter for employee's assigned headquarters (if no branch office)
+        * Getter for employee's assigned headquarter (if no branch office)
+        * <p>
+        * @return Employee's assigned headquarter
+        */
+       public Headquarter getEmployeeHeadquarter () {
+               return this.employeeHeadquarter;
+       }
+
+       /**
+        * Setter for employee's assigned headquarter (if no branch office)
         * <p>
-        * @return Employee's assigned headquarters
+        * @param employeeHeadquarter Employee's assigned headquarter
         */
-       public HeadquartersData getEmployeeHeadquarters () {
-               return this.employeeHeadquarters;
+       public void setEmployeeHeadquarter (final Headquarter employeeHeadquarter) {
+               this.employeeHeadquarter = employeeHeadquarter;
        }
 
        /**
-        * Setter for employee's assigned headquarters (if no branch office)
+        * Getter for employee's staff number
         * <p>
-        * @param employeeHeadquarters Employee's assigned headquarters
+        * @return Employee's staff number
         */
-       public void setEmployeeHeadquarters (final HeadquartersData employeeHeadquarters) {
-               this.employeeHeadquarters = employeeHeadquarters;
+       public String getEmployeeNumber () {
+               return this.employeeNumber;
+       }
+
+       /**
+        * Setter for employee's staff number
+        * <p>
+        * @param employeeNumber Employee's staff number
+        */
+       public void setEmployeeNumber (final String employeeNumber) {
+               this.employeeNumber = employeeNumber;
        }
 
        /**
@@ -237,7 +308,7 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
         * <p>
         * @return Employee's phone extension
         */
-       public Long getEmployeePhoneExtension () {
+       public Integer getEmployeePhoneExtension () {
                return this.employeePhoneExtension;
        }
 
@@ -246,28 +317,10 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
         * <p>
         * @param employeePhoneExtension Employee's phone extension
         */
-       public void setEmployeePhoneExtension (final Long employeePhoneExtension) {
+       public void setEmployeePhoneExtension (final Integer employeePhoneExtension) {
                this.employeePhoneExtension = employeePhoneExtension;
        }
 
-       /**
-        * Getter for employee's staff number
-        * <p>
-        * @return Employee's staff number
-        */
-       public Long getEmployeeStaffNumber () {
-               return this.employeeStaffNumber;
-       }
-
-       /**
-        * Setter for employee's staff number
-        * <p>
-        * @param employeeStaffNumber Employee's staff number
-        */
-       public void setEmployeeStaffNumber (final Long employeeStaffNumber) {
-               this.employeeStaffNumber = employeeStaffNumber;
-       }
-
        /**
         * Getter for employee's user "owner"
         * <p>
@@ -322,4 +375,75 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job
                this.mobileProvider = mobileProvider;
        }
 
+       /**
+        * Clears all bean fields
+        */
+       private void clear () {
+               // Clear all fields
+               this.setEmployeeBranchOffice(null);
+               this.setEmployeeCompany(null);
+               this.setEmployeeDepartment(null);
+               this.setEmployeeEmailAddress(null);
+               this.setEmployeeHeadquarter(null);
+               this.setEmployeePersonalContact(null);
+               this.setEmployeePhoneExtension(null);
+               this.setEmployeeNumber(null);
+               this.setEmployeeUserOwner(null);
+       }
+
+       /**
+        * Creates employee instance with all data from this bean
+        * <p>
+        * @return Employee instance
+        */
+       private Employable createEmployee () {
+               // Init instance
+               final Employable employee = new BusinessEmployee(this.getEmployeeCompany(), this.getEmployeeNumber(), this.getEmployeePersonalContact());
+
+               // Set all othewr data
+               employee.setEmployeeBranchOffice(this.getEmployeeBranchOffice());
+               employee.setEmployeeDepartment(this.getEmployeeDepartment());
+               employee.setEmployeeHeadquarter(this.getEmployeeHeadquarter());
+               employee.setEmployeePhoneExtension(this.getEmployeePhoneExtension());
+               // @TODO employee.setEmployeePosition(this.getEmployeePosition());
+               employee.setEmployeeUserOwner(this.getEmployeeUserOwner());
+
+               // Is mobile provider and number set?
+               if ((this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
+                       // Init mobile number instance
+                       final DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+
+                       // Set it in employee
+                       employee.setEmployeeMobileNumber(number);
+               }
+
+               // Return it
+               return employee;
+       }
+
+       /**
+        * Checks whether given employee is already added
+        * <p>
+        * @param employee Employee to be checked
+        * <p>
+        * @return Whether the employee has already been added
+        */
+       private boolean isEmployeeCreatedByRequiredData (final Employable employee) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all employees
+               for (final Employable otherEmployee : this.employeeController.allEmployees()) {
+                       // Is same found?
+                       if (Employees.isSameEmployeeFound(employee, otherEmployee)) {
+                               // Okay, found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return it
+               return isFound;
+       }
+
 }
index 13ee9425d43e76ebc1d10977dd0189c5d0de1835..ef3409b68da3299f46f84b4be2fe4513f4dd451c 100644 (file)
@@ -109,11 +109,7 @@ public class JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
                this.allEmployees.add(event.getEmployee());
        }
 
-       /**
-        * Returns a list of all company employees
-        * <p>
-        * @return List of all company employees
-        */
+       @Override
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<Employable> allEmployees () {
                return this.allEmployees;
index ed21595ee4536b0cf2e4324eed8b747f1615ee45..1e8d42b3e598a7b2ccb16a7b53e839d08060a2e0 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jjobs.beans.business.employee;
 
 import java.io.Serializable;
+import java.util.List;
 import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeNotFoundException;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
@@ -27,6 +28,13 @@ import org.mxchange.jcontactsbusiness.model.employee.Employable;
  */
 public interface JobsEmployeeWebRequestController extends Serializable {
 
+       /**
+        * Returns a list of all company employees
+        * <p>
+        * @return List of all company employees
+        */
+       List<Employable> allEmployees ();
+
        /**
         * Finds a company employee by given employee id
         * <p>
diff --git a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java
new file mode 100644 (file)
index 0000000..2d55dd3
--- /dev/null
@@ -0,0 +1,836 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.headquarter;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import javax.ejb.EJB;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.headquarter.added.HeadquarterAddedEvent;
+import org.mxchange.jcontactsbusiness.events.headquarter.added.ObservableHeadquarterAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.AdminHeadquarterSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.headquarter.BusinessHeadquarter;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarters;
+import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An administrative bean for headquarter
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminHeadquarterController")
+@SessionScoped
+public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements JobsAdminHeadquarterWebRequestController {
+
+       /**
+        * Opening times of this headquarter
+        */
+       private static List<OpeningTime> headquarterOpeningTimes;
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 5_028_697_360_462L;
+
+       /**
+        * EJB for administrative purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/adminHeadquarter!org.mxchange.jcontactsbusiness.model.headquarter.AdminHeadquarterSessionBeanRemote")
+       private AdminHeadquarterSessionBeanRemote adminHeadquarterBean;
+
+       /**
+        * Area code for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Dial number for fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * An event being fired when a headquarter has been successfully added
+        */
+       @Inject
+       @Any
+       private Event<ObservableHeadquarterAddedEvent> headquarterAddedEvent;
+
+       /**
+        * City
+        */
+       private String headquarterCity;
+
+       /**
+        * Contact person in headquarter
+        */
+       private Employable headquarterContactEmployee;
+
+       /**
+        * A general headquarter controller (backing bean)
+        */
+       @Inject
+       private JobsHeadquarterWebRequestController headquarterController;
+
+       /**
+        * Country
+        */
+       private Country headquarterCountry;
+
+       /**
+        * Email address
+        */
+       private String headquarterEmailAddress;
+
+       /**
+        * House number
+        */
+       private Short headquarterHouseNumber;
+
+       /**
+        * Store
+        */
+       private Short headquarterStore;
+
+       /**
+        * Headquarter street name
+        */
+       private String headquarterStreet;
+
+       /**
+        * Suite number
+        */
+       private Short headquarterSuiteNumber;
+
+       /**
+        * Owning user instance (which this headquarter is assigned to)
+        */
+       private User headquarterUserOwner;
+
+       /**
+        * ZIP code
+        */
+       private Integer headquarterZipCode;
+
+       /**
+        * Area code for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Dial number for land-line number
+        */
+       private Long landLineNumber;
+
+       /**
+        * Ending week day
+        */
+       private DayOfTheWeek openingEndDay;
+
+       /**
+        * Ending time
+        */
+       private Date openingEndTime;
+
+       /**
+        * Starting week day
+        */
+       private DayOfTheWeek openingStartDay;
+
+       /**
+        * Starting time
+        */
+       private Date openingStartTime;
+
+       /**
+        * Default constructor
+        */
+       public JobsAdminHeadquarterWebRequestBean () {
+               // Call super constructor
+               super();
+
+               // Is the opening times list there?
+               if (null == headquarterOpeningTimes) {
+                       // Init list
+                       headquarterOpeningTimes = new ArrayList<>(1);
+               }
+       }
+
+       /**
+        * Adds headquarter with all data from this backing bean. First this action
+        * method will validate if the headquarter's address is already registered
+        * and if found, it will output a proper faces message.
+        * <p>
+        * @return Redirect outcome
+        */
+       public String addHeadquarter () {
+               // Get instance
+               final Headquarter headquarter = this.createHeadquarter();
+
+               // 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
+                       return ""; //NOI18N
+               }
+
+               // Delcare updated instance
+               final Headquarter updatedHeadquarter;
+
+               try {
+                       // Try to call EJB
+                       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
+                       return ""; //NOI18N
+               }
+
+               // Fire event
+               this.headquarterAddedEvent.fire(new HeadquarterAddedEvent(updatedHeadquarter));
+
+               // Clear this bean
+               this.clear();
+
+               // Redirect to list
+               return "admin_list_headquarter_office"; //NOI18N
+       }
+
+       /**
+        * Adds opening time to temporary list which will be sent along with the
+        * headquarter data to the EJB.
+        */
+       public void addOpeningTime () {
+               // Validate all required fields
+               if (this.getOpeningEndDay() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingEndDay is null"); //NOI18N
+               } else if (this.getOpeningEndTime() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingEndTime is null"); //NOI18N
+               } else if (this.getOpeningStartDay() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingStartDay is null"); //NOI18N
+               } else if (this.getOpeningStartTime() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingStartTime is null"); //NOI18N
+               }
+
+               // Get opening time instance
+               final OpeningTime openingTime = this.createOpeningTimes();
+
+               // Is same found?
+               if (this.isSameOpeningTimeFound(openingTime)) {
+                       // Yes then abort here
+                       this.showFacesMessage("form-admin-add-headquarter-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED"); //NOI18N
+                       return;
+               }
+
+               // Add to temporary list
+               headquarterOpeningTimes.add(openingTime);
+
+               // Clear opening time fields
+               this.clearOpeningTime();
+       }
+
+       /**
+        * Getter for fax number's area code
+        * <p>
+        * @return Fax number's area code
+        */
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
+       }
+
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax's country instance
+        * <p>
+        * @param faxCountry Fax' country instance
+        */
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
+       }
+
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for city
+        * <p>
+        * @return City
+        */
+       public String getHeadquarterCity () {
+               return this.headquarterCity;
+       }
+
+       /**
+        * Setter for city
+        * <p>
+        * @param headquarterCity City
+        */
+       public void setHeadquarterCity (final String headquarterCity) {
+               this.headquarterCity = headquarterCity;
+       }
+
+       /**
+        * Getter for headquarter contact person
+        * <p>
+        * @return Headquarter contact person
+        */
+       public Employable getHeadquarterContactEmployee () {
+               return this.headquarterContactEmployee;
+       }
+
+       /**
+        * Setter for headquarter contact person
+        * <p>
+        * @param headquarterContactEmployee Headquarter contact person
+        */
+       public void setHeadquarterContactEmployee (final Employable headquarterContactEmployee) {
+               this.headquarterContactEmployee = headquarterContactEmployee;
+       }
+
+       /**
+        * Getter for country
+        * <p>
+        * @return Country
+        */
+       public Country getHeadquarterCountry () {
+               return this.headquarterCountry;
+       }
+
+       /**
+        * Setter for country
+        * <p>
+        * @param headquarterCountry Country
+        */
+       public void setHeadquarterCountry (final Country headquarterCountry) {
+               this.headquarterCountry = headquarterCountry;
+       }
+
+       /**
+        * Getter for email address
+        * <p>
+        * @return Email address
+        */
+       public String getHeadquarterEmailAddress () {
+               return this.headquarterEmailAddress;
+       }
+
+       /**
+        * Getter for email address
+        * <p>
+        * @param headquarterEmailAddress Email address
+        */
+       public void setHeadquarterEmailAddress (final String headquarterEmailAddress) {
+               this.headquarterEmailAddress = headquarterEmailAddress;
+       }
+
+       /**
+        * Getter for house number
+        * <p>
+        * @return House number
+        */
+       public Short getHeadquarterHouseNumber () {
+               return this.headquarterHouseNumber;
+       }
+
+       /**
+        * Setter for house number
+        * <p>
+        * @param headquarterHouseNumber House number
+        */
+       public void setHeadquarterHouseNumber (final Short headquarterHouseNumber) {
+               this.headquarterHouseNumber = headquarterHouseNumber;
+       }
+
+       /**
+        * Getter for opening times of this headquarter
+        * <p>
+        * @return Opening times
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<OpeningTime> getHeadquarterOpeningTimes () {
+               return headquarterOpeningTimes;
+       }
+
+       /**
+        * Setter for opening times of this headquarter
+        * <p>
+        * @param headquarterOpeningTimes Opening times
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setHeadquarterOpeningTimes (final List<OpeningTime> headquarterOpeningTimes) {
+               JobsAdminHeadquarterWebRequestBean.headquarterOpeningTimes = headquarterOpeningTimes;
+       }
+
+       /**
+        * Getter for store
+        * <p>
+        * @return Store
+        */
+       public Short getHeadquarterStore () {
+               return this.headquarterStore;
+       }
+
+       /**
+        * Setter for store
+        * <p>
+        * @param headquarterStore Store
+        */
+       public void setHeadquarterStore (final Short headquarterStore) {
+               this.headquarterStore = headquarterStore;
+       }
+
+       /**
+        * Getter for street name
+        * <p>
+        * @return Street name
+        */
+       public String getHeadquarterStreet () {
+               return this.headquarterStreet;
+       }
+
+       /**
+        * Setter for street name
+        * <p>
+        * @param headquarterStreet Street name
+        */
+       public void setHeadquarterStreet (final String headquarterStreet) {
+               this.headquarterStreet = headquarterStreet;
+       }
+
+       /**
+        * Getter for suite number
+        * <p>
+        * @return Suite number
+        */
+       public Short getHeadquarterSuiteNumber () {
+               return this.headquarterSuiteNumber;
+       }
+
+       /**
+        * Setter for suite number
+        * <p>
+        * @param headquarterSuiteNumber Suite number
+        */
+       public void setHeadquarterSuiteNumber (final Short headquarterSuiteNumber) {
+               this.headquarterSuiteNumber = headquarterSuiteNumber;
+       }
+
+       /**
+        * Getter for owning user instance
+        * <p>
+        * @return Owning user instance
+        */
+       public User getHeadquarterUserOwner () {
+               return this.headquarterUserOwner;
+       }
+
+       /**
+        * Setter for owning user instance
+        * <p>
+        * @param headquarterUserOwner Owning user instance
+        */
+       public void setHeadquarterUserOwner (final User headquarterUserOwner) {
+               this.headquarterUserOwner = headquarterUserOwner;
+       }
+
+       /**
+        * Getter for ZIP code\
+        * <p>
+        * @return ZIP code
+        */
+       public Integer getHeadquarterZipCode () {
+               return this.headquarterZipCode;
+       }
+
+       /**
+        * Setter for ZIP code\
+        * <p>
+        * @param headquarterZipCode ZIP code
+        */
+       public void setHeadquarterZipCode (final Integer headquarterZipCode) {
+               this.headquarterZipCode = headquarterZipCode;
+       }
+
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line number's area code
+        * <p>
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line number's country instance
+        * <p>
+        * @param landLineCountry Land-line number's country instance
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+       /**
+        * Getter for ending week day
+        * <p>
+        * @return Ending week day
+        */
+       public DayOfTheWeek getOpeningEndDay () {
+               return this.openingEndDay;
+       }
+
+       /**
+        * Setter for ending week day
+        * <p>
+        * @param openingEndDay Ending week day
+        */
+       public void setOpeningEndDay (final DayOfTheWeek openingEndDay) {
+               this.openingEndDay = openingEndDay;
+       }
+
+       /**
+        * Getter for ending time
+        * <p>
+        * @return Ending time
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getOpeningEndTime () {
+               return this.openingEndTime;
+       }
+
+       /**
+        * Getter for ending time
+        * <p>
+        * @param openingEndTime Ending time
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setOpeningEndTime (final Date openingEndTime) {
+               this.openingEndTime = openingEndTime;
+       }
+
+       /**
+        * Getter for starting week day
+        * <p>
+        * @return Starting week day
+        */
+       public DayOfTheWeek getOpeningStartDay () {
+               return this.openingStartDay;
+       }
+
+       /**
+        * Getter for starting week day
+        * <p>
+        * @param openingStartDay Starting week day
+        */
+       public void setOpeningStartDay (final DayOfTheWeek openingStartDay) {
+               this.openingStartDay = openingStartDay;
+       }
+
+       /**
+        * Getter for starting time
+        * <p>
+        * @return Starting time
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getOpeningStartTime () {
+               return this.openingStartTime;
+       }
+
+       /**
+        * Getter for starting time
+        * <p>
+        * @param openingStartTime Starting time
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setOpeningStartTime (final Date openingStartTime) {
+               this.openingStartTime = openingStartTime;
+       }
+
+       /**
+        * Clears this bean data
+        */
+       private void clear () {
+               // Clear all headquarter data
+               this.setHeadquarterCity(null);
+               this.setHeadquarterContactEmployee(null);
+               this.setHeadquarterCountry(null);
+               this.setHeadquarterEmailAddress(null);
+               this.setHeadquarterHouseNumber(null);
+               this.setHeadquarterStore(null);
+               this.setHeadquarterStreet(null);
+               this.setHeadquarterSuiteNumber(null);
+               this.setHeadquarterUserOwner(null);
+               this.setHeadquarterZipCode(null);
+               this.setHeadquarterOpeningTimes(null);
+
+               // Extra-clear opening time
+               this.clearOpeningTime();
+       }
+
+       /**
+        * Clears all opening time fields
+        */
+       private void clearOpeningTime () {
+               // Clear all opening time fields
+               this.setOpeningEndDay(null);
+               this.setOpeningEndTime(null);
+               this.setOpeningStartDay(null);
+               this.setOpeningStartTime(null);
+       }
+
+       /**
+        * Prepares an instance of a Headquarter object (entity) with all data from
+        * this bean. If a complete fax number or land-line number was provided, it
+        * will be set in the instance as well.
+        * <p>
+        * @return An instance of a Headquarter class (entity)
+        */
+       private Headquarter createHeadquarter () {
+               // Create new headquarter instance
+               final Headquarter headquarter = new BusinessHeadquarter(this.getHeadquarterCity(), this.getHeadquarterCountry(), this.getHeadquarterStreet(), this.getHeadquarterZipCode(), this.getHeadquarterHouseNumber());
+
+               // Add all other fields, too
+               headquarter.setHeadquarterContactEmployee(this.getHeadquarterContactEmployee());
+               headquarter.setHeadquarterEmailAddress(this.getHeadquarterEmailAddress());
+               headquarter.setHeadquarterStore(this.getHeadquarterStore());
+               headquarter.setHeadquarterSuiteNumber(this.getHeadquarterSuiteNumber());
+               headquarter.setHeadquarterUserOwner(this.getHeadquarterUserOwner());
+
+               // Generate phone number
+               final DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               final DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+
+               // Don't set null or wrong references
+               if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
+                       // Now the number must be given
+                       if (landLine.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
+                       } else if (landLine.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (landLine.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
+                       } else if (landLine.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
+                       }
+
+                       // Set phone number
+                       headquarter.setHeadquarterLandLineNumber(landLine);
+               }
+
+               // Don't set null or wrong references
+               if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
+                       // Now the number must be given
+                       if (fax.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
+                       } else if (fax.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (fax.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
+                       } else if (fax.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
+                       }
+
+                       // Set fax number
+                       headquarter.setHeadquarterFaxNumber(fax);
+               }
+               // Is the opening times list filled?
+               if (!this.getHeadquarterOpeningTimes().isEmpty()) {
+                       // Yes, then set in headquarter, too
+                       headquarter.setHeadquarterOpeningTimes(this.getHeadquarterOpeningTimes());
+               }
+
+               // Return fully prepared instance
+               return headquarter;
+       }
+
+       /**
+        * Prepares an instance of a OpeningTimes object (entity) with all data from
+        * this bean. If a complete fax number or land-line number was provided, it
+        * will be set in the instance as well.
+        * <p>
+        * @return An instance of a OpeningTimes class (entity)
+        */
+       private OpeningTime createOpeningTimes () {
+               // Create new openingTime instance
+               final OpeningTime openingTime = new BusinessOpeningTime(this.getOpeningEndDay(), this.getOpeningEndTime(), this.getOpeningStartDay(), this.getOpeningStartTime());
+
+               // Return fully prepared instance
+               return openingTime;
+       }
+
+       /**
+        * Checks whether the given headquarter' address is already found in local
+        * cache. Please note that this method fully relies on the cache, so you
+        * must always fire proper events that add/update/delete entries in cache.
+        * <p>
+        * @param headquarter Headquarter to check it's address
+        * <p>
+        * @return Whether the address has been found
+        */
+       private boolean isHeadquarterCreatedByRequiredData (final Headquarter headquarter) {
+               // Get full list from other bean
+               final List<Headquarter> allHeadquarter = this.headquarterController.allHeadquarter();
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Now check each entry
+               for (final Headquarter hq : allHeadquarter) {
+                       // Is same address?
+                       if (Headquarters.isSameAddress(hq, headquarter)) {
+                               // Found one
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+       /**
+        * Checks if given opening time is already added
+        * <p>
+        * @param openingTime Opening time to be checked
+        * <p>
+        * @return Whether it has been added already
+        */
+       private boolean isSameOpeningTimeFound (final OpeningTime openingTime) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Loop through list
+               for (final OpeningTime ot : this.getHeadquarterOpeningTimes()) {
+                       // Check it
+                       if (Objects.equals(ot, openingTime)) {
+                               // Found same match
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return it
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestController.java
new file mode 100644 (file)
index 0000000..f4e9133
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.headquarter;
+
+import java.io.Serializable;
+
+/**
+ * An interface for administrative headquarter controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsAdminHeadquarterWebRequestController extends Serializable {
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestBean.java
new file mode 100644 (file)
index 0000000..892c951
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.headquarter;
+
+import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
+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;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.headquarter.added.ObservableHeadquarterAddedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterNotFoundException;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+
+/**
+ * A general bean for headquarter
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("headquarterController")
+@RequestScoped
+public class JobsHeadquarterWebRequestBean extends BaseJobsBean implements JobsHeadquarterWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 5_028_697_360_465L;
+
+       /**
+        * A list of all headquarter
+        */
+       private final List<Headquarter> allHeadquarter;
+
+       /**
+        * A list of filtered headquarter
+        */
+       private List<Headquarter> filteredHeadquarter;
+
+       /**
+        * EJB for administrative purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
+       private HeadquarterSessionBeanRemote headquarterBean;
+
+       /**
+        * A list of all headquarter (globally)
+        */
+       @Inject
+       @NamedCache (cacheName = "headquarterCache")
+       private Cache<Long, Headquarter> headquarterCache;
+
+       /**
+        * Default constructor
+        */
+       public JobsHeadquarterWebRequestBean () {
+               // Call super constructor
+               super();
+
+               // Init list
+               this.allHeadquarter = new LinkedList<>();
+       }
+
+       /**
+        * Observes events being fired when a branch office has been added.
+        * <p>
+        * @param event Event being fired
+        * <p>
+        * @throws NullPointerException If the parameter or it's carried instance is
+        * null
+        * @throws IllegalArgumentException If the branchId is zero or lower
+        */
+       public void afterHeadquarterAddedEvent (@Observes final ObservableHeadquarterAddedEvent event) {
+               // Validate parameter
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getHeadquarter() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.headquarter is null"); //NOI18N
+               } else if (event.getHeadquarter().getHeadquarterId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("event.headquarter.branchId is null"); //NOI18N
+               } else if (event.getHeadquarter().getHeadquarterId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("event.headquarter.branchId={0} is not valid", event.getHeadquarter().getHeadquarterId())); //NOI18N
+               }
+
+               // Add instance to cache
+               this.headquarterCache.put(event.getHeadquarter().getHeadquarterId(), event.getHeadquarter());
+               this.allHeadquarter.add(event.getHeadquarter());
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<Headquarter> allHeadquarter () {
+               return this.allHeadquarter;
+       }
+
+       @Override
+       public Headquarter findHeadquarterById (final Long headquarterId) throws HeadquarterNotFoundException {
+               // Validate parameter
+               if (null == headquarterId) {
+                       // Throw NPE
+                       throw new NullPointerException("headquarterId is null"); //NOI18N
+               } else if (headquarterId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("headquarterId={0} is invalid", headquarterId)); //NOI18N
+               } else if (!this.headquarterCache.containsKey(headquarterId)) {
+                       // Not found
+                       throw new HeadquarterNotFoundException(headquarterId);
+               }
+
+               // Get it from cache
+               final Headquarter headquarter = this.headquarterCache.get(headquarterId);
+
+               // Return it
+               return headquarter;
+       }
+
+       /**
+        * Getter for a list of filtered headquarter
+        * <p>
+        * @return Filtered headquarter
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<Headquarter> getFilteredHeadquarter () {
+               return this.filteredHeadquarter;
+       }
+
+       /**
+        * Setter for a list of filtered headquarter
+        * <p>
+        * @param filteredHeadquarter Filtered headquarter
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setFilteredHeadquarter (final List<Headquarter> filteredHeadquarter) {
+               this.filteredHeadquarter = filteredHeadquarter;
+       }
+
+       /**
+        * Initializer method
+        */
+       @PostConstruct
+       public void initializeList () {
+               // Is cache there?
+               if (!this.headquarterCache.iterator().hasNext()) {
+                       // Get whole list
+                       final List<Headquarter> Headquarter = this.headquarterBean.allHeadquarters();
+
+                       // Add all
+                       for (final Headquarter headquarter : Headquarter) {
+                               // Add it to cache
+                               this.headquarterCache.put(headquarter.getHeadquarterId(), headquarter);
+                       }
+               }
+
+               // Is the list empty, but filled cache?
+               if (this.allHeadquarter.isEmpty() && this.headquarterCache.iterator().hasNext()) {
+                       // Get iterator
+                       final Iterator<Cache.Entry<Long, Headquarter>> iterator = this.headquarterCache.iterator();
+
+                       // Build up list
+                       while (iterator.hasNext()) {
+                               // GEt next element
+                               final Cache.Entry<Long, Headquarter> next = iterator.next();
+
+                               // Add to list
+                               this.allHeadquarter.add(next.getValue());
+                       }
+
+                       // Sort list
+                       this.allHeadquarter.sort(new Comparator<Headquarter>() {
+                               @Override
+                               public int compare (final Headquarter o1, final Headquarter o2) {
+                                       return o1.getHeadquarterId() > o2.getHeadquarterId() ? 1 : o1.getHeadquarterId() < o2.getHeadquarterId() ? -1 : 0;
+                               }
+                       });
+               }
+       }
+
+       @Override
+       public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final Headquarter headquarter : this.allHeadquarter()) {
+                       // Is email address used?
+                       if (Objects.equals(headquarter.getHeadquarterEmailAddress(), emailAddress)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsHeadquarterWebRequestController.java
new file mode 100644 (file)
index 0000000..9d65fba
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.headquarter;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterNotFoundException;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+
+/**
+ * An interface for general Headquarter controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsHeadquarterWebRequestController extends Serializable {
+
+       /**
+        * Checks if given email address is already registered by an other
+        * headquarter
+        * <p>
+        * @param emailAddress Email address
+        * <p>
+        * @return Whether the email address has been already registered
+        */
+       Boolean isEmailAddressRegistered (final String emailAddress);
+
+       /**
+        * Returns a list of all headquarter
+        * <p>
+        * @return A list of all headquarter
+        */
+       List<Headquarter> allHeadquarter ();
+
+       /**
+        * Tries to find a headquarter with given id number
+        * <p>
+        * @param headquarterId Headquarter id
+        * <p>
+        * @return A headquarter instance
+        * <p>
+        * @throws HeadquarterNotFoundException If the headquarter was not found
+        */
+       Headquarter findHeadquarterById (final Long headquarterId) throws HeadquarterNotFoundException;
+
+}
index a419047d0e5e491f7c182896192cd0ade6d723e7..35ae96aac60ecc18865029b560187f1599cdd7a0 100644 (file)
@@ -1115,7 +1115,7 @@ public class JobsContactWebRequestBean extends BaseJobsBean implements JobsConta
        }
 
        @Override
-       public boolean isEmailAddressRegistered (String emailAddress) {
+       public boolean isEmailAddressRegistered (final String emailAddress) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
index a6ac5b7c980d41b3b2ed455e5d9265a108d6063e..5bc0b0fcf968cfe5d6606663eb6ef433c1d73c49 100644 (file)
@@ -27,7 +27,8 @@ import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEve
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
@@ -567,44 +568,71 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq
        }
 
        /**
-        * Returns the headquarters address. If null is provided, an empty string is
+        * Returns the product name and price. If null is provided, an empty string
+        * is returned.
+        * <p>
+        * @param product Product instance
+        * <p>
+        * @return Product name
+        */
+       public String renderGenericProduct (final Product product) {
+               // Default is empty string, so let's get started
+               final StringBuilder sb = new StringBuilder(10);
+
+               // Is a product set?
+               if (product instanceof Product) {
+                       // Add name and price
+                       sb.append(this.getMessageFromBundle(product.getProductI18nKey()));
+                       sb.append(" ("); //NOI18N
+                       sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice()));
+                       sb.append(" "); //NOI18N
+                       sb.append(product.getProductCurrencyCode());
+                       sb.append(")"); //NOI18N
+               }
+
+               // Return it
+               return sb.toString();
+       }
+
+       /**
+        * Returns the headquarter address. If null is provided, an empty string is
         * returned.
         * <p>
-        * @param headquarters Headquarters instance
+        * @param headquarter Headquarter instance
         * <p>
-        * @return Headquarters address
+        * @return Headquarter address
         */
-       public String renderHeadquarters (final HeadquartersData headquarters) {
+       public String renderHeadquarter (final Headquarter headquarter) {
                // Default is empty string, so let's get started
                final StringBuilder sb = new StringBuilder(10);
 
-               // Is a headquarters set?
-               if (headquarters instanceof HeadquartersData) {
+               // Is a headquarter set?
+               if (headquarter instanceof Headquarter) {
                        // Then create name
-                       sb.append(headquarters.getHeadquartersStreet());
+                       sb.append(headquarter.getHeadquarterStreet());
                        sb.append(" "); //NOI18N
-                       sb.append(headquarters.getHeadquartersHouseNumber());
+                       sb.append(headquarter.getHeadquarterHouseNumber());
 
                        // Is store/suite number set?
-                       if (headquarters.getHeadquartersStore() instanceof Short) {
+                       if (headquarter.getHeadquarterStore() instanceof Short) {
                                sb.append(" ("); //NOI18N
                                sb.append(this.getMessageFromBundle("DATA_STORE")); //NOI18N
                                sb.append(" "); //NOI18N
-                               sb.append(headquarters.getHeadquartersStore());
+                               sb.append(headquarter.getHeadquarterStore());
                                sb.append(", "); //NOI18N
                                sb.append(this.getMessageFromBundle("DATA_SUITE_NUMBER")); //NOI18N
                                sb.append(" "); //NOI18N
-                               sb.append(headquarters.getHeadquartersSuiteNumber());
+                               sb.append(headquarter.getHeadquarterSuiteNumber());
                                sb.append(")"); //NOI18N
                        }
 
                        // Continue with country, ZIP code and city
                        sb.append(", "); //NOI18N
-                       sb.append(headquarters.getHeadquartersCountry().getCountryCode());
+                       sb.append(headquarter.getHeadquarterCountry().getCountryCode());
                        sb.append(" "); //NOI18N
-                       sb.append(headquarters.getHeadquartersZipCode());
+                       sb.append(headquarter.getHeadquarterZipCode());
                        sb.append(" "); //NOI18N
-                       sb.append(headquarters.getHeadquartersCity());
+                       sb.append(headquarter.getHeadquarterCity());
                }
 
                // Return it
index 83b20e21d20a22237689d51f9d9e60bb700c62b8..4f41c2b4339e72ef5b753cde983b601b0d21ae05 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jjobs.beans.business.basicdata.JobsBusinessDataWebRequestBean;
-import org.mxchange.jjobs.beans.business.basicdata.JobsBusinessDataWebRequestController;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController;
 
 /**
  * Converter for basic company data id <-> valid basic company data instance
@@ -38,14 +38,14 @@ public class JobsBasicCompanyDataConverter implements Converter<BasicData> {
        /**
         * Basic company data backing bean
         */
-       private static JobsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
+       private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
 
        @Override
        public BasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (BASIC_DATA_CONTROLLER == null) {
+               if (null == BASIC_DATA_CONTROLLER) {
                        // Get bean from CDI directly
-                       BASIC_DATA_CONTROLLER = CDI.current().select(JobsBusinessDataWebRequestBean.class).get();
+                       BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get();
                }
 
                // Is the value null or empty?
index 5c700adfc435cfd7ab8b9520ba5141d0a34b4683..6d72217f66186913b9a7c9d9dfae77ad7b6956b8 100644 (file)
@@ -43,7 +43,7 @@ public class JobsBranchOfficeConverter implements Converter<BranchOffice> {
        @Override
        public BranchOffice getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (BRANCH_OFFICE_CONTROLLER == null) {
+               if (null == BRANCH_OFFICE_CONTROLLER) {
                        // Get bean from CDI directly
                        BRANCH_OFFICE_CONTROLLER = CDI.current().select(JobsBranchOfficeWebRequestBean.class).get();
                }
index b84061d7adfc08c40895842814721239e5e73395..b480e600261b969af7455adb138cec17200a55c8 100644 (file)
@@ -43,7 +43,7 @@ public class JobsDepartmentConverter implements Converter<Department> {
        @Override
        public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (DEPARTMENT_CONTROLLER == null) {
+               if (null == DEPARTMENT_CONTROLLER) {
                        // Get bean from CDI directly
                        DEPARTMENT_CONTROLLER = CDI.current().select(JobsDepartmentWebRequestBean.class).get();
                }
index 65cc395ea42edf6a05c7de55ee19645baab36bbf..646af467eac270db10e2ec728ef50dd1d1ce6d49 100644 (file)
@@ -43,7 +43,7 @@ public class JobsEmployeeConverter implements Converter<Employable> {
        @Override
        public Employable getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (EMPLOYEE_CONTROLLER == null) {
+               if (null == EMPLOYEE_CONTROLLER) {
                        // Get bean from CDI directly
                        EMPLOYEE_CONTROLLER = CDI.current().select(JobsEmployeeWebRequestBean.class).get();
                }
diff --git a/src/java/org/mxchange/jjobs/converter/business/headquarter/JobsHeadquarterConverter.java b/src/java/org/mxchange/jjobs/converter/business/headquarter/JobsHeadquarterConverter.java
new file mode 100644 (file)
index 0000000..0ee2ea4
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.converter.business.headquarter;
+
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterNotFoundException;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jjobs.beans.business.headquarter.JobsHeadquarterWebRequestBean;
+import org.mxchange.jjobs.beans.business.headquarter.JobsHeadquarterWebRequestController;
+
+/**
+ * Converter for converting company headquarter to and from id number
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("HeadquarterConverter")
+public class JobsHeadquarterConverter implements Converter<Headquarter> {
+
+       /**
+        * Headquarter backing bean
+        */
+       private static JobsHeadquarterWebRequestController HEADQUARTER_CONTROLLER;
+
+       @Override
+       public Headquarter getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the instance there?
+               if (null == HEADQUARTER_CONTROLLER) {
+                       HEADQUARTER_CONTROLLER = CDI.current().select(JobsHeadquarterWebRequestBean.class).get();
+               }
+
+               // Init instance
+               Headquarter headquarter = null;
+
+               try {
+                       // Try to parse the value as long
+                       final Long headquarterId = Long.valueOf(submittedValue);
+
+                       // Try to get user instance from it
+                       headquarter = HEADQUARTER_CONTROLLER.findHeadquarterById(headquarterId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final HeadquarterNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Return it
+               return headquarter;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Headquarter value) {
+               // Is the object null?
+               if ((null == value) || (String.valueOf(value).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               }
+
+               // Return id number
+               return String.valueOf(value.getHeadquarterId());
+       }
+
+}
index 8fc86430890443281f6458e7e138c7aaaadcf805..1d88fc8318ebf2529426dbc51bb365674eed5421 100644 (file)
@@ -43,7 +43,7 @@ public class JobsCompanyOpeningTimeConverter implements Converter<OpeningTime> {
        @Override
        public OpeningTime getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (OPENING_TIMES_CONTROLLER == null) {
+               if (null == OPENING_TIMES_CONTROLLER) {
                        // Get bean from CDI directly
                        OPENING_TIMES_CONTROLLER = CDI.current().select(JobsOpeningTimeWebRequestBean.class).get();
                }
index 2731b969753ab6c4a186ae97acde72aca252d13d..b57562bfeb9d33fa334f378b36b38bc54462e069 100644 (file)
@@ -43,7 +43,7 @@ public class JobsContactConverter implements Converter<Contact> {
        @Override
        public Contact getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (CONTACT_CONTROLLER == null) {
+               if (null == CONTACT_CONTROLLER) {
                        // Get bean from CDI directly
                        CONTACT_CONTROLLER = CDI.current().select(JobsContactWebRequestBean.class).get();
                }
index 4289c3daae7c8cfc0792719a2eaed5500b7b4636..bf0f546170d9b9ee9e78b0ab4acb32453e665316 100644 (file)
@@ -43,7 +43,7 @@ public class JobsCountryConverter implements Converter<Country> {
        @Override
        public Country getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (COUNTRY_CONTROLLER == null) {
+               if (null == COUNTRY_CONTROLLER) {
                        // Get bean from CDI directly
                        COUNTRY_CONTROLLER = CDI.current().select(JobsCountryWebRequestBean.class).get();
                }
index 225fdea6d8e98c3e5e5c46ea34c32c77cd28c799..c97b4542c921eeba6d77996cd9597d5443bc5f0c 100644 (file)
@@ -43,7 +43,7 @@ public class JobsFaxNumberConverter implements Converter<DialableFaxNumber> {
        @Override
        public DialableFaxNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_CONTROLLER == null) {
+               if (null == PHONE_CONTROLLER) {
                        // Get bean from CDI directly
                        PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();
                }
index ed7f613e9b1d0caf93007a6479a9dbda3b4d996f..c18992f40b5ca3db35e4e42d39a793bab1513430 100644 (file)
@@ -43,7 +43,7 @@ public class JobsLandLineNumberConverter implements Converter<DialableLandLineNu
        @Override
        public DialableLandLineNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_CONTROLLER == null) {
+               if (null == PHONE_CONTROLLER) {
                        // Get bean from CDI directly
                        PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();
                }
index 2cf27482a01c837748936c6f0b756635583846ea..b35e80d437c47a1423e36f1b577fed4087057896 100644 (file)
@@ -43,7 +43,7 @@ public class JobsMobileNumberConverter implements Converter<DialableMobileNumber
        @Override
        public DialableMobileNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (PHONE_CONTROLLER == null) {
+               if (null == PHONE_CONTROLLER) {
                        // Get bean from CDI directly
                        PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();
                }
index 408f8fc9e9fdd762970516a0f6de7a0ef38d492a..8f60aecb622a04725279327dca788bd82bd32e53 100644 (file)
@@ -43,7 +43,7 @@ public class JobsMobileProviderConverter implements Converter<MobileProvider> {
        @Override
        public MobileProvider getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (MOBILE_PROVIDER_CONTROLLER == null) {
+               if (null == MOBILE_PROVIDER_CONTROLLER) {
                        // Get bean from CDI directly
                        MOBILE_PROVIDER_CONTROLLER = CDI.current().select(JobsMobileProviderWebRequestBean.class).get();
                }
index e9e4dcc5f77eb1d56db73b7e00274b59e8c835a3..579faef24a9d4b9e64e410d1d59a7fbeeea2e1c7 100644 (file)
@@ -43,7 +43,7 @@ public class JobsUserConverter implements Converter<User> {
        @Override
        public User getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (USER_CONTROLLER == null) {
+               if (null == USER_CONTROLLER) {
                        // Get bean from CDI directly
                        USER_CONTROLLER = CDI.current().select(JobsUserWebRequestBean.class).get();
                }
index 1d45b7ae795905e4f47e796412155903d4694b8c..3cc67c6f47918a87fcb8d6f7731987812d0e9bce 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
-import org.mxchange.jjobs.beans.business.basicdata.JobsBusinessDataWebRequestBean;
-import org.mxchange.jjobs.beans.business.basicdata.JobsBusinessDataWebRequestController;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController;
 
 /**
  * A validator for company names
@@ -38,7 +38,7 @@ public class JobsCompanyNameValidator extends BaseStringValidator {
        /**
         * Business basic data backing bean
         */
-       private static JobsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
+       private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
 
        /**
         * Serial number
@@ -48,9 +48,9 @@ public class JobsCompanyNameValidator extends BaseStringValidator {
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Is the instance there?
-               if (BASIC_DATA_CONTROLLER == null) {
+               if (null == BASIC_DATA_CONTROLLER) {
                        // Get bean from CDI directly
-                       BASIC_DATA_CONTROLLER = CDI.current().select(JobsBusinessDataWebRequestBean.class).get();
+                       BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get();
                }
 
                // All accepted, required fields
index f83f4ebc04cd6279ac670e1b75941191cde85a93..24d96d790f600fb0273ca5d9191e48055906a8ec 100644 (file)
@@ -58,12 +58,6 @@ public class JobsEmailAddressValidator extends BaseStringValidator {
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
-               // Is the instance there?
-               if (CONTACT_CONTROLLER == null) {
-                       // Get bean from CDI directly
-                       CONTACT_CONTROLLER = CDI.current().select(JobsContactWebRequestBean.class).get();
-               }
-
                // The required field
                final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
 
@@ -117,6 +111,12 @@ public class JobsEmailAddressValidator extends BaseStringValidator {
                // Get client id (aka form id)
                final String clientId = component.getClientId();
 
+               // Is the instance there?
+               if (null == CONTACT_CONTROLLER) {
+                       // Get bean from CDI directly
+                       CONTACT_CONTROLLER = CDI.current().select(JobsContactWebRequestBean.class).get();
+               }
+
                // Is it registered?
                final Boolean isRegistered = CONTACT_CONTROLLER.isEmailAddressRegistered(emailAddress);
 
diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java
new file mode 100644 (file)
index 0000000..3a6b076
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.validator.emailaddress.basicdata;
+
+import java.text.MessageFormat;
+import java.util.regex.Pattern;
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean;
+import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController;
+
+/**
+ * A validator for basic company data email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "BasicDataEmailAddressValidator")
+public class JobsBasicDataEmailAddressValidator extends BaseStringValidator {
+
+       /**
+        * Branch office backing bean
+        */
+       private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
+
+       /**
+        * Email pattern
+        */
+       private static final String EMAIL_REGEX = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; //NOI18N
+
+       /**
+        * Pattern matcher
+        */
+       private static final Pattern PATTERN_MATCHER = Pattern.compile(JobsBasicDataEmailAddressValidator.EMAIL_REGEX);
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 187_536_745_607_195L;
+
+       @Override
+       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // The required field
+               final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
+
+               // Default is to reject empty email address fields
+               Boolean allowEmptyValue = Boolean.FALSE;
+
+               // Is attribute "allowEmptyValue" set?
+               if (component.getAttributes().containsKey("allowEmptyValue")) { //NOI18N
+                       // Get attribute
+                       final Object attribute = component.getAttributes().get("allowEmptyValue"); //NOI18N
+
+                       // Make sure, it is Boolean as no String is accepted anymore
+                       if (!(attribute instanceof String)) {
+                               // Not valid attribute, please use "true" or "false" (default)
+                               throw new IllegalArgumentException("allowEmptyValue must be of type String. Please use \"true\" or \"false\" for f:attribute value."); //NOI18N
+                       }
+
+                       // Securely cast it
+                       allowEmptyValue = Boolean.parseBoolean((String) attribute);
+               }
+
+               // Pre-validation (example: not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFields, allowEmptyValue);
+
+               // Is the email address empty and allowed?
+               if (null == value && allowEmptyValue) {
+                       // Then accept this here
+                       return;
+               } else if (null == value) {
+                       // Abort here
+                       throw new ValidatorException(new FacesMessage("No empty email address allowed.")); //NOI18N
+               }
+
+               // Get string from object ... ;-)
+               // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat
+               final String emailAddress = String.valueOf(value).trim();
+
+               // Checks if the email address matches a regex ("low-level" check)
+               // @TODO Should also be done by <f:validatorRegex />)
+               final boolean matches = PATTERN_MATCHER.matcher(emailAddress).matches(); //NOI18N
+
+               // Is the email address valid?
+               if (!matches) {
+                       // Generate message
+                       String message = MessageFormat.format("Email address {0} does not match regular expression.", emailAddress); //NOI18N
+
+                       // Not matching
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message));
+               }
+
+               // Get client id (aka form id)
+               final String clientId = component.getClientId();
+
+               // Is the instance there?
+               if (null == BASIC_DATA_CONTROLLER) {
+                       // Get bean from CDI directly
+                       BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get();
+               }
+
+               // Is it registered?
+               final Boolean isRegistered = BASIC_DATA_CONTROLLER.isEmailAddressRegistered(emailAddress);
+
+               // Is the email address already registered?
+               if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               }
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java
new file mode 100644 (file)
index 0000000..acc93b9
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.validator.emailaddress.branchoffice;
+
+import java.text.MessageFormat;
+import java.util.regex.Pattern;
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jjobs.beans.business.branchoffice.JobsBranchOfficeWebRequestBean;
+import org.mxchange.jjobs.beans.business.branchoffice.JobsBranchOfficeWebRequestController;
+
+/**
+ * A validator for branch office email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "BranchOfficeEmailAddressValidator")
+public class JobsBranchOfficeEmailAddressValidator extends BaseStringValidator {
+
+       /**
+        * Branch office backing bean
+        */
+       private static JobsBranchOfficeWebRequestController BRANCH_OFFICE_CONTROLLER;
+
+       /**
+        * Email pattern
+        */
+       private static final String EMAIL_REGEX = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; //NOI18N
+
+       /**
+        * Pattern matcher
+        */
+       private static final Pattern PATTERN_MATCHER = Pattern.compile(JobsBranchOfficeEmailAddressValidator.EMAIL_REGEX);
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 187_536_745_607_195L;
+
+       @Override
+       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // The required field
+               final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
+
+               // Default is to reject empty email address fields
+               Boolean allowEmptyValue = Boolean.FALSE;
+
+               // Is attribute "allowEmptyValue" set?
+               if (component.getAttributes().containsKey("allowEmptyValue")) { //NOI18N
+                       // Get attribute
+                       final Object attribute = component.getAttributes().get("allowEmptyValue"); //NOI18N
+
+                       // Make sure, it is Boolean as no String is accepted anymore
+                       if (!(attribute instanceof String)) {
+                               // Not valid attribute, please use "true" or "false" (default)
+                               throw new IllegalArgumentException("allowEmptyValue must be of type String. Please use \"true\" or \"false\" for f:attribute value."); //NOI18N
+                       }
+
+                       // Securely cast it
+                       allowEmptyValue = Boolean.parseBoolean((String) attribute);
+               }
+
+               // Pre-validation (example: not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFields, allowEmptyValue);
+
+               // Is the email address empty and allowed?
+               if (null == value && allowEmptyValue) {
+                       // Then accept this here
+                       return;
+               } else if (null == value) {
+                       // Abort here
+                       throw new ValidatorException(new FacesMessage("No empty email address allowed.")); //NOI18N
+               }
+
+               // Get string from object ... ;-)
+               // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat
+               final String emailAddress = String.valueOf(value).trim();
+
+               // Checks if the email address matches a regex ("low-level" check)
+               // @TODO Should also be done by <f:validatorRegex />)
+               final boolean matches = PATTERN_MATCHER.matcher(emailAddress).matches(); //NOI18N
+
+               // Is the email address valid?
+               if (!matches) {
+                       // Generate message
+                       String message = MessageFormat.format("Email address {0} does not match regular expression.", emailAddress); //NOI18N
+
+                       // Not matching
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message));
+               }
+
+               // Get client id (aka form id)
+               final String clientId = component.getClientId();
+
+               // Is the instance there?
+               if (null == BRANCH_OFFICE_CONTROLLER) {
+                       // Get bean from CDI directly
+                       BRANCH_OFFICE_CONTROLLER = CDI.current().select(JobsBranchOfficeWebRequestBean.class).get();
+               }
+
+               // Is it registered?
+               final Boolean isRegistered = BRANCH_OFFICE_CONTROLLER.isEmailAddressRegistered(emailAddress);
+
+               // Is the email address already registered?
+               if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               }
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java
new file mode 100644 (file)
index 0000000..aa566f7
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.validator.emailaddress.headquarter;
+
+import java.text.MessageFormat;
+import java.util.regex.Pattern;
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jjobs.beans.business.headquarter.JobsHeadquarterWebRequestBean;
+import org.mxchange.jjobs.beans.business.headquarter.JobsHeadquarterWebRequestController;
+
+/**
+ * A validator for headquarter's email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "HeadquarterEmailAddressValidator")
+public class JobsHeadquarterEmailAddressValidator extends BaseStringValidator {
+
+       /**
+        * Email pattern
+        */
+       private static final String EMAIL_REGEX = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; //NOI18N
+
+       /**
+        * Headquarter backing bean
+        */
+       private static JobsHeadquarterWebRequestController HEADQUARTER_CONTROLLER;
+
+       /**
+        * Pattern matcher
+        */
+       private static final Pattern PATTERN_MATCHER = Pattern.compile(JobsHeadquarterEmailAddressValidator.EMAIL_REGEX);
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 187_536_745_607_194L;
+
+       @Override
+       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // The required field
+               final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
+
+               // Default is to reject empty email address fields
+               Boolean allowEmptyValue = Boolean.FALSE;
+
+               // Is attribute "allowEmptyValue" set?
+               if (component.getAttributes().containsKey("allowEmptyValue")) { //NOI18N
+                       // Get attribute
+                       final Object attribute = component.getAttributes().get("allowEmptyValue"); //NOI18N
+
+                       // Make sure, it is Boolean as no String is accepted anymore
+                       if (!(attribute instanceof String)) {
+                               // Not valid attribute, please use "true" or "false" (default)
+                               throw new IllegalArgumentException("allowEmptyValue must be of type String. Please use \"true\" or \"false\" for f:attribute value."); //NOI18N
+                       }
+
+                       // Securely cast it
+                       allowEmptyValue = Boolean.parseBoolean((String) attribute);
+               }
+
+               // Pre-validation (example: not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFields, allowEmptyValue);
+
+               // Is the email address empty and allowed?
+               if (null == value && allowEmptyValue) {
+                       // Then accept this here
+                       return;
+               } else if (null == value) {
+                       // Abort here
+                       throw new ValidatorException(new FacesMessage("No empty email address allowed.")); //NOI18N
+               }
+
+               // Get string from object ... ;-)
+               // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat
+               final String emailAddress = String.valueOf(value).trim();
+
+               // Checks if the email address matches a regex ("low-level" check)
+               // @TODO Should also be done by <f:validatorRegex />)
+               final boolean matches = PATTERN_MATCHER.matcher(emailAddress).matches(); //NOI18N
+
+               // Is the email address valid?
+               if (!matches) {
+                       // Generate message
+                       String message = MessageFormat.format("Email address {0} does not match regular expression.", emailAddress); //NOI18N
+
+                       // Not matching
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_WARN, message, message));
+               }
+
+               // Get client id (aka form id)
+               final String clientId = component.getClientId();
+
+               // Is the instance there?
+               if (null == HEADQUARTER_CONTROLLER) {
+                       // Get bean from CDI directly
+                       HEADQUARTER_CONTROLLER = CDI.current().select(JobsHeadquarterWebRequestBean.class).get();
+               }
+
+               // Is it registered?
+               final Boolean isRegistered = HEADQUARTER_CONTROLLER.isEmailAddressRegistered(emailAddress);
+
+               // Is the email address already registered?
+               if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N
+                       // Generate message
+                       final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N
+
+                       // No, then abort here
+                       throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
+               }
+       }
+
+}
index b416b0e8e59627e0749b56daf8390dda47447db2..d3bc56a9365a18537f0b6c45c0d48ff4202c07b8 100644 (file)
@@ -47,18 +47,18 @@ public class JobsUserIdValidator extends BaseNumberValidator {
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
-               // Is the instance there?
-               if (USER_CONTROLLER == null) {
-                       // Get bean from CDI directly
-                       USER_CONTROLLER = CDI.current().select(JobsUserWebRequestBean.class).get();
-               }
-
                // All accepted, required fields
                final String[] requiredFields = {"userId"}; //NOI18N
 
                // Pre-validation (example: not null, not a string, empty string ...)
                super.preValidate(context, component, value, requiredFields, false);
 
+               // Is the instance there?
+               if (null == USER_CONTROLLER) {
+                       // Get bean from CDI directly
+                       USER_CONTROLLER = CDI.current().select(JobsUserWebRequestBean.class).get();
+               }
+
                // Cast value
                final Long userId = (Long) value;
 
index 6353d3c701748cdd89f62b54cded3e1a91c14ecc..ebad34de14267854cc487afb58ccc32a8b33361e 100644 (file)
@@ -492,6 +492,7 @@ ADMIN_LINK_EXPORT_CONTACT=Kontaktdaten exportieren
 ADMIN_LINK_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren
 PERSONAL_DATA_BIRTHDAY=Geburtsdatum (tt.mm.jjjj):
 DATE_PATTERN=dd.MM.yyyy
+DATE_TIME_PATTERN=dd.MM.yyyy HH:mm:ss
 ADMIN_EXPORT_CONTACT_ID=Kontaktdaten-Id
 ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Anrede
 ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Titel
@@ -578,7 +579,6 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Fehler: Instanz 'user' im Bean-Helper nicht geset
 ERROR_BEAN_HELPER_CONTACT_NOT_SET=Fehler: Instanz 'contact' im Bean-Helper nicht gesetzt.
 ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Fehler: Instanz 'mobile' in Bean-Helper nicht gesetzt.
 CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=Auflisten von Mobiltelefonnummern:
-ADMIN_LIST_MOBILE_EMPTY=Es sind keine Mobilfunknummern gespeichert.
 ADMIN_MENU_PHONE_NUMBERS_TITLE=Telefonnummern:
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Handynummern
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=Alle Mobilfunknummern auflisten.
@@ -629,17 +629,15 @@ ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS=Festnetznummern ...
 ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Listet alle Festnetznummern auf.
 ADMIN_LINK_LIST_FAX_PHONE_NUMBERS=Faxnummern
 ADMIN_LINK_LIST_FAX_PHONE_NUMBERS_TITLE=Listet alle Faxnummern auf.
-ADMIN_LIST_FAX_NUMBER_EMPTY=Es sind keine Faxnummern gelistet.
 PAGE_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=Faxnummern auflisten
 CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=Auflisten von Faxnummern:
 PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=Festnetznummern auflisten
 CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=Auflisten von Festnetznummern:
-ADMIN_SHOW_PHONE_NUMBER=Festnetznummer:
+ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer:
 PAGE_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer anzeigen
 CONTENT_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer anzeigen:
 ERROR_BEAN_HELPER_LAND_LINE_NUMBER_NOT_SET=Fehler: Instanz 'landLine' nicht in Bean-Helper gesetzt.
 ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_LINKS=Alle Festnetznummer-Verkn\u00fcpfungen f\u00fcr Id-Nummer {0}:
-ADMIN_LIST_LAND_LINE_EMPTY=Es sind keine Festnetznummern gelistet.
 ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_DATA=Daten der Festnetznummer:
 ADMIN_SHOW_LAND_LINE_NUMBER_COMPLETE=Vollst\u00e4ndige Festnetznummer:
 ADMIN_HEADER_SHOW_FAX_NUMBER_DATA=Daten der Faxnummer:
@@ -789,36 +787,36 @@ GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Bitte wiederholen Sie das eingege
 PAGE_TITLE_ADMIN_AREA=Administration
 #@TODO Please fix German umlauts!
 ADMIN_MENU_BUSINESS_CONTACT_TITLE=Geschaeftliche Kontakte
-ADMIN_LINK_LIST_BASIC_COMPANY_DATA=Unternehmensstammdaten
-ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE=Listet Stammdaten von Unternehmen auf.
-PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Stammdaten auflisten
+ADMIN_LINK_LIST_BASIC_DATA=Unternehmensstammdaten
+ADMIN_LINK_LIST_BASIC_DATA_TITLE=Listet Stammdaten von Unternehmen auf.
+PAGE_TITLE_ADMIN_LIST_BASIC_DATA=Stammdaten auflisten
 #@TODO Please fix German umlauts!
-CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Auflisten von Stammdaten
+CONTENT_TITLE_ADMIN_LIST_BASIC_DATA=Auflisten von Stammdaten
 #@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_BASIC_COMPANY_DATA=Es befinden sich keine Stammdaten in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_EMPTY_LIST_BASIC_DATA=Es befinden sich keine Stammdaten in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
-TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=Diese Tabelle listet Stammdaten auf.
-ADMIN_HEADER_BASIC_COMPANY_DATA_ID=Id-Nummer:
+TABLE_SUMMARY_ADMIN_LIST_BASIC_DATA=Diese Tabelle listet Stammdaten auf.
+ADMIN_HEADER_BASIC_DATA_ID=Id-Nummer:
 #@TODO Please fix German umlauts!
 ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Stammdaten des Unternehmens anzeigen.
 ADMIN_HEADER_ASSIGNED_USER=Zugew. Benutzer:
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen.
+ADMIN_LINK_SHOW_BASIC_DATA_OWNER_USER_TITLE=Benutzerprofil des der Filiale zugewiesenen Benutzers anzeigen.
 ADMIN_LINK_ASSIGN=Zuweisen
 #@TODO Please fix German umlauts!
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Stammdaten einen Benutzeraccount zuweisen.
+ADMIN_LINK_ASSIGN_BASIC_DATA_OWNER_USER_TITLE=Stammdaten einen Benutzeraccount zuweisen.
 ADMIN_HEADER_BASIC_DATA_COMPANY_NAME=Firmenname:
 ADMIN_HEADER_COMPANY_CONTACT_PERSON=Ansprechpartner:
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist.
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Zuweisen
+ADMIN_LINK_SHOW_BASIC_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist.
+ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON=Zuweisen
 #@TODO Please fix German umlauts!
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu.
+ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu.
 ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Zeigt das komplette Kontaktprofil an.
 ADMIN_BASIC_DATA_COMPANY_COMMENTS=Anmerkungen:
 ADMIN_BASIC_DATA_PHONE_NUMBER=Haupttelefonnummer:
 ADMIN_BASIC_DATA_FAX_NUMBER=Hauptfaxnummer:
 #@TODO Please fix German umlauts!
-ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Geschaeftlichen Kontakt hinzufuegen
-ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein.
+ADMIN_ADD_BASIC_DATA_TITLE=Geschaeftlichen Kontakt hinzufuegen
+ADMIN_ADD_BASIC_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein.
 #@TODO Please fix German umlauts!
 ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format.
 #@TODO Please fix German umlauts!
@@ -829,33 +827,33 @@ ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED=Bitte geben Sie den Firmennamen inklusive
 ADMIN_BASIC_DATA_COMPANY_LEGAL_STATUS=Rechtsform (z.B. GmbH):
 ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS=Haupt-Email-Adresse:
 #@TODO Please fix German umlauts!
-BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA=Basisdaten hinzufuegen
+BUTTON_ADMIN_ADD_BASIC_DATA=Basisdaten hinzufuegen
 ERROR_GUEST_REGISTRATION_IN_INDEX_ENABLED=Fehler: Falscher Aufruf der Anmeldeseite, da die Eingangsseite als Anmeldeseite fungiert.
 #@TODO Please fix German umlauts!
 BUTTON_CHANGE_LOCALE=Aendern
 #@TODO Please fix German umlauts!
 BUTTON_CHANGE_LOCALE_TITLE=Aendern Sie hier in der aktuellen Sitzung die angezeigte Sprache.
 #@TODO Please fix German umlauts!
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Firmengruender auswaehlen:
+ADMIN_SELECT_BASIC_DATA_COMPANY_FOUNDER=Firmengruender auswaehlen:
 ADMIN_FEATURE_UNFINISHED_WARNING=Diese Funktion ist noch nicht fertiggestellt.
 ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER=Steuernummer:
 ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL=Webseiten-URL:
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_USER_OWNER=Unternehmen einem Benutzer zuweisen:
+ADMIN_SELECT_BASIC_DATA_COMPANY_USER_OWNER=Unternehmen einem Benutzer zuweisen:
 #@TODO Please fix German umlauts!
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_LOGO=Firmenlogo auswaehlen:
+ADMIN_SELECT_BASIC_DATA_COMPANY_LOGO=Firmenlogo auswaehlen:
 #@TODO Please fix German umlauts!
 URL_NOT_MATCHING_REGULAR_EXPRESSION=Die eingegebene URL entspricht nicht der ueblichen Form.
 #@TODO Please fix German umlauts!
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson auswaehlen:
+ADMIN_SELECT_BASIC_DATA_COMPANY_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson auswaehlen:
 #@TODO Please fix German umlauts!
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS=Daten des Hauptsitzesz auswaehlen:
+ADMIN_SELECT_BASIC_DATA_COMPANY_HEADQUARTER=Daten des Hauptsitzesz auswaehlen:
 LINK_COMPANY_WEBSITE_URL_TITLE=Link zur Unternehmenswebseite (neues Fenster)
 #@TODO Please fix German umlauts!
 ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER=Gruender
 #@TODO Please fix German umlauts!
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen.
+ADMIN_LINK_SHOW_BASIC_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen.
 #@TODO Please fix German umlauts!
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu.
+ADMIN_LINK_ASSIGN_BASIC_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu.
 ADMIN_USER_NAME_IS_REQUIRED=Bitte vergeben Sie einen Benutzernamen. Dieser muss unique sein.
 NO_WEBSITE_URL_ENTERED=Keine URL eingegeben.
 ADMIN_LINK_LIST_BRANCH_OFFICES=Filialen
@@ -867,7 +865,7 @@ ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Kontaktperson der Filiale zuweisen:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND=Grunddaten der Filiale:
 #@TODO Please fix German umlauts!
 ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Geben Sie hier die Grunddaten der Filiale ein.
-ADMIN_ASSIGN_BRANCH_OFFICE=Filiale dem Unternehmen zuweisen:
+ADMIN_ASSIGN_BASIC_DATA_BRANCH_OFFICE=Unternehmen der Filiale zuweisen:
 PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=Filialen auflisten
 CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=Auflisten von Filialen:
 #@TODO Please fix German umlauts!
@@ -877,7 +875,7 @@ ADMIN_ADD_BRANCH_OFFICE_TITLE=Filiale hinzufuegen
 #@TODO Please fix German umlauts!
 ADMIN_ADD_BRANCH_OFFICE_MINIMUM_DATA=Bitte waehlen Sie mindestens das zugehoerige Unternehmen und das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein.
 ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email-Addresse der Filiale:
-ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Telefonnummer eingeben:
+ADMIN_ENTER_BRANCH_OFFICE_LAND_LINE_NUMBER=Telefonnummer eingeben:
 ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Faxnummer eingeben:
 #@TODO Please fix German umlauts!
 ADMIN_BRANCH_OFFICE_REQUIRED=Bitte waehlen das zur Filiale gehoerende Unternehmen aus.
@@ -998,7 +996,7 @@ ADMIN_EMPLOYEE_OTHER_LEGEND=Weitere Daten des Mitarbeiters:
 ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE=Geben Sie hier weitere Daten des Mitarbeiters ein. Diese sind alle optional.
 ADMIN_ENTER_PHONE_EXTENSION=Durchwahl eingeben:
 ADMIN_ASSIGN_EMPLOYEE_DEPARTMENT=Abteilung einem Mitarbeiter zuweisen:
-ADMIN_ASSIGN_EMPLOYEE_HEADQUARTERS=Hauptsitz einem Mitarbeiter zuweisen:
+ADMIN_ASSIGN_EMPLOYEE_HEADQUARTER=Hauptsitz einem Mitarbeiter zuweisen:
 ADMIN_ENTER_EMPLOYEE_MOBILE_NUMBER=Geschaefliche Mobilfunknummer des Mitarbeiters eingeben:
 ADMIN_EMPLOYEE_GENERAL_LEGEND=Allgemeine Daten des Mitarbeiters:
 ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE=Geben Sie hier die generellen Daten des Mitarbeiters an.
@@ -1016,7 +1014,7 @@ ADMIN_ADD_EMPLOYEE_TITLE=Mitarbeiter hinzufuegen
 ADMIN_ADD_EMPLOYEE_MINIMUM_DATA=Bitte waehlen Sie mindestens das Unternehmen aus und geben SIe mindestens entweder die Mitarbeiternummer ein oder waehlen Sie die persoenlichen Kontaktdaten des Mitarbeiters aus.
 #@TODO Please fix German umlauts!
 BUTTON_ADMIN_ADD_EMPLOYEE=Mitarbeiter hinzufuegen
-ADMIN_LIST_BASIC_COMPANY_DATA_HEADER=Alle Unternehmensgrunddaten auflisten
+ADMIN_LIST_BASIC_DATA_HEADER=Alle Unternehmensgrunddaten auflisten
 ADMIN_LINK_LIST_DEPARTMENTS=Abteilungen
 ADMIN_LINK_LIST_DEPARTMENTS_TITLE=Listet Abteilungen von Unternehmen auf.
 #@TODO Please fix German umlauts!
@@ -1027,7 +1025,7 @@ CONTENT_TITLE_ADMIN_LIST_DEPARTMENTS=Auflisten von Abteilungen:
 ADMIN_EMPTY_LIST_DEPARTMENTS=Es befinden sich keine Abteilungen in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
 ADMIN_LINK_SHOW_DEPARTMENT_TITLE=Zeigt Details zur Abteilung an.
 ADMIN_LINK_EDIT_DEPARTMENT_TITLE=Editieren der Abteilung
-ADMIN_LINK_DELETE_DEPARTMENT_TITLE=Loescht die Abteilung
+ADMIN_LINK_DELETE_DEPARTMENT_TITLE=Loescht die Abteilung.
 #@TODO Please fix German umlauts!
 ADMIN_DEPARTMENT_ALREADY_CREATED=Die Abteilung existiert bereits im ausgewaehlten Unternehmen.
 ADMIN_LIST_DEPARTMENTS_HEADER=Alle Abteilungen auflisten
@@ -1041,7 +1039,7 @@ ADMIN_DEPARTMENT_LEGEND_TITLE=Geben Sie hier die Daten der Abteilung ein.
 #@TODO Please fix German umlauts!
 ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus.
 ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Filiale der Abteilung zuweisen:
-ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Hauptsitz der Abteilung zuweisen:
+ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER=Hauptsitz der Abteilung zuweisen:
 ADMIN_ASSIGN_DEPARTMENT_COMPANY=Unternehmen der Abteilung zuweisen:
 ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Leitender Mitarbeiter der Abteilung zuweisen:
 ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Benutzer als Besitzer der Abteilung zuweisen:
@@ -1087,12 +1085,12 @@ ADMIN_LIST_USERS_HEADER=Liste aller Benutzer
 #@TODO Please fix German umlauts!
 ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Oeffnungszeiten der Filiale:
 #@TODO Please fix German umlauts!
-TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=Diese Tabelle listet Oeffnungszeiten der Filiale auf.
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=Diese Tabelle listet neue Oeffnungszeiten der Filiale auf.
 TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=Diese Tabelle listet Filialen auf.
 #@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=Es befinden sich keine Oeffnungszeiten dieser Filiale in der Datenbank.
+ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=Es wurden noch keine Oeffnungszeiten fuer eine neue Filiale hinzugefuegt.
 #@TODO Please fix German umlauts!
-ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=Alle Oeffnungszeiten der Filiale auflisten
+ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=Oeffnungszeiten der neuen Filiale auflisten
 #@TODO Please fix German umlauts!
 ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Oeffnungszeit zur Filiale hinzufuegen
 #@TODO Please fix German umlauts!
@@ -1102,3 +1100,51 @@ ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Geben Sie hier eine einzelne Oeffn
 #@TODO Please fix German umlauts!
 ADMIN_OPENING_TIME_ALREADY_CREATED=Die Oeffnungzeit wurde bereits hinzugefuegt.
 ADMIN_NOT_ASSIGNED=Nicht zugewiesen
+ADMIN_BASIC_DATA_COMPANY_NAME=Firmenname:
+ADMIN_LINK_SHOW_HEADQUARTER_TITLE=Zeigt Details zur Hauptstelle an.
+ADMIN_LINK_EDIT_HEADQUARTER_TITLE=Editieren der Hauptstelle.
+ADMIN_LINK_DELETE_HEADQUARTER_TITLE=Loescht die Hauptstelle.
+PAGE_TITLE_ADMIN_LIST_HEADQUARTER=Haupstellen auflisten
+CONTENT_TITLE_ADMIN_LIST_HEADQUARTER=Auflisten von Hauptstellen:
+TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER=Diese Tabelle listet alle Hauptstellen auf.
+#@TODO Please fix German umlauts!
+ADMIN_EMPTY_LIST_HEADQUARTER=Es befinden sich keine Hauptstellen in der Datenbank oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_LIST_HEADQUARTER_HEADER=Alle Hauptstellen auflisten
+ADMIN_LINK_SHOW_HEADQUARTER_OWNER_USER_TITLE=Benutzerprofil des der Hauptstelle zugewiesenen Benutzers anzeigen.
+#@TODO Please fix German umlauts!
+ADMIN_ADD_HEADQUARTER_TITLE=Hauptstelle hinzufuegen
+ADMIN_LINK_LIST_HEADQUARTER=Hauptstellen
+ADMIN_LINK_LIST_HEADQUARTER_TITLE=Listed alle Hauptstellen auf.
+#@TODO Please fix German umlauts!
+ADMIN_ADD_HEADQUARTER_MINIMUM_DATA=Bitte waehlen Sie mindestens das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein.
+ADMIN_HEADQUARTER_LEGEND=Daten der Hauptstelle:
+ADMIN_ASSIGN_HEADQUARTER_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson fuer Hauptstelle:
+ADMIN_ASSIGN_HEADQUARTER_USER_OWNER=Benutzer als Besitzer der Hauptstelle zuweisen:
+ADMIN_ENTER_HEADQUARTER_EMAIL_ADDRESS=Email-Adresse der Hauptstelle eingeben:
+ADMIN_ENTER_HEADQUARTER_LAND_LINE_NUMBER=Festnetznummer der Hauptstelle eingeben:
+ADMIN_ENTER_HEADQUARTER_FAX_NUMBER=Faxnummer der Hauptstelle eingeben:
+ADMIN_HEADQUARTER_ADDRESS_LEGEND=Adresse der Hauptstelle:
+ADMIN_HEADQUARTER_STREET_NAME_REQUIRED=Bitte geben Sie den Strassennamen der Hauptstelle ein.
+ADMIN_HEADQUARTER_HOUSE_NUMBER_REQUIRED=Bitte geben Sie die Hausnummer der Hauptstelle ein.
+ADMIN_HEADQUARTER_ZIP_CODE_REQUIRED=Bitte geben Sie die Postleitzahl der Hauptstelle ein.
+ADMIN_HEADQUARTER_CITY_REQUIRED=Bitte geben Sie die Stadt der Hauptstelle ein.
+#@TODO Please fix German umlauts!
+ADMIN_BRANCH_OFFICE_COUNTRY_REQUIRED=Bittw waehlen Sie ein Land fuer die Filiale aus.
+#@TODO Please fix German umlauts!
+ADMIN_HEADQUARTER_COUNTRY_REQUIRED=Bitte waehlen Sie ein Land fuer die Hauptstelle aus.
+#@TODO Please fix German umlauts!
+BUTTON_ADMIN_ADD_HEADQUARTER=Hauptstelle hinzufuegen
+#@TODO Please fix German umlauts!
+ADMIN_HEADQUARTER_OPENING_TIMES_LEGEND=Oeffnungszeiten der Hauptstelle:
+#@TODO Please fix German umlauts!
+TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER_OPENING_TIMES=Diese Tabelle listet neue Oeffnungszeiten der Hauptstelle auf.
+#@TODO Please fix German umlauts!
+ADMIN_EMPTY_LIST_HEADQUARTER_OPENING_TIMES=Es wurden noch keine Oeffnungszeiten fuer eine neue Hauptstelle hinzugefuegt.
+#@TODO Please fix German umlauts!
+ADMIN_LIST_HEADQUARTER_OPENING_TIMES_HEADER=Oeffnungszeiten der neuen Hauptstelle auflisten
+#@TODO Please fix German umlauts!
+ADMIN_ADD_HEADQUARTER_OPENING_TIME_TITLE=Oeffnungszeit zur Hauptstelle hinzufuegen
+#@TODO Please fix German umlauts!
+BUTTON_ADMIN_ADD_HEADQUARTER_OPENING_TIME=Oeffnungszeit zur Hauptstelle hinzufuegen
+ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE=Diesem Mitarbeiter eine Abteilung zuweisen.
+ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE=Diesem Mitarbeiter einen besitzenden Benutzer zuweisen.
index d9bf6bbe505a03e786cc41a635b1b940a4556266..35e70381b50bd35364bae2f52fad7da8e9a6ebd7 100644 (file)
@@ -278,7 +278,7 @@ ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE=Country code:
 ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Dial prefix outside:
 ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME=Country:
 ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Edit or delete country
-TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=List of all already added countries.
+TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=This table lists all countries.
 COUNTRY_GERMANY=Germany
 ADMIN_MENU_MOBILE_PROVIDER_TITLE=Mobile providers
 ADMIN_LINK_LIST_MOBILE_PROVIDER=List mobile provider
@@ -293,7 +293,7 @@ ADMIN_MOBILE_PROVIDER_LEGEND_TITLE=Here you can enter all data of the mobile pro
 CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider:
 CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Edit mobile provider:
 PAGE_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider
-TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=Lists all already added mobile providers.
+TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=This table lists all mobile providers.
 ADMIN_ENTER_MOBILE_PROVIDER_DIAL_PREFIX=Dial prefix of provider (no leading zero):
 ADMIN_ENTER_MOBILE_PROVIDER_PATTERN=Pattern for mails:
 ADMIN_ENTER_MOBILE_PROVIDER_NAME=Name of provider:
@@ -486,6 +486,7 @@ ADMIN_LINK_EXPORT_CONTACT=Export data
 ADMIN_LINK_EXPORT_CONTACT_TITLE=Export contact data
 PERSONAL_DATA_BIRTHDAY=Birthday (mm-dd-yyyy):
 DATE_PATTERN=MM-dd-yyyy
+DATE_TIME_PATTERN=MM-dd-yyyy HH:mm:ss
 ADMIN_EXPORT_CONTACT_ID=Contact data id
 ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Gender
 ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Title
@@ -569,7 +570,6 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Error: Instance 'user' not set in bean helper.
 ERROR_BEAN_HELPER_CONTACT_NOT_SET=Error: Instance 'contact' not set in bean helper.
 ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Error: Instance 'mobile' in bean helper not set.
 CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=List mobile phone numbers:
-ADMIN_LIST_MOBILE_EMPTY=No mobile numbers are saved.
 ADMIN_MENU_PHONE_NUMBERS_TITLE=Phone numbers:
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Mobile numbers
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=List all mobile numbers.
@@ -620,17 +620,15 @@ ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS=Land-line numbers ...
 ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Lists all land-line numbers.
 ADMIN_LINK_LIST_FAX_PHONE_NUMBERS=Fax numbers
 ADMIN_LINK_LIST_FAX_PHONE_NUMBERS_TITLE=Lists all fax numbers.
-ADMIN_LIST_FAX_NUMBER_EMPTY=There are no fax numbers listed.
 PAGE_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=List fax numbers
 CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=List fax numbers:
 PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=List land-line numbers
 CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=List land-line numbers:
-ADMIN_SHOW_PHONE_NUMBER=Land-line number:
+ADMIN_SHOW_LAND_LINE_NUMBER=Land-line number:
 PAGE_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Show land-line number
 CONTENT_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Show land-line number:
 ERROR_BEAN_HELPER_LAND_LINE_NUMBER_NOT_SET=Error: Instance 'landLine' not set in bean helper.
 ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_LINKS=All links for land-line number id number {0}:
-ADMIN_LIST_LAND_LINE_EMPTY=There are no land-line numbers listed.
 ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_DATA=Data of land-line number:
 ADMIN_SHOW_LAND_LINE_NUMBER_COMPLETE=Complete land-line number:
 ADMIN_HEADER_SHOW_FAX_NUMBER_DATA=Data of fax number:
@@ -693,7 +691,7 @@ CONTENT_TITLE_ADMIN_DELETE_LAND_LINE_NUMBER=Delete land-line number:
 ADMIN_DELETE_LAND_LINE_NUMBER_TITLE=Dou you really want to delete following land-line number?
 ADMIN_DELETE_LAND_LINE_NUMBER_DATA_NOTICE=If you delete the land-line number, it won't be available anymore for anything. Please consider carefully if you really want this.
 BUTTON_ADMIN_DELETE_LAND_LINE_NUMBER=Delete land-line number
-ADMIN_EMPTY_LIST_CONTACT=No contact data found in database. Or your search criteria doesn't match anything.
+ADMIN_EMPTY_LIST_CONTACT=There are no contacts of contacts in database. Or your search criteria doesn't match anything.
 ADMIN_EMPTY_LIST_USER=No user data found in database. Or your search criteria doesn't match anything.
 ADMIN_PERSONAL_DATA_COMMENT=Comment: (optional)
 ADMIN_LINK_RESEND_USER_CONFIRMATION_LINK=Send new confirmation key
@@ -702,7 +700,6 @@ ERROR_ADMIN_CANNOT_RESEND_USER_CONFIRMATION_LINK_ACCOUNT_UNLOCKED=Error: Cannot
 ERROR_ADMIN_CANNOT_RESEND_USER_CONFIRMATION_LINK_ACCOUNT_LOCKED=Error: Cannot send new confirmation link to user, account is locked.
 BUTTON_ADMIN_RESEND_USER_CONFIRMATION_LINK_ACCOUNT=Send new confirmation link
 ADMIN_RESEND_USER_CONFIRMATION_LINK_TITLE=Do you want to send a new confirmation link to user {0} (id numer {1})?
-#Durch das Zuschicken eines neuen Best\u00e4tigungslinkes wird der alte ung\u00fcltig und nur noch der neue Link kann verwendet werden.
 ADMIN_RESEND_USER_CONFIRMATION_LINK_NOTICE=By sending a new confirmation link to the user, the old link becomes invalid and only the new link can be used.
 PAGE_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link
 CONTENT_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link:
@@ -778,54 +775,52 @@ GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Please enter a password. This must match
 GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Please repeat the entered password. This done to confirm the password.
 PAGE_TITLE_ADMIN_AREA=Administration
 ADMIN_MENU_BUSINESS_CONTACT_TITLE=Business contacts
-ADMIN_LINK_LIST_BASIC_COMPANY_DATA=Basic company data
-ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE=Lists basic company data.
-PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=List basic company data
-CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Lists basic company data
-ADMIN_EMPTY_LIST_BASIC_COMPANY_DATA=There are currently no basic company data in database. Or your search criteria doesn't match anything.
-TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=This table lists all basic company data.
-ADMIN_HEADER_BASIC_COMPANY_DATA_ID=Id Number:
+ADMIN_LINK_LIST_BASIC_DATA=Basic company data
+ADMIN_LINK_LIST_BASIC_DATA_TITLE=Lists basic company data.
+PAGE_TITLE_ADMIN_LIST_BASIC_DATA=List basic company data
+CONTENT_TITLE_ADMIN_LIST_BASIC_DATA=Lists basic company data
+ADMIN_EMPTY_LIST_BASIC_DATA=There are no basic company data in database. Or your search criteria doesn't match anything.
+TABLE_SUMMARY_ADMIN_LIST_BASIC_DATA=This table lists all basic company data.
+ADMIN_HEADER_BASIC_DATA_ID=Id Number:
 ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Show details of this business contact.
 ADMIN_HEADER_ASSIGNED_USER=Assigned user:
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Shows assigned user profile.
+ADMIN_LINK_SHOW_BASIC_DATA_OWNER_USER_TITLE=Shows branch office's assigned user profile.
 ADMIN_LINK_ASSIGN=Assign
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account.
+ADMIN_LINK_ASSIGN_BASIC_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account.
 ADMIN_HEADER_BASIC_DATA_COMPANY_NAME=Company name:
 ADMIN_HEADER_COMPANY_CONTACT_PERSON=Contact person:
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person.
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Assign
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact.
+ADMIN_LINK_SHOW_BASIC_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person.
+ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON=Assign
+ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact.
 ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Shows complete contact profile.
 ADMIN_BASIC_DATA_COMPANY_COMMENTS=Comments:
 ADMIN_BASIC_DATA_PHONE_NUMBER=Main phone number:
 ADMIN_BASIC_DATA_FAX_NUMBER=Main fax number:
-ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Add new business contact
-ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA=Please enter at least company name including legal status.
+ADMIN_ADD_BASIC_DATA_TITLE=Add new business contact
+ADMIN_ADD_BASIC_DATA_MINIMUM_DATA=Please enter at least company name including legal status.
 ENTERED_EMAIL_ADDRESS_IS_INVALID=Your entered email address is not valid.
 ADMIN_BASIC_DATA_LEGEND=Basic data for business contact:
-#Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein.
 ADMIN_BASIC_DATA_LEGEND_TITLE=Enter basic data for a business contact.
 ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED=Please enter the company's name including legal status.
 ADMIN_BASIC_DATA_COMPANY_LEGAL_STATUS=Legal status (e.g. Inc.):
 ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS=Main email address:
-BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA=Add basic data
-#Fehler: Falscher Aufruf der Anmeldeseite, da die Eingangsseite als Anmeldeseite fungiert.
+BUTTON_ADMIN_ADD_BASIC_DATA=Add basic data
 ERROR_GUEST_REGISTRATION_IN_INDEX_ENABLED=Error: Wrong request on registration page as the index page serves as registration page.
 BUTTON_CHANGE_LOCALE=Change
 BUTTON_CHANGE_LOCALE_TITLE=Change here in your current session the used language for text output.
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Choose company founder:
+ADMIN_SELECT_BASIC_DATA_COMPANY_FOUNDER=Choose company founder:
 ADMIN_FEATURE_UNFINISHED_WARNING=This feature is not yet finished.
 ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER=Tax number:
 ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL=Website URL:
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_USER_OWNER=Select user to assign with company:
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_LOGO=Choose company logo:
+ADMIN_SELECT_BASIC_DATA_COMPANY_USER_OWNER=Select user to assign with company:
+ADMIN_SELECT_BASIC_DATA_COMPANY_LOGO=Choose company logo:
 URL_NOT_MATCHING_REGULAR_EXPRESSION=The entered URL does not match the common form.
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_CONTACT_EMPLOYEE=Choose employee as contact person:
-ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS=Choose headquarters:
+ADMIN_SELECT_BASIC_DATA_COMPANY_CONTACT_EMPLOYEE=Choose employee as contact person:
+ADMIN_SELECT_BASIC_DATA_COMPANY_HEADQUARTER=Choose headquarter:
 LINK_COMPANY_WEBSITE_URL_TITLE=Link to company's web site (new window)
 ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER=Founder
-ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder.
-ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry.
+ADMIN_LINK_SHOW_BASIC_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder.
+ADMIN_LINK_ASSIGN_BASIC_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry.
 ADMIN_USER_NAME_IS_REQUIRED=Please enter a user name. This must be unique.
 NO_WEBSITE_URL_ENTERED=No URL entered.
 ADMIN_LINK_LIST_BRANCH_OFFICES=Branch offices
@@ -836,15 +831,14 @@ ADMIN_ASSIGN_BRANCH_OFFICE_USER_OWNER=Assign user to branch office:
 ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Assign contact person to branch office:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND=Branch office basic data:
 ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Enter branch office basic data here.
-ADMIN_ASSIGN_BRANCH_OFFICE=Assign branch office to company:
+ADMIN_ASSIGN_BASIC_DATA_BRANCH_OFFICE=Assign company to branch office:
 PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices
 CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices:
 ADMIN_EMPTY_LIST_BRANCH_OFFICES=There are no branch offices found in database. Or your search criteria doesn't match anything.
 ADMIN_ADD_BRANCH_OFFICE_TITLE=Add branch office
-#Bitte waehlen Sie mindestens das zugehoerige Unternehmen und das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein.
 ADMIN_ADD_BRANCH_OFFICE_MINIMUM_DATA=Please at least choose assigned company, country and enter at least street name, house number, ZIP code and city.
 ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email address of branch office:
-ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Enter land-line number:
+ADMIN_ENTER_BRANCH_OFFICE_LAND_LINE_NUMBER=Enter land-line number:
 ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Enter fax number:
 ADMIN_BRANCH_OFFICE_REQUIRED=Please choose a company that sohuld be assigned with the branch office.
 ADMIN_BRANCH_OFFICE_STREET_NAME_REQUIRED=Please enter street name of branch office.
@@ -897,7 +891,6 @@ ADMIN_EMPTY_LIST_MOBILE_NUMBER=There are no mobile numbers in database. Or your
 ADMIN_EMPTY_LIST_CONTACT_MOBILE=There are no mobile numbers of contacts in database. Or your search criteria doesn't match anything.
 ADMIN_MOBILE_PROVIDER_COUNTRY_REQUIRED=Please select a country for mobile provider.
 LABEL_COUNTRIES=Countries
-#Filter list by selecting one or more users.
 FILTER_BY_MULTIPLE_COUNTRY_TITLE=Filter list by selecting one or more countries.
 ADMIN_LIST_MOBILE_PROVIDERS_HEADER=List of all mobile providers
 SELECT_SHOWN_COLUMNS=Shown columns
@@ -937,7 +930,7 @@ ADMIN_EMPLOYEE_OTHER_LEGEND=Other data of employee:
 ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE=Here you can enter additional data for the employee. All fields are optional.
 ADMIN_ENTER_PHONE_EXTENSION=Enter phone extension:
 ADMIN_ASSIGN_EMPLOYEE_DEPARTMENT=Assign department to employee:
-ADMIN_ASSIGN_EMPLOYEE_HEADQUARTERS=Assign headquarters to employee:
+ADMIN_ASSIGN_EMPLOYEE_HEADQUARTER=Assign headquarter to employee:
 ADMIN_ENTER_EMPLOYEE_MOBILE_NUMBER=Enter business mobile number of employee:
 ADMIN_EMPLOYEE_GENERAL_LEGEND=General data of employee:
 ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE=You can enter here the general data of the employee.
@@ -950,10 +943,9 @@ ADMIN_LINK_DELETE_BRANCH_OFFICE_TITLE=Deletes branch office.
 PAGE_TITLE_ADMIN_LIST_EMPLOYEE=List employees
 CONTENT_TITLE_ADMIN_LIST_EMPLOYEE=List employees:
 ADMIN_ADD_EMPLOYEE_TITLE=Add company employee
-#Bitte waehlen Sie mindestens das Unternehmen aus und geben SIe mindestens entweder die Mitarbeiternummer ein oder waehlen Sie die persoenlichen Kontaktdaten des Mitarbeiters aus (beides ist auch moeglich).
 ADMIN_ADD_EMPLOYEE_MINIMUM_DATA=Please choose at least assigned company and enter at least employee number or choose personal data (both is possible, too).
 BUTTON_ADMIN_ADD_EMPLOYEE=Add employee
-ADMIN_LIST_BASIC_COMPANY_DATA_HEADER=List all company basic data
+ADMIN_LIST_BASIC_DATA_HEADER=List all company basic data
 ADMIN_LINK_LIST_DEPARTMENTS=Departments
 ADMIN_LINK_LIST_DEPARTMENTS_TITLE=Lists departments of companies.
 ADMIN_LINK_LIST_OPENING_TIMES=Opening times
@@ -971,10 +963,9 @@ ADMIN_DEPARTMENT_LEAD_EMPLOYEE=Department leader:
 ADMIN_ADD_DEPARTMENT_TITLE=Add new department
 ADMIN_DEPARTMENT_LEGEND=Enter data of department:
 ADMIN_DEPARTMENT_LEGEND_TITLE=Here you can enter data of the new department.
-#Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus.
-ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Please enter at least name of department (e.g. Sales) and choose assigned company. If known, choose a branch office or headquarters.
+ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Please enter at least name of department (e.g. Sales) and choose assigned company. If known, choose a branch office or headquarter.
 ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Assign branch office to department:
-ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Assign headquarters to department:
+ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER=Assign headquarter to department:
 ADMIN_ASSIGN_DEPARTMENT_COMPANY=Assign company to department:
 ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Assign leading employee to department:
 ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Assign owning user to department:
@@ -999,7 +990,6 @@ ADMIN_END_TIME_REQUIRED=Please enter end time.
 ADMIN_OPENING_TIME_LEGEND=Data of single opening time:
 ADMIN_OPENING_TIME_LEGEND_TITLE=Enter data of single opening time.
 ADMIN_ADD_OPENING_TIME_TITLE=Add new opening time:
-#BItte geben Sie zum Hinzufuegen einer Oeffnungszeit alle Angaben an. Diese sollten nicht konfliktieren.
 ADMIN_ADD_OPENING_TIME_MINIMUM_DATA=To add new opening time, you have to provide all data. They should not conflict.
 BUTTON_ADMIN_ADD_OPENING_TIME=Add opening time
 ADMIN_LINK_ASSIGN_DEPARTMENT_BRANCH_OFFICE_TITLE=Assign this department a branch office.
@@ -1008,13 +998,50 @@ ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Assign this department an owning
 FIELD_PAYMENT_TYPE_REQUIRED=Please choose a payment method.
 ADMIN_LIST_USERS_HEADER=List of all users
 ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Opening times of branch office:
-TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=This table lists opening times of this branch office.
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=This table lists new opening times of this branch office.
 TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=This table lists branch offices.
-ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=There are no opening times of this branch office in database.
-ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=List all opening times of branch office
+ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=There are no opening times for a new branch office beging setup.
+ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=List opening times of a new branch office
 ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Add opening time to branch office
 BUTTON_ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME=Add opening time to branch office
 ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND=Single opening time of branch office:
 ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Enter single opening time of branch office.
 ADMIN_OPENING_TIME_ALREADY_CREATED=The opening time has already been added.
 ADMIN_NOT_ASSIGNED=Not assigned
+ADMIN_BASIC_DATA_COMPANY_NAME=Company's name:
+ADMIN_LINK_SHOW_HEADQUARTER_TITLE=Shows details of a headquarter.
+ADMIN_LINK_EDIT_HEADQUARTER_TITLE=Edit of a headquarter.
+ADMIN_LINK_DELETE_HEADQUARTER_TITLE=Deletes a headquarter.
+PAGE_TITLE_ADMIN_LIST_HEADQUARTER=List headquarters
+CONTENT_TITLE_ADMIN_LIST_HEADQUARTER=List headquarters:
+TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER=This table lists all headquarter.
+ADMIN_EMPTY_LIST_HEADQUARTER=There are no headquarter in database. Or your search criteria doesn't match anything.
+ADMIN_LIST_HEADQUARTER_HEADER=List all headquarter
+ADMIN_LINK_SHOW_HEADQUARTER_OWNER_USER_TITLE=Show the profile of the headquarter entry owning user.
+ADMIN_ADD_HEADQUARTER_TITLE=Add headquarter
+ADMIN_LINK_LIST_HEADQUARTER=Headquarter
+ADMIN_LINK_LIST_HEADQUARTER_TITLE=Lists all headquarter.
+ADMIN_ADD_HEADQUARTER_MINIMUM_DATA=Please at least choose country and enter at least street name, house number, ZIP code and city.
+ADMIN_HEADQUARTER_LEGEND=Headquarter data:
+#@TODO Please fix German umlauts!
+ADMIN_ASSIGN_HEADQUARTER_CONTACT_EMPLOYEE=Assign employee as contact person for headquarter:
+ADMIN_ASSIGN_HEADQUARTER_USER_OWNER=Assign owning user to headquarter:
+ADMIN_ENTER_HEADQUARTER_EMAIL_ADDRESS=Enter headquarter' email address:
+ADMIN_ENTER_HEADQUARTER_LAND_LINE_NUMBER=Enter land-line number of headquarter:
+ADMIN_ENTER_HEADQUARTER_FAX_NUMBER=Enter fax number of headquarter
+ADMIN_HEADQUARTER_ADDRESS_LEGEND=Address of headquarter:
+ADMIN_HEADQUARTER_STREET_NAME_REQUIRED=Please enter street name for headquarter.
+ADMIN_HEADQUARTER_HOUSE_NUMBER_REQUIRED=Please enter house number for headquarter.
+ADMIN_HEADQUARTER_ZIP_CODE_REQUIRED=Please enter ZIP code for headquarter.
+ADMIN_HEADQUARTER_CITY_REQUIRED=Please enter city for headquarter.
+ADMIN_BRANCH_OFFICE_COUNTRY_REQUIRED=Please choose a country for branch office.
+ADMIN_HEADQUARTER_COUNTRY_REQUIRED=Please choose a country for headquarter.
+BUTTON_ADMIN_ADD_HEADQUARTER=Add headquarter
+ADMIN_HEADQUARTER_OPENING_TIMES_LEGEND=Opening times of headquarter:
+TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER_OPENING_TIMES=This table lists new opening times for headquarter.
+ADMIN_EMPTY_LIST_HEADQUARTER_OPENING_TIMES=There are no opening times for a new headquarter beging setup.
+ADMIN_LIST_HEADQUARTER_OPENING_TIMES_HEADER=List opening times of a new headquarter
+ADMIN_ADD_HEADQUARTER_OPENING_TIME_TITLE=Add opening time to headquarter
+BUTTON_ADMIN_ADD_HEADQUARTER_OPENING_TIME=Add opening time to headquarter
+ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE=Assign a branch office to this employee.
+ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE=Assign an owning user to this employee.
index 25ccb302c034e797578ea6c172a4c03f93986e7b..116ae73b366b4cac68d36c5e8059101c70a186c5 100644 (file)
                        <to-view-id>/admin/contact/admin_contact_export.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_list_basic_company_data</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_list.xhtml</to-view-id>
+                       <from-outcome>admin_list_headquarter</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_list.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_list_basic_data</from-outcome>
+                       <to-view-id>/admin/basic_data/admin_basic_data_list.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_list_branch_office</from-outcome>
                </navigation-case>
        </navigation-rule>
        <navigation-rule>
-               <from-view-id>/admin/basic_company_data/admin_basic_company_data_list.xhtml</from-view-id>
+               <from-view-id>/admin/basic_data/admin_basic_data_list.xhtml</from-view-id>
                <navigation-case>
                        <from-outcome>admin_show_basic_data</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_show.xhtml</to-view-id>
+                       <to-view-id>/admin/basic_data/admin_basic_data_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_edit_basic_data</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_edit.xhtml</to-view-id>
+                       <to-view-id>/admin/basic_data/admin_basic_data_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_delete_basic_data</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_delete.xhtml</to-view-id>
+                       <to-view-id>/admin/basic_data/admin_basic_data_delete.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_assign_basic_data_contact</from-outcome>
+                       <to-view-id>/admin/basic_data/admin_basic_data_assign_contact.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_assign_basic_data_founder</from-outcome>
+                       <to-view-id>/admin/basic_data/admin_basic_data_assign_founder.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_assign_basic_data_owner</from-outcome>
+                       <to-view-id>/admin/basic_data/admin_basic_data_assign_owner.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_show_employee</from-outcome>
+                       <to-view-id>/admin/company_employee/admin_company_employee_show.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_assign_basic_data_employee</from-outcome>
+                       <to-view-id>/admin/basic_data/admin_basic_data_assign_employee.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/headquarter/admin_headquarter_list.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_show_headquarter</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_assign_basic_company_data_contact</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_assign_contact.xhtml</to-view-id>
+                       <from-outcome>admin_edit_headquarter</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_edit.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_assign_basic_company_data_founder</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_assign_founder.xhtml</to-view-id>
+                       <from-outcome>admin_delete_headquarter</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_delete.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_show_user</from-outcome>
+                       <to-view-id>/admin/user/admin_user_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_assign_basic_company_data_owner</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_assign_owner.xhtml</to-view-id>
+                       <from-outcome>admin_assign_headquarter_owner</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_assign_owner.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_show_employee</from-outcome>
                        <to-view-id>/admin/company_employee/admin_company_employee_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_assign_basic_company_data_employee</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_assign_employee.xhtml</to-view-id>
+                       <from-outcome>admin_assign_headquarter_employee</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_assign_employee.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
        <navigation-rule>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_show_basic_data</from-outcome>
-                       <to-view-id>/admin/basic_company_data/admin_basic_company_data_show.xhtml</to-view-id>
+                       <to-view-id>/admin/basic_data/admin_basic_data_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_show_employee</from-outcome>
                        <from-outcome>admin_delete_employee</from-outcome>
                        <to-view-id>/admin/employee/admin_employee_delete.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_show_branch_office</from-outcome>
+                       <to-view-id>/admin/branch_office/admin_branch_office_show.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_assign_employee_owner</from-outcome>
+                       <to-view-id>/admin/employee/admin_assign_employee_user.xhtml</to-view-id>
+               </navigation-case>
        </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/opening_time/admin_opening_time_list.xhtml</from-view-id>
index 06af978746b7523ebc2341b6ceab3d4919b512f3..0598de75efcc32f9b2e602ebf0e84ca613561847 100644 (file)
@@ -149,7 +149,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
        </tag>
        <tag>
                <tag-name>outputBasicDataAdminMiniLinks</tag-name>
-               <description>This tag renders administrative "mini-links" for given basicData instance.</description>
+               <description>This tag renders administrative "mini-links" for given basic data instance.</description>
                <source>resources/tags/admin/links/mini/basic_data/admin_basic_data_links.tpl</source>
                <attribute>
                        <name>basicData</name>
@@ -170,6 +170,29 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                        <type>java.lang.Boolean</type>
                </attribute>
        </tag>
+       <tag>
+               <tag-name>outputHeadquarterAdminMiniLinks</tag-name>
+               <description>This tag renders administrative "mini-links" for given headquarter instance.</description>
+               <source>resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl</source>
+               <attribute>
+                       <name>headquarter</name>
+                       <description>The headquarter instance that provides the data for this tag.</description>
+                       <required>true</required>
+                       <type>org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterData</type>
+               </attribute>
+               <attribute>
+                       <name>renderShowLink</name>
+                       <description>Whether to render (default: true) "show headquarter" link.</description>
+                       <required>false</required>
+                       <type>java.langBoolean</type>
+               </attribute>
+               <attribute>
+                       <name>rendered</name>
+                       <description>Whether this tag is being rendered by JSF engine (default: true).</description>
+                       <required>false</required>
+                       <type>java.lang.Boolean</type>
+               </attribute>
+       </tag>
        <tag>
                <tag-name>outputBranchOfficeAdminMiniLinks</tag-name>
                <description>This tag renders administrative "mini-links" for given branchOffice instance.</description>
index dda3549817747b1dfafdf98c9fc1e8f78cf66db5..d973950c558087eebc454b954e7cd517b86f300a 100644 (file)
                <ul class="navbar-mini">
                        <ui:fragment rendered="#{empty renderShowLink or renderShowLink}">
                                <li class="navlink-mini">
-                                       <p:link outcome="admin_show_branch_office" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}">
+                                       <p:link outcome="admin_show_employee" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}">
                                                <f:param name="employeeId" value="#{employee.employeeId}" />
                                        </p:link>
                                </li>
                        </ui:fragment>
 
                        <li class="navlink-mini">
-                               <p:link outcome="admin_edit_branch_office" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_EMPLOYEE_TITLE}">
+                               <p:link outcome="admin_edit_employee" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_EMPLOYEE_TITLE}">
                                        <f:param name="employeeId" value="#{employee.employeeId}" />
                                </p:link>
                        </li>
 
                        <li class="navlink-mini">
-                               <p:link outcome="admin_delete_branch_office">
+                               <p:link outcome="admin_delete_employee">
                                        <h:outputText styleClass="link-danger" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{msg.ADMIN_LINK_DELETE_EMPLOYEE_TITLE}" />
                                        <f:param name="employeeId" value="#{employee.employeeId}" />
                                </p:link>
diff --git a/web/WEB-INF/resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl b/web/WEB-INF/resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl
new file mode 100644 (file)
index 0000000..9819a41
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <ui:fragment rendered="#{empty rendered or rendered}">
+               <ul class="navbar-mini">
+                       <ui:fragment rendered="#{empty renderShowLink or renderShowLink}">
+                               <li class="navlink-mini">
+                                       <p:link outcome="admin_show_headquarter" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_HEADQUARTER_TITLE}">
+                                               <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                                       </p:link>
+                               </li>
+                       </ui:fragment>
+
+                       <li class="navlink-mini">
+                               <p:link outcome="admin_edit_headquarter" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_HEADQUARTER_TITLE}">
+                                       <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                               </p:link>
+                       </li>
+
+                       <li class="navlink-mini">
+                               <p:link outcome="admin_delete_headquarter">
+                                       <h:outputText styleClass="link-danger" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{msg.ADMIN_LINK_DELETE_HEADQUARTER_TITLE}" />
+                                       <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                               </p:link>
+                       </li>
+               </ul>
+       </ui:fragment>
+</ui:composition>
index aebb6bcb1a921ca28e1e84ad30fb77833fc4c9c0..b992069a3f40530f8c5b506f5a93a55650c1769b 100644 (file)
@@ -25,8 +25,9 @@
                                <p:menuitem title="#{msg.ADMIN_LINK_EXPORT_CONTACT_TITLE}" outcome="admin_export_contact" value="#{msg.ADMIN_LINK_EXPORT_CONTACT}" />
                        </p:submenu>
 
-                       <p:submenu label="#{msg.ADMIN_MENU_BUSINESS_CONTACT_TITLE}" rendered="#{featureController.isFeatureEnabled('basic_company_data')}">
-                               <p:menuitem title="#{msg.ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE}" outcome="admin_list_basic_company_data" value="#{msg.ADMIN_LINK_LIST_BASIC_COMPANY_DATA}" />
+                       <p:submenu label="#{msg.ADMIN_MENU_BUSINESS_CONTACT_TITLE}" rendered="#{featureController.isFeatureEnabled('basic_data')}">
+                               <p:menuitem title="#{msg.ADMIN_LINK_LIST_BASIC_DATA_TITLE}" outcome="admin_list_basic_data" value="#{msg.ADMIN_LINK_LIST_BASIC_DATA}" />
+                               <p:menuitem title="#{msg.ADMIN_LINK_LIST_HEADQUARTER_TITLE}" outcome="admin_list_headquarter" value="#{msg.ADMIN_LINK_LIST_HEADQUARTER}" />
                                <p:menuitem title="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICES_TITLE}" outcome="admin_list_branch_office" value="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICES}" />
                                <p:menuitem title="#{msg.ADMIN_LINK_LIST_DEPARTMENTS_TITLE}" outcome="admin_list_department" value="#{msg.ADMIN_LINK_LIST_DEPARTMENTS}" />
                                <p:menuitem title="#{msg.ADMIN_LINK_LIST_OPENING_TIMES_TITLE}" outcome="admin_list_opening_time" value="#{msg.ADMIN_LINK_LIST_OPENING_TIMES}" />
diff --git a/web/WEB-INF/templates/admin/basic_company_data/admin_form_basic_company_data.tpl b/web/WEB-INF/templates/admin/basic_company_data/admin_form_basic_company_data.tpl
deleted file mode 100644 (file)
index 5f98fa8..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-@TODO: title="#{msg.ADMIN_BASIC_DATA_LEGEND_TITLE}"
--->
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:core="http://mxchange.org/jsf/core/widgets"
-       xmlns:f="http://xmlns.jcp.org/jsf/core"
-       xmlns:h="http://xmlns.jcp.org/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-       xmlns:p="http://primefaces.org/ui">
-
-       <h:panelGroup styleClass="para" layout="block">
-               <p:fieldset legend="#{msg.ADMIN_BASIC_DATA_LEGEND}">
-                       <p:panelGrid columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
-                               <p:outputLabel for="companyName" value="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME}" />
-                               <p:inputText
-                                       id="companyName"
-                                       value="#{adminBasicCompanyDataController.companyName}"
-                                       size="30"
-                                       maxlength="200"
-                                       required="true"
-                                       requiredMessage="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED}"
-                                       >
-                                       <f:validator validatorId="CompanyNameValidator" />
-                                       <f:attribute name="checkExisting" value="false" />
-                               </p:inputText>
-
-                               <p:outputLabel for="companyEmailAddress" value="#{msg.ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS}" />
-                               <p:inputText id="companyEmailAddress" size="20" maxlength="255" value="#{adminBasicCompanyDataController.companyEmailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
-                                       <f:validator validatorId="EmailAddressValidator" />
-                                       <f:attribute name="allowEmptyValue" value="true" />
-                               </p:inputText>
-
-                               <p:outputLabel for="companyLogo" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_LOGO}" />
-                               <core:outputMessageBox id="companyLogo" message="#{msg.ADMIN_FEATURE_UNFINISHED_WARNING}" boxStyleClass="message-full" messageStyleClass="alert-warning" />
-
-                               <p:outputLabel for="companyTaxNumber" value="#{msg.ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER}" />
-                               <p:inputText id="companyTaxNumber" size="30" maxlength="200" value="#{adminBasicCompanyDataController.companyTaxNumber}" />
-
-                               <p:outputLabel for="companyWebsiteUrl" value="#{msg.ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL}" />
-                               <p:inputText id="companyWebsiteUrl" size="30" maxlength="200" value="#{adminBasicCompanyDataController.companyWebsiteUrl}" validatorMessage="#{msg.URL_NOT_MATCHING_REGULAR_EXPRESSION}">
-                                       <f:validator validatorId="UrlValidator" />
-                                       <f:attribute name="allowEmptyValue" value="true" />
-                               </p:inputText>
-
-                               <p:outputLabel for="companyUserOwner" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_USER_OWNER}" />
-                               <p:selectOneMenu
-                                       id="companyUserOwner"
-                                       value="#{adminBasicCompanyDataController.companyUserOwner}"
-                                       filter="true"
-                                       filterMatchMode="contains"
-                                       >
-                                       <f:converter converterId="UserConverter" />
-                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{userController.allUsers()}" var="companyUserOwner" itemValue="#{companyUserOwner}" itemLabel="#{companyUserOwner.userContact.contactFirstName} #{companyUserOwner.userContact.contactFamilyName} (#{companyUserOwner.userName})" />
-                               </p:selectOneMenu>
-
-                               <p:outputLabel for="companyContactEmployee" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_CONTACT_EMPLOYEE}" />
-                               <p:selectOneMenu
-                                       id="companyContactEmployee"
-                                       value="#{adminBasicCompanyDataController.companyContactEmployee}"
-                                       filter="true"
-                                       filterMatchMode="contains"
-                                       >
-                                       <f:converter converterId="EmployeeConverter" />
-                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
-                               </p:selectOneMenu>
-
-                               <p:outputLabel for="companyFounder" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER}" />
-                               <p:selectOneMenu
-                                       id="companyFounder"
-                                       value="#{adminBasicCompanyDataController.companyFounder}"
-                                       filter="true"
-                                       filterMatchMode="contains"
-                                       >
-                                       <f:converter converterId="EmployeeConverter" />
-                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
-                               </p:selectOneMenu>
-
-                               <p:outputLabel for="companyHeadQuarters" value="#{msg.ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS}" />
-                               <p:selectOneMenu
-                                       id="companyHeadQuarters"
-                                       value="#{adminBasicCompanyDataController.companyHeadQuarters}"
-                                       filter="true"
-                                       filterMatchMode="contains"
-                                       >
-                                       <f:converter converterId="CompanyHeadquartersConverter" />
-                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                       <f:selectItems value="#{companyHeadquartersController.allCompanyHeadquarters()}" var="companyHeadQuarters" itemValue="#{companyHeadQuarters}" itemLabel="#{companyHeadQuarters.foo}" />
-                               </p:selectOneMenu>
-
-                               <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_BASIC_DATA_PHONE_NUMBER}" />
-                               <core:inputLandLineNumberPanelGrid targetController="#{adminBasicCompanyDataController}" />
-
-                               <p:outputLabel for="faxCountry" value="#{msg.ADMIN_BASIC_DATA_FAX_NUMBER}" />
-                               <core:inputFaxNumberPanelGrid targetController="#{adminBasicCompanyDataController}" />
-
-                               <p:outputLabel for="companyComments" value="#{msg.ADMIN_BASIC_DATA_COMPANY_COMMENTS}" />
-                               <p:inputTextarea
-                                       id="companyComments"
-                                       value="#{adminBasicCompanyDataController.companyComments}"
-                                       rows="7"
-                                       cols="25"
-                                       />
-                       </p:panelGrid>
-               </p:fieldset>
-       </h:panelGroup>
-</ui:composition>
diff --git a/web/WEB-INF/templates/admin/basic_data/admin_form_basic_data.tpl b/web/WEB-INF/templates/admin/basic_data/admin_form_basic_data.tpl
new file mode 100644 (file)
index 0000000..5f7c79a
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+@TODO: title="#{msg.ADMIN_BASIC_DATA_LEGEND_TITLE}"
+-->
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:core="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <h:panelGroup styleClass="para" layout="block">
+               <p:fieldset legend="#{msg.ADMIN_BASIC_DATA_LEGEND}">
+                       <p:panelGrid columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
+                               <p:outputLabel for="companyName" value="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME}" />
+                               <p:inputText
+                                       id="companyName"
+                                       value="#{adminBasicCompanyDataController.companyName}"
+                                       size="30"
+                                       maxlength="200"
+                                       required="true"
+                                       requiredMessage="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED}"
+                                       >
+                                       <f:validator validatorId="CompanyNameValidator" />
+                                       <f:attribute name="checkExisting" value="false" />
+                               </p:inputText>
+
+                               <p:outputLabel for="companyEmailAddress" value="#{msg.ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS}" />
+                               <p:inputText id="companyEmailAddress" size="20" maxlength="255" value="#{adminBasicCompanyDataController.companyEmailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+                                       <f:validator validatorId="BasicDataEmailAddressValidator" />
+                                       <f:attribute name="allowEmptyValue" value="true" />
+                               </p:inputText>
+
+                               <p:outputLabel for="companyLogo" value="#{msg.ADMIN_SELECT_BASIC_DATA_COMPANY_LOGO}" />
+                               <core:outputMessageBox id="companyLogo" message="#{msg.ADMIN_FEATURE_UNFINISHED_WARNING}" boxStyleClass="message-full" messageStyleClass="alert-warning" />
+
+                               <p:outputLabel for="companyTaxNumber" value="#{msg.ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER}" />
+                               <p:inputText id="companyTaxNumber" size="30" maxlength="200" value="#{adminBasicCompanyDataController.companyTaxNumber}" />
+
+                               <p:outputLabel for="companyWebsiteUrl" value="#{msg.ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL}" />
+                               <p:inputText id="companyWebsiteUrl" size="30" maxlength="200" value="#{adminBasicCompanyDataController.companyWebsiteUrl}" validatorMessage="#{msg.URL_NOT_MATCHING_REGULAR_EXPRESSION}">
+                                       <f:validator validatorId="UrlValidator" />
+                                       <f:attribute name="allowEmptyValue" value="true" />
+                               </p:inputText>
+
+                               <p:outputLabel for="companyUserOwner" value="#{msg.ADMIN_SELECT_BASIC_DATA_COMPANY_USER_OWNER}" />
+                               <p:selectOneMenu
+                                       id="companyUserOwner"
+                                       value="#{adminBasicCompanyDataController.companyUserOwner}"
+                                       filter="true"
+                                       filterMatchMode="contains"
+                                       >
+                                       <f:converter converterId="UserConverter" />
+                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                       <f:selectItems value="#{userController.allUsers()}" var="companyUserOwner" itemValue="#{companyUserOwner}" itemLabel="#{companyUserOwner.userContact.contactFirstName} #{companyUserOwner.userContact.contactFamilyName} (#{companyUserOwner.userName})" />
+                               </p:selectOneMenu>
+
+                               <p:outputLabel for="companyContactEmployee" value="#{msg.ADMIN_SELECT_BASIC_DATA_COMPANY_CONTACT_EMPLOYEE}" />
+                               <p:selectOneMenu
+                                       id="companyContactEmployee"
+                                       value="#{adminBasicCompanyDataController.companyContactEmployee}"
+                                       filter="true"
+                                       filterMatchMode="contains"
+                                       >
+                                       <f:converter converterId="EmployeeConverter" />
+                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadquarter" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                               </p:selectOneMenu>
+
+                               <p:outputLabel for="companyFounder" value="#{msg.ADMIN_SELECT_BASIC_DATA_COMPANY_FOUNDER}" />
+                               <p:selectOneMenu
+                                       id="companyFounder"
+                                       value="#{adminBasicCompanyDataController.companyFounder}"
+                                       filter="true"
+                                       filterMatchMode="contains"
+                                       >
+                                       <f:converter converterId="EmployeeConverter" />
+                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                       <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadquarter" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                               </p:selectOneMenu>
+
+                               <p:outputLabel for="companyHeadquarter" value="#{msg.ADMIN_SELECT_BASIC_DATA_COMPANY_HEADQUARTER}" />
+                               <p:selectOneMenu
+                                       id="companyHeadquarter"
+                                       value="#{adminBasicCompanyDataController.companyHeadQuarter}"
+                                       filter="true"
+                                       filterMatchMode="contains"
+                                       >
+                                       <f:converter converterId="HeadquarterConverter" />
+                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                       <f:selectItems value="#{headquarterController.allHeadquarter()}" var="headquarter" itemValue="#{headquarter}" itemLabel="#{beanHelper.renderHeadquarter(headquarter)}" />
+                               </p:selectOneMenu>
+
+                               <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_BASIC_DATA_PHONE_NUMBER}" />
+                               <core:inputLandLineNumberPanelGrid targetController="#{adminBasicCompanyDataController}" />
+
+                               <p:outputLabel for="faxCountry" value="#{msg.ADMIN_BASIC_DATA_FAX_NUMBER}" />
+                               <core:inputFaxNumberPanelGrid targetController="#{adminBasicCompanyDataController}" />
+
+                               <p:outputLabel for="companyComments" value="#{msg.ADMIN_BASIC_DATA_COMPANY_COMMENTS}" />
+                               <p:inputTextarea
+                                       id="companyComments"
+                                       value="#{adminBasicCompanyDataController.companyComments}"
+                                       rows="7"
+                                       cols="25"
+                                       />
+                       </p:panelGrid>
+               </p:fieldset>
+       </h:panelGroup>
+</ui:composition>
index dd6db1701343197b60c869dff8fa49aa82621ec7..c7ad682b5a3b438983802baf7cfda7a2a3c2b9f8 100644 (file)
@@ -11,7 +11,7 @@
 
        <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_DATA_LEGEND}">
                <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
-                       <p:outputLabel for="branchCompany" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE}" />
+                       <p:outputLabel for="branchCompany" value="#{msg.ADMIN_ASSIGN_BASIC_DATA_BRANCH_OFFICE}" />
                        <p:selectOneMenu
                                id="branchCompany"
                                value="#{adminBranchOfficeController.branchCompany}"
@@ -34,7 +34,7 @@
                                >
                                <f:converter converterId="EmployeeConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                               <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                               <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadquarter" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="branchUserOwner" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE_USER_OWNER}" />
 
                        <p:outputLabel for="branchEmailAddress" value="#{msg.ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS}" />
                        <p:inputText id="branchEmailAddress" size="20" maxlength="255" value="#{adminBranchOfficeController.branchEmailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
-                               <f:validator validatorId="EmailAddressValidator" />
+                               <f:validator validatorId="BranchOfficeEmailAddressValidator" />
                                <f:attribute name="allowEmptyValue" value="true" />
                        </p:inputText>
 
-                       <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER}" />
+                       <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_ENTER_BRANCH_OFFICE_LAND_LINE_NUMBER}" />
                        <core:inputLandLineNumberPanelGrid targetController="#{adminBranchOfficeController}" />
 
                        <p:outputLabel for="faxCountry" value="#{msg.ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER}" />
@@ -95,7 +95,7 @@
                        <p:inputText id="branchCity" size="20" maxlength="255" value="#{adminBranchOfficeController.branchCity}" required="true" requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_CITY_REQUIRED}" />
 
                        <p:outputLabel for="branchCountry" value="#{msg.ADMIN_SELECT_COUNTRY}" />
-                       <core:outputCountrySelector id="branchCountry" value="#{adminBranchOfficeController.branchCountry}" />
+                       <core:outputCountrySelector id="branchCountry" value="#{adminBranchOfficeController.branchCountry}" required="true" requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COUNTRY_REQUIRED}" />
                </p:panelGrid>
        </p:fieldset>
 </ui:composition>
diff --git a/web/WEB-INF/templates/admin/branch_office/admin_form_branch_opening_time.tpl b/web/WEB-INF/templates/admin/branch_office/admin_form_branch_opening_time.tpl
new file mode 100644 (file)
index 0000000..b581c70
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+@TODO: title="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE}"
+-->
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND}">
+               <p:panelGrid layout="grid" columns="4" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
+                       <p:outputLabel for="openingStartDay" value="#{msg.ADMIN_START_WEEK_DAY}" />
+                       <p:outputLabel for="openingEndDay" value="#{msg.ADMIN_END_WEEK_DAY}" />
+                       <p:outputLabel for="openingStartTime" value="#{msg.ADMIN_START_TIME}" />
+                       <p:outputLabel for="openingEndTime" value="#{msg.ADMIN_END_TIME}" />
+
+                       <p:selectOneMenu
+                               id="openingStartDay"
+                               value="#{adminBranchOfficeController.openingStartDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_START_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:selectOneMenu
+                               id="openingEndDay"
+                               value="#{adminBranchOfficeController.openingEndDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_END_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:calendar
+                               id="openingStartTime"
+                               value="#{adminBranchOfficeController.openingStartTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_START_TIME_REQUIRED}"
+                               />
+
+                       <p:calendar
+                               id="openingEndTime"
+                               value="#{adminBranchOfficeController.openingEndTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_END_TIME_REQUIRED}"
+                               />
+               </p:panelGrid>
+       </p:fieldset>
+</ui:composition>
diff --git a/web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl b/web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl
deleted file mode 100644 (file)
index b581c70..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-@TODO: title="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE}"
--->
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:f="http://xmlns.jcp.org/jsf/core"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-       xmlns:p="http://primefaces.org/ui">
-
-       <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND}">
-               <p:panelGrid layout="grid" columns="4" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
-                       <p:outputLabel for="openingStartDay" value="#{msg.ADMIN_START_WEEK_DAY}" />
-                       <p:outputLabel for="openingEndDay" value="#{msg.ADMIN_END_WEEK_DAY}" />
-                       <p:outputLabel for="openingStartTime" value="#{msg.ADMIN_START_TIME}" />
-                       <p:outputLabel for="openingEndTime" value="#{msg.ADMIN_END_TIME}" />
-
-                       <p:selectOneMenu
-                               id="openingStartDay"
-                               value="#{adminBranchOfficeController.openingStartDay}"
-                               filter="true"
-                               filterMatchMode="contains"
-                               required="true"
-                               requiredMessage="#{msg.ADMIN_START_WEEK_DAY_REQUIRED}"
-                               >
-                               <f:converter converterId="DayOfTheWeekConverter" />
-                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
-                       </p:selectOneMenu>
-
-                       <p:selectOneMenu
-                               id="openingEndDay"
-                               value="#{adminBranchOfficeController.openingEndDay}"
-                               filter="true"
-                               filterMatchMode="contains"
-                               required="true"
-                               requiredMessage="#{msg.ADMIN_END_WEEK_DAY_REQUIRED}"
-                               >
-                               <f:converter converterId="DayOfTheWeekConverter" />
-                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
-                       </p:selectOneMenu>
-
-                       <p:calendar
-                               id="openingStartTime"
-                               value="#{adminBranchOfficeController.openingStartTime}"
-                               pattern="HH:mm"
-                               timeOnly="true"
-                               required="true"
-                               stepMinute="5"
-                               requiredMessage="#{msg.ADMIN_START_TIME_REQUIRED}"
-                               />
-
-                       <p:calendar
-                               id="openingEndTime"
-                               value="#{adminBranchOfficeController.openingEndTime}"
-                               pattern="HH:mm"
-                               timeOnly="true"
-                               required="true"
-                               stepMinute="5"
-                               requiredMessage="#{msg.ADMIN_END_TIME_REQUIRED}"
-                               />
-               </p:panelGrid>
-       </p:fieldset>
-</ui:composition>
index add54f3f882196dbd28f1a12db803a2b1b996417..47cfa8f99b8dada4d44268bf18c86189c594183e 100644 (file)
@@ -11,7 +11,7 @@
        <p:fieldset legend="#{msg.ADMIN_DEPARTMENT_LEGEND}">
                <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
                        <p:outputLabel for="departmentI18nKey" value="#{msg.ADMIN_ENTER_DEPARTMENT_I18N_KEY}" />
-                       <p:inputText id="departmentI18nKey" size="2" maxlength="10" value="#{adminDepartmentController.departmentI18nKey}" required="true" requiredMessage="#{msg.ADMIN_DEPARTMENT_I18N_KEY_REQUIRED}" />
+                       <p:inputText id="departmentI18nKey" size="20" maxlength="255" value="#{adminDepartmentController.departmentI18nKey}" required="true" requiredMessage="#{msg.ADMIN_DEPARTMENT_I18N_KEY_REQUIRED}" />
 
                        <p:outputLabel for="departmentCompany" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_COMPANY}" />
                        <p:selectOneMenu
                                <f:selectItems value="#{branchOfficeController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" />
                        </p:selectOneMenu>
 
-                       <p:outputLabel for="departmentHeadquarters" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS}" />
+                       <p:outputLabel for="departmentHeadquarter" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER}" />
                        <p:selectOneMenu
-                               id="departmentHeadquarters"
-                               value="#{adminDepartmentController.departmentHeadquarters}"
+                               id="departmentHeadquarter"
+                               value="#{adminDepartmentController.departmentHeadquarter}"
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="EmployeeConverter" />
+                               <f:converter converterId="HeadquarterConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                               <f:selectItems value="#{headquartersController.allHeadquarters()}" var="headquarters" itemValue="#{headquarters}" itemLabel="#{beanHelper.renderHeadquarters(headquarters)}" />
+                               <f:selectItems value="#{headquarterController.allHeadquarter()}" var="headquarter" itemValue="#{headquarter}" itemLabel="#{beanHelper.renderHeadquarter(headquarter)}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="departmentLead" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE}" />
index f3834ade0dc5ee584c34dddcd7c68c2b05276e42..d5747d89b22566c10cb6a53cd8572bcd7efc1289 100644 (file)
@@ -3,7 +3,6 @@
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:core="http://mxchange.org/jsf/core/widgets"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
-       xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
 
@@ -69,7 +68,7 @@
                        </p:inputText>
 
                        <p:outputLabel for="employeeStaffNumber" value="#{msg.ADMIN_ENTER_EMPLOYEE_STAFF_NUMBER}" />
-                       <p:inputText id="employeeStaffNumber" size="2" maxlength="10" value="#{adminEmployeeController.employeeStaffNumber}" />
+                       <p:inputText id="employeeStaffNumber" size="2" maxlength="10" value="#{adminEmployeeController.employeeNumber}" />
                </p:panelGrid>
        </p:fieldset>
 
@@ -77,7 +76,7 @@
        @TODO title="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE}"
        -->
        <p:fieldset legend="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND}">
-               <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full">
+               <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
                        <p:outputLabel for="employeePhoneExtension" value="#{msg.ADMIN_ENTER_PHONE_EXTENSION}" />
                        <p:inputText id="employeePhoneExtension" size="2" maxlength="10" value="#{adminEmployeeController.employeePhoneExtension}" />
 
                                <f:selectItems value="#{departmentController.allDepartments()}" var="department" itemValue="#{department}" itemLabel="#{beanHelper.renderDepartment(department)}" />
                        </p:selectOneMenu>
 
-                       <p:outputLabel for="employeeHeadquarters" value="#{msg.ADMIN_ASSIGN_EMPLOYEE_HEADQUARTERS}" />
+                       <p:outputLabel for="employeeHeadquarter" value="#{msg.ADMIN_ASSIGN_EMPLOYEE_HEADQUARTER}" />
                        <p:selectOneMenu
-                               id="employeeHeadquarters"
-                               value="#{adminEmployeeController.employeeHeadquarters}"
+                               id="employeeHeadquarter"
+                               value="#{adminEmployeeController.employeeHeadquarter}"
                                filter="true"
                                filterMatchMode="contains"
                                >
-                               <f:converter converterId="CompanyHeadquartersConverter" />
+                               <f:converter converterId="HeadquarterConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                               <f:selectItems value="#{companyHeadquartersController.allHeadquarterss()}" var="headquarters" itemValue="#{headquarters}" itemLabel="#{beanHelper.renderHeadquarters(headquarters)}" />
+                               <f:selectItems value="#{headquarterController.allHeadquarter()}" var="headquarter" itemValue="#{headquarter}" itemLabel="#{beanHelper.renderHeadquarter(headquarter)}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="mobileNumber" value="#{msg.ADMIN_ENTER_EMPLOYEE_MOBILE_NUMBER}" />
diff --git a/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl b/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl
new file mode 100644 (file)
index 0000000..3dec21a
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+@TODO: title="#{msg.ADMIN_HEADQUARTER_LEGEND_TITLE}"
+-->
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:core="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <p:fieldset legend="#{msg.ADMIN_HEADQUARTER_LEGEND}">
+               <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
+                       <p:outputLabel for="headquarterContactEmployee" value="#{msg.ADMIN_ASSIGN_HEADQUARTER_CONTACT_EMPLOYEE}" />
+                       <p:selectOneMenu
+                               id="headquarterContactEmployee"
+                               value="#{adminHeadquarterController.headquarterContactEmployee}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               >
+                               <f:converter converterId="EmployeeConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                               <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadquarter" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+                       </p:selectOneMenu>
+
+                       <p:outputLabel for="headquarterUserOwner" value="#{msg.ADMIN_ASSIGN_HEADQUARTER_USER_OWNER}" />
+                       <p:selectOneMenu
+                               id="headquarterUserOwner"
+                               value="#{adminHeadquarterController.headquarterUserOwner}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               >
+                               <f:converter converterId="UserConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                               <f:selectItems value="#{userController.allUsers()}" var="headquarterUserOwner" itemValue="#{headquarterUserOwner}" itemLabel="#{headquarterUserOwner.userContact.contactFirstName} #{headquarterUserOwner.userContact.contactFamilyName} (#{headquarterUserOwner.userName})" />
+                       </p:selectOneMenu>
+
+                       <p:outputLabel for="headquarterEmailAddress" value="#{msg.ADMIN_ENTER_HEADQUARTER_EMAIL_ADDRESS}" />
+                       <p:inputText id="headquarterEmailAddress" size="20" maxlength="255" value="#{adminHeadquarterController.headquarterEmailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+                               <f:validator validatorId="HeadquarterEmailAddressValidator" />
+                               <f:attribute name="allowEmptyValue" value="true" />
+                       </p:inputText>
+
+                       <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_ENTER_HEADQUARTER_LAND_LINE_NUMBER}" />
+                       <core:inputLandLineNumberPanelGrid targetController="#{adminHeadquarterController}" />
+
+                       <p:outputLabel for="faxCountry" value="#{msg.ADMIN_ENTER_HEADQUARTER_FAX_NUMBER}" />
+                       <core:inputFaxNumberPanelGrid targetController="#{adminHeadquarterController}" />
+               </p:panelGrid>
+       </p:fieldset>
+
+       <p:fieldset legend="#{msg.ADMIN_HEADQUARTER_ADDRESS_LEGEND}">
+               <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
+                       <p:outputLabel for="headquarterStreet" value="#{msg.ADMIN_DATA_STREET_NAME}" />
+                       <p:inputText id="headquarterStreet" size="20" maxlength="255" value="#{adminHeadquarterController.headquarterStreet}" required="true" requiredMessage="#{msg.ADMIN_HEADQUARTER_STREET_NAME_REQUIRED}" />
+
+                       <p:outputLabel for="headquarterHouseNumber" value="#{msg.ADMIN_DATA_HOUSE_NUMBER}" />
+                       <p:inputText id="headquarterHouseNumber" size="3" maxlength="5" value="#{adminHeadquarterController.headquarterHouseNumber}" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}" required="true" requiredMessage="#{msg.ADMIN_HEADQUARTER_HOUSE_NUMBER_REQUIRED}">
+                               <f:validateLongRange for="headquarterHouseNumber" minimum="1" maximum="500" />
+                       </p:inputText>
+
+                       <p:outputLabel for="headquarterStore" value="#{msg.ADMIN_ENTER_DATA_STORE}" />
+                       <p:inputText id="headquarterStore" size="3" maxlength="5" value="#{adminHeadquarterController.headquarterStore}" validatorMessage="#{msg.ENTERED_STORE_INVALID}">
+                               <f:validateLongRange for="headquarterStore" minimum="-5" maximum="200" />
+                       </p:inputText>
+
+                       <p:outputLabel for="headquarterSuiteNumber" value="#{msg.ADMIN_ENTER_DATA_SUITE_NUMBER}" />
+                       <p:inputText id="headquarterSuiteNumber" size="3" maxlength="5" value="#{adminHeadquarterController.headquarterSuiteNumber}" validatorMessage="#{msg.ENTERED_SUITE_NUMBER_INVALID}">
+                               <f:validateLongRange for="headquarterSuiteNumber" minimum="1" maximum="500" />
+                       </p:inputText>
+
+                       <p:outputLabel for="headquarterZipCode" value="#{msg.ADMIN_DATA_ZIP_CODE}" />
+                       <p:inputText id="headquarterZipCode" size="5" maxlength="6" value="#{adminHeadquarterController.headquarterZipCode}" required="true" requiredMessage="#{msg.ADMIN_HEADQUARTER_ZIP_CODE_REQUIRED}">
+                               <f:validateLongRange for="headquarterZipCode" minimum="1" maximum="99999" />
+                       </p:inputText>
+
+                       <p:outputLabel for="headquarterCity" value="#{msg.ADMIN_DATA_CITY}" />
+                       <p:inputText id="headquarterCity" size="20" maxlength="255" value="#{adminHeadquarterController.headquarterCity}" required="true" requiredMessage="#{msg.ADMIN_HEADQUARTER_CITY_REQUIRED}" />
+
+                       <p:outputLabel for="headquarterCountry" value="#{msg.ADMIN_SELECT_COUNTRY}" />
+                       <core:outputCountrySelector id="headquarterCountry" value="#{adminHeadquarterController.headquarterCountry}" required="true" requiredMessage="#{msg.ADMIN_HEADQUARTER_COUNTRY_REQUIRED}" />
+               </p:panelGrid>
+       </p:fieldset>
+</ui:composition>
diff --git a/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_opening_time.tpl b/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_opening_time.tpl
new file mode 100644 (file)
index 0000000..b581c70
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+@TODO: title="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE}"
+-->
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND}">
+               <p:panelGrid layout="grid" columns="4" columnClasses="ui-grid-col-4,ui-grid-col-8" styleClass="table table-full ui-noborder">
+                       <p:outputLabel for="openingStartDay" value="#{msg.ADMIN_START_WEEK_DAY}" />
+                       <p:outputLabel for="openingEndDay" value="#{msg.ADMIN_END_WEEK_DAY}" />
+                       <p:outputLabel for="openingStartTime" value="#{msg.ADMIN_START_TIME}" />
+                       <p:outputLabel for="openingEndTime" value="#{msg.ADMIN_END_TIME}" />
+
+                       <p:selectOneMenu
+                               id="openingStartDay"
+                               value="#{adminBranchOfficeController.openingStartDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_START_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:selectOneMenu
+                               id="openingEndDay"
+                               value="#{adminBranchOfficeController.openingEndDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_END_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:calendar
+                               id="openingStartTime"
+                               value="#{adminBranchOfficeController.openingStartTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_START_TIME_REQUIRED}"
+                               />
+
+                       <p:calendar
+                               id="openingEndTime"
+                               value="#{adminBranchOfficeController.openingEndTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_END_TIME_REQUIRED}"
+                               />
+               </p:panelGrid>
+       </p:fieldset>
+</ui:composition>
index bca788446b555a0963a189dfcbec057bc3e1a32e..282b797b6427ce6f10584c8c5e2c14e7d0f2decf 100644 (file)
@@ -8,7 +8,7 @@
         <param-value>JJobs</param-value>
     </context-param>
     <context-param>
-        <description>Primefaces theme</description>
+        <description>PrimeFaces theme</description>
         <param-name>primefaces.THEME</param-name>
         <param-value>bootstrap</param-value>
     </context-param>
     </context-param>
     <context-param>
         <description>Whether business contacts are used in this project.</description>
-        <param-name>is_feature_basic_company_data_enabled</param-name>
+        <param-name>is_feature_basic_data_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
     <context-param>
diff --git a/web/admin/basic_company_data/admin_basic_company_data_list.xhtml b/web/admin/basic_company_data/admin_basic_company_data_list.xhtml
deleted file mode 100644 (file)
index 3f1fb16..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
-                               xmlns="http://www.w3.org/1999/xhtml"
-                               xmlns:core="http://mxchange.org/jsf/core/widgets"
-                               xmlns:links="http://mxchange.org/jsf/core/links"
-                               xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-                               xmlns:h="http://xmlns.jcp.org/jsf/html"
-                               xmlns:f="http://xmlns.jcp.org/jsf/core"
-                               xmlns:p="http://primefaces.org/ui">
-
-       <ui:define name="document_admin_title">
-               <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA}" />
-       </ui:define>
-
-       <ui:define name="content_header">
-               <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA}" />
-       </ui:define>
-
-       <ui:define name="content">
-               <h:form id="form-list-basic-company-data">
-                       <p:dataTable
-                               id="table-list-basic-company-data"
-                               var="basicData"
-                               value="#{basicCompanyDataController.allBasicData()}"
-                               tableStyleClass="table table-full"
-                               paginator="true"
-                               paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
-                               filteredValue="#{basicCompanyDataController.filteredBasicCompanyData}"
-                               rows="10"
-                               reflow="true"
-                               resizableColumns="true"
-                               rowsPerPageTemplate="5,10,20,50,100"
-                               sortMode="multiple"
-                               summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA}"
-                               emptyMessage="#{msg.ADMIN__EMPTY_LISTBASIC_COMPANY_DATA}"
-                               widgetVar="basicDataList"
-                               >
-
-                               <f:facet name="header">
-                                       <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
-                                               <h:outputText value="#{msg.ADMIN_LIST_BASIC_COMPANY_DATA_HEADER}" />
-
-                                               <h:panelGroup>
-                                                       <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
-                                                       <p:columnToggler datasource="table-list-basic-company-data" trigger="toggler" />
-                                               </h:panelGroup>
-                                       </p:panelGrid>
-                               </f:facet>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_COMPANY_DATA_ID}" sortBy="#{basicData.basicDataId}" filterable="false">
-                                       <p:link outcome="admin_show_basic_data" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE}" value="#{basicData.basicDataId}">
-                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
-                                       </p:link>
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_ASSIGNED_USER}" sortBy="#{basicData.companyUserOwner.userName}" filterBy="#{basicData.companyUserOwner}" filterMatchMode="in">
-                                       <f:facet name="filter">
-                                               <p:selectCheckboxMenu
-                                                       filter="true"
-                                                       filterMatchMode="contains"
-                                                       label="#{msg.LABEL_USERS}"
-                                                       onchange="PF('basicDataList').filter()"
-                                                       updateLabel="true"
-                                                       title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
-                                                       >
-                                                       <f:converter converterId="UserConverter" />
-                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{userController.allUsers()}" var="user" itemValue="#{user}" itemLabel="#{user.userName}" />
-                                               </p:selectCheckboxMenu>
-                                       </f:facet>
-
-                                       <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE}" value="#{basicData.companyUserOwner.userId}" rendered="#{not empty basicData.companyUserOwner}">
-                                               <f:param name="userId" value="#{basicData.companyUserOwner.userId}" />
-                                       </p:link>
-
-                                       <p:link outcome="admin_assign_basic_company_data_owner" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty basicData.companyUserOwner}">
-                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
-                                       </p:link>
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_COMPANY_NAME}" sortBy="#{basicData.companyName}" filterBy="#{basicData.companyName}" filterMatchMode="contains">
-                                       <h:outputLink value="#{basicData.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty basicData.companyWebsiteUrl}">
-                                               <h:outputText value="#{basicData.companyName}" />
-                                       </h:outputLink>
-
-                                       <h:outputText value="#{basicData.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty basicData.companyWebsiteUrl}" />
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_COMPANY_CONTACT_PERSON}" sortBy="#{basicData.companyContactEmployee}" filterBy="#{basicData.companyContactEmployee}" filterMatchMode="in">
-                                       <f:facet name="filter">
-                                               <p:selectCheckboxMenu
-                                                       filter="true"
-                                                       filterMatchMode="contains"
-                                                       label="#{msg.LABEL_EMPLOYEES}"
-                                                       onchange="PF('basicDataList').filter()"
-                                                       updateLabel="true"
-                                                       title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
-                                                       >
-                                                       <f:converter converterId="EmployeeConverter" />
-                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
-                                               </p:selectCheckboxMenu>
-                                       </f:facet>
-
-                                       <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE}" value="#{basicData.companyContactEmployee.employeeId}" rendered="#{not empty basicData.companyContactEmployee}">
-                                               <f:param name="employeeId" value="#{basicData.companyContactEmployee.employeeId}" />
-                                       </p:link>
-
-                                       <p:link outcome="admin_assign_basic_company_data_employee" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON}" rendered="#{empty basicData.companyContactEmployee}">
-                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
-                                       </p:link>
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER}" sortBy="#{basicData.companyFounder}" filterBy="#{basicData.companyFounder}" filterMatchMode="in">
-                                       <f:facet name="filter">
-                                               <p:selectCheckboxMenu
-                                                       filter="true"
-                                                       filterMatchMode="contains"
-                                                       label="#{msg.LABEL_EMPLOYEES}"
-                                                       onchange="PF('basicDataList').filter()"
-                                                       updateLabel="true"
-                                                       title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
-                                                       >
-                                                       <f:converter converterId="EmployeeConverter" />
-                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
-                                               </p:selectCheckboxMenu>
-                                       </f:facet>
-
-                                       <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE}" value="#{basicData.companyFounder.employeeId}" rendered="#{not empty basicData.companyFounder}">
-                                               <f:param name="employeeId" value="#{basicData.companyFounder.employeeId}" />
-                                       </p:link>
-
-                                       <p:link outcome="admin_assign_basic_company_data_contact" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty basicData.companyFounder}">
-                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
-                                       </p:link>
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{basicData.companyCreated}">
-                                       <h:outputText id="companyCreated" value="#{basicData.companyCreated.time}">
-                                               <f:convertDateTime for="companyCreated" type="both" timeStyle="short" dateStyle="short" />
-                                       </h:outputText>
-                               </p:column>
-
-                               <p:column headerText="#{msg.ADMIN_HEADER_ACTION_LINKS}" sortable="false" filterable="false">
-                                       <links:outputBasicDataAdminMiniLinks basicData="#{basicData}" />
-                               </p:column>
-                       </p:dataTable>
-               </h:form>
-
-               <h:form>
-                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
-                               <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_ADD_BASIC_COMPANY_DATA_TITLE}" />
-                               </f:facet>
-
-                               <h:panelGroup styleClass="para" layout="block">
-                                       <h:outputText value="#{msg.ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA}" />
-                               </h:panelGroup>
-
-                               <ui:include src="/WEB-INF/templates/admin/basic_company_data/admin_form_basic_company_data.tpl" />
-
-                               <f:facet name="footer">
-                                       <p:panelGrid columns="2" layout="grid">
-                                               <p:commandButton
-                                                       styleClass="reset"
-                                                       type="reset"
-                                                       value="#{msg.BUTTON_RESET_FORM}"
-                                                       />
-
-                                               <p:commandButton
-                                                       styleClass="submit"
-                                                       type="submit"
-                                                       value="#{msg.BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA}"
-                                                       action="#{adminBasicCompanyDataController.addBusinessBasicData()}"
-                                                       update=":master:form-list-basic-company-data:table-list-basic-company-data"
-                                                       />
-                                       </p:panelGrid>
-                               </f:facet>
-                       </p:panelGrid>
-               </h:form>
-       </ui:define>
-</ui:composition>
diff --git a/web/admin/basic_data/admin_basic_data_list.xhtml b/web/admin/basic_data/admin_basic_data_list.xhtml
new file mode 100644 (file)
index 0000000..86988c9
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
+                               xmlns="http://www.w3.org/1999/xhtml"
+                               xmlns:core="http://mxchange.org/jsf/core/widgets"
+                               xmlns:links="http://mxchange.org/jsf/core/links"
+                               xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+                               xmlns:h="http://xmlns.jcp.org/jsf/html"
+                               xmlns:f="http://xmlns.jcp.org/jsf/core"
+                               xmlns:p="http://primefaces.org/ui">
+
+       <ui:define name="document_admin_title">
+               <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_BASIC_DATA}" />
+       </ui:define>
+
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_BASIC_DATA}" />
+       </ui:define>
+
+       <ui:define name="content">
+               <h:form id="form-list-basic-company-data">
+                       <p:dataTable
+                               id="table-list-basic-company-data"
+                               var="basicData"
+                               value="#{basicCompanyDataController.allBasicData()}"
+                               tableStyleClass="table table-full"
+                               paginator="true"
+                               paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+                               filteredValue="#{basicCompanyDataController.filteredBasicCompanyData}"
+                               rows="10"
+                               reflow="true"
+                               resizableColumns="true"
+                               rowsPerPageTemplate="5,10,20,50,100"
+                               sortMode="multiple"
+                               summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_BASIC_DATA}"
+                               emptyMessage="#{msg.ADMIN__EMPTY_LISTBASIC_DATA}"
+                               widgetVar="basicDataList"
+                               >
+
+                               <f:facet name="header">
+                                       <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
+                                               <h:outputText value="#{msg.ADMIN_LIST_BASIC_DATA_HEADER}" />
+
+                                               <h:panelGroup>
+                                                       <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+                                                       <p:columnToggler datasource="table-list-basic-company-data" trigger="toggler" />
+                                               </h:panelGroup>
+                                       </p:panelGrid>
+                               </f:facet>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_ID}" sortBy="#{basicData.basicDataId}" filterable="false">
+                                       <p:link outcome="admin_show_basic_data" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE}" value="#{basicData.basicDataId}">
+                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ASSIGNED_USER}" sortBy="#{basicData.companyUserOwner.userName}" filterBy="#{basicData.companyUserOwner}" filterMatchMode="in">
+                                       <f:facet name="filter">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_USERS}"
+                                                       onchange="PF('basicDataList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
+                                                       >
+                                                       <f:converter converterId="UserConverter" />
+                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                                       <f:selectItems value="#{userController.allUsers()}" var="user" itemValue="#{user}" itemLabel="#{user.userName}" />
+                                               </p:selectCheckboxMenu>
+                                       </f:facet>
+
+                                       <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_OWNER_USER_TITLE}" value="#{basicData.companyUserOwner.userId}" rendered="#{not empty basicData.companyUserOwner}">
+                                               <f:param name="userId" value="#{basicData.companyUserOwner.userId}" />
+                                       </p:link>
+
+                                       <p:link outcome="admin_assign_basic_data_owner" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_DATA_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty basicData.companyUserOwner}">
+                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_COMPANY_NAME}" sortBy="#{basicData.companyName}" filterBy="#{basicData.companyName}" filterMatchMode="contains">
+                                       <h:outputLink value="#{basicData.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty basicData.companyWebsiteUrl}">
+                                               <h:outputText value="#{basicData.companyName}" />
+                                       </h:outputLink>
+
+                                       <h:outputText value="#{basicData.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty basicData.companyWebsiteUrl}" />
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_COMPANY_CONTACT_PERSON}" sortBy="#{basicData.companyContactEmployee}" filterBy="#{basicData.companyContactEmployee}" filterMatchMode="in">
+                                       <f:facet name="filter">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_EMPLOYEES}"
+                                                       onchange="PF('basicDataList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
+                                                       >
+                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                               </p:selectCheckboxMenu>
+                                       </f:facet>
+
+                                       <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_CONTACT_PERSON_TITLE}" value="#{basicData.companyContactEmployee.employeeId}" rendered="#{not empty basicData.companyContactEmployee}">
+                                               <f:param name="employeeId" value="#{basicData.companyContactEmployee.employeeId}" />
+                                       </p:link>
+
+                                       <p:link outcome="admin_assign_basic_data_employee" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON}" rendered="#{empty basicData.companyContactEmployee}">
+                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER}" sortBy="#{basicData.companyFounder}" filterBy="#{basicData.companyFounder}" filterMatchMode="in">
+                                       <f:facet name="filter">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_EMPLOYEES}"
+                                                       onchange="PF('basicDataList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
+                                                       >
+                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                               </p:selectCheckboxMenu>
+                                       </f:facet>
+
+                                       <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_COMPANY_FOUNDER_TITLE}" value="#{basicData.companyFounder.employeeId}" rendered="#{not empty basicData.companyFounder}">
+                                               <f:param name="employeeId" value="#{basicData.companyFounder.employeeId}" />
+                                       </p:link>
+
+                                       <p:link outcome="admin_assign_basic_data_contact" title="#{msg.ADMIN_LINK_ASSIGN_BASIC_DATA_COMPANY_FOUNDER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty basicData.companyFounder}">
+                                               <f:param name="basicDataId" value="#{basicData.basicDataId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{basicData.companyCreated}">
+                                       <h:outputText id="companyCreated" value="#{basicData.companyCreated.time}">
+                                               <f:convertDateTime for="companyCreated" type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ACTION_LINKS}" sortable="false" filterable="false">
+                                       <links:outputBasicDataAdminMiniLinks basicData="#{basicData}" />
+                               </p:column>
+                       </p:dataTable>
+               </h:form>
+
+               <h:form>
+                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.ADMIN_ADD_BASIC_DATA_TITLE}" />
+                               </f:facet>
+
+                               <h:panelGroup styleClass="para" layout="block">
+                                       <h:outputText value="#{msg.ADMIN_ADD_BASIC_DATA_MINIMUM_DATA}" />
+                               </h:panelGroup>
+
+                               <ui:include src="/WEB-INF/templates/admin/basic_data/admin_form_basic_data.tpl" />
+
+                               <f:facet name="footer">
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       styleClass="reset"
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+
+                                               <p:commandButton
+                                                       styleClass="submit"
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_BASIC_DATA}"
+                                                       action="#{adminBasicCompanyDataController.addBusinessBasicData()}"
+                                                       update=":master:form-list-basic-company-data:table-list-basic-company-data"
+                                                       />
+                                       </p:panelGrid>
+                               </f:facet>
+                       </p:panelGrid>
+               </h:form>
+       </ui:define>
+</ui:composition>
index 01d31d8a3565f8924109aadfb4ddccb3dfd9b8d0..6f14b7259e07e11690156904c34501c6ee65832a 100644 (file)
                                </p:column>
 
                                <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{branchOffice.branchEmailAddress}" filterBy="#{branchOffice.branchEmailAddress}" filterMatchMode="contains">
-                                       <h:outputLink value="mailto:#{branchOffice.branchEmailAddress}" rendered="#{not empty branchOffice.branchEmailAddress}" />
+                                       <p:link href="mailto:#{branchOffice.branchEmailAddress}" value="#{branchOffice.branchEmailAddress}" rendered="#{not empty branchOffice.branchEmailAddress}" />
 
                                        <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty branchOffice.branchEmailAddress}" />
                                </p:column>
 
                                <p:column headerText="#{msg.DATA_ADDRESS}" sortBy="#{branchOffice.branchCity}" filterBy="#{branchOffice.branchCity}" filterMatchMode="contains">
-                                       <h:outputText value="#{branchOffice.branchZipCode} #{branchOffice.branchCity}" title="#{branchOffice.branchStreet} #{branchOffice.branchHouseNumber} (#{msg.DATA_STORE} #{branchOffice.branchStore}, #{msg.DATA_SUITE_NUMBER} #{branchOffice.branchSuiteNumber})" />
+                                       <h:outputText value="#{beanHelper.renderBranchOffice(branchOffice)}" title="#{beanHelper.renderBranchOffice(branchOffice)}" />
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_HEADER_COMPANY_CONTACT_PERSON}" sortBy="#{branchOffice.branchContactEmployee.employeePersonalData}" filterBy="#{branchOffice.branchContactEmployee}" filterMatchMode="in">
                                                <p:commandButton
                                                        styleClass="submit"
                                                        type="submit"
-                                                       value="#{msg.BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA}"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_BASIC_DATA}"
                                                        action="#{adminBranchOfficeController.addBranchOffice()}"
                                                        update=":master:form-list-branch-offices:table-list-branch-offices"
                                                        />
                                        <h:outputText value="#{msg.ADMIN_ADD_OPENING_TIME_MINIMUM_DATA}" />
                                </h:panelGroup>
 
-                               <ui:include src="/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl" />
+                               <ui:include src="/WEB-INF/templates/admin/branch_office/admin_form_branch_opening_time.tpl" />
 
                                <f:facet name="footer">
                                        <p:panelGrid columns="2" layout="grid">
index 12f307b9f56d5e3f8ebe81cb0b222ef454d37221..eb02e42f5fd58340f3a1b92a30edfb06f611651b 100644 (file)
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{employee.employeeBranchOffice.branchId}" rendered="#{not empty employee.employeeBranchOffice}">
+                                       <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice)}" rendered="#{not empty employee.employeeBranchOffice}">
                                                <f:param name="branchId" value="#{employee.employeeBranchOffice.branchId}" />
                                        </p:link>
 
-                                       <p:link outcome="admin_assign_branch_office" title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICE_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty employee.employeeBranchOffice}">
+                                       <p:link outcome="admin_assign_branch_office" title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty employee.employeeBranchOffice}">
                                                <f:param name="employeeId" value="#{employee.employeeId}" />
                                        </p:link>
                                </p:column>
                                </p:column>
 
                                <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{employee.employeeEmailAddress}" filterBy="#{employee.employeeEmailAddress}" filterMatchMode="contains">
-                                       <h:outputLink value="mailto:#{employee.employeeEmailAddress}" rendered="#{not empty employee.employeeEmailAddress}" />
+                                       <p:link href="mailto:#{employee.employeeEmailAddress}" value="#{employee.employeeEmailAddress}" rendered="#{not empty employee.employeeEmailAddress}" />
 
                                        <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty employee.employeeEmailAddress}" />
                                </p:column>
index 46db0f3e841b0d807e639827222fa03a49c337a6..c97371136faa0ee81bf2290587866e9e38df5f36 100644 (file)
@@ -38,7 +38,7 @@
 
                        <p:column>
                                <f:facet name="header">
-                                       <p:outputLabel for="faxNumber" value="#{msg.ADMIN_SHOW_PHONE_NUMBER}" />
+                                       <p:outputLabel for="faxNumber" value="#{msg.ADMIN_SHOW_FAX_NUMBER}" />
                                </f:facet>
 
                                <h:outputText id="faxNumber" value="#{faxNumber.phoneCountry.countryAbroadDialPrefix}#{faxNumber.phoneCountry.countryPhoneCode} (#{faxNumber.phoneAreaCode}) #{faxNumber.phoneNumber}" />
diff --git a/web/admin/headquarter/admin_headquarter_list.xhtml b/web/admin/headquarter/admin_headquarter_list.xhtml
new file mode 100644 (file)
index 0000000..60309da
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
+                               xmlns="http://www.w3.org/1999/xhtml"
+                               xmlns:links="http://mxchange.org/jsf/core/links"
+                               xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+                               xmlns:h="http://xmlns.jcp.org/jsf/html"
+                               xmlns:f="http://xmlns.jcp.org/jsf/core"
+                               xmlns:p="http://primefaces.org/ui">
+
+       <ui:define name="document_admin_title">
+               <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_HEADQUARTER}" />
+       </ui:define>
+
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_HEADQUARTER}" />
+       </ui:define>
+
+       <ui:define name="content">
+               <h:form id="form-list-Headquarter">
+                       <p:dataTable
+                               id="table-list-Headquarter"
+                               var="headquarter"
+                               value="#{headquarterController.allHeadquarter()}"
+                               tableStyleClass="table table-full"
+                               paginator="true"
+                               paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+                               filteredValue="#{headquarterController.filteredHeadquarter}"
+                               rows="10"
+                               reflow="true"
+                               resizableColumns="true"
+                               rowsPerPageTemplate="5,10,20,50,100"
+                               sortMode="multiple"
+                               summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER}"
+                               emptyMessage="#{msg.ADMIN_EMPTY_LIST_HEADQUARTER}"
+                               widgetVar="headquarterList"
+                               >
+
+                               <f:facet name="header">
+                                       <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
+                                               <h:outputText value="#{msg.ADMIN_LIST_HEADQUARTER_HEADER}" />
+
+                                               <h:panelGroup>
+                                                       <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+                                                       <p:columnToggler datasource="table-list-Headquarter" trigger="toggler" />
+                                               </h:panelGroup>
+                                       </p:panelGrid>
+                               </f:facet>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ID_NUMBER}" sortBy="#{headquarter.headquarterId}" filterable="false">
+                                       <p:link outcome="admin_show_headquarter" title="#{msg.ADMIN_LINK_SHOW_HEADQUARTER_TITLE}" value="#{headquarter.headquarterId}">
+                                               <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ASSIGNED_USER}" sortBy="#{headquarter.headquarterUserOwner.userName}" filterBy="#{headquarter.headquarterUserOwner}" filterMatchMode="in">
+                                       <f:facet name="filter">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_USERS}"
+                                                       onchange="PF('headquarterList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
+                                                       >
+                                                       <f:converter converterId="UserConverter" />
+                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                                       <f:selectItems value="#{userController.allUsers()}" var="user" itemValue="#{user}" itemLabel="#{user.userName}" />
+                                               </p:selectCheckboxMenu>
+                                       </f:facet>
+
+                                       <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_HEADQUARTER_OWNER_USER_TITLE}" value="#{headquarter.headquarterUserOwner.userId}" rendered="#{not empty headquarter.headquarterUserOwner}">
+                                               <f:param name="userId" value="#{headquarter.headquarterUserOwner.userId}" />
+                                       </p:link>
+
+                                       <p:link outcome="admin_assign_headquarter_owner" title="#{msg.ADMIN_LINK_ASSIGN_HEADQUARTER_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty headquarter.headquarterUserOwner}">
+                                               <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{headquarter.headquarterEmailAddress}" filterBy="#{headquarter.headquarterEmailAddress}" filterMatchMode="contains">
+                                       <p:link href="mailto:#{headquarter.headquarterEmailAddress}" value="#{headquarter.headquarterEmailAddress}" rendered="#{not empty headquarter.headquarterEmailAddress}" />
+
+                                       <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty headquarter.headquarterEmailAddress}" />
+                               </p:column>
+
+                               <p:column headerText="#{msg.DATA_ADDRESS}" sortBy="#{headquarter.headquarterCity}" filterBy="#{headquarter.headquarterCity}" filterMatchMode="contains">
+                                       <h:outputText value="#{beanHelper.renderHeadquarter(headquarter)}" title="#{beanHelper.renderHeadquarter(headquarter)}" />
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_COMPANY_CONTACT_PERSON}" sortBy="#{headquarter.headquarterContactEmployee.employeePersonalData}" filterBy="#{headquarter.headquarterContactEmployee}" filterMatchMode="in">
+                                       <f:facet name="filter">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_EMPLOYEES}"
+                                                       onchange="PF('headquarterList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
+                                                       >
+                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                                       <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+                                               </p:selectCheckboxMenu>
+                                       </f:facet>
+
+                                       <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_HEADQUARTER_CONTACT_PERSON_TITLE}" value="#{headquarter.headquarterContactEmployee.employeeId}" rendered="#{not empty headquarter.headquarterContactEmployee}">
+                                               <f:param name="employeeId" value="#{headquarter.headquarterContactEmployee.employeeId}" />
+                                       </p:link>
+
+                                       <p:link outcome="admin_assign_headquarter_employee" title="#{msg.ADMIN_LINK_ASSIGN_HEADQUARTER_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty headquarter.headquarterContactEmployee}">
+                                               <f:param name="headquarterId" value="#{headquarter.headquarterId}" />
+                                       </p:link>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{headquarter.headquarterCreated}" filterable="false">
+                                       <h:outputText id="headquarterCreated" value="#{headquarter.headquarterCreated.time}">
+                                               <f:convertDateTime for="headquarterCreated" type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </p:column>
+
+                               <p:column headerText="#{msg.ADMIN_HEADER_ACTION_LINKS}" sortable="false" filterable="false">
+                                       <links:outputHeadquarterAdminMiniLinks headquarter="#{headquarter}" />
+                               </p:column>
+                       </p:dataTable>
+               </h:form>
+
+               <h:form>
+                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.ADMIN_ADD_HEADQUARTER_TITLE}" />
+                               </f:facet>
+
+                               <h:panelGroup styleClass="para" layout="block">
+                                       <h:outputText value="#{msg.ADMIN_ADD_HEADQUARTER_MINIMUM_DATA}" />
+                               </h:panelGroup>
+
+                               <ui:include src="/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl" />
+
+                               <f:facet name="footer">
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       styleClass="reset"
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+
+                                               <p:commandButton
+                                                       styleClass="submit"
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_HEADQUARTER}"
+                                                       action="#{adminHeadquarterController.addHeadquarter()}"
+                                                       update=":master:form-list-Headquarter:table-list-Headquarter"
+                                                       />
+                                       </p:panelGrid>
+                               </f:facet>
+                       </p:panelGrid>
+               </h:form>
+
+               <h:form id="form-list-headquarter-opening-time">
+                       <p:fieldset legend="#{msg.ADMIN_HEADQUARTER_OPENING_TIMES_LEGEND}">
+                               <p:dataTable
+                                       id="table-list-headquarter-opening-time"
+                                       var="openingTime"
+                                       value="#{adminHeadquarterController.headquarterOpeningTimes}"
+                                       tableStyleClass="table table-full"
+                                       rows="10"
+                                       reflow="true"
+                                       summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER_OPENING_TIMES}"
+                                       emptyMessage="#{msg.ADMIN_EMPTY_LIST_HEADQUARTER_OPENING_TIMES}"
+                                       widgetVar="headquarterOpeningTimeList"
+                                       >
+
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_LIST_HEADQUARTER_OPENING_TIMES_HEADER}" />
+                                       </f:facet>
+
+                                       <p:column headerText="#{msg.ADMIN_START_WEEK_DAY}">
+                                               <h:outputText value="#{openingTime.openingStartDay.toString()}" />
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_END_WEEK_DAY}">
+                                               <h:outputText value="#{openingTime.openingEndDay.toString()}" />
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_START_TIME}">
+                                               <h:outputText value="#{openingTime.openingStartTime.time}">
+                                                       <f:convertDateTime type="time" timeStyle="short" />
+                                               </h:outputText>
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_END_TIME}">
+                                               <h:outputText value="#{openingTime.openingEndTime.time}">
+                                                       <f:convertDateTime type="time" timeStyle="short" />
+                                               </h:outputText>
+                                       </p:column>
+                               </p:dataTable>
+                       </p:fieldset>
+               </h:form>
+
+               <h:form id="form-admin-add-headquarter-opening-time">
+                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.ADMIN_ADD_HEADQUARTER_OPENING_TIME_TITLE}" />
+                               </f:facet>
+
+                               <h:panelGroup styleClass="para" layout="block">
+                                       <h:outputText value="#{msg.ADMIN_ADD_OPENING_TIME_MINIMUM_DATA}" />
+                               </h:panelGroup>
+
+                               <ui:include src="/WEB-INF/templates/admin/headquarter/admin_form_headquarter_opening_time.tpl" />
+
+                               <f:facet name="footer">
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       styleClass="reset"
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+
+                                               <p:commandButton
+                                                       styleClass="submit"
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_HEADQUARTER_OPENING_TIME}"
+                                                       action="#{adminHeadquarterController.addOpeningTime()}"
+                                                       update=":master:form-list-headquarter-opening-time:table-list-headquarter-opening-time"
+                                                       />
+                                       </p:panelGrid>
+                               </f:facet>
+                       </p:panelGrid>
+               </h:form>
+       </ui:define>
+</ui:composition>
index f2a19b6b1d568d805952b69382785309245019d2..f7c681176767df186ed67394cd67b6c505c40ac9 100644 (file)
@@ -38,7 +38,7 @@
 
                        <p:column>
                                <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_SHOW_PHONE_NUMBER}" />
+                                       <h:outputText value="#{msg.ADMIN_SHOW_LAND_LINE_NUMBER}" />
                                </f:facet>
 
                                <h:outputText value="#{landLineNumber.phoneCountry.countryAbroadDialPrefix}#{landLineNumber.phoneCountry.countryPhoneCode} (#{landLineNumber.phoneAreaCode}) #{landLineNumber.phoneNumber}" />