From d64d6f9a4ab647d227865bb5d78c6c906b708654 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 --- ...inancialsAdminBasicDataWebRequestBean.java | 6 +- ...ncialsAdminBranchOfficeWebRequestBean.java | 11 +-- ...nancialsAdminDepartmentWebRequestBean.java | 11 +-- ...FinancialsAdminEmployeeWebRequestBean.java | 43 ++++----- ...ancialsAdminHeadquarterWebRequestBean.java | 11 +-- ...ancialsAdminOpeningTimeWebRequestBean.java | 7 +- .../FinancialsAdminContactWebRequestBean.java | 14 +-- .../FinancialsAdminCountryWebRequestBean.java | 7 +- ....java => FinancialsWebViewHelperBean.java} | 89 +------------------ ...=> FinancialsWebViewHelperController.java} | 2 +- ...ialsAdminMobileProviderWebRequestBean.java | 9 +- .../FinancialsAdminPhoneWebRequestBean.java | 20 +---- .../FinancialsAdminUserWebRequestBean.java | 28 ++---- 13 files changed, 50 insertions(+), 208 deletions(-) rename src/java/org/mxchange/jfinancials/beans/helper/{FinancialsWebRequestHelperBean.java => FinancialsWebViewHelperBean.java} (90%) rename src/java/org/mxchange/jfinancials/beans/helper/{FinancialsWebRequestHelperController.java => FinancialsWebViewHelperController.java} (92%) diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java index 9becdef3..cb40dce1 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsAdminBasicDataWebRequestBean.java @@ -152,9 +152,8 @@ public class FinancialsAdminBasicDataWebRequestBean extends BaseFinancialsBean i /** * 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 FinancialsAdminBasicDataWebRequestBean extends BaseFinancialsBean i // Does already exist throw new FacesException(e); } - - // Continue to list again - return "admin_list_basic_data"; //NOI18N } /** 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 32e6fa40..7a809934 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsAdminBranchOfficeWebRequestBean.java @@ -227,10 +227,8 @@ public class FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea * 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 FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea 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 FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea } 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 FinancialsAdminBranchOfficeWebRequestBean extends BaseFinancialsBea // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_branch_office"; //NOI18N } /** 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 237b24f3..8130d2fd 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsAdminDepartmentWebRequestBean.java @@ -112,10 +112,8 @@ public class FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean * 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 FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean 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 FinancialsAdminDepartmentWebRequestBean extends BaseFinancialsBean } 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/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java index 07bc852c..7da132bf 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsAdminEmployeeWebRequestBean.java @@ -141,10 +141,8 @@ public class FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im * 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 FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im 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 FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im } 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 FinancialsAdminEmployeeWebRequestBean extends BaseFinancialsBean im // 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 getEmployeeBasicData () { - 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 setEmployeeBasicData (final BasicData employeeBasicData) { - this.employeeBasicData = employeeBasicData; + public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) { + this.employeeBranchOffice = employeeBranchOffice; } /** diff --git a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java index d69a8e63..c15f83f0 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/headquarter/FinancialsAdminHeadquarterWebRequestBean.java @@ -216,10 +216,8 @@ public class FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean * 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 FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean 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 FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean } 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 FinancialsAdminHeadquarterWebRequestBean extends BaseFinancialsBean // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_headquarter"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestBean.java index 203c17c1..c99cc9bd 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsAdminOpeningTimeWebRequestBean.java @@ -90,10 +90,8 @@ public class FinancialsAdminOpeningTimeWebRequestBean extends BaseFinancialsBean * 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 FinancialsAdminOpeningTimeWebRequestBean extends BaseFinancialsBean // Fire event this.openingTimeAddedEvent.fire(new OpeningTimeAddedEvent(updatedOpeningTimes)); - - // Redirect to list - return "admin_list_opening_time"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java index 5791012e..c15ca219 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsAdminContactWebRequestBean.java @@ -247,10 +247,8 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp /** * 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 FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp // Clear this bean this.clear(); - - // Return outcome - return "admin_list_contact"; //NOI18N } /** @@ -486,10 +481,8 @@ public class FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp /** * 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 FinancialsAdminContactWebRequestBean extends BaseFinancialsBean imp // Clear bean this.clear(); - - // Return to contact list (for now) - return "admin_list_contact"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java index c9775bf4..5927c9cd 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java @@ -109,11 +109,9 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp * 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 FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp // Clear this bean this.clear(); - - // Redirect to list - return "admin_list_country"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java similarity index 90% rename from src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java rename to src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java index 361cebd0..35b09af8 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java @@ -18,9 +18,9 @@ package org.mxchange.jfinancials.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; @@ -44,8 +44,6 @@ 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.category.Category; -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; @@ -56,8 +54,8 @@ import org.mxchange.jusercore.model.user.User; * @author Roland Häder */ @Named ("beanHelper") -@RequestScoped -public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implements FinancialsWebRequestHelperController { +@ViewScoped +public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements FinancialsWebViewHelperController { /** * Serial number @@ -139,7 +137,7 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement /** * Default constructor */ - public FinancialsWebRequestHelperBean () { + public FinancialsWebViewHelperBean () { // Call super constructor super(); } @@ -605,55 +603,6 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement 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) { - // Is product number given? - if (product.getProductNumber() != null) { - // Prepend it - sb.append(this.getMessageFromBundle("NUMBER")).append(" "); //NOI18N - sb.append(product.getProductNumber()); - sb.append(", "); //NOI18N - } - - // Add name and price - sb.append(this.getMessageFromBundle(product.getProductI18nKey())); - - // Is there any age group? - if (product.getProductAgeGroup() != null) { - // Show it - sb.append(", ").append(this.getMessageFromBundle(product.getProductAgeGroup().getI18nKey())); //NOI18N - } - - // Is there any size? - if ((product.getProductSize() != null) && (!product.getProductSize().isEmpty())) { - // Show size - sb.append(", ").append(this.getMessageFromBundle("SIZE")).append(product.getProductSize()); //NOI18N - } - - // Add price - sb.append(" ("); //NOI18N - sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice().floatValue())); - 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. @@ -699,36 +648,6 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement return sb.toString(); } - /** - * Returns the category's i18n string translated. If null is provided, an - * empty string is returned. - *

- * @param category Product category instance - *

- * @return Category's i18n string translation - */ - public String renderProductCategory (final Category category) { - // Default is empty string, so let's get started - final StringBuilder sb = new StringBuilder(10); - - // Is a category set? - if (category instanceof Category) { - // Add title - sb.append(this.getMessageFromBundle(category.getCategoryI18nKey())); - - // Is a parent category set? - if (category.getParentCategory() instanceof Category) { - // Then add it in braces, too - sb.append(" ("); //NOI18N - sb.append(this.getMessageFromBundle(category.getParentCategory().getCategoryI18nKey())); - sb.append(")"); //NOI18N - } - } - - // Return it - return sb.toString(); - } - /** * Returns the receipt. If null is provided, an empty string is returned. *

diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperController.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperController.java similarity index 92% rename from src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperController.java rename to src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperController.java index 4890ed6c..f36fb124 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperController.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperController.java @@ -23,6 +23,6 @@ import java.io.Serializable; *

* @author Roland Häder */ -public interface FinancialsWebRequestHelperController extends Serializable { +public interface FinancialsWebViewHelperController extends Serializable { } diff --git a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java index a023a82f..646b6a24 100644 --- a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsAdminMobileProviderWebRequestBean.java @@ -101,11 +101,9 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsB * 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()); @@ -113,7 +111,7 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsB if (this.isMobileProviderCreated(mobileProvider)) { // Then throw exception this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider)); //NOI18N - return ""; //NOI18N + return; //NOI18N } // Init variable @@ -129,9 +127,6 @@ public class FinancialsAdminMobileProviderWebRequestBean extends BaseFinancialsB // Fire event this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider)); - - // Redirect to list - return "admin_list_mobile_provider"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java index 3731b3a2..caf2f9aa 100644 --- a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java @@ -360,9 +360,8 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple /** * 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 FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // 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 FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // 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 FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple // Fire event this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(number)); - - // All fine, redirect - return "admin_list_mobile"; //NOI18N } /** diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java index 64c40d0f..0531fd72 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsAdminUserWebRequestBean.java @@ -216,9 +216,8 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem * 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 FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem this.setUserPasswordRepeat(null); // Skip it - return ""; //NOI18N + return; } try { @@ -276,9 +275,6 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem // Clear this bean this.clear(); - - // Return to user list (for now) - return "admin_list_user"; //NOI18N } /** @@ -339,10 +335,8 @@ public class FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem /** * 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 FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem // 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 FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem // 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 FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem // 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 FinancialsAdminUserWebRequestBean extends BaseFinancialsBean implem // Fire event this.updatedUserDataEvent.fire(new AdminUpdatedUserDataEvent(updatedUser)); - - // Return to user list (for now) - return "admin_list_user"; //NOI18N } /** -- 2.39.5