/**
* Adds a basic business data entry, if not yet found.
* <p>
- * @return Redirect outcome
*/
- public String addBusinessBasicData () {
+ public void addBusinessBasicData () {
// First, validate all parameter
if (this.getCompanyName() == null) {
// Is null
// Does already exist
throw new FacesException(e);
}
-
- // Continue to list again
- return "admin_list_basic_data"; //NOI18N
}
/**
private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
/**
-<<<<<<< HEAD:src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java
- * List of all basic company data
- */
- private final List<BasicData> allBasicData;
-
- /**
- * A list of all registered companies (globally)
- */
- @Inject
- @NamedCache (cacheName = "basicDataCache")
- private Cache<Long, BasicData> basicDataCache;
-
- /**
- * EJB for general basic business data purposes
- */
- @EJB (lookup = "java:global/jjobs-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
- private BasicCompanyDataSessionBeanRemote businessDataBean;
-
- /**
-=======
->>>>>>> 11ccdf2a4... Please cherry-pick::src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBasicDataWebRequestBean.java
* Comments for this company
*/
private String companyComments;
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.mxchange.jfinancials.beans.business.basicdata.list;
+package org.mxchange.jjobs.beans.business.basicdata.list;
import java.io.Serializable;
import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
* Adds branch office with all data from this backing bean. First this
* action method will validate if the branch office's address is already
* registered and if found, it will output a proper faces message.
- * <p>
- * @return Redirect outcome
*/
- public String addBranchOffice () {
+ public void addBranchOffice () {
// Get instance
final BranchOffice branchOffice = this.createBranchOffice();
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
} 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
// Clear this bean
this.clear();
-
- // Redirect to list
- return "admin_list_branch_office"; //NOI18N
}
/**
* 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.
- * <p>
- * @return Redirect outcome
*/
- public String addDepartment () {
+ public void addDepartment () {
// Get instance
final Department department = this.createDepartment();
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
} 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
}
/**
* Adds branch office with all data from this backing bean. First this
* action method will validate if the branch office's address is already
* registered and if found, it will output a proper faces message.
- * <p>
- * @return Redirect outcome
*/
- public String addEmployee () {
+ public void addEmployee () {
// Get instance
final Employable employee = this.createEmployee();
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
} catch (final EmployeeAlreadyAddedException ex) {
// Output message
this.showFacesMessage("form-admin-add-employee:employeeNumber", "ADMIN_EMPLOYEE_ALREADY_CREATED"); //NOI18N
- return ""; //NOI18N
+ return;
}
// Fire event
// 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
* <p>
- * @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
* <p>
- * @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
* <p>
- * @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
* <p>
- * @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;
}
/**
* Adds headquarter with all data from this backing bean. First this action
* method will validate if the headquarter's address is already registered
* and if found, it will output a proper faces message.
- * <p>
- * @return Redirect outcome
*/
- public String addHeadquarter () {
+ public void addHeadquarter () {
// Get instance
final Headquarter headquarter = this.createHeadquarter();
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
} catch (final HeadquarterAlreadyAddedException ex) {
// Output message
this.showFacesMessage("form-admin-add-headquarter-office:headquarterStreet", "ADMIN_HEADQUARTER_ALREADY_CREATED"); //NOI18N
- return ""; //NOI18N
+ return;
}
// Fire event
// Clear this bean
this.clear();
-
- // Redirect to list
- return "admin_list_headquarter"; //NOI18N
}
/**
* 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.
- * <p>
- * @return Redirect outcome
*/
- public String addOpeningTimes () {
+ public void addOpeningTimes () {
// Get instance
final OpeningTime openingTime = this.createOpeningTimes();
// Fire event
this.openingTimeAddedEvent.fire(new OpeningTimeAddedEvent(updatedOpeningTimes));
-
- // Redirect to list
- return "admin_list_opening_time"; //NOI18N
}
/**
/**
* Adds contact data to database and redirects on success. If the contact is
* already found, a proper exception is thrown.
- * <p>
- * @return Redirect outcome
*/
- public String addContact () {
+ public void addContact () {
// Are all minimum fields set?
if (this.getPersonalTitle() == null) {
// Throw NPE
// Clear this bean
this.clear();
-
- // Return outcome
- return "admin_list_contact"; //NOI18N
}
/**
/**
* Edits currently loaded contact's data in database.
- * <p>
- * @return Redirect outcome
*/
- public String editContactData () {
+ public void editContactData () {
// Get contact instance
final Contact contact = this.createContactInstance();
// Clear bean
this.clear();
-
- // Return to contact list (for now)
- return "admin_list_contact"; //NOI18N
}
/**
* Adds country to all relevant beans and sends it to the EJB. A redirect
* should happen after successfull creation.
* <p>
- * @return Redirect outcome
- * <p>
* @todo Add field validation
*/
- public String addCountry () {
+ public void addCountry () {
// Create new country object
final Country country = new CountryData();
// Clear this bean
this.clear();
-
- // Redirect to list
- return "admin_list_country"; //NOI18N
}
/**
+++ /dev/null
-/*
- * Copyright (C) 2016 - 2018 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.helper;
-
-import java.text.MessageFormat;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent;
-import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
-import org.mxchange.jcontacts.model.contact.Contact;
-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.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
-import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
-import org.mxchange.jjobs.model.receipt.BillableReceipt;
-import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
-import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
-import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent;
-import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
-import org.mxchange.jphone.events.mobile.created.CreatedMobileNumberEvent;
-import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
-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
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("beanHelper")
-@RequestScoped
-public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebRequestHelperController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 17_258_793_567_145_701L;
-
- /**
- * Contact instance
- */
- private Contact contact;
-
- /**
- * Event for when a contact instance was created
- */
- @Any
- @Inject
- private Event<ObservableCreatedContactEvent> contactCreatedEvent;
-
- /**
- * Fax number
- */
- private DialableFaxNumber faxNumber;
-
- /**
- * Event for when a fax number instance was created
- */
- @Any
- @Inject
- private Event<ObservableCreatedFaxNumberEvent> faxNumberCreatedEvent;
-
- /**
- * Land-line number
- */
- private DialableLandLineNumber landLineNumber;
-
- /**
- * Event for when a land-line number instance was created
- */
- @Any
- @Inject
- private Event<ObservableCreatedLandLineNumberEvent> landLineNumberCreatedEvent;
-
- /**
- * Localization controller
- */
- @Inject
- private JobsLocalizationSessionController localizationController;
-
- /**
- * Mobile number
- */
- private DialableMobileNumber mobileNumber;
-
- /**
- * Event for when a mobile number instance was created
- */
- @Any
- @Inject
- private Event<ObservableCreatedMobileNumberEvent> mobileNumberCreatedEvent;
-
- /**
- * User instance
- */
- private User user;
-
- /**
- * Regular user controller
- */
- @Inject
- private JobsUserWebRequestController userController;
-
- /**
- * Event for when a user instance was created
- */
- @Any
- @Inject
- private Event<ObservableCreatedUserEvent> userCreatedEvent;
-
- /**
- * Default constructor
- */
- public JobsWebRequestHelperBean () {
- // Call super constructor
- super();
- }
-
- /**
- * Getter for contact instance
- * <p>
- * @return Contact instance
- */
- public Contact getContact () {
- return this.contact;
- }
-
- /**
- * Setter for contact instance
- * <p>
- * @param contact Contact instance
- */
- public void setContact (final Contact contact) {
- this.contact = contact;
- }
-
- /**
- * Returns a message key depending on if this contact is a user and/or a
- * contact. If this contact is unused, a default key is returned.
- * <p>
- * @param contact Contact instance to check
- * <p>
- * @return Message key
- */
- public String getContactUsageMessageKey (final Contact contact) {
- // The contact must be valid
- if (null == contact) {
- // Throw NPE
- throw new NullPointerException("contact is null"); //NOI18N
- } else if (contact.getContactId() == null) {
- // Throw again ...
- throw new NullPointerException("contact.contactId is null"); //NOI18N
- } else if (contact.getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
- }
-
- // Default key is "unused"
- String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
-
- // Check user first
- if (this.userController.isContactFound(contact)) {
- // Only user
- messageKey = "CONTACT_IS_USER"; //NOI18N
- }
-
- // Return message key
- return messageKey;
- }
-
- /**
- * Getter for dialable fax number
- * <p>
- * @return Dialable fax number
- */
- public DialableFaxNumber getFaxNumber () {
- return this.faxNumber;
- }
-
- /**
- * Setter for dialable fax number
- * <p>
- * @param faxNumber Dialable fax number
- */
- public void setFaxNumber (final DialableFaxNumber faxNumber) {
- this.faxNumber = faxNumber;
- }
-
- /**
- * Getter for dialable land-line number
- * <p>
- * @return Dialable land-line number
- */
- public DialableLandLineNumber getLandLineNumber () {
- return this.landLineNumber;
- }
-
- /**
- * Setter for dialable land-line number
- * <p>
- * @param landLineNumber Dialable land-line number
- */
- public void setLandLineNumber (final DialableLandLineNumber landLineNumber) {
- this.landLineNumber = landLineNumber;
- }
-
- /**
- * Getter for dialable mobile number
- * <p>
- * @return Dialable mobile number
- */
- public DialableMobileNumber getMobileNumber () {
- return this.mobileNumber;
- }
-
- /**
- * Setter for dialable mobile number
- * <p>
- * @param mobileNumber Dialable mobile number
- */
- public void setMobileNumber (final DialableMobileNumber mobileNumber) {
- this.mobileNumber = mobileNumber;
- }
-
- /**
- * Getter for user instance
- * <p>
- * @return User instance
- */
- public User getUser () {
- return this.user;
- }
-
- /**
- * Setter for user instance
- * <p>
- * @param user User instance
- */
- public void setUser (final User user) {
- this.user = user;
- }
-
- /**
- * Notifies other controllers (backing beans) if a contact id has been
- * successfully converted to a Contact instance.
- */
- public void notifyControllerContactConverted () {
- // Validate contact instance
- if (this.getContact() == null) {
- // Throw NPE
- throw new NullPointerException("this.contact is null"); //NOI18N
- } else if (this.getContact().getContactId() == null) {
- // Throw NPE again
- throw new NullPointerException("this.contact.contactId is null"); //NOI18N
- } else if (this.getContact().getContactId() < 1) {
- // Not valid
- throw new IllegalStateException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId())); //NOI18N
- }
-
- // Set all phone instances
- this.setPhoneInstances(this.getContact());
-
- // Set all fields: user
- this.contactCreatedEvent.fire(new CreatedContactEvent(this.getContact()));
- }
-
- /**
- * Notifies other controllers (backing beans) if a phone id has been
- * successfully converted to a DialableFaxNumber instance.
- */
- public void notifyControllerFaxNumberConverted () {
- // Validate fax instance
- if (this.getFaxNumber() == null) {
- // Throw NPE
- throw new NullPointerException("this.faxNumber is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneId() == null) {
- // Throw again
- throw new NullPointerException("this.faxNumber.phoneId is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneId() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneId={0} is not valid", this.getFaxNumber().getPhoneId())); //NOI18N
- } else if (this.getFaxNumber().getPhoneAreaCode() == null) {
- // Throw again
- throw new NullPointerException("this.faxNumber.phoneAreaCode is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneAreaCode() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
- } else if (this.getFaxNumber().getPhoneCountry() == null) {
- // Throw NPE again
- throw new NullPointerException("this.faxNumber.phoneCountry is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneCountry().getCountryId() == null) {
- // ... throw again
- throw new NullPointerException("this.faxNumber.phoneCountry.countryId is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneCountry().getCountryId() < 1) {
- // Invalid id
- throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneCountry.countryId={0} is invalid", this.getFaxNumber().getPhoneCountry().getCountryId())); //NOI18N
- } else if (this.getFaxNumber().getPhoneNumber() == null) {
- // Throw NPE again ...
- throw new NullPointerException("this.faxNumber.phoneNumber is null"); //NOI18N
- } else if (this.getFaxNumber().getPhoneNumber() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneNumber={0} is not valid", this.getFaxNumber().getPhoneNumber())); //NOI18N
- }
-
- // Fire event
- this.faxNumberCreatedEvent.fire(new CreatedFaxNumberEvent(this.getFaxNumber()));
- }
-
- /**
- * Notifies other controllers (backing beans) if a phone id has been
- * successfully converted to a DialableLandLineNumber instance.
- */
- public void notifyControllerLandLineNumberConverted () {
- // Validate land-line instance
- if (this.getLandLineNumber() == null) {
- // Throw NPE
- throw new NullPointerException("this.landLineNumber is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneId() == null) {
- // Throw again
- throw new NullPointerException("this.landLineNumber.phoneId is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneId() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneId={0} is not valid", this.getLandLineNumber().getPhoneId())); //NOI18N
- } else if (this.getLandLineNumber().getPhoneAreaCode() == null) {
- // Throw again
- throw new NullPointerException("this.landLineNumber.phoneAreaCode is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneAreaCode() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
- } else if (this.getLandLineNumber().getPhoneCountry() == null) {
- // Throw NPE again
- throw new NullPointerException("this.landLineNumber.phoneCountry is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() == null) {
- // ... throw again
- throw new NullPointerException("this.landLineNumber.phoneCountry.countryId is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() < 1) {
- // Invalid id
- throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneCountry.countryId={0} is invalid", this.getLandLineNumber().getPhoneCountry().getCountryId())); //NOI18N
- } else if (this.getLandLineNumber().getPhoneNumber() == null) {
- // Throw NPE again ...
- throw new NullPointerException("this.landLineNumber.phoneNumber is null"); //NOI18N
- } else if (this.getLandLineNumber().getPhoneNumber() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneNumber={0} is not valid", this.getLandLineNumber().getPhoneNumber())); //NOI18N
- }
-
- // Fire event
- this.landLineNumberCreatedEvent.fire(new CreatedLandLineNumberEvent(this.getLandLineNumber()));
- }
-
- /**
- * Notifies other controllers (backing beans) if a phone id has been
- * successfully converted to a DialableMobileNumber instance.
- */
- public void notifyControllerMobileNumberConverted () {
- // Validate mobile instance
- if (this.getMobileNumber() == null) {
- // Throw NPE
- throw new NullPointerException("this.mobileNumber is null"); //NOI18N
- } else if (this.getMobileNumber().getPhoneId() == null) {
- // Throw again
- throw new NullPointerException("this.mobileNumber.phoneId is null"); //NOI18N
- } else if (this.getMobileNumber().getPhoneId() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneId={0} is not valid", this.getMobileNumber().getPhoneId())); //NOI18N
- } else if (this.getMobileNumber().getMobileProvider() == null) {
- // Throw NPE again
- throw new NullPointerException("this.mobileNumber.mobileProvider is null"); //NOI18N
- } else if (this.getMobileNumber().getMobileProvider().getProviderId() == null) {
- // ... throw again
- throw new NullPointerException("this.mobileNumber.mobileProvider.providerId is null"); //NOI18N
- } else if (this.getMobileNumber().getMobileProvider().getProviderId() < 1) {
- // Invalid id
- throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.mobileProvider.providerId={0} is invalid", this.getMobileNumber().getMobileProvider().getProviderId())); //NOI18N
- } else if (this.getMobileNumber().getPhoneNumber() == null) {
- // Throw NPE again ...
- throw new NullPointerException("this.mobileNumber.phoneNumber is null"); //NOI18N
- } else if (this.getMobileNumber().getPhoneNumber() < 1) {
- // Invalid id number
- throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneNumber={0} is not valid", this.getMobileNumber().getPhoneNumber())); //NOI18N
- }
-
- // Fire event
- this.mobileNumberCreatedEvent.fire(new CreatedMobileNumberEvent(this.getMobileNumber()));
- }
-
- /**
- * Notifies other controllers (backing beans) if a user id has been
- * successfully converted to a User instance.
- */
- public void notifyControllerUserConverted () {
- // Validate user instance
- if (this.getUser() == null) {
- // Throw NPE
- throw new NullPointerException("this.user is null"); //NOI18N
- } else if (this.getUser().getUserId() == null) {
- // Throw NPE again
- throw new NullPointerException("this.user.userId is null"); //NOI18N
- } else if (this.getUser().getUserId() < 1) {
- // Not valid
- throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId())); //NOI18N
- }
-
- // Get contact
- final Contact userContact = this.getUser().getUserContact();
-
- // Set contact here, too. This avoids parameters that cannot auto-complete in IDEs.
- this.setContact(userContact);
-
- // Set all phone instances
- this.setPhoneInstances(userContact);
-
- // Fire event
- this.userCreatedEvent.fire(new CreatedUserEvent(this.getUser()));
- }
-
- /**
- * Renders data of basic company data
- * <p>
- * @param basicData Basic company data instance
- * <p>
- * @return Basic company data as string
- */
- public String renderBasicData (final BasicData basicData) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(30);
-
- // Is basic company data set?
- if (basicData instanceof BasicData) {
- // Add company name
- sb.append(basicData.getCompanyName()); //NOI18N
-
- // Is email address set?
- if (basicData.getCompanyEmailAddress() != null) {
- // Add it
- sb.append(", ").append(basicData.getCompanyEmailAddress()); //NOI18N
- }
-
- // Is tax number set?
- if (basicData.getCompanyTaxNumber() != null) {
- // Add it
- sb.append(", ").append(basicData.getCompanyTaxNumber()); //NOI18N
- }
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the branch office's full address. If null is provided, an empty
- * string is returned.
- * <p>
- * @param branchOffice Branch office instance
- * <p>
- * @return Branch office's address
- */
- public String renderBranchOffice (final BranchOffice branchOffice) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(30);
-
- // Is a branch office instance given?
- if (branchOffice instanceof BranchOffice) {
- // This should not happen:
- assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N
-
- // Yes, then append all data
- sb.append(branchOffice.getBranchCompany().getCompanyName());
- sb.append(", "); //NOI18N
- sb.append(branchOffice.getBranchStreet());
- sb.append(" "); //NOI18N
- sb.append(branchOffice.getBranchHouseNumber());
- sb.append(", "); //NOI18N
- sb.append(branchOffice.getBranchCountry().getCountryCode());
- sb.append(" "); //NOI18N
- sb.append(branchOffice.getBranchZipCode());
- sb.append(" "); //NOI18N
- sb.append(branchOffice.getBranchCity());
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the contact's personal title, family name and name. If null is
- * provided, an empty string is returned.
- * <p>
- * @param contact Contact instance
- * <p>
- * @return Contact's full name
- */
- public String renderContact (final Contact contact) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(20);
-
- // Is contact set?
- if (contact instanceof Contact) {
- // Then create name
- sb.append(this.getMessageFromBundle(contact.getContactPersonalTitle().getMessageKey()));
- sb.append(" "); //NOI18N
- sb.append(contact.getContactFirstName());
- sb.append(" "); //NOI18N
- sb.append(contact.getContactFamilyName());
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the department's name and name of assigned company. If null is
- * provided, an empty string is returned.
- * <p>
- * @param department Department instance
- * <p>
- * @return Department's full name
- */
- public String renderDepartment (final Department department) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(10);
-
- // Is a department set?
- if (department instanceof Department) {
- // Then create name
- sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey()));
- sb.append(" ("); //NOI18N
- sb.append(department.getDepartmentCompany().getCompanyName());
- sb.append(")"); //NOI18N
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the employee's number, personal title, family name and name if
- * available. If null is provided, an empty string is returned.
- * <p>
- * @param employee Employable instance
- <p>
- * @return Contact's full name
- */
- public String renderEmployee (final Employable employee) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(20);
-
- // Is employee set?
- if (employee instanceof Employable) {
- // Then create name
- sb.append(employee.getEmployeeNumber());
-
- // Is a department found?
- if (employee.getEmployeeDepartment() instanceof Department) {
- // Then add it's name to it
- sb.append(" ("); //NOI18N
- sb.append(this.renderDepartment(employee.getEmployeeDepartment()));
- sb.append(")"); //NOI18N
- }
-
- // Is contact data found?
- if (employee.getEmployeePersonalData() instanceof Contact) {
- // Yes, then render it
- final String contactName = this.renderContact(employee.getEmployeePersonalData());
-
- // Is it given?
- if (contactName != null) {
- // Then add it
- sb.append(" ("); //NOI18N
- sb.append(contactName);
- sb.append(")"); //NOI18N
- }
- }
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the product name and price. If null is provided, an empty string
- * is returned.
- * <p>
- * @param product Product instance
- * <p>
- * @return Product name
- */
- public String renderGenericProduct (final Product product) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(10);
-
- // Is a product set?
- if (product instanceof Product) {
- // Add name and price
- sb.append(this.getMessageFromBundle(product.getProductI18nKey()));
- sb.append(" ("); //NOI18N
- sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice()));
- sb.append(" "); //NOI18N
- sb.append(product.getProductCurrencyCode());
- sb.append(")"); //NOI18N
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the headquarter address. If null is provided, an empty string is
- * returned.
- * <p>
- * @param headquarter Headquarter instance
- * <p>
- * @return Headquarter address
- */
- public String renderHeadquarter (final Headquarter headquarter) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(10);
-
- // Is a headquarter set?
- if (headquarter instanceof Headquarter) {
- // Then create name
- sb.append(headquarter.getHeadquarterStreet());
- sb.append(" "); //NOI18N
- sb.append(headquarter.getHeadquarterHouseNumber());
-
- // Is store/suite number set?
- if (headquarter.getHeadquarterStore() instanceof Short) {
- sb.append(" ("); //NOI18N
- sb.append(this.getMessageFromBundle("DATA_STORE")); //NOI18N
- sb.append(" "); //NOI18N
- sb.append(headquarter.getHeadquarterStore());
- sb.append(", "); //NOI18N
- sb.append(this.getMessageFromBundle("DATA_SUITE_NUMBER")); //NOI18N
- sb.append(" "); //NOI18N
- sb.append(headquarter.getHeadquarterSuiteNumber());
- sb.append(")"); //NOI18N
- }
-
- // Continue with country, ZIP code and city
- sb.append(", "); //NOI18N
- sb.append(headquarter.getHeadquarterCountry().getCountryCode());
- sb.append(" "); //NOI18N
- sb.append(headquarter.getHeadquarterZipCode());
- sb.append(" "); //NOI18N
- sb.append(headquarter.getHeadquarterCity());
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the product name and price. If null is provided, an empty string
- * is returned.
- * <p>
- * @param product Product instance
- * <p>
- * @return Product name
- */
- public String 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.
- * <p>
- * @param receipt Receipt instance
- * <p>
- * @return Product name
- */
- public String renderReceipt (final BillableReceipt receipt) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(10);
-
- // Is receipt set?
- if (receipt instanceof BillableReceipt) {
- // Add relevant data
- sb.append(this.getMessageFromBundle("RECEIPT_ISSUED")).append(" "); //NOI18N
- sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getI18nKey()));
-
- // Is receipt number included?
- if (receipt.getReceiptNumber() !=null) {
- // Append it
- sb.append(", ").append(this.getMessageFromBundle("RECEIPT_NUMBER")).append(" "); //NOI18N
- sb.append(receipt.getReceiptNumber());
- }
-
- // Add company (over branch office)
- sb.append(" ("); //NOI18N
- sb.append(receipt.getReceiptBranchOffice().getBranchCompany().getCompanyName());
- sb.append(")"); //NOI18N
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Returns the user's personal title, family name and name. If null is
- * provided, an empty string is returned.
- * <p>
- * @param user User instance
- * <p>
- * @return User's full name
- */
- public String renderUser (final User user) {
- // Default is empty string, so let's get started
- final StringBuilder sb = new StringBuilder(20);
-
- // Is user given?
- if (user instanceof User) {
- // Add user name first
- sb.append(user.getUserName());
- sb.append(" ("); //NOI18N
-
- // Add contact data
- sb.append(this.renderContact(user.getUserContact()));
-
- // Close brace
- sb.append(")"); //NOI18N
- }
-
- // Return it
- return sb.toString();
- }
-
- /**
- * Set's all given contact's phone instances: land-line, mobile and
- * faxNumber
- * <p>
- * @param contact Contact to set phone instances for
- */
- private void setPhoneInstances (final Contact contact) {
- // The contact must be valid
- if (null == contact) {
- // Throw NPE
- throw new NullPointerException("contact is null"); //NOI18N
- } else if (contact.getContactId() == null) {
- // Throw again ...
- throw new NullPointerException("contact.contactId is null"); //NOI18N
- } else if (contact.getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
- }
-
- // Is mobile set?
- if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
- // Yes, then set it in admin controller
- this.setMobileNumber(contact.getContactMobileNumber());
- }
-
- // Is land-line set?
- if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
- // Yes, then set it in admin controller
- this.setLandLineNumber(contact.getContactLandLineNumber());
- }
-
- // Is faxNumber set?
- if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
- // Yes, then set it in admin controller
- this.setFaxNumber(contact.getContactFaxNumber());
- }
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016 - 2018 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.helper;
-
-import java.io.Serializable;
-
-/**
- * An interface for general bean helper
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface JobsWebRequestHelperController extends Serializable {
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2018 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.helper;
+
+import java.text.DateFormat;
+import java.text.MessageFormat;
+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;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
+import org.mxchange.jcontacts.model.contact.Contact;
+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.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
+import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
+import org.mxchange.jjobs.model.receipt.BillableReceipt;
+import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
+import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.landline.created.CreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.landline.created.ObservableCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.mobile.created.CreatedMobileNumberEvent;
+import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
+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.jusercore.events.user.created.CreatedUserEvent;
+import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A general helper for beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("beanHelper")
+@ViewScoped
+public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHelperController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 17_258_793_567_145_701L;
+
+ /**
+ * Contact instance
+ */
+ private Contact contact;
+
+ /**
+ * Event for when a contact instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedContactEvent> contactCreatedEvent;
+
+ /**
+ * Fax number
+ */
+ private DialableFaxNumber faxNumber;
+
+ /**
+ * Event for when a fax number instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedFaxNumberEvent> faxNumberCreatedEvent;
+
+ /**
+ * Land-line number
+ */
+ private DialableLandLineNumber landLineNumber;
+
+ /**
+ * Event for when a land-line number instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedLandLineNumberEvent> landLineNumberCreatedEvent;
+
+ /**
+ * Localization controller
+ */
+ @Inject
+ private JobsLocalizationSessionController localizationController;
+
+ /**
+ * Mobile number
+ */
+ private DialableMobileNumber mobileNumber;
+
+ /**
+ * Event for when a mobile number instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedMobileNumberEvent> mobileNumberCreatedEvent;
+
+ /**
+ * User instance
+ */
+ private User user;
+
+ /**
+ * Regular user controller
+ */
+ @Inject
+ private JobsUserWebRequestController userController;
+
+ /**
+ * Event for when a user instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedUserEvent> userCreatedEvent;
+
+ /**
+ * Default constructor
+ */
+ public JobsWebViewHelperBean () {
+ // Call super constructor
+ super();
+ }
+
+ /**
+ * Getter for contact instance
+ * <p>
+ * @return Contact instance
+ */
+ public Contact getContact () {
+ return this.contact;
+ }
+
+ /**
+ * Setter for contact instance
+ * <p>
+ * @param contact Contact instance
+ */
+ public void setContact (final Contact contact) {
+ this.contact = contact;
+ }
+
+ /**
+ * Returns a message key depending on if this contact is a user and/or a
+ * contact. If this contact is unused, a default key is returned.
+ * <p>
+ * @param contact Contact instance to check
+ * <p>
+ * @return Message key
+ */
+ public String getContactUsageMessageKey (final Contact contact) {
+ // The contact must be valid
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("contact.contactId is null"); //NOI18N
+ } else if (contact.getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
+ }
+
+ // Default key is "unused"
+ String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
+
+ // Check user first
+ if (this.userController.isContactFound(contact)) {
+ // Only user
+ messageKey = "CONTACT_IS_USER"; //NOI18N
+ }
+
+ // Return message key
+ return messageKey;
+ }
+
+ /**
+ * Getter for dialable fax number
+ * <p>
+ * @return Dialable fax number
+ */
+ public DialableFaxNumber getFaxNumber () {
+ return this.faxNumber;
+ }
+
+ /**
+ * Setter for dialable fax number
+ * <p>
+ * @param faxNumber Dialable fax number
+ */
+ public void setFaxNumber (final DialableFaxNumber faxNumber) {
+ this.faxNumber = faxNumber;
+ }
+
+ /**
+ * Getter for dialable land-line number
+ * <p>
+ * @return Dialable land-line number
+ */
+ public DialableLandLineNumber getLandLineNumber () {
+ return this.landLineNumber;
+ }
+
+ /**
+ * Setter for dialable land-line number
+ * <p>
+ * @param landLineNumber Dialable land-line number
+ */
+ public void setLandLineNumber (final DialableLandLineNumber landLineNumber) {
+ this.landLineNumber = landLineNumber;
+ }
+
+ /**
+ * Getter for dialable mobile number
+ * <p>
+ * @return Dialable mobile number
+ */
+ public DialableMobileNumber getMobileNumber () {
+ return this.mobileNumber;
+ }
+
+ /**
+ * Setter for dialable mobile number
+ * <p>
+ * @param mobileNumber Dialable mobile number
+ */
+ public void setMobileNumber (final DialableMobileNumber mobileNumber) {
+ this.mobileNumber = mobileNumber;
+ }
+
+ /**
+ * Getter for user instance
+ * <p>
+ * @return User instance
+ */
+ public User getUser () {
+ return this.user;
+ }
+
+ /**
+ * Setter for user instance
+ * <p>
+ * @param user User instance
+ */
+ public void setUser (final User user) {
+ this.user = user;
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a contact id has been
+ * successfully converted to a Contact instance.
+ */
+ public void notifyControllerContactConverted () {
+ // Validate contact instance
+ if (this.getContact() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.contact is null"); //NOI18N
+ } else if (this.getContact().getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.contact.contactId is null"); //NOI18N
+ } else if (this.getContact().getContactId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId())); //NOI18N
+ }
+
+ // Set all phone instances
+ this.setPhoneInstances(this.getContact());
+
+ // Set all fields: user
+ this.contactCreatedEvent.fire(new CreatedContactEvent(this.getContact()));
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableFaxNumber instance.
+ */
+ public void notifyControllerFaxNumberConverted () {
+ // Validate fax instance
+ if (this.getFaxNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.faxNumber is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.faxNumber.phoneId is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneId={0} is not valid", this.getFaxNumber().getPhoneId())); //NOI18N
+ } else if (this.getFaxNumber().getPhoneAreaCode() == null) {
+ // Throw again
+ throw new NullPointerException("this.faxNumber.phoneAreaCode is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneAreaCode() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
+ } else if (this.getFaxNumber().getPhoneCountry() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.faxNumber.phoneCountry is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneCountry().getCountryId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.faxNumber.phoneCountry.countryId is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneCountry().getCountryId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneCountry.countryId={0} is invalid", this.getFaxNumber().getPhoneCountry().getCountryId())); //NOI18N
+ } else if (this.getFaxNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.faxNumber.phoneNumber is null"); //NOI18N
+ } else if (this.getFaxNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneNumber={0} is not valid", this.getFaxNumber().getPhoneNumber())); //NOI18N
+ }
+
+ // Fire event
+ this.faxNumberCreatedEvent.fire(new CreatedFaxNumberEvent(this.getFaxNumber()));
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableLandLineNumber instance.
+ */
+ public void notifyControllerLandLineNumberConverted () {
+ // Validate land-line instance
+ if (this.getLandLineNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.landLineNumber is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.landLineNumber.phoneId is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneId={0} is not valid", this.getLandLineNumber().getPhoneId())); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneAreaCode() == null) {
+ // Throw again
+ throw new NullPointerException("this.landLineNumber.phoneAreaCode is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneAreaCode() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneCountry() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.landLineNumber.phoneCountry is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.landLineNumber.phoneCountry.countryId is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneCountry.countryId={0} is invalid", this.getLandLineNumber().getPhoneCountry().getCountryId())); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.landLineNumber.phoneNumber is null"); //NOI18N
+ } else if (this.getLandLineNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneNumber={0} is not valid", this.getLandLineNumber().getPhoneNumber())); //NOI18N
+ }
+
+ // Fire event
+ this.landLineNumberCreatedEvent.fire(new CreatedLandLineNumberEvent(this.getLandLineNumber()));
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a phone id has been
+ * successfully converted to a DialableMobileNumber instance.
+ */
+ public void notifyControllerMobileNumberConverted () {
+ // Validate mobile instance
+ if (this.getMobileNumber() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.mobileNumber is null"); //NOI18N
+ } else if (this.getMobileNumber().getPhoneId() == null) {
+ // Throw again
+ throw new NullPointerException("this.mobileNumber.phoneId is null"); //NOI18N
+ } else if (this.getMobileNumber().getPhoneId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneId={0} is not valid", this.getMobileNumber().getPhoneId())); //NOI18N
+ } else if (this.getMobileNumber().getMobileProvider() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.mobileNumber.mobileProvider is null"); //NOI18N
+ } else if (this.getMobileNumber().getMobileProvider().getProviderId() == null) {
+ // ... throw again
+ throw new NullPointerException("this.mobileNumber.mobileProvider.providerId is null"); //NOI18N
+ } else if (this.getMobileNumber().getMobileProvider().getProviderId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.mobileProvider.providerId={0} is invalid", this.getMobileNumber().getMobileProvider().getProviderId())); //NOI18N
+ } else if (this.getMobileNumber().getPhoneNumber() == null) {
+ // Throw NPE again ...
+ throw new NullPointerException("this.mobileNumber.phoneNumber is null"); //NOI18N
+ } else if (this.getMobileNumber().getPhoneNumber() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneNumber={0} is not valid", this.getMobileNumber().getPhoneNumber())); //NOI18N
+ }
+
+ // Fire event
+ this.mobileNumberCreatedEvent.fire(new CreatedMobileNumberEvent(this.getMobileNumber()));
+ }
+
+ /**
+ * Notifies other controllers (backing beans) if a user id has been
+ * successfully converted to a User instance.
+ */
+ public void notifyControllerUserConverted () {
+ // Validate user instance
+ if (this.getUser() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.user is null"); //NOI18N
+ } else if (this.getUser().getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.user.userId is null"); //NOI18N
+ } else if (this.getUser().getUserId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId())); //NOI18N
+ }
+
+ // Get contact
+ final Contact userContact = this.getUser().getUserContact();
+
+ // Set contact here, too. This avoids parameters that cannot auto-complete in IDEs.
+ this.setContact(userContact);
+
+ // Set all phone instances
+ this.setPhoneInstances(userContact);
+
+ // Fire event
+ this.userCreatedEvent.fire(new CreatedUserEvent(this.getUser()));
+ }
+
+ /**
+ * Renders data of basic company data
+ * <p>
+ * @param basicData Basic company data instance
+ * <p>
+ * @return Basic company data as string
+ */
+ public String renderBasicData (final BasicData basicData) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(30);
+
+ // Is basic company data set?
+ if (basicData instanceof BasicData) {
+ // Add company name
+ sb.append(basicData.getCompanyName()); //NOI18N
+
+ // Is email address set?
+ if (basicData.getCompanyEmailAddress() != null) {
+ // Add it
+ sb.append(", ").append(basicData.getCompanyEmailAddress()); //NOI18N
+ }
+
+ // Is tax number set?
+ if (basicData.getCompanyTaxNumber() != null) {
+ // Add it
+ sb.append(", ").append(basicData.getCompanyTaxNumber()); //NOI18N
+ }
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the branch office's full address. If null is provided, an empty
+ * string is returned.
+ * <p>
+ * @param branchOffice Branch office instance
+ * <p>
+ * @return Branch office's address
+ */
+ public String renderBranchOffice (final BranchOffice branchOffice) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(30);
+
+ // Is a branch office instance given?
+ if (branchOffice instanceof BranchOffice) {
+ // This should not happen:
+ assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N
+
+ // Yes, then append all data
+ sb.append(branchOffice.getBranchCompany().getCompanyName());
+ sb.append(", "); //NOI18N
+ sb.append(branchOffice.getBranchStreet());
+ sb.append(" "); //NOI18N
+ sb.append(branchOffice.getBranchHouseNumber());
+ sb.append(", "); //NOI18N
+ sb.append(branchOffice.getBranchCountry().getCountryCode());
+ sb.append(" "); //NOI18N
+ sb.append(branchOffice.getBranchZipCode());
+ sb.append(" "); //NOI18N
+ sb.append(branchOffice.getBranchCity());
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the contact's personal title, family name and name. If null is
+ * provided, an empty string is returned.
+ * <p>
+ * @param contact Contact instance
+ * <p>
+ * @return Contact's full name
+ */
+ public String renderContact (final Contact contact) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(20);
+
+ // Is contact set?
+ if (contact instanceof Contact) {
+ // Then create name
+ sb.append(this.getMessageFromBundle(contact.getContactPersonalTitle().getMessageKey()));
+ sb.append(" "); //NOI18N
+ sb.append(contact.getContactFirstName());
+ sb.append(" "); //NOI18N
+ sb.append(contact.getContactFamilyName());
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the department's name and name of assigned company. If null is
+ * provided, an empty string is returned.
+ * <p>
+ * @param department Department instance
+ * <p>
+ * @return Department's full name
+ */
+ public String renderDepartment (final Department department) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(10);
+
+ // Is a department set?
+ if (department instanceof Department) {
+ // Then create name
+ sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey()));
+ sb.append(" ("); //NOI18N
+ sb.append(department.getDepartmentCompany().getCompanyName());
+ sb.append(")"); //NOI18N
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the employee's number, personal title, family name and name if
+ * available. If null is provided, an empty string is returned.
+ * <p>
+ * @param employee Employable instance
+ * <p>
+ * @return Contact's full name
+ */
+ public String renderEmployee (final Employable employee) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(20);
+
+ // Is employee set?
+ if (employee instanceof Employable) {
+ // Then create name
+ sb.append(employee.getEmployeeNumber());
+
+ // Is a department found?
+ if (employee.getEmployeeDepartment() instanceof Department) {
+ // Then add it's name to it
+ sb.append(" ("); //NOI18N
+ sb.append(this.renderDepartment(employee.getEmployeeDepartment()));
+ sb.append(")"); //NOI18N
+ }
+
+ // Is contact data found?
+ if (employee.getEmployeePersonalData() instanceof Contact) {
+ // Yes, then render it
+ final String contactName = this.renderContact(employee.getEmployeePersonalData());
+
+ // Is it given?
+ if (contactName != null) {
+ // Then add it
+ sb.append(" ("); //NOI18N
+ sb.append(contactName);
+ sb.append(")"); //NOI18N
+ }
+ }
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the headquarter address. If null is provided, an empty string is
+ * returned.
+ * <p>
+ * @param headquarter Headquarter instance
+ * <p>
+ * @return Headquarter address
+ */
+ public String renderHeadquarter (final Headquarter headquarter) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(10);
+
+ // Is a headquarter set?
+ if (headquarter instanceof Headquarter) {
+ // Then create name
+ sb.append(headquarter.getHeadquarterStreet());
+ sb.append(" "); //NOI18N
+ sb.append(headquarter.getHeadquarterHouseNumber());
+
+ // Is store/suite number set?
+ if (headquarter.getHeadquarterStore() instanceof Short) {
+ sb.append(" ("); //NOI18N
+ sb.append(this.getMessageFromBundle("DATA_STORE")); //NOI18N
+ sb.append(" "); //NOI18N
+ sb.append(headquarter.getHeadquarterStore());
+ sb.append(", "); //NOI18N
+ sb.append(this.getMessageFromBundle("DATA_SUITE_NUMBER")); //NOI18N
+ sb.append(" "); //NOI18N
+ sb.append(headquarter.getHeadquarterSuiteNumber());
+ sb.append(")"); //NOI18N
+ }
+
+ // Continue with country, ZIP code and city
+ sb.append(", "); //NOI18N
+ sb.append(headquarter.getHeadquarterCountry().getCountryCode());
+ sb.append(" "); //NOI18N
+ sb.append(headquarter.getHeadquarterZipCode());
+ sb.append(" "); //NOI18N
+ sb.append(headquarter.getHeadquarterCity());
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the receipt. If null is provided, an empty string is returned.
+ * <p>
+ * @param receipt Receipt instance
+ * <p>
+ * @return Product name
+ */
+ public String renderReceipt (final BillableReceipt receipt) {
+ // Default is empty string, so let's get started
+ 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) {
+ // Append it
+ sb.append(", ").append(this.getMessageFromBundle("RECEIPT_NUMBER")).append(" "); //NOI18N
+ sb.append(receipt.getReceiptNumber());
+ }
+
+ // Add company (over branch office)
+ sb.append(" ("); //NOI18N
+ sb.append(receipt.getReceiptBranchOffice().getBranchCompany().getCompanyName());
+ sb.append(")"); //NOI18N
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Returns the user's personal title, family name and name. If null is
+ * provided, an empty string is returned.
+ * <p>
+ * @param user User instance
+ * <p>
+ * @return User's full name
+ */
+ public String renderUser (final User user) {
+ // Default is empty string, so let's get started
+ final StringBuilder sb = new StringBuilder(20);
+
+ // Is user given?
+ if (user instanceof User) {
+ // Add user name first
+ sb.append(user.getUserName());
+ sb.append(" ("); //NOI18N
+
+ // Add contact data
+ sb.append(this.renderContact(user.getUserContact()));
+
+ // Close brace
+ sb.append(")"); //NOI18N
+ }
+
+ // Return it
+ return sb.toString();
+ }
+
+ /**
+ * Set's all given contact's phone instances: land-line, mobile and
+ * faxNumber
+ * <p>
+ * @param contact Contact to set phone instances for
+ */
+ private void setPhoneInstances (final Contact contact) {
+ // The contact must be valid
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("contact.contactId is null"); //NOI18N
+ } else if (contact.getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
+ }
+
+ // Is mobile set?
+ if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
+ // Yes, then set it in admin controller
+ this.setMobileNumber(contact.getContactMobileNumber());
+ }
+
+ // Is land-line set?
+ if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+ // Yes, then set it in admin controller
+ this.setLandLineNumber(contact.getContactLandLineNumber());
+ }
+
+ // Is faxNumber set?
+ if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
+ // Yes, then set it in admin controller
+ this.setFaxNumber(contact.getContactFaxNumber());
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2018 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.helper;
+
+import java.io.Serializable;
+
+/**
+ * An interface for general bean helper
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsWebViewHelperController extends Serializable {
+
+}
* dial-prefix and country combination is done, if found, an exception is
* thrown. A redirect should take place after successfull creation.
* <p>
- * @return Redirect outcome
- * <p>
* @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
// Fire event
this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider));
-
- // Redirect to list
- return "admin_list_mobile_provider"; //NOI18N
}
/**
/**
* Deletes given fax entry data
* <p>
- * @return Redirect outcome
*/
- public String deleteFaxData () {
+ public void deleteFaxData () {
// Get fax number from bean helper
DialableFaxNumber number = this.createFaxNumber();
// Fire event
this.faxNumberDeletedEvent.fire(new AdminFaxNumberDeletedEvent(number));
-
- // All fine, redirect
- return "admin_list_fax"; //NOI18N
}
/**
* Deletes given land-line entry data
- * <p>
- * @return Redirect outcome
*/
- public String deleteLandLineData () {
+ public void deleteLandLineData () {
// Get land-line number from helper
DialableLandLineNumber number = this.createLandLineNumber();
// Fire event
this.landLineNumberDeletedEvent.fire(new AdminLandLineNumberDeletedEvent(number));
-
- // All fine, redirect
- return "admin_list_landline"; //NOI18N
}
/**
* Deletes given mobile entry data
- * <p>
- * @return Redirect outcome
*/
- public String deleteMobileData () {
+ public void deleteMobileData () {
// Get mobile number from helper
DialableMobileNumber number = this.createMobileNumber();
// Fire event
this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(number));
-
- // All fine, redirect
- return "admin_list_mobile"; //NOI18N
}
/**
* 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.
* <p>
- * @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
this.setUserPasswordRepeat(null);
// Skip it
- return ""; //NOI18N
+ return;
}
try {
// Clear this bean
this.clear();
-
- // Return to user list (for now)
- return "admin_list_user"; //NOI18N
}
/**
/**
* Deletes given user account
- * <p>
- * @return Redirect outcome
*/
- public String deleteUserData () {
+ public void deleteUserData () {
// Is the user instance valid and CONFIRMED?
if (this.getUser() == null) {
// Throw NPE
// 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.
- * <p>
- * @return Redirect outcome
*/
- public String editUserData () {
+ public void editUserData () {
// Null password means not setting it
String encryptedPassword = null;
// 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())))) {
// Same password entered
this.showFacesMessage("form_edit_user:userPassword", "ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD"); //NOI18N
- return ""; //NOI18N
+ return;
}
// Encrypt password
// Fire event
this.updatedUserDataEvent.fire(new AdminUpdatedUserDataEvent(updatedUser));
-
- // Return to user list (for now)
- return "admin_list_user"; //NOI18N
}
/**
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
/**
* 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?
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
/**
* 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
// 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
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
/**
* 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
// 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?