From 9c60e01de7a0494f6ffab0636fe4a26bbaf3dda3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 4 Nov 2017 00:56:18 +0100 Subject: [PATCH] Please cherry-pick: - removed company from "basic_company_data" (and class names) as there will be no other basic data - added view for headquarter listing (administrative) - used more beanHelper's renderFoo(foo) methods as this is much easier to debug - renamed ADMIN_SHOW_PHONE_NUMBER to ADMIN_SHOW__NUMBER - added menu for headquarters (administrative) - added custom JSF tag for administrative "mini-links" for headquarters - added templates for form and opening times of headquarters - fixed employee link outcomes, was copy-paste mistake (ops) - renamed more headquarters -> headquarter - addEmployee() is now "basically finished" - changed h:outputLink to p:link which suits better here - added missing navigation rules for headquarters/employees - isCompanyNameUsed() and isEmailAddressRegistered() should be "basically finished" - still one isEmailAddressRegistered() is left in generic contactController - first value, then variable on comparison (null == someVariable) - lot's more fixes/improvements I cannot remember ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...nancialsAdminBasicDataWebRequestBean.java} | 30 +- ...lsAdminBasicDataWebRequestController.java} | 2 +- ...=> FinancialsBasicDataWebRequestBean.java} | 65 +- ...ancialsBasicDataWebRequestController.java} | 16 +- ...ncialsAdminBranchOfficeWebRequestBean.java | 14 +- .../FinancialsBranchOfficeWebRequestBean.java | 20 + ...cialsBranchOfficeWebRequestController.java | 10 + ...nancialsAdminDepartmentWebRequestBean.java | 70 +- ...FinancialsAdminEmployeeWebRequestBean.java | 200 ++++- .../FinancialsEmployeeWebRequestBean.java | 6 +- ...inancialsEmployeeWebRequestController.java | 8 + ...ancialsAdminHeadquarterWebRequestBean.java | 836 ++++++++++++++++++ ...sAdminHeadquarterWebRequestController.java | 28 + .../FinancialsHeadquarterWebRequestBean.java | 224 +++++ ...ncialsHeadquarterWebRequestController.java | 59 ++ .../FinancialsContactWebRequestBean.java | 2 +- .../FinancialsWebRequestHelperBean.java | 36 +- .../FinancialsBasicCompanyDataConverter.java | 10 +- .../FinancialsBranchOfficeConverter.java | 2 +- .../FinancialsDepartmentConverter.java | 2 +- .../employee/FinancialsEmployeeConverter.java | 2 +- .../FinancialsHeadquarterConverter.java | 83 ++ ...inancialsCompanyHeadquartersConverter.java | 105 --- ...FinancialsCompanyOpeningTimeConverter.java | 2 +- .../contact/FinancialsContactConverter.java | 2 +- .../country/FinancialsCountryConverter.java | 2 +- .../fax/FinancialsFaxNumberConverter.java | 2 +- .../FinancialsLandLineNumberConverter.java | 2 +- .../FinancialsMobileNumberConverter.java | 2 +- .../FinancialsMobileProviderConverter.java | 2 +- .../user/FinancialsUserConverter.java | 2 +- .../FinancialsCompanyNameValidator.java | 10 +- .../FinancialsEmailAddressValidator.java | 12 +- ...ancialsBasicDataEmailAddressValidator.java | 139 +++ ...ialsBranchOfficeEmailAddressValidator.java | 139 +++ ...cialsHeadquarterEmailAddressValidator.java | 139 +++ .../user/FinancialsUserIdValidator.java | 12 +- .../localization/generic_de_DE.properties | 116 ++- .../localization/generic_en_US.properties | 119 ++- web/WEB-INF/faces-config.xml | 73 +- web/WEB-INF/links.jsf.taglib.xml | 25 +- .../mini/employee/admin_employee_links.tpl | 6 +- .../headquarter/admin_headquarter_links.tpl | 33 + web/WEB-INF/templates/admin/admin_menu.tpl | 5 +- .../admin_form_basic_data.tpl} | 24 +- .../admin_form_branch_office_data.tpl | 10 +- ...tpl => admin_form_branch_opening_time.tpl} | 0 .../department/admin_form_department_data.tpl | 12 +- .../employee/admin_form_employee_data.tpl | 15 +- .../headquarter/admin_form_headquarter.tpl | 84 ++ .../admin_form_headquarter_opening_time.tpl | 65 ++ web/WEB-INF/web.xml | 4 +- .../admin_basic_data_list.xhtml} | 32 +- .../admin_branch_office_list.xhtml | 8 +- web/admin/employee/admin_employee_list.xhtml | 6 +- web/admin/fax/admin_fax_list.xhtml | 2 +- .../admin_receipt_item_list.xhtml | 22 + .../admin_generic_product_list.xhtml | 28 +- .../headquarter/admin_headquarter_list.xhtml | 232 +++++ web/admin/landline/admin_landline_list.xhtml | 2 +- .../admin_product_category_list.xhtml | 4 +- 61 files changed, 2788 insertions(+), 436 deletions(-) rename src/java/org/mxchange/jfinancials/beans/business/basicdata/{FinancialsAdminBusinessDataWebRequestBean.java => FinancialsAdminBasicDataWebRequestBean.java} (93%) rename src/java/org/mxchange/jfinancials/beans/business/basicdata/{FinancialsAdminBusinessDataWebRequestController.java => FinancialsAdminBasicDataWebRequestController.java} (91%) rename src/java/org/mxchange/jfinancials/beans/business/basicdata/{FinancialsBusinessDataWebRequestBean.java => FinancialsBasicDataWebRequestBean.java} (87%) rename src/java/org/mxchange/jfinancials/beans/business/basicdata/{FinancialsBusinessDataWebRequestController.java => FinancialsBasicDataWebRequestController.java} (80%) create mode 100644 src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestController.java create mode 100644 src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestController.java create mode 100644 src/java/org/mxchange/jfinancials/converter/business/headquarter/FinancialsHeadquarterConverter.java delete mode 100644 src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java create mode 100644 src/java/org/mxchange/jfinancials/validator/emailaddress/basicdata/FinancialsBasicDataEmailAddressValidator.java create mode 100644 src/java/org/mxchange/jfinancials/validator/emailaddress/branchoffice/FinancialsBranchOfficeEmailAddressValidator.java create mode 100644 src/java/org/mxchange/jfinancials/validator/emailaddress/headquarter/FinancialsHeadquarterEmailAddressValidator.java create mode 100644 web/WEB-INF/resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl rename web/WEB-INF/templates/admin/{basic_company_data/admin_form_basic_company_data.tpl => basic_data/admin_form_basic_data.tpl} (84%) rename web/WEB-INF/templates/admin/branch_office/{admin_form_opening_time.tpl => admin_form_branch_opening_time.tpl} (100%) create mode 100644 web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl create mode 100644 web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_opening_time.tpl rename web/admin/{basic_company_data/admin_basic_company_data_list.xhtml => basic_data/admin_basic_data_list.xhtml} (78%) create mode 100644 web/admin/headquarter/admin_headquarter_list.xhtml diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java similarity index 93% rename from src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestBean.java rename to src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java index 1c0760f7..c0c3deba 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java @@ -30,7 +30,7 @@ import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessi 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.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; @@ -46,7 +46,7 @@ import org.mxchange.jusercore.model.user.User; */ @Named ("adminBasicCompanyDataController") @RequestScoped -public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBusinessDataWebRequestController { +public class FinancialsAdminBasicDataWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBasicDataWebRequestController { /** * Serial number @@ -87,9 +87,9 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea private Employable companyFounder; /** - * Head quarter data for this company + * Headquarter data for this company */ - private HeadquartersData companyHeadQuarters; + private Headquarter companyHeadQuarter; /** * Company name @@ -144,7 +144,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea /** * Default constructor */ - public FinancialsAdminBusinessDataWebRequestBean () { + public FinancialsAdminBasicDataWebRequestBean () { // Call super constructor super(); } @@ -172,7 +172,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea basicData.setCompanyContactEmployee(this.getCompanyContactEmployee()); basicData.setCompanyEmailAddress(this.getCompanyEmailAddress()); basicData.setCompanyFounder(this.getCompanyFounder()); - basicData.setCompanyHeadQuartersData(this.getCompanyHeadQuarters()); + basicData.setCompanyHeadquarterData(this.getCompanyHeadQuarter()); basicData.setCompanyTaxNumber(this.getCompanyTaxNumber()); basicData.setCompanyUserOwner(this.getCompanyUserOwner()); basicData.setCompanyWebsiteUrl(this.getCompanyWebsiteUrl()); @@ -238,7 +238,7 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea } // Continue to list again - return "admin_list_basic_company_data"; //NOI18N + return "admin_list_basic_data"; //NOI18N } /** @@ -314,21 +314,21 @@ public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsBea } /** - * Getter for headquarters data + * Getter for headquarter data *

- * @return Headquarters data + * @return Headquarter data */ - public HeadquartersData getCompanyHeadQuarters () { - return this.companyHeadQuarters; + public Headquarter getCompanyHeadQuarter () { + return this.companyHeadQuarter; } /** - * Setter for headquarters data + * Setter for headquarter data *

- * @param companyHeadQuarters Headquarters data + * @param companyHeadQuarter Headquarter data */ - public void setCompanyHeadQuarters (final HeadquartersData companyHeadQuarters) { - this.companyHeadQuarters = companyHeadQuarters; + public void setCompanyHeadQuarter (final Headquarter companyHeadQuarter) { + this.companyHeadQuarter = companyHeadQuarter; } /** diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestController.java similarity index 91% rename from src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestController.java rename to src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestController.java index a718313b..52f84e52 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBusinessDataWebRequestController.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestController.java @@ -23,6 +23,6 @@ import java.io.Serializable; *

* @author Roland Häder */ -public interface FinancialsAdminBusinessDataWebRequestController extends Serializable { +public interface FinancialsAdminBasicDataWebRequestController extends Serializable { } diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestBean.java similarity index 87% rename from src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java rename to src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestBean.java index 73a5b3d6..1de8415c 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestBean.java @@ -22,6 +22,7 @@ import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Objects; import javax.annotation.PostConstruct; import javax.cache.Cache; import javax.ejb.EJB; @@ -45,7 +46,7 @@ import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionCo */ @Named ("basicCompanyDataController") @RequestScoped -public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean implements FinancialsBusinessDataWebRequestController { +public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implements FinancialsBasicDataWebRequestController { /** * Serial number @@ -135,7 +136,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp /** * Constructor */ - public FinancialsBusinessDataWebRequestBean () { + public FinancialsBasicDataWebRequestBean () { // Call super constructor super(); @@ -153,22 +154,22 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp // Is the parameter valid? if (null == event) { // Throw NPE - throw new NullPointerException("event is null"); + throw new NullPointerException("event is null"); //NOI18N } else if (event.getBasicData() == null) { // Throw NPE again - throw new NullPointerException("event.basicData is null"); + 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"); + 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())); + 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"); + 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"); + throw new IllegalArgumentException("event.basicData.companyName is empty"); //NOI18N } // Add it to list @@ -194,7 +195,7 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp throw new NullPointerException("basicDataId is null"); //NOI18N } else if (basicDataId < 1) { // Throw IAE - throw new IllegalArgumentException("basicDataId=" + basicDataId + " is invalid"); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("basicDataId={0} is invalid", basicDataId)); //NOI18N } else if (!this.basicDataCache.containsKey(basicDataId)) { // Not found throw new BasicDataNotFoundException(basicDataId); @@ -431,8 +432,50 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp } @Override - public Boolean isCompanyNameUsed (String companyName) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + 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; } /** diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestController.java similarity index 80% rename from src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestController.java rename to src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestController.java index 10492201..5b28f52d 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestController.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestController.java @@ -25,7 +25,17 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; *

* @author Roland Häder */ -public interface FinancialsBusinessDataWebRequestController extends Serializable { +public interface FinancialsBasicDataWebRequestController extends Serializable { + + /** + * Checks if given email address is already registered by other basic + * company data + *

+ * @param emailAddress Email address + *

+ * @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 @@ -35,8 +45,8 @@ public interface FinancialsBusinessDataWebRequestController extends Serializable *

* @return Business contact instance *

- * @throws BasicDataNotFoundException If the id number could not be - * looked up and solved into an entity + * @throws BasicDataNotFoundException If the id number could not be looked + * up and solved into an entity */ BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException; diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java index b3a069e8..99493c23 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java @@ -29,10 +29,12 @@ import javax.inject.Named; import org.mxchange.jcontactsbusiness.events.branchoffice.added.BranchOfficeAddedEvent; import org.mxchange.jcontactsbusiness.events.branchoffice.added.ObservableBranchOfficeAddedEvent; import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.branchoffice.AdminBranchOfficeSessionBeanRemote; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices; import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice; +import org.mxchange.jcontactsbusiness.model.employee.Employable; import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime; import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime; import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek; @@ -43,8 +45,6 @@ import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber; import org.mxchange.jusercore.model.user.User; -import org.mxchange.jcontactsbusiness.model.employee.Employable; -import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; /** * An administrative bean for branch offices @@ -55,6 +55,11 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; @SessionScoped public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBean implements FinancialsAdminBranchOfficeWebRequestController { + /** + * Opening times of this branch office + */ + private static List branchOpeningTimes; + /** * Serial number */ @@ -114,11 +119,6 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea @Inject private FinancialsBranchOfficeWebRequestController branchOfficeController; - /** - * Opening times of this branch office - */ - private static List branchOpeningTimes; - /** * Store */ diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java index 6659b2ea..d1590740 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java @@ -22,6 +22,7 @@ import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Objects; import javax.annotation.PostConstruct; import javax.cache.Cache; import javax.ejb.EJB; @@ -201,4 +202,23 @@ public class FinancialsBranchOfficeWebRequestBean extends BaseFinancialsBean imp } } + @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; + } + } diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestController.java index 7aae1945..31ac9d31 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestController.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestController.java @@ -28,6 +28,16 @@ import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; */ public interface FinancialsBranchOfficeWebRequestController extends Serializable { + /** + * Checks if given email address is already registered by an other branch + * office + *

+ * @param emailAddress Email address + *

+ * @return Whether the email address has been already registered + */ + Boolean isEmailAddressRegistered (final String emailAddress); + /** * Returns a list of all branch offices *

diff --git a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java index 81957206..5d981d25 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java @@ -26,16 +26,16 @@ import javax.inject.Named; import org.mxchange.jcontactsbusiness.events.department.added.DepartmentAddedEvent; import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent; import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote; import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment; import org.mxchange.jcontactsbusiness.model.department.Department; import org.mxchange.jcontactsbusiness.model.department.Departments; -import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData; +import org.mxchange.jcontactsbusiness.model.employee.Employable; +import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter; import org.mxchange.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 @@ -49,7 +49,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean /** * Serial number */ - private static final long serialVersionUID = 5_028_697_360_462L; + private static final long serialVersionUID = 5_028_697_360_464L; /** * EJB for administrative purposes @@ -81,19 +81,19 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean 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) @@ -182,57 +182,57 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean } /** - * Getter for assigned headquarters data + * Getter for assigned headquarter data *

- * @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 *

- * @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 *

- * @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 *

- * @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 *

- * @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 *

- * @param departmentI18nKey Department name + * @param departmentLead Department contact person */ - public void setDepartmentI18nKey (final String departmentI18nKey) { - this.departmentI18nKey = departmentI18nKey; + public void setDepartmentLead (final Employable departmentLead) { + this.departmentLead = departmentLead; } /** @@ -265,7 +265,7 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean 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()); diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java index 186da77f..8e33098a 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java @@ -23,13 +23,20 @@ import javax.enterprise.inject.Any; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.model.contact.Contact; +import org.mxchange.jcontactsbusiness.events.employee.added.EmployeeAddedEvent; import org.mxchange.jcontactsbusiness.events.employee.added.ObservableEmployeeAddedEvent; +import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeAlreadyAddedException; import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; import org.mxchange.jcontactsbusiness.model.department.Department; import org.mxchange.jcontactsbusiness.model.employee.AdminEmployeeSessionBeanRemote; -import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData; +import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee; +import org.mxchange.jcontactsbusiness.model.employee.Employable; +import org.mxchange.jcontactsbusiness.model.employee.Employees; +import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter; import org.mxchange.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; @@ -72,7 +79,13 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im 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; @@ -82,24 +95,24 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im private String employeeEmailAddress; /** - * Employee's Headquarters data, if he is working there + * Employee's Headquarter data, if he is working there */ - private HeadquartersData employeeHeadquarters; + private Headquarter employeeHeadquarter; /** - * Assigned personal data of the employee + * Employee's staff number */ - private Contact employeePersonalContact; + private String employeeNumber; /** - * Employee's phone extension (on top of a "main number") + * Assigned personal data of the employee */ - private Long employeePhoneExtension; + private Contact employeePersonalContact; /** - * Employee's staff number + * Employee's phone extension (on top of a "main number") */ - private Long employeeStaffNumber; + private Integer employeePhoneExtension; /** * Assigned user account @@ -124,6 +137,46 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im 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. + *

+ * @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 *

@@ -197,21 +250,39 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im } /** - * Getter for employee's assigned headquarters (if no branch office) + * Getter for employee's assigned headquarter (if no branch office) + *

+ * @return Employee's assigned headquarter + */ + public Headquarter getEmployeeHeadquarter () { + return this.employeeHeadquarter; + } + + /** + * Setter for employee's assigned headquarter (if no branch office) *

- * @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 *

- * @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 + *

+ * @param employeeNumber Employee's staff number + */ + public void setEmployeeNumber (final String employeeNumber) { + this.employeeNumber = employeeNumber; } /** @@ -237,7 +308,7 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im *

* @return Employee's phone extension */ - public Long getEmployeePhoneExtension () { + public Integer getEmployeePhoneExtension () { return this.employeePhoneExtension; } @@ -246,28 +317,10 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im *

* @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 - *

- * @return Employee's staff number - */ - public Long getEmployeeStaffNumber () { - return this.employeeStaffNumber; - } - - /** - * Setter for employee's staff number - *

- * @param employeeStaffNumber Employee's staff number - */ - public void setEmployeeStaffNumber (final Long employeeStaffNumber) { - this.employeeStaffNumber = employeeStaffNumber; - } - /** * Getter for employee's user "owner" *

@@ -322,4 +375,75 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im 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 + *

+ * @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 + *

+ * @param employee Employee to be checked + *

+ * @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; + } + } diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java index 0cdbca49..b4ec452f 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java @@ -109,11 +109,7 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme this.allEmployees.add(event.getEmployee()); } - /** - * Returns a list of all company employees - *

- * @return List of all company employees - */ + @Override @SuppressWarnings ("ReturnOfCollectionOrArrayField") public List allEmployees () { return this.allEmployees; diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestController.java index ba07d24d..59eb640a 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestController.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestController.java @@ -17,6 +17,7 @@ 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; @@ -27,6 +28,13 @@ import org.mxchange.jcontactsbusiness.model.employee.Employable; */ public interface FinancialsEmployeeWebRequestController extends Serializable { + /** + * Returns a list of all company employees + *

+ * @return List of all company employees + */ + List allEmployees (); + /** * Finds a company employee by given employee id *

diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java new file mode 100644 index 00000000..994215ae --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java @@ -0,0 +1,836 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@Named ("adminHeadquarterController") +@SessionScoped +public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean implements FinancialsAdminHeadquarterWebRequestController { + + /** + * Opening times of this headquarter + */ + private static List 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 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. + *

+ * @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 + *

+ * @return Fax number's area code + */ + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + /** + * Setter for fax number's area code + *

+ * @param faxAreaCode Fax number's area code + */ + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + /** + * Getter for fax's country instance + *

+ * @return Fax' country instance + */ + public Country getFaxCountry () { + return this.faxCountry; + } + + /** + * Setter for fax's country instance + *

+ * @param faxCountry Fax' country instance + */ + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + /** + * Getter for fax number + *

+ * @return Fax number + */ + public Long getFaxNumber () { + return this.faxNumber; + } + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + public void setFaxNumber (final Long faxNumber) { + this.faxNumber = faxNumber; + } + + /** + * Getter for city + *

+ * @return City + */ + public String getHeadquarterCity () { + return this.headquarterCity; + } + + /** + * Setter for city + *

+ * @param headquarterCity City + */ + public void setHeadquarterCity (final String headquarterCity) { + this.headquarterCity = headquarterCity; + } + + /** + * Getter for headquarter contact person + *

+ * @return Headquarter contact person + */ + public Employable getHeadquarterContactEmployee () { + return this.headquarterContactEmployee; + } + + /** + * Setter for headquarter contact person + *

+ * @param headquarterContactEmployee Headquarter contact person + */ + public void setHeadquarterContactEmployee (final Employable headquarterContactEmployee) { + this.headquarterContactEmployee = headquarterContactEmployee; + } + + /** + * Getter for country + *

+ * @return Country + */ + public Country getHeadquarterCountry () { + return this.headquarterCountry; + } + + /** + * Setter for country + *

+ * @param headquarterCountry Country + */ + public void setHeadquarterCountry (final Country headquarterCountry) { + this.headquarterCountry = headquarterCountry; + } + + /** + * Getter for email address + *

+ * @return Email address + */ + public String getHeadquarterEmailAddress () { + return this.headquarterEmailAddress; + } + + /** + * Getter for email address + *

+ * @param headquarterEmailAddress Email address + */ + public void setHeadquarterEmailAddress (final String headquarterEmailAddress) { + this.headquarterEmailAddress = headquarterEmailAddress; + } + + /** + * Getter for house number + *

+ * @return House number + */ + public Short getHeadquarterHouseNumber () { + return this.headquarterHouseNumber; + } + + /** + * Setter for house number + *

+ * @param headquarterHouseNumber House number + */ + public void setHeadquarterHouseNumber (final Short headquarterHouseNumber) { + this.headquarterHouseNumber = headquarterHouseNumber; + } + + /** + * Getter for opening times of this headquarter + *

+ * @return Opening times + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List getHeadquarterOpeningTimes () { + return headquarterOpeningTimes; + } + + /** + * Setter for opening times of this headquarter + *

+ * @param headquarterOpeningTimes Opening times + */ + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") + public void setHeadquarterOpeningTimes (final List headquarterOpeningTimes) { + FinancialsAdminHeadquarterWebRequestBean.headquarterOpeningTimes = headquarterOpeningTimes; + } + + /** + * Getter for store + *

+ * @return Store + */ + public Short getHeadquarterStore () { + return this.headquarterStore; + } + + /** + * Setter for store + *

+ * @param headquarterStore Store + */ + public void setHeadquarterStore (final Short headquarterStore) { + this.headquarterStore = headquarterStore; + } + + /** + * Getter for street name + *

+ * @return Street name + */ + public String getHeadquarterStreet () { + return this.headquarterStreet; + } + + /** + * Setter for street name + *

+ * @param headquarterStreet Street name + */ + public void setHeadquarterStreet (final String headquarterStreet) { + this.headquarterStreet = headquarterStreet; + } + + /** + * Getter for suite number + *

+ * @return Suite number + */ + public Short getHeadquarterSuiteNumber () { + return this.headquarterSuiteNumber; + } + + /** + * Setter for suite number + *

+ * @param headquarterSuiteNumber Suite number + */ + public void setHeadquarterSuiteNumber (final Short headquarterSuiteNumber) { + this.headquarterSuiteNumber = headquarterSuiteNumber; + } + + /** + * Getter for owning user instance + *

+ * @return Owning user instance + */ + public User getHeadquarterUserOwner () { + return this.headquarterUserOwner; + } + + /** + * Setter for owning user instance + *

+ * @param headquarterUserOwner Owning user instance + */ + public void setHeadquarterUserOwner (final User headquarterUserOwner) { + this.headquarterUserOwner = headquarterUserOwner; + } + + /** + * Getter for ZIP code\ + *

+ * @return ZIP code + */ + public Integer getHeadquarterZipCode () { + return this.headquarterZipCode; + } + + /** + * Setter for ZIP code\ + *

+ * @param headquarterZipCode ZIP code + */ + public void setHeadquarterZipCode (final Integer headquarterZipCode) { + this.headquarterZipCode = headquarterZipCode; + } + + /** + * Getter for land-line number's area code + *

+ * @return Land-line number's area code + */ + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; + } + + /** + * Setter for land-line number's area code + *

+ * @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 + *

+ * @return Land-line number's country instance + */ + public Country getLandLineCountry () { + return this.landLineCountry; + } + + /** + * Setter for land-line number's country instance + *

+ * @param landLineCountry Land-line number's country instance + */ + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; + } + + /** + * Getter for land-line number + *

+ * @return Land-line number + */ + public Long getLandLineNumber () { + return this.landLineNumber; + } + + /** + * Setter for land-line number + *

+ * @param landLineNumber Land-line number + */ + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; + } + + /** + * Getter for ending week day + *

+ * @return Ending week day + */ + public DayOfTheWeek getOpeningEndDay () { + return this.openingEndDay; + } + + /** + * Setter for ending week day + *

+ * @param openingEndDay Ending week day + */ + public void setOpeningEndDay (final DayOfTheWeek openingEndDay) { + this.openingEndDay = openingEndDay; + } + + /** + * Getter for ending time + *

+ * @return Ending time + */ + @SuppressWarnings ("ReturnOfDateField") + public Date getOpeningEndTime () { + return this.openingEndTime; + } + + /** + * Getter for ending time + *

+ * @param openingEndTime Ending time + */ + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setOpeningEndTime (final Date openingEndTime) { + this.openingEndTime = openingEndTime; + } + + /** + * Getter for starting week day + *

+ * @return Starting week day + */ + public DayOfTheWeek getOpeningStartDay () { + return this.openingStartDay; + } + + /** + * Getter for starting week day + *

+ * @param openingStartDay Starting week day + */ + public void setOpeningStartDay (final DayOfTheWeek openingStartDay) { + this.openingStartDay = openingStartDay; + } + + /** + * Getter for starting time + *

+ * @return Starting time + */ + @SuppressWarnings ("ReturnOfDateField") + public Date getOpeningStartTime () { + return this.openingStartTime; + } + + /** + * Getter for starting time + *

+ * @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. + *

+ * @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. + *

+ * @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. + *

+ * @param headquarter Headquarter to check it's address + *

+ * @return Whether the address has been found + */ + private boolean isHeadquarterCreatedByRequiredData (final Headquarter headquarter) { + // Get full list from other bean + final List 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 + *

+ * @param openingTime Opening time to be checked + *

+ * @return Whether it has been added already + */ + private boolean isSameOpeningTimeFound (final OpeningTime openingTime) { + // Default is not found + boolean isFound = false; + + // Loop through list + for (final OpeningTime ot : this.getHeadquarterOpeningTimes()) { + // Check it + if (Objects.equals(ot, openingTime)) { + // Found same match + isFound = true; + break; + } + } + + // Return it + return isFound; + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestController.java new file mode 100644 index 00000000..c5ffe143 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jfinancials.beans.business.headquarter; + +import java.io.Serializable; + +/** + * An interface for administrative headquarter controller + *

+ * @author Roland Häder + */ +public interface FinancialsAdminHeadquarterWebRequestController extends Serializable { + +} diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java new file mode 100644 index 00000000..33612dc0 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestBean.java @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@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 allHeadquarter; + + /** + * A list of filtered headquarter + */ + private List 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 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. + *

+ * @param event Event being fired + *

+ * @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 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 + *

+ * @return Filtered headquarter + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List getFilteredHeadquarter () { + return this.filteredHeadquarter; + } + + /** + * Setter for a list of filtered headquarter + *

+ * @param filteredHeadquarter Filtered headquarter + */ + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") + public void setFilteredHeadquarter (final List filteredHeadquarter) { + this.filteredHeadquarter = filteredHeadquarter; + } + + /** + * Initializer method + */ + @PostConstruct + public void initializeList () { + // Is cache there? + if (!this.headquarterCache.iterator().hasNext()) { + // Get whole list + final List 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> iterator = this.headquarterCache.iterator(); + + // Build up list + while (iterator.hasNext()) { + // GEt next element + final Cache.Entry next = iterator.next(); + + // Add to list + this.allHeadquarter.add(next.getValue()); + } + + // Sort list + this.allHeadquarter.sort(new Comparator() { + @Override + public int compare (final Headquarter o1, final Headquarter o2) { + return o1.getHeadquarterId() > o2.getHeadquarterId() ? 1 : o1.getHeadquarterId() < o2.getHeadquarterId() ? -1 : 0; + } + }); + } + } + + @Override + public Boolean isEmailAddressRegistered (final String emailAddress) { + // Default is not found + boolean isFound = false; + + // Check all entries + for (final Headquarter headquarter : this.allHeadquarter()) { + // Is email address used? + if (Objects.equals(headquarter.getHeadquarterEmailAddress(), emailAddress)) { + // Found it + isFound = true; + break; + } + } + + // Return flag + return isFound; + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestController.java new file mode 100644 index 00000000..e91c4372 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsHeadquarterWebRequestController.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +public interface FinancialsHeadquarterWebRequestController extends Serializable { + + /** + * Checks if given email address is already registered by an other + * headquarter + *

+ * @param emailAddress Email address + *

+ * @return Whether the email address has been already registered + */ + Boolean isEmailAddressRegistered (final String emailAddress); + + /** + * Returns a list of all headquarter + *

+ * @return A list of all headquarter + */ + List allHeadquarter (); + + /** + * Tries to find a headquarter with given id number + *

+ * @param headquarterId Headquarter id + *

+ * @return A headquarter instance + *

+ * @throws HeadquarterNotFoundException If the headquarter was not found + */ + Headquarter findHeadquarterById (final Long headquarterId) throws HeadquarterNotFoundException; + +} diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java index 334a4324..0f00f682 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebRequestBean.java @@ -1115,7 +1115,7 @@ public class FinancialsContactWebRequestBean extends BaseFinancialsBean implemen } @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. } diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java index 5592f369..b0e407f9 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java @@ -28,7 +28,7 @@ import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; import org.mxchange.jcontactsbusiness.model.department.Department; import org.mxchange.jcontactsbusiness.model.employee.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; @@ -582,9 +582,11 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement // 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 } @@ -593,44 +595,44 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement } /** - * 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. *

- * @param headquarters Headquarters instance - *

- * @return Headquarters address + * @param headquarter Headquarter instance +

+ * @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 diff --git a/src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java b/src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java index 83e5e504..560e3dfe 100644 --- a/src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java @@ -24,8 +24,8 @@ import javax.faces.convert.ConverterException; import javax.faces.convert.FacesConverter; import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException; import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; -import org.mxchange.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 @@ -38,14 +38,14 @@ public class FinancialsBasicCompanyDataConverter implements Converter /** * 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? diff --git a/src/java/org/mxchange/jfinancials/converter/business/branchoffice/FinancialsBranchOfficeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/branchoffice/FinancialsBranchOfficeConverter.java index fe025081..0c8d018d 100644 --- a/src/java/org/mxchange/jfinancials/converter/business/branchoffice/FinancialsBranchOfficeConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/business/branchoffice/FinancialsBranchOfficeConverter.java @@ -43,7 +43,7 @@ public class FinancialsBranchOfficeConverter implements Converter @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(); } diff --git a/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java b/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java index 79ae0dc7..e852832c 100644 --- a/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/business/department/FinancialsDepartmentConverter.java @@ -43,7 +43,7 @@ public class FinancialsDepartmentConverter implements Converter { @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(); } diff --git a/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java index 0c601060..fa1780a5 100644 --- a/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/business/employee/FinancialsEmployeeConverter.java @@ -43,7 +43,7 @@ public class FinancialsEmployeeConverter implements Converter { @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(); } diff --git a/src/java/org/mxchange/jfinancials/converter/business/headquarter/FinancialsHeadquarterConverter.java b/src/java/org/mxchange/jfinancials/converter/business/headquarter/FinancialsHeadquarterConverter.java new file mode 100644 index 00000000..c75af1cc --- /dev/null +++ b/src/java/org/mxchange/jfinancials/converter/business/headquarter/FinancialsHeadquarterConverter.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@FacesConverter ("HeadquarterConverter") +public class FinancialsHeadquarterConverter implements Converter { + + /** + * 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()); + } + +} diff --git a/src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java b/src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java deleted file mode 100644 index cb273d68..00000000 --- a/src/java/org/mxchange/jfinancials/converter/business/headquarters/FinancialsCompanyHeadquartersConverter.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -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 - *

- * @author Roland Häder - */ -@FacesConverter ("CompanyHeadquartersConverter") -public class FinancialsCompanyHeadquartersConverter implements Converter { - - /** - * 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()); - } - -} diff --git a/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java b/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java index 6afd11da..8d4e1ba9 100644 --- a/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/business/opening_time/FinancialsCompanyOpeningTimeConverter.java @@ -43,7 +43,7 @@ public class FinancialsCompanyOpeningTimeConverter implements Converter { @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(); } diff --git a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java index e1fbde72..b671dec4 100644 --- a/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/country/FinancialsCountryConverter.java @@ -43,7 +43,7 @@ public class FinancialsCountryConverter implements Converter { @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(); } diff --git a/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java b/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java index 9c4400ec..2904f48c 100644 --- a/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/fax/FinancialsFaxNumberConverter.java @@ -43,7 +43,7 @@ public class FinancialsFaxNumberConverter implements Converter { @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(); } diff --git a/src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java b/src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java index 050ea27a..f93f8cf7 100644 --- a/src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsCompanyNameValidator.java @@ -24,8 +24,8 @@ import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.ValidatorException; import org.mxchange.jcoreee.validator.string.BaseStringValidator; -import org.mxchange.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 @@ -38,7 +38,7 @@ public class FinancialsCompanyNameValidator extends BaseStringValidator { /** * Business basic data backing bean */ - private static FinancialsBusinessDataWebRequestController BASIC_DATA_CONTROLLER; + private static FinancialsBasicDataWebRequestController BASIC_DATA_CONTROLLER; /** * Serial number @@ -48,9 +48,9 @@ public class FinancialsCompanyNameValidator extends BaseStringValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // Is the instance there? - if (BASIC_DATA_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 diff --git a/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java index 4e5a4313..7f54b429 100644 --- a/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/FinancialsEmailAddressValidator.java @@ -58,12 +58,6 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Is the instance there? - if (CONTACT_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 @@ -117,6 +111,12 @@ public class FinancialsEmailAddressValidator extends BaseStringValidator { // Get client id (aka form id) final String clientId = component.getClientId(); + // Is the instance there? + if (null == CONTACT_CONTROLLER) { + // Get bean from CDI directly + CONTACT_CONTROLLER = CDI.current().select(FinancialsContactWebRequestBean.class).get(); + } + // Is it registered? final Boolean isRegistered = CONTACT_CONTROLLER.isEmailAddressRegistered(emailAddress); diff --git a/src/java/org/mxchange/jfinancials/validator/emailaddress/basicdata/FinancialsBasicDataEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/basicdata/FinancialsBasicDataEmailAddressValidator.java new file mode 100644 index 00000000..cb392b53 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/basicdata/FinancialsBasicDataEmailAddressValidator.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@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 ) + 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)); + } + } + +} diff --git a/src/java/org/mxchange/jfinancials/validator/emailaddress/branchoffice/FinancialsBranchOfficeEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/branchoffice/FinancialsBranchOfficeEmailAddressValidator.java new file mode 100644 index 00000000..0432de1a --- /dev/null +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/branchoffice/FinancialsBranchOfficeEmailAddressValidator.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@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 ) + 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)); + } + } + +} diff --git a/src/java/org/mxchange/jfinancials/validator/emailaddress/headquarter/FinancialsHeadquarterEmailAddressValidator.java b/src/java/org/mxchange/jfinancials/validator/emailaddress/headquarter/FinancialsHeadquarterEmailAddressValidator.java new file mode 100644 index 00000000..bb157d02 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/validator/emailaddress/headquarter/FinancialsHeadquarterEmailAddressValidator.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +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 + *

+ * @author Roland Häder + */ +@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 ) + 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)); + } + } + +} diff --git a/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java b/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java index 741ad434..7af9f53e 100644 --- a/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/user/FinancialsUserIdValidator.java @@ -47,18 +47,18 @@ public class FinancialsUserIdValidator extends BaseNumberValidator { @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Is the instance there? - if (USER_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; diff --git a/src/java/org/mxchange/localization/generic_de_DE.properties b/src/java/org/mxchange/localization/generic_de_DE.properties index 7b5ca976..58bcca9c 100644 --- a/src/java/org/mxchange/localization/generic_de_DE.properties +++ b/src/java/org/mxchange/localization/generic_de_DE.properties @@ -489,6 +489,7 @@ ADMIN_LINK_EXPORT_CONTACT=Kontaktdaten exportieren ADMIN_LINK_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren PERSONAL_DATA_BIRTHDAY=Geburtsdatum (tt.mm.jjjj): DATE_PATTERN=dd.MM.yyyy +DATE_TIME_PATTERN=dd.MM.yyyy HH:mm:ss ADMIN_EXPORT_CONTACT_ID=Kontaktdaten-Id ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Anrede ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Titel @@ -575,7 +576,6 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Fehler: Instanz 'user' im Bean-Helper nicht geset ERROR_BEAN_HELPER_CONTACT_NOT_SET=Fehler: Instanz 'contact' im Bean-Helper nicht gesetzt. ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Fehler: Instanz 'mobile' in Bean-Helper nicht gesetzt. CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=Auflisten von Mobiltelefonnummern: -ADMIN_LIST_MOBILE_EMPTY=Es sind keine Mobilfunknummern gespeichert. ADMIN_MENU_PHONE_NUMBERS_TITLE=Telefonnummern: ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Handynummern ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=Alle Mobilfunknummern auflisten. @@ -626,17 +626,15 @@ ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS=Festnetznummern ... ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Listet alle Festnetznummern auf. ADMIN_LINK_LIST_FAX_PHONE_NUMBERS=Faxnummern ADMIN_LINK_LIST_FAX_PHONE_NUMBERS_TITLE=Listet alle Faxnummern auf. -ADMIN_LIST_FAX_NUMBER_EMPTY=Es sind keine Faxnummern gelistet. PAGE_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=Faxnummern auflisten CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=Auflisten von Faxnummern: PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=Festnetznummern auflisten CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=Auflisten von Festnetznummern: -ADMIN_SHOW_PHONE_NUMBER=Festnetznummer: +ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer: PAGE_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer anzeigen CONTENT_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Festnetznummer anzeigen: ERROR_BEAN_HELPER_LAND_LINE_NUMBER_NOT_SET=Fehler: Instanz 'landLine' nicht in Bean-Helper gesetzt. ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_LINKS=Alle Festnetznummer-Verkn\u00fcpfungen f\u00fcr Id-Nummer {0}: -ADMIN_LIST_LAND_LINE_EMPTY=Es sind keine Festnetznummern gelistet. ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_DATA=Daten der Festnetznummer: ADMIN_SHOW_LAND_LINE_NUMBER_COMPLETE=Vollst\u00e4ndige Festnetznummer: ADMIN_HEADER_SHOW_FAX_NUMBER_DATA=Daten der Faxnummer: @@ -782,36 +780,36 @@ GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Bitte wiederholen Sie das eingege PAGE_TITLE_ADMIN_AREA=Administration #@TODO Please fix German umlauts! ADMIN_MENU_BUSINESS_CONTACT_TITLE=Geschaeftliche Kontakte -ADMIN_LINK_LIST_BASIC_COMPANY_DATA=Unternehmensstammdaten -ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE=Listet Stammdaten von Unternehmen auf. -PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Stammdaten auflisten +ADMIN_LINK_LIST_BASIC_DATA=Unternehmensstammdaten +ADMIN_LINK_LIST_BASIC_DATA_TITLE=Listet Stammdaten von Unternehmen auf. +PAGE_TITLE_ADMIN_LIST_BASIC_DATA=Stammdaten auflisten #@TODO Please fix German umlauts! -CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Auflisten von Stammdaten +CONTENT_TITLE_ADMIN_LIST_BASIC_DATA=Auflisten von Stammdaten #@TODO Please fix German umlauts! -ADMIN_EMPTY_LIST_BASIC_COMPANY_DATA=Es befinden sich keine Stammdaten in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen. +ADMIN_EMPTY_LIST_BASIC_DATA=Es befinden sich keine Stammdaten in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen. #@TODO Please fix German umlauts! -TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=Diese Tabelle listet Stammdaten auf. -ADMIN_HEADER_BASIC_COMPANY_DATA_ID=Id-Nummer: +TABLE_SUMMARY_ADMIN_LIST_BASIC_DATA=Diese Tabelle listet Stammdaten auf. +ADMIN_HEADER_BASIC_DATA_ID=Id-Nummer: #@TODO Please fix German umlauts! ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Stammdaten des Unternehmens anzeigen. ADMIN_HEADER_ASSIGNED_USER=Zugew. Benutzer: -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen. +ADMIN_LINK_SHOW_BASIC_DATA_OWNER_USER_TITLE=Benutzerprofil des der Filiale zugewiesenen Benutzers anzeigen. ADMIN_LINK_ASSIGN=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Stammdaten einen Benutzeraccount zuweisen. +ADMIN_LINK_ASSIGN_BASIC_DATA_OWNER_USER_TITLE=Stammdaten einen Benutzeraccount zuweisen. ADMIN_HEADER_BASIC_DATA_COMPANY_NAME=Firmenname: ADMIN_HEADER_COMPANY_CONTACT_PERSON=Ansprechpartner: -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Zuweisen +ADMIN_LINK_SHOW_BASIC_DATA_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist. +ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON=Zuweisen #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. +ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu. ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Zeigt das komplette Kontaktprofil an. ADMIN_BASIC_DATA_COMPANY_COMMENTS=Anmerkungen: ADMIN_BASIC_DATA_PHONE_NUMBER=Haupttelefonnummer: ADMIN_BASIC_DATA_FAX_NUMBER=Hauptfaxnummer: #@TODO Please fix German umlauts! -ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Geschaeftlichen Kontakt hinzufuegen -ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein. +ADMIN_ADD_BASIC_DATA_TITLE=Geschaeftlichen Kontakt hinzufuegen +ADMIN_ADD_BASIC_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein. #@TODO Please fix German umlauts! ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format. #@TODO Please fix German umlauts! @@ -822,33 +820,33 @@ ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED=Bitte geben Sie den Firmennamen inklusive ADMIN_BASIC_DATA_COMPANY_LEGAL_STATUS=Rechtsform (z.B. GmbH): ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS=Haupt-Email-Adresse: #@TODO Please fix German umlauts! -BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA=Basisdaten hinzufuegen +BUTTON_ADMIN_ADD_BASIC_DATA=Basisdaten hinzufuegen ERROR_GUEST_REGISTRATION_IN_INDEX_ENABLED=Fehler: Falscher Aufruf der Anmeldeseite, da die Eingangsseite als Anmeldeseite fungiert. #@TODO Please fix German umlauts! BUTTON_CHANGE_LOCALE=Aendern #@TODO Please fix German umlauts! BUTTON_CHANGE_LOCALE_TITLE=Aendern Sie hier in der aktuellen Sitzung die angezeigte Sprache. #@TODO Please fix German umlauts! -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Firmengruender auswaehlen: +ADMIN_SELECT_BASIC_DATA_COMPANY_FOUNDER=Firmengruender auswaehlen: ADMIN_FEATURE_UNFINISHED_WARNING=Diese Funktion ist noch nicht fertiggestellt. ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER=Steuernummer: ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL=Webseiten-URL: -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_USER_OWNER=Unternehmen einem Benutzer zuweisen: +ADMIN_SELECT_BASIC_DATA_COMPANY_USER_OWNER=Unternehmen einem Benutzer zuweisen: #@TODO Please fix German umlauts! -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_LOGO=Firmenlogo auswaehlen: +ADMIN_SELECT_BASIC_DATA_COMPANY_LOGO=Firmenlogo auswaehlen: #@TODO Please fix German umlauts! URL_NOT_MATCHING_REGULAR_EXPRESSION=Die eingegebene URL entspricht nicht der ueblichen Form. #@TODO Please fix German umlauts! -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson auswaehlen: +ADMIN_SELECT_BASIC_DATA_COMPANY_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson auswaehlen: #@TODO Please fix German umlauts! -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS=Daten des Hauptsitzesz auswaehlen: +ADMIN_SELECT_BASIC_DATA_COMPANY_HEADQUARTER=Daten des Hauptsitzesz auswaehlen: LINK_COMPANY_WEBSITE_URL_TITLE=Link zur Unternehmenswebseite (neues Fenster) #@TODO Please fix German umlauts! ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER=Gruender #@TODO Please fix German umlauts! -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen. +ADMIN_LINK_SHOW_BASIC_DATA_COMPANY_FOUNDER_TITLE=Daten des Unternehmensgruenders anzeigen. #@TODO Please fix German umlauts! -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu. +ADMIN_LINK_ASSIGN_BASIC_DATA_COMPANY_FOUNDER_TITLE=Weisst diesem Firmeneintrag einen Unternehmensgruender zu. ADMIN_USER_NAME_IS_REQUIRED=Bitte vergeben Sie einen Benutzernamen. Dieser muss unique sein. NO_WEBSITE_URL_ENTERED=Keine URL eingegeben. ADMIN_LINK_LIST_BRANCH_OFFICES=Filialen @@ -860,7 +858,7 @@ ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Kontaktperson der Filiale zuweisen: ADMIN_BRANCH_OFFICE_DATA_LEGEND=Grunddaten der Filiale: #@TODO Please fix German umlauts! ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Geben Sie hier die Grunddaten der Filiale ein. -ADMIN_ASSIGN_BRANCH_OFFICE=Filiale dem Unternehmen zuweisen: +ADMIN_ASSIGN_BASIC_DATA_BRANCH_OFFICE=Unternehmen der Filiale zuweisen: PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=Filialen auflisten CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=Auflisten von Filialen: #@TODO Please fix German umlauts! @@ -870,7 +868,7 @@ ADMIN_ADD_BRANCH_OFFICE_TITLE=Filiale hinzufuegen #@TODO Please fix German umlauts! ADMIN_ADD_BRANCH_OFFICE_MINIMUM_DATA=Bitte waehlen Sie mindestens das zugehoerige Unternehmen und das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein. ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email-Addresse der Filiale: -ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Telefonnummer eingeben: +ADMIN_ENTER_BRANCH_OFFICE_LAND_LINE_NUMBER=Telefonnummer eingeben: ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Faxnummer eingeben: #@TODO Please fix German umlauts! ADMIN_BRANCH_OFFICE_REQUIRED=Bitte waehlen das zur Filiale gehoerende Unternehmen aus. @@ -991,7 +989,7 @@ ADMIN_EMPLOYEE_OTHER_LEGEND=Weitere Daten des Mitarbeiters: ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE=Geben Sie hier weitere Daten des Mitarbeiters ein. Diese sind alle optional. ADMIN_ENTER_PHONE_EXTENSION=Durchwahl eingeben: ADMIN_ASSIGN_EMPLOYEE_DEPARTMENT=Abteilung einem Mitarbeiter zuweisen: -ADMIN_ASSIGN_EMPLOYEE_HEADQUARTERS=Hauptsitz einem Mitarbeiter zuweisen: +ADMIN_ASSIGN_EMPLOYEE_HEADQUARTER=Hauptsitz einem Mitarbeiter zuweisen: ADMIN_ENTER_EMPLOYEE_MOBILE_NUMBER=Geschaefliche Mobilfunknummer des Mitarbeiters eingeben: ADMIN_EMPLOYEE_GENERAL_LEGEND=Allgemeine Daten des Mitarbeiters: ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE=Geben Sie hier die generellen Daten des Mitarbeiters an. @@ -1009,7 +1007,7 @@ ADMIN_ADD_EMPLOYEE_TITLE=Mitarbeiter hinzufuegen ADMIN_ADD_EMPLOYEE_MINIMUM_DATA=Bitte waehlen Sie mindestens das Unternehmen aus und geben SIe mindestens entweder die Mitarbeiternummer ein oder waehlen Sie die persoenlichen Kontaktdaten des Mitarbeiters aus. #@TODO Please fix German umlauts! BUTTON_ADMIN_ADD_EMPLOYEE=Mitarbeiter hinzufuegen -ADMIN_LIST_BASIC_COMPANY_DATA_HEADER=Alle Unternehmensgrunddaten auflisten +ADMIN_LIST_BASIC_DATA_HEADER=Alle Unternehmensgrunddaten auflisten ADMIN_LINK_LIST_DEPARTMENTS=Abteilungen ADMIN_LINK_LIST_DEPARTMENTS_TITLE=Listet Abteilungen von Unternehmen auf. #@TODO Please fix German umlauts! @@ -1020,7 +1018,7 @@ CONTENT_TITLE_ADMIN_LIST_DEPARTMENTS=Auflisten von Abteilungen: ADMIN_EMPTY_LIST_DEPARTMENTS=Es befinden sich keine Abteilungen in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen. ADMIN_LINK_SHOW_DEPARTMENT_TITLE=Zeigt Details zur Abteilung an. ADMIN_LINK_EDIT_DEPARTMENT_TITLE=Editieren der Abteilung -ADMIN_LINK_DELETE_DEPARTMENT_TITLE=Loescht die Abteilung +ADMIN_LINK_DELETE_DEPARTMENT_TITLE=Loescht die Abteilung. #@TODO Please fix German umlauts! ADMIN_DEPARTMENT_ALREADY_CREATED=Die Abteilung existiert bereits im ausgewaehlten Unternehmen. ADMIN_LIST_DEPARTMENTS_HEADER=Alle Abteilungen auflisten @@ -1034,7 +1032,7 @@ ADMIN_DEPARTMENT_LEGEND_TITLE=Geben Sie hier die Daten der Abteilung ein. #@TODO Please fix German umlauts! ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus. ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Filiale der Abteilung zuweisen: -ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Hauptsitz der Abteilung zuweisen: +ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER=Hauptsitz der Abteilung zuweisen: ADMIN_ASSIGN_DEPARTMENT_COMPANY=Unternehmen der Abteilung zuweisen: ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Leitender Mitarbeiter der Abteilung zuweisen: ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Benutzer als Besitzer der Abteilung zuweisen: @@ -1080,12 +1078,12 @@ ADMIN_LIST_USERS_HEADER=Liste aller Benutzer #@TODO Please fix German umlauts! ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Oeffnungszeiten der Filiale: #@TODO Please fix German umlauts! -TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=Diese Tabelle listet Oeffnungszeiten der Filiale auf. +TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=Diese Tabelle listet neue Oeffnungszeiten der Filiale auf. TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=Diese Tabelle listet Filialen auf. #@TODO Please fix German umlauts! -ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=Es befinden sich keine Oeffnungszeiten dieser Filiale in der Datenbank. +ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=Es wurden noch keine Oeffnungszeiten fuer eine neue Filiale hinzugefuegt. #@TODO Please fix German umlauts! -ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=Alle Oeffnungszeiten der Filiale auflisten +ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=Oeffnungszeiten der neuen Filiale auflisten #@TODO Please fix German umlauts! ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Oeffnungszeit zur Filiale hinzufuegen #@TODO Please fix German umlauts! @@ -1095,3 +1093,51 @@ ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Geben Sie hier eine einzelne Oeffn #@TODO Please fix German umlauts! ADMIN_OPENING_TIME_ALREADY_CREATED=Die Oeffnungzeit wurde bereits hinzugefuegt. ADMIN_NOT_ASSIGNED=Nicht zugewiesen +ADMIN_BASIC_DATA_COMPANY_NAME=Firmenname: +ADMIN_LINK_SHOW_HEADQUARTER_TITLE=Zeigt Details zur Hauptstelle an. +ADMIN_LINK_EDIT_HEADQUARTER_TITLE=Editieren der Hauptstelle. +ADMIN_LINK_DELETE_HEADQUARTER_TITLE=Loescht die Hauptstelle. +PAGE_TITLE_ADMIN_LIST_HEADQUARTER=Haupstellen auflisten +CONTENT_TITLE_ADMIN_LIST_HEADQUARTER=Auflisten von Hauptstellen: +TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER=Diese Tabelle listet alle Hauptstellen auf. +#@TODO Please fix German umlauts! +ADMIN_EMPTY_LIST_HEADQUARTER=Es befinden sich keine Hauptstellen in der Datenbank oder Ihre Suche ergab keine Uebereinstimmungen. +ADMIN_LIST_HEADQUARTER_HEADER=Alle Hauptstellen auflisten +ADMIN_LINK_SHOW_HEADQUARTER_OWNER_USER_TITLE=Benutzerprofil des der Hauptstelle zugewiesenen Benutzers anzeigen. +#@TODO Please fix German umlauts! +ADMIN_ADD_HEADQUARTER_TITLE=Hauptstelle hinzufuegen +ADMIN_LINK_LIST_HEADQUARTER=Hauptstellen +ADMIN_LINK_LIST_HEADQUARTER_TITLE=Listed alle Hauptstellen auf. +#@TODO Please fix German umlauts! +ADMIN_ADD_HEADQUARTER_MINIMUM_DATA=Bitte waehlen Sie mindestens das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein. +ADMIN_HEADQUARTER_LEGEND=Daten der Hauptstelle: +ADMIN_ASSIGN_HEADQUARTER_CONTACT_EMPLOYEE=Mitarbeiter als Kontaktperson fuer Hauptstelle: +ADMIN_ASSIGN_HEADQUARTER_USER_OWNER=Benutzer als Besitzer der Hauptstelle zuweisen: +ADMIN_ENTER_HEADQUARTER_EMAIL_ADDRESS=Email-Adresse der Hauptstelle eingeben: +ADMIN_ENTER_HEADQUARTER_LAND_LINE_NUMBER=Festnetznummer der Hauptstelle eingeben: +ADMIN_ENTER_HEADQUARTER_FAX_NUMBER=Faxnummer der Hauptstelle eingeben: +ADMIN_HEADQUARTER_ADDRESS_LEGEND=Adresse der Hauptstelle: +ADMIN_HEADQUARTER_STREET_NAME_REQUIRED=Bitte geben Sie den Strassennamen der Hauptstelle ein. +ADMIN_HEADQUARTER_HOUSE_NUMBER_REQUIRED=Bitte geben Sie die Hausnummer der Hauptstelle ein. +ADMIN_HEADQUARTER_ZIP_CODE_REQUIRED=Bitte geben Sie die Postleitzahl der Hauptstelle ein. +ADMIN_HEADQUARTER_CITY_REQUIRED=Bitte geben Sie die Stadt der Hauptstelle ein. +#@TODO Please fix German umlauts! +ADMIN_BRANCH_OFFICE_COUNTRY_REQUIRED=Bittw waehlen Sie ein Land fuer die Filiale aus. +#@TODO Please fix German umlauts! +ADMIN_HEADQUARTER_COUNTRY_REQUIRED=Bitte waehlen Sie ein Land fuer die Hauptstelle aus. +#@TODO Please fix German umlauts! +BUTTON_ADMIN_ADD_HEADQUARTER=Hauptstelle hinzufuegen +#@TODO Please fix German umlauts! +ADMIN_HEADQUARTER_OPENING_TIMES_LEGEND=Oeffnungszeiten der Hauptstelle: +#@TODO Please fix German umlauts! +TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER_OPENING_TIMES=Diese Tabelle listet neue Oeffnungszeiten der Hauptstelle auf. +#@TODO Please fix German umlauts! +ADMIN_EMPTY_LIST_HEADQUARTER_OPENING_TIMES=Es wurden noch keine Oeffnungszeiten fuer eine neue Hauptstelle hinzugefuegt. +#@TODO Please fix German umlauts! +ADMIN_LIST_HEADQUARTER_OPENING_TIMES_HEADER=Oeffnungszeiten der neuen Hauptstelle auflisten +#@TODO Please fix German umlauts! +ADMIN_ADD_HEADQUARTER_OPENING_TIME_TITLE=Oeffnungszeit zur Hauptstelle hinzufuegen +#@TODO Please fix German umlauts! +BUTTON_ADMIN_ADD_HEADQUARTER_OPENING_TIME=Oeffnungszeit zur Hauptstelle hinzufuegen +ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE=Diesem Mitarbeiter eine Abteilung zuweisen. +ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE=Diesem Mitarbeiter einen besitzenden Benutzer zuweisen. diff --git a/src/java/org/mxchange/localization/generic_en_US.properties b/src/java/org/mxchange/localization/generic_en_US.properties index 1f343143..ae3da0a6 100644 --- a/src/java/org/mxchange/localization/generic_en_US.properties +++ b/src/java/org/mxchange/localization/generic_en_US.properties @@ -270,7 +270,7 @@ ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE=Country code: ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX=Dial prefix outside: ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME=Country: ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE=Edit or delete country -TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=List of all already added countries. +TABLE_SUMMARY_ADMIN_LIST_COUNTRIES=This table lists all countries. COUNTRY_GERMANY=Germany ADMIN_MENU_MOBILE_PROVIDER_TITLE=Mobile providers ADMIN_LINK_LIST_MOBILE_PROVIDER=List mobile provider @@ -285,7 +285,7 @@ ADMIN_MOBILE_PROVIDER_LEGEND_TITLE=Here you can enter all data of the mobile pro CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider: CONTENT_TITLE_ADMIN_MOBILE_PROVIDER_EDIT=Edit mobile provider: PAGE_TITLE_ADMIN_MOBILE_PROVIDER_DELETE=Delete mobile provider -TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=Lists all already added mobile providers. +TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS=This table lists all mobile providers. ADMIN_ENTER_MOBILE_PROVIDER_DIAL_PREFIX=Dial prefix of provider (no leading zero): ADMIN_ENTER_MOBILE_PROVIDER_PATTERN=Pattern for mails: ADMIN_ENTER_MOBILE_PROVIDER_NAME=Name of provider: @@ -477,6 +477,7 @@ ADMIN_LINK_EXPORT_CONTACT=Export data ADMIN_LINK_EXPORT_CONTACT_TITLE=Export contact data PERSONAL_DATA_BIRTHDAY=Birthday (mm-dd-yyyy): DATE_PATTERN=MM-dd-yyyy +DATE_TIME_PATTERN=MM-dd-yyyy HH:mm:ss ADMIN_EXPORT_CONTACT_ID=Contact data id ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Gender ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Title @@ -560,7 +561,6 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Error: Instance 'user' not set in bean helper. ERROR_BEAN_HELPER_CONTACT_NOT_SET=Error: Instance 'contact' not set in bean helper. ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Error: Instance 'mobile' in bean helper not set. CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=List mobile phone numbers: -ADMIN_LIST_MOBILE_EMPTY=No mobile numbers are saved. ADMIN_MENU_PHONE_NUMBERS_TITLE=Phone numbers: ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Mobile numbers ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=List all mobile numbers. @@ -611,17 +611,15 @@ ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS=Land-line numbers ... ADMIN_LINK_LIST_LAND_LINE_PHONE_NUMBERS_TITLE=Lists all land-line numbers. ADMIN_LINK_LIST_FAX_PHONE_NUMBERS=Fax numbers ADMIN_LINK_LIST_FAX_PHONE_NUMBERS_TITLE=Lists all fax numbers. -ADMIN_LIST_FAX_NUMBER_EMPTY=There are no fax numbers listed. PAGE_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=List fax numbers CONTENT_TITLE_ADMIN_LIST_CONTACT_FAX_NUMBER=List fax numbers: PAGE_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=List land-line numbers CONTENT_TITLE_ADMIN_LIST_CONTACT_LAND_LINE_NUMBER=List land-line numbers: -ADMIN_SHOW_PHONE_NUMBER=Land-line number: +ADMIN_SHOW_LAND_LINE_NUMBER=Land-line number: PAGE_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Show land-line number CONTENT_TITLE_ADMIN_SHOW_LAND_LINE_NUMBER=Show land-line number: ERROR_BEAN_HELPER_LAND_LINE_NUMBER_NOT_SET=Error: Instance 'landLine' not set in bean helper. ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_LINKS=All links for land-line number id number {0}: -ADMIN_LIST_LAND_LINE_EMPTY=There are no land-line numbers listed. ADMIN_HEADER_SHOW_LAND_LINE_NUMBER_DATA=Data of land-line number: ADMIN_SHOW_LAND_LINE_NUMBER_COMPLETE=Complete land-line number: ADMIN_HEADER_SHOW_FAX_NUMBER_DATA=Data of fax number: @@ -684,7 +682,7 @@ CONTENT_TITLE_ADMIN_DELETE_LAND_LINE_NUMBER=Delete land-line number: ADMIN_DELETE_LAND_LINE_NUMBER_TITLE=Dou you really want to delete following land-line number? ADMIN_DELETE_LAND_LINE_NUMBER_DATA_NOTICE=If you delete the land-line number, it won't be available anymore for anything. Please consider carefully if you really want this. BUTTON_ADMIN_DELETE_LAND_LINE_NUMBER=Delete land-line number -ADMIN_EMPTY_LIST_CONTACT=No contact data found in database. Or your search criteria doesn't match anything. +ADMIN_EMPTY_LIST_CONTACT=There are no contacts of contacts in database. Or your search criteria doesn't match anything. ADMIN_EMPTY_LIST_USER=No user data found in database. Or your search criteria doesn't match anything. ADMIN_PERSONAL_DATA_COMMENT=Comment: (optional) ADMIN_LINK_RESEND_USER_CONFIRMATION_LINK=Send new confirmation key @@ -693,7 +691,6 @@ ERROR_ADMIN_CANNOT_RESEND_USER_CONFIRMATION_LINK_ACCOUNT_UNLOCKED=Error: Cannot ERROR_ADMIN_CANNOT_RESEND_USER_CONFIRMATION_LINK_ACCOUNT_LOCKED=Error: Cannot send new confirmation link to user, account is locked. BUTTON_ADMIN_RESEND_USER_CONFIRMATION_LINK_ACCOUNT=Send new confirmation link ADMIN_RESEND_USER_CONFIRMATION_LINK_TITLE=Do you want to send a new confirmation link to user {0} (id numer {1})? -#Durch das Zuschicken eines neuen Best\u00e4tigungslinkes wird der alte ung\u00fcltig und nur noch der neue Link kann verwendet werden. ADMIN_RESEND_USER_CONFIRMATION_LINK_NOTICE=By sending a new confirmation link to the user, the old link becomes invalid and only the new link can be used. PAGE_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link CONTENT_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link: @@ -765,54 +762,52 @@ GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Please enter a password. This must match GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Please repeat the entered password. This done to confirm the password. PAGE_TITLE_ADMIN_AREA=Administration ADMIN_MENU_BUSINESS_CONTACT_TITLE=Business contacts -ADMIN_LINK_LIST_BASIC_COMPANY_DATA=Basic company data -ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE=Lists basic company data. -PAGE_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=List basic company data -CONTENT_TITLE_ADMIN_LIST_BASIC_COMPANY_DATA=Lists basic company data -ADMIN_EMPTY_LIST_BASIC_COMPANY_DATA=There are currently no basic company data in database. Or your search criteria doesn't match anything. -TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=This table lists all basic company data. -ADMIN_HEADER_BASIC_COMPANY_DATA_ID=Id Number: +ADMIN_LINK_LIST_BASIC_DATA=Basic company data +ADMIN_LINK_LIST_BASIC_DATA_TITLE=Lists basic company data. +PAGE_TITLE_ADMIN_LIST_BASIC_DATA=List basic company data +CONTENT_TITLE_ADMIN_LIST_BASIC_DATA=Lists basic company data +ADMIN_EMPTY_LIST_BASIC_DATA=There are no basic company data in database. Or your search criteria doesn't match anything. +TABLE_SUMMARY_ADMIN_LIST_BASIC_DATA=This table lists all basic company data. +ADMIN_HEADER_BASIC_DATA_ID=Id Number: ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Show details of this business contact. ADMIN_HEADER_ASSIGNED_USER=Assigned user: -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Shows assigned user profile. +ADMIN_LINK_SHOW_BASIC_DATA_OWNER_USER_TITLE=Shows branch office's assigned user profile. ADMIN_LINK_ASSIGN=Assign -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account. +ADMIN_LINK_ASSIGN_BASIC_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account. ADMIN_HEADER_BASIC_DATA_COMPANY_NAME=Company name: ADMIN_HEADER_COMPANY_CONTACT_PERSON=Contact person: -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON=Assign -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact. +ADMIN_LINK_SHOW_BASIC_DATA_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person. +ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON=Assign +ADMIN_LINK_ASSIGN_BASIC_DATA_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact. ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Shows complete contact profile. ADMIN_BASIC_DATA_COMPANY_COMMENTS=Comments: ADMIN_BASIC_DATA_PHONE_NUMBER=Main phone number: ADMIN_BASIC_DATA_FAX_NUMBER=Main fax number: -ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Add new business contact -ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA=Please enter at least company name including legal status. +ADMIN_ADD_BASIC_DATA_TITLE=Add new business contact +ADMIN_ADD_BASIC_DATA_MINIMUM_DATA=Please enter at least company name including legal status. ENTERED_EMAIL_ADDRESS_IS_INVALID=Your entered email address is not valid. ADMIN_BASIC_DATA_LEGEND=Basic data for business contact: -#Geben Sie die Basisdaten fuer einen geschaeftlichen Kontakt ein. ADMIN_BASIC_DATA_LEGEND_TITLE=Enter basic data for a business contact. ADMIN_BASIC_DATA_COMPANY_NAME_REQUIRED=Please enter the company's name including legal status. ADMIN_BASIC_DATA_COMPANY_LEGAL_STATUS=Legal status (e.g. Inc.): ADMIN_BASIC_DATA_COMPANY_EMAIL_ADDRESS=Main email address: -BUTTON_ADMIN_ADD_BASIC_COMPANY_DATA=Add basic data -#Fehler: Falscher Aufruf der Anmeldeseite, da die Eingangsseite als Anmeldeseite fungiert. +BUTTON_ADMIN_ADD_BASIC_DATA=Add basic data ERROR_GUEST_REGISTRATION_IN_INDEX_ENABLED=Error: Wrong request on registration page as the index page serves as registration page. BUTTON_CHANGE_LOCALE=Change BUTTON_CHANGE_LOCALE_TITLE=Change here in your current session the used language for text output. -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_FOUNDER=Choose company founder: +ADMIN_SELECT_BASIC_DATA_COMPANY_FOUNDER=Choose company founder: ADMIN_FEATURE_UNFINISHED_WARNING=This feature is not yet finished. ADMIN_BASIC_DATA_COMPANY_TAX_NUMBER=Tax number: ADMIN_BASIC_DATA_COMPANY_WEBSITE_URL=Website URL: -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_USER_OWNER=Select user to assign with company: -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_LOGO=Choose company logo: +ADMIN_SELECT_BASIC_DATA_COMPANY_USER_OWNER=Select user to assign with company: +ADMIN_SELECT_BASIC_DATA_COMPANY_LOGO=Choose company logo: URL_NOT_MATCHING_REGULAR_EXPRESSION=The entered URL does not match the common form. -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_CONTACT_EMPLOYEE=Choose employee as contact person: -ADMIN_SELECT_BASIC_COMPANY_DATA_COMPANY_HEADQUARTERS=Choose headquarters: +ADMIN_SELECT_BASIC_DATA_COMPANY_CONTACT_EMPLOYEE=Choose employee as contact person: +ADMIN_SELECT_BASIC_DATA_COMPANY_HEADQUARTER=Choose headquarter: LINK_COMPANY_WEBSITE_URL_TITLE=Link to company's web site (new window) ADMIN_HEADER_BASIC_DATA_COMPANY_FOUNDER=Founder -ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder. -ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry. +ADMIN_LINK_SHOW_BASIC_DATA_COMPANY_FOUNDER_TITLE=Show data of company founder. +ADMIN_LINK_ASSIGN_BASIC_DATA_COMPANY_FOUNDER_TITLE=Assigns a company founder to this company entry. ADMIN_USER_NAME_IS_REQUIRED=Please enter a user name. This must be unique. NO_WEBSITE_URL_ENTERED=No URL entered. ADMIN_LINK_LIST_BRANCH_OFFICES=Branch offices @@ -823,15 +818,14 @@ ADMIN_ASSIGN_BRANCH_OFFICE_USER_OWNER=Assign user to branch office: ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE=Assign contact person to branch office: ADMIN_BRANCH_OFFICE_DATA_LEGEND=Branch office basic data: ADMIN_BRANCH_OFFICE_DATA_LEGEND_TITLE=Enter branch office basic data here. -ADMIN_ASSIGN_BRANCH_OFFICE=Assign branch office to company: +ADMIN_ASSIGN_BASIC_DATA_BRANCH_OFFICE=Assign company to branch office: PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=List branch offices: ADMIN_EMPTY_LIST_BRANCH_OFFICES=There are no branch offices found in database. Or your search criteria doesn't match anything. ADMIN_ADD_BRANCH_OFFICE_TITLE=Add branch office -#Bitte waehlen Sie mindestens das zugehoerige Unternehmen und das Land aus und geben Sie Strasse, Hausnummer, Postleitzahl und Stadt ein. ADMIN_ADD_BRANCH_OFFICE_MINIMUM_DATA=Please at least choose assigned company, country and enter at least street name, house number, ZIP code and city. ADMIN_ENTER_BRANCH_OFFICE_EMAIL_ADDRESS=Email address of branch office: -ADMIN_ENTER_BRANCH_OFFICE_PHONE_NUMBER=Enter land-line number: +ADMIN_ENTER_BRANCH_OFFICE_LAND_LINE_NUMBER=Enter land-line number: ADMIN_ENTER_BRANCH_OFFICE_FAX_NUMBER=Enter fax number: ADMIN_BRANCH_OFFICE_REQUIRED=Please choose a company that sohuld be assigned with the branch office. ADMIN_BRANCH_OFFICE_STREET_NAME_REQUIRED=Please enter street name of branch office. @@ -884,7 +878,6 @@ ADMIN_EMPTY_LIST_MOBILE_NUMBER=There are no mobile numbers in database. Or your ADMIN_EMPTY_LIST_CONTACT_MOBILE=There are no mobile numbers of contacts in database. Or your search criteria doesn't match anything. ADMIN_MOBILE_PROVIDER_COUNTRY_REQUIRED=Please select a country for mobile provider. LABEL_COUNTRIES=Countries -#Filter list by selecting one or more users. FILTER_BY_MULTIPLE_COUNTRY_TITLE=Filter list by selecting one or more countries. ADMIN_LIST_MOBILE_PROVIDERS_HEADER=List of all mobile providers SELECT_SHOWN_COLUMNS=Shown columns @@ -924,7 +917,7 @@ ADMIN_EMPLOYEE_OTHER_LEGEND=Other data of employee: ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE=Here you can enter additional data for the employee. All fields are optional. ADMIN_ENTER_PHONE_EXTENSION=Enter phone extension: ADMIN_ASSIGN_EMPLOYEE_DEPARTMENT=Assign department to employee: -ADMIN_ASSIGN_EMPLOYEE_HEADQUARTERS=Assign headquarters to employee: +ADMIN_ASSIGN_EMPLOYEE_HEADQUARTER=Assign headquarter to employee: ADMIN_ENTER_EMPLOYEE_MOBILE_NUMBER=Enter business mobile number of employee: ADMIN_EMPLOYEE_GENERAL_LEGEND=General data of employee: ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE=You can enter here the general data of the employee. @@ -937,10 +930,9 @@ ADMIN_LINK_DELETE_BRANCH_OFFICE_TITLE=Deletes branch office. PAGE_TITLE_ADMIN_LIST_EMPLOYEE=List employees CONTENT_TITLE_ADMIN_LIST_EMPLOYEE=List employees: ADMIN_ADD_EMPLOYEE_TITLE=Add company employee -#Bitte waehlen Sie mindestens das Unternehmen aus und geben SIe mindestens entweder die Mitarbeiternummer ein oder waehlen Sie die persoenlichen Kontaktdaten des Mitarbeiters aus (beides ist auch moeglich). ADMIN_ADD_EMPLOYEE_MINIMUM_DATA=Please choose at least assigned company and enter at least employee number or choose personal data (both is possible, too). BUTTON_ADMIN_ADD_EMPLOYEE=Add employee -ADMIN_LIST_BASIC_COMPANY_DATA_HEADER=List all company basic data +ADMIN_LIST_BASIC_DATA_HEADER=List all company basic data ADMIN_LINK_LIST_DEPARTMENTS=Departments ADMIN_LINK_LIST_DEPARTMENTS_TITLE=Lists departments of companies. ADMIN_LINK_LIST_OPENING_TIMES=Opening times @@ -958,10 +950,9 @@ ADMIN_DEPARTMENT_LEAD_EMPLOYEE=Department leader: ADMIN_ADD_DEPARTMENT_TITLE=Add new department ADMIN_DEPARTMENT_LEGEND=Enter data of department: ADMIN_DEPARTMENT_LEGEND_TITLE=Here you can enter data of the new department. -#Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus. -ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Please enter at least name of department (e.g. Sales) and choose assigned company. If known, choose a branch office or headquarters. +ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Please enter at least name of department (e.g. Sales) and choose assigned company. If known, choose a branch office or headquarter. ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Assign branch office to department: -ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Assign headquarters to department: +ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER=Assign headquarter to department: ADMIN_ASSIGN_DEPARTMENT_COMPANY=Assign company to department: ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Assign leading employee to department: ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Assign owning user to department: @@ -986,7 +977,6 @@ ADMIN_END_TIME_REQUIRED=Please enter end time. ADMIN_OPENING_TIME_LEGEND=Data of single opening time: ADMIN_OPENING_TIME_LEGEND_TITLE=Enter data of single opening time. ADMIN_ADD_OPENING_TIME_TITLE=Add new opening time: -#BItte geben Sie zum Hinzufuegen einer Oeffnungszeit alle Angaben an. Diese sollten nicht konfliktieren. ADMIN_ADD_OPENING_TIME_MINIMUM_DATA=To add new opening time, you have to provide all data. They should not conflict. BUTTON_ADMIN_ADD_OPENING_TIME=Add opening time ADMIN_LINK_ASSIGN_DEPARTMENT_BRANCH_OFFICE_TITLE=Assign this department a branch office. @@ -995,13 +985,50 @@ ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Assign this department an owning FIELD_PAYMENT_TYPE_REQUIRED=Please choose a payment method. ADMIN_LIST_USERS_HEADER=List of all users ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Opening times of branch office: -TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=This table lists opening times of this branch office. +TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=This table lists new opening times of this branch office. TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=This table lists branch offices. -ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=There are no opening times of this branch office in database. -ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=List all opening times of branch office +ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=There are no opening times for a new branch office beging setup. +ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=List opening times of a new branch office ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Add opening time to branch office BUTTON_ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME=Add opening time to branch office ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND=Single opening time of branch office: ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Enter single opening time of branch office. ADMIN_OPENING_TIME_ALREADY_CREATED=The opening time has already been added. ADMIN_NOT_ASSIGNED=Not assigned +ADMIN_BASIC_DATA_COMPANY_NAME=Company's name: +ADMIN_LINK_SHOW_HEADQUARTER_TITLE=Shows details of a headquarter. +ADMIN_LINK_EDIT_HEADQUARTER_TITLE=Edit of a headquarter. +ADMIN_LINK_DELETE_HEADQUARTER_TITLE=Deletes a headquarter. +PAGE_TITLE_ADMIN_LIST_HEADQUARTER=List headquarters +CONTENT_TITLE_ADMIN_LIST_HEADQUARTER=List headquarters: +TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER=This table lists all headquarter. +ADMIN_EMPTY_LIST_HEADQUARTER=There are no headquarter in database. Or your search criteria doesn't match anything. +ADMIN_LIST_HEADQUARTER_HEADER=List all headquarter +ADMIN_LINK_SHOW_HEADQUARTER_OWNER_USER_TITLE=Show the profile of the headquarter entry owning user. +ADMIN_ADD_HEADQUARTER_TITLE=Add headquarter +ADMIN_LINK_LIST_HEADQUARTER=Headquarter +ADMIN_LINK_LIST_HEADQUARTER_TITLE=Lists all headquarter. +ADMIN_ADD_HEADQUARTER_MINIMUM_DATA=Please at least choose country and enter at least street name, house number, ZIP code and city. +ADMIN_HEADQUARTER_LEGEND=Headquarter data: +#@TODO Please fix German umlauts! +ADMIN_ASSIGN_HEADQUARTER_CONTACT_EMPLOYEE=Assign employee as contact person for headquarter: +ADMIN_ASSIGN_HEADQUARTER_USER_OWNER=Assign owning user to headquarter: +ADMIN_ENTER_HEADQUARTER_EMAIL_ADDRESS=Enter headquarter' email address: +ADMIN_ENTER_HEADQUARTER_LAND_LINE_NUMBER=Enter land-line number of headquarter: +ADMIN_ENTER_HEADQUARTER_FAX_NUMBER=Enter fax number of headquarter +ADMIN_HEADQUARTER_ADDRESS_LEGEND=Address of headquarter: +ADMIN_HEADQUARTER_STREET_NAME_REQUIRED=Please enter street name for headquarter. +ADMIN_HEADQUARTER_HOUSE_NUMBER_REQUIRED=Please enter house number for headquarter. +ADMIN_HEADQUARTER_ZIP_CODE_REQUIRED=Please enter ZIP code for headquarter. +ADMIN_HEADQUARTER_CITY_REQUIRED=Please enter city for headquarter. +ADMIN_BRANCH_OFFICE_COUNTRY_REQUIRED=Please choose a country for branch office. +ADMIN_HEADQUARTER_COUNTRY_REQUIRED=Please choose a country for headquarter. +BUTTON_ADMIN_ADD_HEADQUARTER=Add headquarter +ADMIN_HEADQUARTER_OPENING_TIMES_LEGEND=Opening times of headquarter: +TABLE_SUMMARY_ADMIN_LIST_HEADQUARTER_OPENING_TIMES=This table lists new opening times for headquarter. +ADMIN_EMPTY_LIST_HEADQUARTER_OPENING_TIMES=There are no opening times for a new headquarter beging setup. +ADMIN_LIST_HEADQUARTER_OPENING_TIMES_HEADER=List opening times of a new headquarter +ADMIN_ADD_HEADQUARTER_OPENING_TIME_TITLE=Add opening time to headquarter +BUTTON_ADMIN_ADD_HEADQUARTER_OPENING_TIME=Add opening time to headquarter +ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE=Assign a branch office to this employee. +ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE=Assign an owning user to this employee. diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 81a63726..2a0b6203 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -109,8 +109,12 @@ /admin/contact/admin_contact_export.xhtml - admin_list_basic_company_data - /admin/basic_company_data/admin_basic_company_data_list.xhtml + admin_list_headquarter + /admin/headquarter/admin_headquarter_list.xhtml + + + admin_list_basic_data + /admin/basic_data/admin_basic_data_list.xhtml admin_list_branch_office @@ -747,38 +751,69 @@ - /admin/basic_company_data/admin_basic_company_data_list.xhtml + /admin/basic_data/admin_basic_data_list.xhtml admin_show_basic_data - /admin/basic_company_data/admin_basic_company_data_show.xhtml + /admin/basic_data/admin_basic_data_show.xhtml admin_edit_basic_data - /admin/basic_company_data/admin_basic_company_data_edit.xhtml + /admin/basic_data/admin_basic_data_edit.xhtml admin_delete_basic_data - /admin/basic_company_data/admin_basic_company_data_delete.xhtml + /admin/basic_data/admin_basic_data_delete.xhtml + + + admin_assign_basic_data_contact + /admin/basic_data/admin_basic_data_assign_contact.xhtml + + + admin_assign_basic_data_founder + /admin/basic_data/admin_basic_data_assign_founder.xhtml + + + admin_assign_basic_data_owner + /admin/basic_data/admin_basic_data_assign_owner.xhtml + + + admin_show_employee + /admin/company_employee/admin_company_employee_show.xhtml + + + admin_assign_basic_data_employee + /admin/basic_data/admin_basic_data_assign_employee.xhtml + + + + /admin/headquarter/admin_headquarter_list.xhtml + + admin_show_headquarter + /admin/headquarter/admin_headquarter_show.xhtml - admin_assign_basic_company_data_contact - /admin/basic_company_data/admin_basic_company_data_assign_contact.xhtml + admin_edit_headquarter + /admin/headquarter/admin_headquarter_edit.xhtml - admin_assign_basic_company_data_founder - /admin/basic_company_data/admin_basic_company_data_assign_founder.xhtml + admin_delete_headquarter + /admin/headquarter/admin_headquarter_delete.xhtml + + + admin_show_user + /admin/user/admin_user_show.xhtml - admin_assign_basic_company_data_owner - /admin/basic_company_data/admin_basic_company_data_assign_owner.xhtml + admin_assign_headquarter_owner + /admin/headquarter/admin_headquarter_assign_owner.xhtml admin_show_employee /admin/company_employee/admin_company_employee_show.xhtml - admin_assign_basic_company_data_employee - /admin/basic_company_data/admin_basic_company_data_assign_employee.xhtml + admin_assign_headquarter_employee + /admin/headquarter/admin_headquarter_assign_employee.xhtml @@ -805,7 +840,7 @@ admin_show_basic_data - /admin/basic_company_data/admin_basic_company_data_show.xhtml + /admin/basic_data/admin_basic_data_show.xhtml admin_show_employee @@ -865,6 +900,14 @@ admin_delete_employee /admin/employee/admin_employee_delete.xhtml + + admin_show_branch_office + /admin/branch_office/admin_branch_office_show.xhtml + + + admin_assign_employee_owner + /admin/employee/admin_assign_employee_user.xhtml + /admin/opening_time/admin_opening_time_list.xhtml diff --git a/web/WEB-INF/links.jsf.taglib.xml b/web/WEB-INF/links.jsf.taglib.xml index 06af9787..0598de75 100644 --- a/web/WEB-INF/links.jsf.taglib.xml +++ b/web/WEB-INF/links.jsf.taglib.xml @@ -149,7 +149,7 @@ along with this program. If not, see . outputBasicDataAdminMiniLinks - This tag renders administrative "mini-links" for given basicData instance. + This tag renders administrative "mini-links" for given basic data instance. resources/tags/admin/links/mini/basic_data/admin_basic_data_links.tpl basicData @@ -170,6 +170,29 @@ along with this program. If not, see . java.lang.Boolean + + outputHeadquarterAdminMiniLinks + This tag renders administrative "mini-links" for given headquarter instance. + resources/tags/admin/links/mini/headquarter/admin_headquarter_links.tpl + + headquarter + The headquarter instance that provides the data for this tag. + true + org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterData + + + renderShowLink + Whether to render (default: true) "show headquarter" link. + false + java.langBoolean + + + rendered + Whether this tag is being rendered by JSF engine (default: true). + false + java.lang.Boolean + + outputBranchOfficeAdminMiniLinks This tag renders administrative "mini-links" for given branchOffice instance. diff --git a/web/WEB-INF/resources/tags/admin/links/mini/employee/admin_employee_links.tpl b/web/WEB-INF/resources/tags/admin/links/mini/employee/admin_employee_links.tpl index dda35498..d973950c 100644 --- a/web/WEB-INF/resources/tags/admin/links/mini/employee/admin_employee_links.tpl +++ b/web/WEB-INF/resources/tags/admin/links/mini/employee/admin_employee_links.tpl @@ -10,20 +10,20 @@