--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
+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 FinancialsAdminBasicDataWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBasicDataWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 56_189_028_928_374L;
+
+ /**
+ * EJB for administrative purposes
+ */
+ @EJB (lookup = "java:global/jfinancials-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 FinancialsAdminBasicDataWebRequestBean () {
+ // 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;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.business.basicdata;
+
+import java.io.Serializable;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsAdminBasicDataWebRequestController extends Serializable {
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
-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 FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBusinessDataWebRequestController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 56_189_028_928_374L;
-
- /**
- * EJB for administrative purposes
- */
- @EJB (lookup = "java:global/jfinancials-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 FinancialsAdminBusinessDataWebRequestBean () {
- // 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;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.beans.business.basicdata;
-
-import java.io.Serializable;
-
-/**
- * An interface for session-scoped financial controller
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface FinancialsAdminBusinessDataWebRequestController extends Serializable {
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
+
+/**
+ * A business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("basicCompanyDataController")
+@RequestScoped
+public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implements FinancialsBasicDataWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 56_189_028_928_371L;
+
+ /**
+ * EJB for administrative basic business data purposes
+ */
+ @EJB (lookup = "java:global/jfinancials-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/jfinancials-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 FinancialsUserLoginWebSessionController userLoginController;
+
+ /**
+ * Constructor
+ */
+ public FinancialsBasicDataWebRequestBean () {
+ // 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);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.business.basicdata;
+
+import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsBasicDataWebRequestController 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);
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
-
-/**
- * A business contact bean (controller)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("basicCompanyDataController")
-@RequestScoped
-public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean implements FinancialsBusinessDataWebRequestController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 56_189_028_928_371L;
-
- /**
- * EJB for administrative basic business data purposes
- */
- @EJB (lookup = "java:global/jfinancials-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/jfinancials-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 FinancialsUserLoginWebSessionController userLoginController;
-
- /**
- * Constructor
- */
- public FinancialsBusinessDataWebRequestBean () {
- // 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);
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.beans.business.basicdata;
-
-import java.io.Serializable;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-
-/**
- * An interface for session-scoped financial controller
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface FinancialsBusinessDataWebRequestController extends Serializable {
-
- /**
- * Retrieves a single business data entity for given id number or throws a
- * proper exception if not found.
- * <p>
- * @param basicDataId Company basic data id to lookup
- * <p>
- * @return Business contact instance
- * <p>
- * @throws BasicDataNotFoundException If the id number could not be
- * looked up and solved into an entity
- */
- BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
-
- /**
- * Checks whether given company name already exists
- * <p>
- * @param companyName Company name to check
- * <p>
- * @return Whether the company name exists
- */
- Boolean isCompanyNameUsed (final String companyName);
-
-}
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;
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
@SessionScoped
public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBranchOfficeWebRequestController {
+ /**
+ * Opening times of this branch office
+ */
+ private static List<OpeningTime> branchOpeningTimes;
+
/**
* Serial number
*/
@Inject
private FinancialsBranchOfficeWebRequestController branchOfficeController;
- /**
- * Opening times of this branch office
- */
- private static List<OpeningTime> branchOpeningTimes;
-
/**
* Store
*/
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;
}
}
+ @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;
+ }
+
}
*/
public interface FinancialsBranchOfficeWebRequestController 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>
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.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
/**
* An administrative bean for departments
/**
* 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
private FinancialsDepartmentWebRequestController 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)
}
/**
- * 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;
}
/**
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());
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.jfinancials.beans.BaseFinancialsBean;
+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;
private BranchOffice employeeBranchOffice;
/**
- * Department where employee works (alternative to headquarters)
+ * General employee controller
+ */
+ @Inject
+ private FinancialsEmployeeWebRequestController employeeController;
+
+ /**
+ * Department where employee works (alternative to headquarter)
*/
private Department employeeDepartment;
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
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>
}
/**
- * 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;
}
/**
* <p>
* @return Employee's phone extension
*/
- public Long getEmployeePhoneExtension () {
+ public Integer getEmployeePhoneExtension () {
return this.employeePhoneExtension;
}
* <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>
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;
+ }
+
}
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;
package org.mxchange.jfinancials.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;
*/
public interface FinancialsEmployeeWebRequestController 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>
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
+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 FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean implements FinancialsAdminHeadquarterWebRequestController {
+
+ /**
+ * 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/jfinancials-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 FinancialsHeadquarterWebRequestController 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 FinancialsAdminHeadquarterWebRequestBean () {
+ // 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) {
+ FinancialsAdminHeadquarterWebRequestBean.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;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.business.headquarter;
+
+import java.io.Serializable;
+
+/**
+ * An interface for administrative headquarter controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsAdminHeadquarterWebRequestController extends Serializable {
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.BaseFinancialsBean;
+
+/**
+ * A general bean for headquarter
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("headquarterController")
+@RequestScoped
+public class FinancialsHeadquarterWebRequestBean extends BaseFinancialsBean implements FinancialsHeadquarterWebRequestController {
+
+ /**
+ * 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/jfinancials-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 FinancialsHeadquarterWebRequestBean () {
+ // 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;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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 FinancialsHeadquarterWebRequestController 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;
+
+}
}
@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.
}
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.department.Department;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
// Is a product set?
if (product instanceof Product) {
// Add name and price
- sb.append(product.getProductI18nKey());
+ 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
}
}
/**
- * Returns the headquarters address. If null is provided, an empty string is
+ * Returns the headquarter address. If null is provided, an empty string is
* returned.
* <p>
- * @param headquarters Headquarters instance
- * <p>
- * @return Headquarters address
+ * @param headquarter Headquarter instance
+ <p>
+ * @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
import javax.faces.convert.FacesConverter;
import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestBean;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
/**
* Converter for basic company data id <-> valid basic company data instance
/**
* Basic company data backing bean
*/
- private static FinancialsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
+ private static FinancialsBasicDataWebRequestController 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(FinancialsBusinessDataWebRequestBean.class).get();
+ BASIC_DATA_CONTROLLER = CDI.current().select(FinancialsBasicDataWebRequestBean.class).get();
}
// Is the value null or empty?
@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(FinancialsBranchOfficeWebRequestBean.class).get();
}
@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(FinancialsDepartmentWebRequestBean.class).get();
}
@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(FinancialsEmployeeWebRequestBean.class).get();
}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.converter.business.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.jfinancials.beans.business.headquarter.FinancialsHeadquarterWebRequestBean;
+import org.mxchange.jfinancials.beans.business.headquarter.FinancialsHeadquarterWebRequestController;
+
+/**
+ * Converter for converting company headquarter to and from id number
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("HeadquarterConverter")
+public class FinancialsHeadquarterConverter implements Converter<Headquarter> {
+
+ /**
+ * Headquarter backing bean
+ */
+ private static FinancialsHeadquarterWebRequestController 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(FinancialsHeadquarterWebRequestBean.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());
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jfinancials.converter.business.headquarters;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.convert.FacesConverter;
-import javax.faces.validator.ValidatorException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.exceptions.headquarters.CompanyHeadquartersNotFoundException;
-import org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
-
-/**
- * Converter for converting company headquarters to and from id number
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter ("CompanyHeadquartersConverter")
-public class FinancialsCompanyHeadquartersConverter implements Converter<HeadquartersData> {
-
- /**
- * Headquarters backing bean
- * @TODO Undone
- */
- private static CompanyHeadquartersSessionBeanRemote HEADQUARTERS_CONTROLLER;
-
- @Override
- public HeadquartersData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Is the instance there?
- if (HEADQUARTERS_CONTROLLER == null) {
- try {
- // Not yet, attempt lookup
- final Context initial = new InitialContext();
-
- // Lookup EJB
- HEADQUARTERS_CONTROLLER = (CompanyHeadquartersSessionBeanRemote) initial.lookup("java:global/jfinancials-ejb/headquarters!org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote"); //NOI18N
- } catch (final NamingException ex) {
- // Throw it again
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex); //NOI18N
- }
- }
-
- // Is the value null or empty?
- if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
- // Warning message
- // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
- // Return null
- return null;
- }
-
- // Init instance
- HeadquartersData companyHeadquarters = null;
-
- try {
- // Try to parse the value as long
- final Long headquartersId = Long.valueOf(submittedValue);
-
- // Try to get user instance from it
- companyHeadquarters = HEADQUARTERS_CONTROLLER.findCompanyHeadquartersById(headquartersId);
- } catch (final NumberFormatException ex) {
- // Throw again
- throw new ConverterException(ex);
- } catch (final CompanyHeadquartersNotFoundException 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 companyHeadquarters;
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final HeadquartersData value) {
- // Is the object null?
- if ((null == value) || (String.valueOf(value).isEmpty())) {
- // Is null
- return ""; //NOI18N
- }
-
- // Return id number
- return String.valueOf(value.getHeadquartersId());
- }
-
-}
@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(FinancialsOpeningTimeWebRequestBean.class).get();
}
@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(FinancialsContactWebRequestBean.class).get();
}
@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(FinancialsCountryWebRequestBean.class).get();
}
@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(FinancialsPhoneWebRequestBean.class).get();
}
@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(FinancialsPhoneWebRequestBean.class).get();
}
@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(FinancialsPhoneWebRequestBean.class).get();
}
@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(FinancialsMobileProviderWebRequestBean.class).get();
}
@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(FinancialsUserWebRequestBean.class).get();
}
import javax.faces.validator.FacesValidator;
import javax.faces.validator.ValidatorException;
import org.mxchange.jcoreee.validator.string.BaseStringValidator;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestBean;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBusinessDataWebRequestController;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
/**
* A validator for company names
/**
* Business basic data backing bean
*/
- private static FinancialsBusinessDataWebRequestController BASIC_DATA_CONTROLLER;
+ private static FinancialsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
/**
* Serial number
@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(FinancialsBusinessDataWebRequestBean.class).get();
+ BASIC_DATA_CONTROLLER = CDI.current().select(FinancialsBasicDataWebRequestBean.class).get();
}
// All accepted, required fields
@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(FinancialsContactWebRequestBean.class).get();
- }
-
// The required field
final String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
// 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(FinancialsContactWebRequestBean.class).get();
+ }
+
// Is it registered?
final Boolean isRegistered = CONTACT_CONTROLLER.isEmailAddressRegistered(emailAddress);
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
+import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
+
+/**
+ * A validator for basic company data email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "BasicDataEmailAddressValidator")
+public class FinancialsBasicDataEmailAddressValidator extends BaseStringValidator {
+
+ /**
+ * Branch office backing bean
+ */
+ private static FinancialsBasicDataWebRequestController 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(FinancialsBasicDataEmailAddressValidator.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(FinancialsBasicDataWebRequestBean.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));
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.business.branchoffice.FinancialsBranchOfficeWebRequestBean;
+import org.mxchange.jfinancials.beans.business.branchoffice.FinancialsBranchOfficeWebRequestController;
+
+/**
+ * A validator for branch office email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "BranchOfficeEmailAddressValidator")
+public class FinancialsBranchOfficeEmailAddressValidator extends BaseStringValidator {
+
+ /**
+ * Branch office backing bean
+ */
+ private static FinancialsBranchOfficeWebRequestController 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(FinancialsBranchOfficeEmailAddressValidator.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(FinancialsBranchOfficeWebRequestBean.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));
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.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.jfinancials.beans.business.headquarter.FinancialsHeadquarterWebRequestBean;
+import org.mxchange.jfinancials.beans.business.headquarter.FinancialsHeadquarterWebRequestController;
+
+/**
+ * A validator for headquarter's email address validation
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesValidator (value = "HeadquarterEmailAddressValidator")
+public class FinancialsHeadquarterEmailAddressValidator 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 FinancialsHeadquarterWebRequestController HEADQUARTER_CONTROLLER;
+
+ /**
+ * Pattern matcher
+ */
+ private static final Pattern PATTERN_MATCHER = Pattern.compile(FinancialsHeadquarterEmailAddressValidator.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(FinancialsHeadquarterWebRequestBean.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));
+ }
+ }
+
+}
@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(FinancialsUserWebRequestBean.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(FinancialsUserWebRequestBean.class).get();
+ }
+
// Cast value
final Long userId = (Long) value;
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
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.
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:
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!
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
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!
#@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.
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.
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!
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
#@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:
#@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!
#@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.
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
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:
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
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.
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:
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
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:
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
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.
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
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.
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
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:
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.
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.
<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>
</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>
<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>
<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>
--- /dev/null
+<?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>
<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}" />
+++ /dev/null
-<?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>
--- /dev/null
+<?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>
<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}"
>
<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}" />
<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>
--- /dev/null
+<?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>
+++ /dev/null
-<?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>
<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}" />
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">
</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>
@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}" />
--- /dev/null
+<?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>
--- /dev/null
+<?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>
<param-value>JFinancials</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>
+++ /dev/null
-<?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>
--- /dev/null
+<?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>
</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">
</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>
<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}" />
</p:link>
</p:column>
+ <p:column headerText="#{project.ADMIN_HEADER_RECEIPT_ITEM_MANUFACTURER_NAME}" sortBy="#{item.itemManufacturer.companyName}" filterBy="#{item.itemManufacturer}" filterMatchMode="in">
+ <f:facet name="filter">
+ <p:selectCheckboxMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_COMPANIES}"
+ onchange="PF('itemList').filter()"
+ updateLabel="true"
+ title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
+ >
+ <f:converter converterId="BasicCompanyDataConverter" />
+ <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+ </p:selectCheckboxMenu>
+ </f:facet>
+
+ <h:outputLink value="#{item.itemManufacturer.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty item.itemManufacturer.companyWebsiteUrl}">
+ <h:outputText value="#{item.itemManufacturer.companyName}" />
+ </h:outputLink>
+
+ <h:outputText value="#{item.itemManufacturer.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty item.itemManufacturer.companyWebsiteUrl}" />
+ </p:column>
+
<p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{receipt.receiptCreated}" filterable="false">
<h:outputText id="itemCreated" value="#{receiptItem.itemCreated.time}">
<f:convertDateTime for="itemCreated" type="both" timeStyle="short" dateStyle="short" />
</p:link>
</p:column>
- <p:column headerText="#{project.ADMIN_HEADER_I18N_KEY}" sortBy="#{product.productI18nKey}" filterBy="#{product.productI18nKey}" filterMatchMode="contains">
- <h:outputText value="#{product.productI18nKey}" />
+ <p:column headerText="#{msg.ADMIN_HEADER_I18N_KEY}" sortBy="#{product.productI18nKey}" filterBy="#{product.productI18nKey}" filterMatchMode="contains">
+ <h:outputText value="#{local[product.productI18nKey]}" title="#{product.productI18nKey}" />
</p:column>
<p:column headerText="#{project.ADMIN_HEADER_ASSIGNED_PRODUCT_CATEGORY}" sortBy="#{product.productCategory.categoryI18nKey}" filterBy="#{product.productCategory}" filterMatchMode="in">
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_product_category" title="#{project.ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE}" value="#{product.productCategory.categoryId}">
+ <p:link outcome="admin_show_product_category" title="#{project.ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE}" value="#{local[product.productCategory.categoryI18nKey]}">
<f:param name="categoryId" value="#{product.productCategory.categoryId}" />
</p:link>
</p:column>
<h:outputText value="#{product.productAvailability ? msg.CHOICE_YES : msg.CHOICE_NO}" />
</p:column>
+ <p:column headerText="#{msg.ADMIN_HEADER_PRODUCT_MANUFACTURER_NAME}" sortBy="#{product.productManufacturer.companyName}" filterBy="#{product.productManufacturer}" filterMatchMode="in">
+ <f:facet name="filter">
+ <p:selectCheckboxMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_COMPANIES}"
+ onchange="PF('productList').filter()"
+ updateLabel="true"
+ title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
+ >
+ <f:converter converterId="BasicCompanyDataConverter" />
+ <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+ </p:selectCheckboxMenu>
+ </f:facet>
+
+ <h:outputLink value="#{product.productManufacturer.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty product.productManufacturer.companyWebsiteUrl}">
+ <h:outputText value="#{product.productManufacturer.companyName}" />
+ </h:outputLink>
+
+ <h:outputText value="#{product.productManufacturer.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty product.productManufacturer.companyWebsiteUrl}" />
+ </p:column>
+
<p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{product.productCreated}" filterable="false">
<h:outputText id="productCreated" value="#{product.productCreated.time}">
<f:convertDateTime for="productCreated" type="both" timeStyle="short" dateStyle="short" />
--- /dev/null
+<?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>
<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}" />
</p:column>
<p:column headerText="#{msg.ADMIN_HEADER_I18N_KEY}" sortBy="#{category.categoryI18nKey}" filterBy="#{category.categoryI18nKey}" filterMatchMode="contains">
- <h:outputText value="#{local[category.categoryI18nKey]}" />
+ <h:outputText value="#{local[category.categoryI18nKey]}" title="#{category.categoryI18nKey}" />
</p:column>
<p:column headerText="#{project.ADMIN_HEADER_ASSIGNED_PARENT_CATEGORY}" sortBy="#{category.parentCategory.categoryI18nKey}" filterBy="#{category.parentCategory}" filterMatchMode="in">
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_product_category" title="#{project.ADMIN_LINK_SHOW_PRODUCT_CATEGORY_TITLE}" value="#{category.parentCategory.categoryId}" rendered="#{not empty category.parentCategory}">
+ <p:link outcome="admin_show_product_category" title="#{project.ADMIN_LINK_SHOW_PRODUCT_CATEGORY_TITLE}" value="#{local[category.parentCategory.categoryI18nKey]}" rendered="#{not empty category.parentCategory}">
<f:param name="categoryId" value="#{category.parentCategory.categoryId}" />
</p:link>