From 0de05b59bb67c10eaab1bc5f577a8130304f71ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Apr 2018 23:22:45 +0200 Subject: [PATCH] Please cherry-pick: - the helper bean needs to be view-scoped for other "list" view-scoped beans - all action methods must return void to have JSF AJAX requests working properly - sorted some members MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../JobsAdminBasicDataWebRequestBean.java | 6 +- .../JobsBasicDataWebRequestBean.java | 21 ------ .../JobsBasicDataListWebViewController.java | 2 +- .../JobsAdminBranchOfficeWebRequestBean.java | 11 +-- .../JobsAdminDepartmentWebRequestBean.java | 11 +-- ...obsAdminCompanyEmployeeWebRequestBean.java | 43 +++++------ .../JobsAdminHeadquarterWebRequestBean.java | 11 +-- .../JobsAdminOpeningTimeWebRequestBean.java | 7 +- .../JobsAdminContactWebRequestBean.java | 14 +--- .../JobsAdminCountryWebRequestBean.java | 7 +- ...erBean.java => JobsWebViewHelperBean.java} | 74 +++---------------- ....java => JobsWebViewHelperController.java} | 2 +- ...JobsAdminMobileProviderWebRequestBean.java | 11 +-- .../phone/JobsAdminPhoneWebRequestBean.java | 20 +---- .../user/JobsAdminUserWebRequestBean.java | 28 ++----- .../JobsBusinessContactConverter.java | 13 ---- .../JobsBasicDataCompanyNameValidator.java | 13 ---- .../JobsBasicDataEmailAddressValidator.java | 13 ---- 18 files changed, 59 insertions(+), 248 deletions(-) rename src/java/org/mxchange/jjobs/beans/helper/{JobsWebRequestHelperBean.java => JobsWebViewHelperBean.java} (92%) rename src/java/org/mxchange/jjobs/beans/helper/{JobsWebRequestHelperController.java => JobsWebViewHelperController.java} (92%) diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java index db6428ed..6ff360fa 100644 --- a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsAdminBasicDataWebRequestBean.java @@ -152,9 +152,8 @@ public class JobsAdminBasicDataWebRequestBean extends BaseJobsBean implements Jo /** * Adds a basic business data entry, if not yet found. *

- * @return Redirect outcome */ - public String addBusinessBasicData () { + public void addBusinessBasicData () { // First, validate all parameter if (this.getCompanyName() == null) { // Is null @@ -236,9 +235,6 @@ public class JobsAdminBasicDataWebRequestBean extends BaseJobsBean implements Jo // Does already exist throw new FacesException(e); } - - // Continue to list again - return "admin_list_basic_data"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java index 44311693..d7e5a5b3 100644 --- a/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java @@ -46,27 +46,6 @@ public class JobsBasicDataWebRequestBean extends BaseJobsBean implements JobsBas private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean; /** -<<<<<<< HEAD:src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java - * List of all basic company data - */ - private final List allBasicData; - - /** - * A list of all registered companies (globally) - */ - @Inject - @NamedCache (cacheName = "basicDataCache") - private Cache basicDataCache; - - /** - * EJB for general basic business data purposes - */ - @EJB (lookup = "java:global/jjobs-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.") - private BasicCompanyDataSessionBeanRemote businessDataBean; - - /** -======= ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java * Comments for this company */ private String companyComments; diff --git a/src/java/org/mxchange/jjobs/beans/business/basicdata/list/JobsBasicDataListWebViewController.java b/src/java/org/mxchange/jjobs/beans/business/basicdata/list/JobsBasicDataListWebViewController.java index f4424c8c..2ba1db89 100644 --- a/src/java/org/mxchange/jjobs/beans/business/basicdata/list/JobsBasicDataListWebViewController.java +++ b/src/java/org/mxchange/jjobs/beans/business/basicdata/list/JobsBasicDataListWebViewController.java @@ -14,7 +14,7 @@ * 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.basicdata.list; +package org.mxchange.jjobs.beans.business.basicdata.list; import java.io.Serializable; import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException; diff --git a/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java index f37c725b..c0539c5d 100644 --- a/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java @@ -227,10 +227,8 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements * 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 addBranchOffice () { + public void addBranchOffice () { // Get instance final BranchOffice branchOffice = this.createBranchOffice(); @@ -238,7 +236,7 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements if (this.isBranchOfficeCreatedByRequiredData(branchOffice)) { // Then show proper faces message this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Delcare updated instance @@ -250,7 +248,7 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements } catch (final BranchOfficeAlreadyAddedException ex) { // Output message this.showFacesMessage("form-admin-add-branch-office:branchStreet", "ADMIN_BRANCH_OFFICE_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Fire event @@ -258,9 +256,6 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_branch_office"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java index 1431e179..bfe5f7e9 100644 --- a/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java @@ -112,10 +112,8 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J * Adds department with all data from this backing bean. First this action * method will validate if the department's address is already registered * and if found, it will output a proper faces message. - *

- * @return Redirect outcome */ - public String addDepartment () { + public void addDepartment () { // Get instance final Department department = this.createDepartment(); @@ -123,7 +121,7 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J if (this.isDepartmentCreatedByRequiredData(department)) { // Then show proper faces message this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Delcare updated instance @@ -135,14 +133,11 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J } catch (final DepartmentAlreadyAddedException ex) { // Output message this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Fire event this.departmentAddedEvent.fire(new DepartmentAddedEvent(updatedDepartment)); - - // Redirect to list - return "admin_list_department"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestBean.java index 38464448..961daf8e 100644 --- a/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/employee/JobsAdminCompanyEmployeeWebRequestBean.java @@ -141,10 +141,8 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job * 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 () { + public void addEmployee () { // Get instance final Employable employee = this.createEmployee(); @@ -152,7 +150,7 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job if (this.isEmployeeCreatedByRequiredData(employee)) { // Then show proper faces message this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Delcare updated instance @@ -164,7 +162,7 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job } catch (final EmployeeAlreadyAddedException ex) { // Output message this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Fire event @@ -172,45 +170,42 @@ public class JobsAdminEmployeeWebRequestBean extends BaseJobsBean implements Job // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_branch_office"; //NOI18N } /** - * Getter for employee's assigned branch office + * Getter for employee's assigned basic company data *

- * @return Employee's assigned branch office + * @return Employee's assigned basic company data */ - public BranchOffice getEmployeeBranchOffice () { - return this.employeeBranchOffice; + public BasicData getEmployeeBasicData () { + return this.employeeBasicData; } /** - * Setter for employee's assigned branch office + * Setter for employee's assigned basic company data *

- * @param employeeBranchOffice Employee's assigned branch office + * @param employeeBasicData Employee's assigned basic company data */ - public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) { - this.employeeBranchOffice = employeeBranchOffice; + public void setEmployeeBasicData (final BasicData employeeBasicData) { + this.employeeBasicData = employeeBasicData; } /** - * Getter for employee's assigned basic company data + * Getter for employee's assigned branch office *

- * @return Employee's assigned basic company data + * @return Employee's assigned branch office */ - public BasicData getEmployeeCompany () { - return this.employeeBasicData; + public BranchOffice getEmployeeBranchOffice () { + return this.employeeBranchOffice; } /** - * Setter for employee's assigned basic company data + * Setter for employee's assigned branch office *

- * @param employeeBasicData Employee's assigned basic company data + * @param employeeBranchOffice Employee's assigned branch office */ - public void setEmployeeCompany (final BasicData employeeBasicData) { - this.employeeBasicData = employeeBasicData; + public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) { + this.employeeBranchOffice = employeeBranchOffice; } /** diff --git a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java index 5ccf6e31..063c2b1d 100644 --- a/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/headquarter/JobsAdminHeadquarterWebRequestBean.java @@ -216,10 +216,8 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements * 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 () { + public void addHeadquarter () { // Get instance final Headquarter headquarter = this.createHeadquarter(); @@ -227,7 +225,7 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements if (this.isHeadquarterCreatedByRequiredData(headquarter)) { // Then show proper faces message this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Delcare updated instance @@ -239,7 +237,7 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements } catch (final HeadquarterAlreadyAddedException ex) { // Output message this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N - return ""; //NOI18N + return; } // Fire event @@ -247,9 +245,6 @@ public class JobsAdminHeadquarterWebRequestBean extends BaseJobsBean implements // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_headquarter"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestBean.java index 7e9976c1..8375764c 100644 --- a/src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/opening_time/JobsAdminOpeningTimeWebRequestBean.java @@ -90,10 +90,8 @@ public class JobsAdminOpeningTimeWebRequestBean extends BaseJobsBean implements * Adds openingTime with all data from this backing bean. First this action * method will validate if the openingTime's address is already registered * and if found, it will output a proper faces message. - *

- * @return Redirect outcome */ - public String addOpeningTimes () { + public void addOpeningTimes () { // Get instance final OpeningTime openingTime = this.createOpeningTimes(); @@ -102,9 +100,6 @@ public class JobsAdminOpeningTimeWebRequestBean extends BaseJobsBean implements // Fire event this.openingTimeAddedEvent.fire(new OpeningTimeAddedEvent(updatedOpeningTimes)); - - // Redirect to list - return "admin_list_opening_time"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java index 7ea8c86b..1d81812a 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java @@ -247,10 +247,8 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs /** * Adds contact data to database and redirects on success. If the contact is * already found, a proper exception is thrown. - *

- * @return Redirect outcome */ - public String addContact () { + public void addContact () { // Are all minimum fields set? if (this.getPersonalTitle() == null) { // Throw NPE @@ -295,9 +293,6 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs // Clear this bean this.clear(); - - // Return outcome - return "admin_list_contact"; //NOI18N } /** @@ -486,10 +481,8 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs /** * Edits currently loaded contact's data in database. - *

- * @return Redirect outcome */ - public String editContactData () { + public void editContactData () { // Get contact instance final Contact contact = this.createContactInstance(); @@ -516,9 +509,6 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs // Clear bean this.clear(); - - // Return to contact list (for now) - return "admin_list_contact"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java index 1f97a968..7db105ee 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java @@ -109,11 +109,9 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsBean implements Jobs * Adds country to all relevant beans and sends it to the EJB. A redirect * should happen after successfull creation. *

- * @return Redirect outcome - *

* @todo Add field validation */ - public String addCountry () { + public void addCountry () { // Create new country object final Country country = new CountryData(); @@ -147,9 +145,6 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsBean implements Jobs // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_country"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java similarity index 92% rename from src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java rename to src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java index 5213862d..4ab1d734 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java @@ -16,10 +16,11 @@ */ package org.mxchange.jjobs.beans.helper; +import java.text.DateFormat; import java.text.MessageFormat; -import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.view.ViewScoped; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent; @@ -43,11 +44,9 @@ import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEv import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jproduct.model.product.Product; import org.mxchange.jusercore.events.user.created.CreatedUserEvent; import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent; import org.mxchange.jusercore.model.user.User; -import org.mxchange.jcontactsbusiness.model.employee.Employable; /** * A general helper for beans @@ -55,8 +54,8 @@ import org.mxchange.jcontactsbusiness.model.employee.Employable; * @author Roland Häder */ @Named ("beanHelper") -@RequestScoped -public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebRequestHelperController { +@ViewScoped +public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHelperController { /** * Serial number @@ -138,7 +137,7 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq /** * Default constructor */ - public JobsWebRequestHelperBean () { + public JobsWebViewHelperBean () { // Call super constructor super(); } @@ -565,7 +564,7 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq * available. If null is provided, an empty string is returned. *

* @param employee Employable instance -

+ *

* @return Contact's full name */ public String renderEmployee (final Employable employee) { @@ -604,33 +603,6 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq return sb.toString(); } - /** - * Returns the product name and price. If null is provided, an empty string - * is returned. - *

- * @param product Product instance - *

- * @return Product name - */ - public String renderGenericProduct (final Product product) { - // Default is empty string, so let's get started - final StringBuilder sb = new StringBuilder(10); - - // Is a product set? - if (product instanceof Product) { - // Add name and price - sb.append(this.getMessageFromBundle(product.getProductI18nKey())); - sb.append(" ("); //NOI18N - sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice())); - sb.append(" "); //NOI18N - sb.append(product.getProductCurrencyCode()); - sb.append(")"); //NOI18N - } - - // Return it - return sb.toString(); - } - /** * Returns the headquarter address. If null is provided, an empty string is * returned. @@ -677,33 +649,7 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq } /** - * Returns the product name and price. If null is provided, an empty string - * is returned. - *

- * @param product Product instance - *

- * @return Product name - */ - public String renderProduct (final Product product) { - // Default is empty string, so let's get started - final StringBuilder sb = new StringBuilder(10); - - // Is a product set? - if (product instanceof Product) { - // Add name and price - sb.append(product.getProductTitle()); - sb.append(" ("); //NOI18N - sb.append(this.localizationController.formatCurrency(product.getProductPrice())); - sb.append(")"); //NOI18N - } - - // Return it - return sb.toString(); - } - - /** - * Returns the receipt. If null is provided, an empty string - * is returned. + * Returns the receipt. If null is provided, an empty string is returned. *

* @param receipt Receipt instance *

@@ -711,16 +657,18 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq */ public String renderReceipt (final BillableReceipt receipt) { // Default is empty string, so let's get started - final StringBuilder sb = new StringBuilder(10); + final StringBuilder sb = new StringBuilder(50); // Is receipt set? if (receipt instanceof BillableReceipt) { // Add relevant data sb.append(this.getMessageFromBundle("RECEIPT_ISSUED")).append(" "); //NOI18N + sb.append(DateFormat.getInstance().format(receipt.getReceiptIssued())).append(", "); //NOI18N + sb.append(this.getMessageFromBundle("PAYMENT_TYPE")).append(" "); //NOI18N sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getI18nKey())); // Is receipt number included? - if (receipt.getReceiptNumber() !=null) { + if (receipt.getReceiptNumber() != null) { // Append it sb.append(", ").append(this.getMessageFromBundle("RECEIPT_NUMBER")).append(" "); //NOI18N sb.append(receipt.getReceiptNumber()); diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java similarity index 92% rename from src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java rename to src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java index 48ecaf37..b4cd8650 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java @@ -23,6 +23,6 @@ import java.io.Serializable; *

* @author Roland Häder */ -public interface JobsWebRequestHelperController extends Serializable { +public interface JobsWebViewHelperController extends Serializable { } diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java index 578b05b3..a675cbee 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java @@ -101,19 +101,17 @@ public class JobsAdminMobileProviderWebRequestBean extends BaseJobsBean implemen * dial-prefix and country combination is done, if found, an exception is * thrown. A redirect should take place after successfull creation. *

- * @return Redirect outcome - *

* @todo Add field validation */ - public String addMobileProvider () { + public void addMobileProvider () { // Create mobile provider instance final MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern()); // Is the provider already created? if (this.isMobileProviderCreated(mobileProvider)) { // Then throw exception - this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", "ERROR_ADMIN_MOBILE_PROVIDER_ALREADY_ADDED"); //NOI18N - return ""; //NOI18N + this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider)); //NOI18N + return; //NOI18N } // Init variable @@ -129,9 +127,6 @@ public class JobsAdminMobileProviderWebRequestBean extends BaseJobsBean implemen // Fire event this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider)); - - // Redirect to list - return "admin_list_mobile_provider"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index b83666a3..a63a5713 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -360,9 +360,8 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd /** * Deletes given fax entry data *

- * @return Redirect outcome */ - public String deleteFaxData () { + public void deleteFaxData () { // Get fax number from bean helper DialableFaxNumber number = this.createFaxNumber(); @@ -404,17 +403,12 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // Fire event this.faxNumberDeletedEvent.fire(new AdminFaxNumberDeletedEvent(number)); - - // All fine, redirect - return "admin_list_fax"; //NOI18N } /** * Deletes given land-line entry data - *

- * @return Redirect outcome */ - public String deleteLandLineData () { + public void deleteLandLineData () { // Get land-line number from helper DialableLandLineNumber number = this.createLandLineNumber(); @@ -456,17 +450,12 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // Fire event this.landLineNumberDeletedEvent.fire(new AdminLandLineNumberDeletedEvent(number)); - - // All fine, redirect - return "admin_list_landline"; //NOI18N } /** * Deletes given mobile entry data - *

- * @return Redirect outcome */ - public String deleteMobileData () { + public void deleteMobileData () { // Get mobile number from helper DialableMobileNumber number = this.createMobileNumber(); @@ -502,9 +491,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd // Fire event this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(number)); - - // All fine, redirect - return "admin_list_mobile"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index faeba8ee..31f79a87 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -216,9 +216,8 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm * sending it to the EJB. The data set in the controller is being verified, * e.g. if the user name or email address is not used yet. *

- * @return Redirect outcome */ - public String addUser () { + public void addUser () { // As the form cannot validate the data (required="true"), check it here if (this.getUserName() == null) { // Throw NPE @@ -248,7 +247,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm this.setUserPasswordRepeat(null); // Skip it - return ""; //NOI18N + return; } try { @@ -276,9 +275,6 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm // Clear this bean this.clear(); - - // Return to user list (for now) - return "admin_list_user"; //NOI18N } /** @@ -339,10 +335,8 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm /** * Deletes given user account - *

- * @return Redirect outcome */ - public String deleteUserData () { + public void deleteUserData () { // Is the user instance valid and CONFIRMED? if (this.getUser() == null) { // Throw NPE @@ -365,17 +359,12 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm // Fire event this.deleteUserEvent.fire(new AdminDeletedUserEvent(this.getUser(), this.getUserDeleteReason())); - - // Redirect - return "admin_list_user"; //NOI18N } /** * Edits currently loaded user's data in database. - *

- * @return Redirect outcome */ - public String editUserData () { + public void editUserData () { // Null password means not setting it String encryptedPassword = null; @@ -402,14 +391,14 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm // Not same password entered this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_PASSWORD_REPEAT_DIFFERENT"); //NOI18N - return ""; //NOI18N + return; } else if ((!Objects.equals(this.getUser().getUserName(), this.getUserName())) && (this.userBean.ifUserNameExists(this.getUserName()))) { // Clear all fields this.clear(); // User name already exists this.showFacesMessage("form_edit_user:userName", "ADMIN_USER_NAME_ALREADY_EXISTS"); //NOI18N - return ""; //NOI18N + return; } else if (this.isSamePasswordEntered()) { // Same password entered, create container if ((Objects.equals(this.getUser().getUserMustChangePassword(), this.getUserMustChangePassword())) && (UserLoginUtils.ifPasswordMatches(new UserLoginContainer(this.getUser(), this.getUserPassword())))) { @@ -419,7 +408,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm // Same password entered this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD"); //NOI18N - return ""; //NOI18N + return; } // Encrypt password @@ -441,9 +430,6 @@ public class JobsAdminUserWebRequestBean extends BaseJobsBean implements JobsAdm // Fire event this.updatedUserDataEvent.fire(new AdminUpdatedUserDataEvent(updatedUser)); - - // Return to user list (for now) - return "admin_list_user"; //NOI18N } /** diff --git a/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java b/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java index 2feff0fa..3dc4c726 100644 --- a/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java +++ b/src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java @@ -24,13 +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; -<<<<<<< HEAD:src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean; -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController; -======= import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewBean; import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewController; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBasicCompanyDataConverter.java /** * Converter for basic company data id <-> valid basic company data instance @@ -43,22 +38,14 @@ public class JobsBasicCompanyDataConverter implements Converter { /** * Basic company data backing bean */ -<<<<<<< HEAD:src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java - private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER; -======= private static JobsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBasicCompanyDataConverter.java @Override public BasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? if (null == BASIC_DATA_LIST_CONTROLLER) { // Get bean from CDI directly -<<<<<<< HEAD:src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBusinessContactConverter.java - BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get(); -======= BASIC_DATA_LIST_CONTROLLER = CDI.current().select(JobsBasicDataListWebViewBean.class).get(); ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/converter/business/basicdata/JobsBasicCompanyDataConverter.java } // Is the value null or empty? diff --git a/src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java b/src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java index a7e4eebf..022e9c4b 100644 --- a/src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java +++ b/src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java @@ -24,13 +24,8 @@ import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.ValidatorException; import org.mxchange.jcoreee.validator.string.BaseStringValidator; -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean; -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController; -======= import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewBean; import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewController; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java /** * A validator for basic data company names @@ -43,11 +38,7 @@ public class JobsBasicDataCompanyNameValidator extends BaseStringValidator { /** * Business basic data backing bean */ -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java - private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER; -======= private static JobsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java /** * Serial number @@ -59,11 +50,7 @@ public class JobsBasicDataCompanyNameValidator extends BaseStringValidator { // Is the instance there? if (null == BASIC_DATA_LIST_CONTROLLER) { // Get bean from CDI directly -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java - BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get(); -======= BASIC_DATA_LIST_CONTROLLER = CDI.current().select(JobsBasicDataListWebViewBean.class).get(); ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/business/basicdata/JobsBasicDataCompanyNameValidator.java } // All accepted, required fields diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java index ce6693fd..c2d923f4 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java @@ -25,13 +25,8 @@ import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.ValidatorException; import org.mxchange.jcoreee.validator.string.BaseStringValidator; -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestBean; -import org.mxchange.jjobs.beans.business.basicdata.JobsBasicDataWebRequestController; -======= import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewBean; import org.mxchange.jjobs.beans.business.basicdata.list.JobsBasicDataListWebViewController; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java /** * A validator for basic company data email address validation @@ -44,11 +39,7 @@ public class JobsBasicDataEmailAddressValidator extends BaseStringValidator { /** * Branch office backing bean */ -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java - private static JobsBasicDataWebRequestController BASIC_DATA_CONTROLLER; -======= private static JobsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER; ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java /** * Email pattern @@ -126,11 +117,7 @@ public class JobsBasicDataEmailAddressValidator extends BaseStringValidator { // Is the instance there? if (null == BASIC_DATA_LIST_CONTROLLER) { // Get bean from CDI directly -<<<<<<< HEAD:src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java - BASIC_DATA_CONTROLLER = CDI.current().select(JobsBasicDataWebRequestBean.class).get(); -======= BASIC_DATA_LIST_CONTROLLER = CDI.current().select(JobsBasicDataListWebViewBean.class).get(); ->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java } // Is it registered? -- 2.39.5