From 16c517e78c186ed0ff9d891e6da4e115915a0621 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 9 Apr 2016 19:54:37 +0200 Subject: [PATCH] This "Pizza-Service" application was build on an outdated core, as it was not required for my certification to have user login. Sure, in the open Internet it makes sense. This rewrites the application towards an updated "core". --- lib/juser-core.jar | Bin 0 -> 38957 bytes lib/juser-lib.jar | Bin 0 -> 5111 bytes nbproject/build-impl.xml | 4 + nbproject/genfiles.properties | 4 +- nbproject/project.properties | 6 + nbproject/project.xml | 8 + .../PizzaCountryWebApplicationBean.java | 2 +- .../login/PizzaUserLoginWebSessionBean.java | 221 +++++ .../PizzaUserLoginWebSessionController.java | 106 ++ .../beans/user/PizzaUserWebSessionBean.java | 914 ++++++++++++++++++ .../user/PizzaUserWebSessionController.java | 516 ++++++++++ .../country/PizzaCountryConverter.java | 4 +- .../PizzaSmsProviderConverter.java | 4 +- .../converter/user/PizzaUserConverter.java | 8 +- 14 files changed, 1786 insertions(+), 11 deletions(-) create mode 100644 lib/juser-core.jar create mode 100644 lib/juser-lib.jar create mode 100644 src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java rename src/java/org/mxchange/{pizzaservice => pizzaapplication}/converter/country/PizzaCountryConverter.java (96%) rename src/java/org/mxchange/{pizzaservice => pizzaapplication}/converter/smsprovider/PizzaSmsProviderConverter.java (95%) rename src/java/org/mxchange/{pizzaservice => pizzaapplication}/converter/user/PizzaUserConverter.java (91%) diff --git a/lib/juser-core.jar b/lib/juser-core.jar new file mode 100644 index 0000000000000000000000000000000000000000..5d51db160dd34f57e4396d21845d8b83d6ca675d GIT binary patch literal 38957 zcmeHw3w&HxdFOXW8r{+8TC!x>^4nv_u`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EJ%pW_^usL=BV=}c^g#J?PZXC=2q iTLND-!*MfFHFq1SjXh-_b?cbihT(h62KQ)Ug?|A#|DsX= literal 0 HcmV?d00001 diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 1b0a0d39..e18a9a08 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -1038,6 +1038,8 @@ exists or setup the property manually. For example like this: + + @@ -1057,6 +1059,8 @@ exists or setup the property manually. For example like this: + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 9d44227b..e395beb3 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=82213886 build.xml.stylesheet.CRC32=651128d4@1.68.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=10a373e0 -nbproject/build-impl.xml.script.CRC32=f7d4e4e8 +nbproject/build-impl.xml.data.CRC32=0accf525 +nbproject/build-impl.xml.script.CRC32=2d3389c2 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.75.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 9ed25a58..371d9295 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -49,6 +49,8 @@ file.reference.jphone-core.jar=lib/jphone-core.jar file.reference.jphone-lib.jar=lib/jphone-lib.jar file.reference.jshop-core.jar=lib/jshop-core.jar file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.jar +file.reference.juser-core.jar=lib/juser-core.jar +file.reference.juser-lib.jar=lib/juser-lib.jar includes=** j2ee.compile.on.save=true j2ee.copy.static.files.on.save=true @@ -71,6 +73,8 @@ javac.classpath=\ ${file.reference.jphone-core.jar}:\ ${file.reference.jphone-lib.jar}:\ ${file.reference.jcontacts-core.jar}:\ + ${file.reference.juser-core.jar}:\ + ${file.reference.juser-lib.jar}:\ ${file.reference.jcustomer-core.jar}:\ ${file.reference.jcustomer-lib.jar}:\ ${file.reference.jshop-core.jar}:\ @@ -129,6 +133,8 @@ source.reference.jphone-core.jar=../jphone-core/src/ source.reference.jphone-lib.jar=../jphone-lib/src/ source.reference.jshop-core.jar=../jshop-core/src/ source.reference.jshop-ee-lib.jar=../jshop-ee-lib/src/ +source.reference.juser-core.jar=../juser-core/src/ +source.reference.juser-lib.jar=../juser-lib/src/ source.root=src src.dir=${source.root}/java test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml index 73eb585e..732fba55 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -38,6 +38,14 @@ ${file.reference.jcontacts-core.jar} WEB-INF/lib + + ${file.reference.juser-core.jar} + WEB-INF/lib + + + ${file.reference.juser-lib.jar} + WEB-INF/lib + ${file.reference.jcustomer-core.jar} WEB-INF/lib diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java index 3a761dc9..c63c393d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java @@ -62,7 +62,7 @@ public class PizzaCountryWebApplicationBean implements PizzaCountryWebApplicatio Context context = new InitialContext(); // Try to lookup the bean - this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N + this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/PizzaService-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N } catch (final NamingException ex) { // Continue to throw throw new FaceletException(ex); diff --git a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java new file mode 100644 index 00000000..79c3f00a --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.login; + +import java.util.Objects; +import javax.enterprise.context.SessionScoped; +import javax.enterprise.event.Event; +import javax.enterprise.inject.Any; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jusercore.container.login.LoginContainer; +import org.mxchange.jusercore.container.login.UserLoginContainer; +import org.mxchange.jusercore.events.login.UserLoggedInEvent; +import org.mxchange.jusercore.events.login.UserLoginEvent; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; +import org.mxchange.jusercore.exceptions.UserStatusLockedException; +import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; +import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserUtils; +import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; +import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController; + +/** + * A web bean for user registration + *

+ * @author Roland Haeder + */ +@Named ("loginController") +@SessionScoped +public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionController { + + /** + * Serial number + */ + private static final long serialVersionUID = 47_828_986_719_691_592L; + + /** + * Current password + */ + private String currentPassword; + + /** + * Logged-in user instance + */ + private User loggedInUser; + + /** + * Remote register session bean + */ + private UserLoginSessionBeanRemote loginBean; + + /** + * Event fired when user has logged in + */ + @Inject + @Any + private Event loginEvent; + + /** + * Template type for pages that might be displayed in guest area and login + * area. Default is guest area. + */ + private String templateType = "guest"; //NOI18N + + /** + * User controller + */ + @Inject + private PizzaUserWebSessionController userController; + + /** + * Flag whether the user has logged-in, set only from inside + */ + private boolean userLoggedIn; + + /** + * Default constructor + */ + public PizzaUserLoginWebSessionBean () { + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.loginBean = (UserLoginSessionBeanRemote) context.lookup("java:global/PizzaService-ejb/login!org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } + + @Override + public String doLogin () { + // Get user instance + User user = this.userController.createUserInstance(); + + // Create login container + LoginContainer container = new UserLoginContainer(user, this.userController.getUserPassword()); + + try { + // Call bean + User confirmedUser = this.loginBean.validateUserAccountStatus(container); + + // All fine here so set it here + this.setLoggedInUser(confirmedUser); + + // Set template to "login" + this.setTemplateType("login"); //NOI18N + + // Fire event away. Keep this last before return statement. + this.loginEvent.fire(new UserLoginEvent(confirmedUser)); + + // All fine + return "login"; //NOI18N + } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException | UserPasswordMismatchException ex) { + // Throw again + throw new FaceletException(ex); + } + } + + @Override + public String getCurrentPassword () { + return this.currentPassword; + } + + @Override + public void setCurrentPassword (final String currentPassword) { + this.currentPassword = currentPassword; + } + + @Override + public User getLoggedInUser () { + return this.loggedInUser; + } + + @Override + public void setLoggedInUser (final User loggedInUser) { + this.loggedInUser = loggedInUser; + } + + @Override + public String getTemplateType () { + return this.templateType; + } + + @Override + public void setTemplateType (final String templateType) { + this.templateType = templateType; + } + + @Override + public boolean ifCurrentPasswordMatches () { + // The current password must be set and not empty + if (this.getCurrentPassword() == null) { + // Is not set + throw new NullPointerException("this.currentPassword is null"); //NOI18N + } else if (this.getCurrentPassword().isEmpty()) { + // Is set empty + throw new IllegalStateException("this.currentPassword is empty."); //NOI18N + } + + // Create "container" + LoginContainer container = new UserLoginContainer(this.getLoggedInUser(), this.getCurrentPassword()); + + // Now check if it matches + return UserUtils.ifPasswordMatches(container, this.getLoggedInUser()); + } + + @Override + public boolean isGuest () { + return (!this.isUserLoggedIn()); + } + + @Override + public boolean isInvisible () { + // Check on login + if (!this.isUserLoggedIn()) { + // Not logged in! + throw new IllegalStateException("isInvisible() has been invoked for a guest."); //NOI18N + } + + // Check logged-in first, then invisibility + return this.getLoggedInUser().getUserProfileMode().equals(ProfileMode.INVISIBLE); + } + + @Override + public boolean isUserLoggedIn () { + // Trace message + // NOISY: System.out.println(MessageFormat.format("PizzaUserLoginWebSessionBean:isUserLoggedIn: this.loggedInUser={0},this.templateType={1} - CALLED!", this.getLoggedInUser(), this.getTemplateType())); + + // Compare instance + this.userLoggedIn = ((this.getLoggedInUser() instanceof User) && (Objects.equals(this.getLoggedInUser().getUserAccountStatus(), UserAccountStatus.CONFIRMED))); + + // Trace message + // NOISY: System.out.println(MessageFormat.format("PizzaUserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn)); + + // Return it + return this.userLoggedIn; + } +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java new file mode 100644 index 00000000..c8ec08ac --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.login; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for registration web controllers + *

+ * @author Roland Haeder + */ +public interface PizzaUserLoginWebSessionController extends Serializable { + + /** + * Getter for template type + *

+ * @return Template type + */ + String getTemplateType (); + + /** + * Setter for template type + *

+ * @param templateType Template type + */ + void setTemplateType (final String templateType); + + /** + * Logins the user, if the account is found, confirmed and unlocked. + *

+ * @return Redirect target + */ + String doLogin (); + + /** + * Getter for logged-in user instance + *

+ * @return Logged-in user instance + */ + User getLoggedInUser (); + + /** + * Setter for logged-in user instance + *

+ * @param loggedInUser Logged-in user instance + */ + void setLoggedInUser (final User loggedInUser); + + /** + * Checks whether the user is logged-in + *

+ * @return Whether the user is logged-in + */ + boolean isUserLoggedIn (); + + /** + * Is this truly a guest? + *

+ * @return Whether the user is truly a guest + */ + boolean isGuest (); + + /** + * Whether the currently logged-in user is invisible + *

+ * @return Whether the currently logged-in user is invisible + */ + boolean isInvisible (); + + /** + * Setter for current password (clear text) + *

+ * @param currentPassword Current password + */ + void setCurrentPassword (final String currentPassword); + + /** + * Getter for current password (clear text) + *

+ * @return Current password + */ + String getCurrentPassword (); + + /** + * Checks whether the (previously entered) current password matches with from + * the user instance. + *

+ * @return If current password matches + */ + boolean ifCurrentPasswordMatches (); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java new file mode 100644 index 00000000..a71bd4c8 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java @@ -0,0 +1,914 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.user; + +import java.text.MessageFormat; +import java.util.Collections; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.enterprise.event.Observes; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.UserContact; +import org.mxchange.jcontacts.contact.gender.Gender; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.fax.FaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; +import org.mxchange.jusercore.events.login.UserLoggedInEvent; +import org.mxchange.jusercore.events.registration.UserRegisteredEvent; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.model.user.LoginUser; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserSessionBeanRemote; +import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; +import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController; + +/** + * A user bean (controller) + *

+ * @author Roland Haeder + */ +@Named ("userController") +@SessionScoped +public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { + + /** + * Serial number + */ + private static final long serialVersionUID = 542_145_347_916L; + + /////////////////////// Properties ///////////////////// + /** + * Birth day + */ + private Date birthday; + + /** + * Cellphone number's carrier + */ + private SmsProvider cellphoneCarrier; + + /** + * Cellphone number + */ + private Long cellphoneNumber; + + /** + * City + */ + private String city; + + /** + * Optional comments + */ + private String comment; + + /** + * Country instance + */ + private Country country; + + /** + * Email address + */ + private String emailAddress; + + /** + * Email address 1 (changing) + */ + private String emailAddress1; + + /** + * Email address 2 (repeat in changing) + */ + private String emailAddress2; + + /** + * Email address list + */ + private List emailAddressList; + + /** + * Email address repeated + */ + private String emailAddressRepeat; + + /** + * Family name + */ + private String familyName; + + /** + * Fax number's area code + */ + private Integer faxAreaCode; + + /** + * Country instance for fax number + */ + private Country faxCountry; + + /** + * Fax number + */ + private Long faxNumber; + + /** + * First name + */ + private String firstName; + + /** + * Gender instance + */ + private Gender gender; + + /** + * House number + */ + private Short houseNumber; + + /** + * Login bean (controller) + */ + @Inject + private PizzaUserLoginWebSessionController loginController; + + /** + * Phone number area code + */ + private Integer phoneAreaCode; + + /** + * Country instance for phone number + */ + private Country phoneCountry; + + /** + * Phone number + */ + private Long phoneNumber; + + /** + * Street + */ + private String street; + + /** + * Remote user bean + */ + private final UserSessionBeanRemote userBean; + + /** + * User id + */ + private Long userId; + + /** + * User name + */ + private String userName; + + /** + * User name list + */ + private List userNameList; + + /** + * User password (unencrypted from web form) + */ + private String userPassword; + + /** + * User password repeated (unencrypted from web form) + */ + private String userPasswordRepeat; + + /** + * Whether the user wants a public profile + */ + private ProfileMode userProfileMode; + + /** + * A list of all public user profiles + */ + private List visibleUserList; + + /** + * ZIP code + */ + private Integer zipCode; + + /** + * Default constructor + */ + public PizzaUserWebSessionBean () { + // Set gender to UNKNOWN + this.gender = Gender.UNKNOWN; + + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.userBean = (UserSessionBeanRemote) context.lookup("java:global/PizzaService-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + } + + @Override + public void afterRegistrationEvent (final @Observes UserRegisteredEvent event) { + // Trace message + System.out.println(MessageFormat.format("UserWebBean:afterRegistration: event={0} - CALLED!", event)); //NOI18N + + // event should not be null + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getUser() == null) { + // Throw NPE again + throw new NullPointerException("event.user is null"); //NOI18N + } else if (event.getUser().getUserId() == null) { + // userId is null + throw new NullPointerException("event.user.userId is null"); //NOI18N + } else if (event.getUser().getUserId() < 1) { + // Not avalid id + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N + } + + // Get user instance + User registeredUser = event.getUser(); + + // Debug message + System.out.println(MessageFormat.format("UserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N + + // Copy all data from registered->user + this.copyUser(registeredUser); + + // Add user name and email address + this.addUserNameEmailAddress(registeredUser); + + // Clear all data + this.clearData(); + + // Set user id again + this.setUserId(registeredUser.getUserId()); + + // Is the account public? + if (registeredUser.getUserProfileMode().equals(ProfileMode.PUBLIC)) { + // Also add it to this list + this.visibleUserList.add(registeredUser); + } + + // Trace message + System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N + } + + @Override + public void afterUserLogin (final @Observes UserLoggedInEvent event) { + // Trace message + System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N + + // event should not be null + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getUser() == null) { + // Throw NPE again + throw new NullPointerException("event.user is null"); //NOI18N + } else if (event.getUser().getUserId() == null) { + // userId is null + throw new NullPointerException("event.user.userId is null"); //NOI18N + } else if (event.getUser().getUserId() < 1) { + // Not avalid id + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N + } + + // Re-initialize list + this.visibleUserList = this.userBean.allMemberPublicVisibleUsers(); + + // Copy all data to this bean + this.copyUser(event.getUser()); + + // Trace message + System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N + } + + @Override + public List allVisibleUsers () { + // Return it + return Collections.unmodifiableList(this.visibleUserList); + } + + @Override + public User createUserInstance () { + // User message + //this.getLogger().logTrace("createUserInstance: CALLED!"); + + // Required personal data must be set + assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N + + // Create new user instance + User user = new LoginUser(); + user.setUserName(this.getUserName()); + user.setUserProfileMode(this.getUserProfileMode()); + user.setUserCreated(new GregorianCalendar()); + + // Generate phone number + DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber(), new GregorianCalendar()); + DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber(), new GregorianCalendar()); + DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber(), new GregorianCalendar()); + + // Create new contact + Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName()); + contact.setContactStreet(this.getStreet()); + contact.setContactHouseNumber(this.getHouseNumber()); + contact.setContactZipCode(this.getZipCode()); + contact.setContactCity(this.getCity()); + contact.setContactCountry(this.getCountry()); + contact.setContactEmailAddress(this.getEmailAddress()); + + // Don't set null or wrong references + if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) { + // Now the number must be given + if (phone.getPhoneAreaCode() == null) { + // Is null + throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N + } else if (phone.getPhoneAreaCode() < 1) { + // Abort here + throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N + } else if (phone.getPhoneNumber() == null) { + // Is null + throw new NullPointerException("phone.phoneNumber is null"); //NOI18N + } else if (phone.getPhoneNumber() < 1) { + // Abort here + throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N + } + + // Set phone number + contact.setContactLandLineNumber(phone); + } + + // Don't set null or wrong references + if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) { + // Now the number must be given + if (fax.getPhoneAreaCode() == null) { + // Is null + throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N + } else if (fax.getPhoneAreaCode() < 1) { + // Abort here + throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N + } else if (fax.getPhoneNumber() == null) { + // Is null + throw new NullPointerException("fax.phoneNumber is null"); //NOI18N + } else if (fax.getPhoneNumber() < 1) { + // Abort here + throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N + } + + // Set fax number + contact.setContactFaxNumber(fax); + } + + // Is the provider set? + if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof SmsProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) { + // Is the number set? + if (cellphone.getPhoneNumber() == null) { + // Is null + throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N + } else if (cellphone.getPhoneNumber() < 1) { + // Abort here + throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N + } + + // Set cellphone number + contact.setContactCellphoneNumber(cellphone); + } + + contact.setContactBirthday(this.getBirthday()); + contact.setContactComment(this.getComment()); + + // Created timestamp and ownContact + contact.setContactCreated(new GregorianCalendar()); + contact.setContactOwnContact(Boolean.TRUE); + + // Set contact in user + user.setUserContact(contact); + + // Trace message + //this.getLogger().logTrace(MessageFormat.format("createUserInstance: user={0} - EXIT!", user)); + // Return it + return user; + } + + @Override + public Date getBirthday () { + return this.birthday; + } + + @Override + public void setBirthday (final Date birthday) { + this.birthday = birthday; + } + + @Override + public SmsProvider getCellphoneCarrier () { + return this.cellphoneCarrier; + } + + @Override + public void setCellphoneCarrier (final SmsProvider cellphoneCarrier) { + this.cellphoneCarrier = cellphoneCarrier; + } + + @Override + public Long getCellphoneNumber () { + return this.cellphoneNumber; + } + + @Override + public void setCellphoneNumber (Long cellphoneNumber) { + this.cellphoneNumber = cellphoneNumber; + } + + @Override + public String getCity () { + return this.city; + } + + @Override + public void setCity (final String city) { + this.city = city; + } + + @Override + public String getComment () { + return this.comment; + } + + @Override + public void setComment (final String comment) { + this.comment = comment; + } + + @Override + public Country getCountry () { + return this.country; + } + + @Override + public void setCountry (final Country country) { + this.country = country; + } + + @Override + public String getEmailAddress () { + return this.emailAddress; + } + + @Override + public void setEmailAddress (final String emailAddress) { + this.emailAddress = emailAddress; + } + + @Override + public String getEmailAddress1 () { + return this.emailAddress1; + } + + @Override + public void setEmailAddress1 (final String emailAddress1) { + this.emailAddress1 = emailAddress1; + } + + @Override + public String getEmailAddress2 () { + return this.emailAddress2; + } + + @Override + public void setEmailAddress2 (final String emailAddress2) { + this.emailAddress2 = emailAddress2; + } + + @Override + public String getEmailAddressRepeat () { + return this.emailAddressRepeat; + } + + @Override + public void setEmailAddressRepeat (final String emailAddressRepeat) { + this.emailAddressRepeat = emailAddressRepeat; + } + + @Override + public String getFamilyName () { + return this.familyName; + } + + @Override + public void setFamilyName (final String familyName) { + this.familyName = familyName; + } + + @Override + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + @Override + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + @Override + public Country getFaxCountry () { + return this.faxCountry; + } + + @Override + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + @Override + public Long getFaxNumber () { + return this.faxNumber; + } + + @Override + public void setFaxNumber (final Long faxNumber) { + this.faxNumber = faxNumber; + } + + @Override + public String getFirstName () { + return this.firstName; + } + + @Override + public void setFirstName (final String firstName) { + this.firstName = firstName; + } + + @Override + public Gender getGender () { + return this.gender; + } + + @Override + public void setGender (final Gender gender) { + this.gender = gender; + } + + @Override + public Short getHouseNumber () { + return this.houseNumber; + } + + @Override + public void setHouseNumber (final Short houseNumber) { + this.houseNumber = houseNumber; + } + + @Override + public Integer getPhoneAreaCode () { + return this.phoneAreaCode; + } + + @Override + public void setPhoneAreaCode (final Integer phoneAreaCode) { + this.phoneAreaCode = phoneAreaCode; + } + + @Override + public Country getPhoneCountry () { + return this.phoneCountry; + } + + @Override + public void setPhoneCountry (final Country phoneCountry) { + this.phoneCountry = phoneCountry; + } + + @Override + public Long getPhoneNumber () { + return this.phoneNumber; + } + + @Override + public void setPhoneNumber (final Long phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public String getStreet () { + return this.street; + } + + @Override + public void setStreet (final String street) { + this.street = street; + } + + @Override + public Long getUserId () { + return this.userId; + } + + @Override + public void setUserId (final Long userId) { + this.userId = userId; + } + + @Override + public String getUserName () { + return this.userName; + } + + @Override + public void setUserName (final String userName) { + this.userName = userName; + } + + @Override + public String getUserPassword () { + return this.userPassword; + } + + @Override + public void setUserPassword (final String userPassword) { + this.userPassword = userPassword; + } + + @Override + public String getUserPasswordRepeat () { + return this.userPasswordRepeat; + } + + @Override + public void setUserPasswordRepeat (final String userPasswordRepeat) { + this.userPasswordRepeat = userPasswordRepeat; + } + + @Override + public ProfileMode getUserProfileMode () { + return this.userProfileMode; + } + + @Override + public void setUserProfileMode (final ProfileMode userProfileMode) { + this.userProfileMode = userProfileMode; + } + + @Override + public Integer getZipCode () { + return this.zipCode; + } + + @Override + public void setZipCode (final Integer zipCode) { + this.zipCode = zipCode; + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + // Get full user name list for reducing EJB calls + this.userNameList = this.userBean.getUserNameList(); + + // Get full email address list for reducing EJB calls + this.emailAddressList = this.userBean.getEmailAddressList(); + + // Is the user logged-in? + if (this.loginController.isUserLoggedIn()) { + // Is logged-in, so load also users visible to memebers + this.visibleUserList = this.userBean.allMemberPublicVisibleUsers(); + } else { + // Initialize user list + this.visibleUserList = this.userBean.allPublicUsers(); + } + } + + @Override + public boolean isEmailAddressRegistered (final User user) { + return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress()))); + } + + @Override + public boolean isRequiredPersonalDataSet () { + return ((this.getUserName() != null) && + (this.getUserProfileMode() != null) && + (this.getGender() != null) && + (this.getFirstName() != null) && + (this.getFamilyName() != null) && + (this.getStreet() != null) && + (this.getHouseNumber() != null) && + (this.getZipCode() != null) && + (this.getCity() != null) && + (this.getEmailAddress() != null) && + (this.getEmailAddressRepeat() != null) && + (this.getUserPassword() != null) && + (this.getUserPasswordRepeat() != null)); + } + + @Override + public boolean isRequiredChangePersonalDataSet () { + return ((this.getUserProfileMode() != null) && + (this.getGender() != null) && + (this.getFirstName() != null) && + (this.getFamilyName() != null) && + (this.getStreet() != null) && + (this.getHouseNumber() != null) && + (this.getZipCode() != null) && + (this.getCity() != null)); + } + + @Override + public boolean isSameEmailAddressEntered () { + return (Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat())); + } + + @Override + public boolean isSamePasswordEntered () { + return (Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())); + } + + @Override + public boolean isUserIdEmpty () { + return ((this.getUserId() == null) || (this.getUserId() == 0)); + } + + @Override + public boolean isUserNameRegistered (final User user) { + return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName()))); + } + + @Override + public boolean isVisibleUserFound () { + return ((this.visibleUserList instanceof List) && (this.visibleUserList.size() > 0)); + } + + @Override + public User lookupUserById (final Long userId) throws UserNotFoundException { + // Init variable + User user = null; + + // Try to lookup it in visible user list + for (final Iterator iterator = this.visibleUserList.iterator(); iterator.hasNext();) { + // Get next user + User next = iterator.next(); + + // Is the user id found? + if (Objects.equals(next.getUserId(), userId)) { + // Copy to other variable + user = next; + break; + } + } + + // Is it still null? + if (null == user) { + // Not visible for the current user + throw new UserNotFoundException(userId); + } + + // Return it + return user; + } + + /** + * Adds user's name and email address to bean's internal list. It also + * updates the public user list if the user has decided to ha } + *

+ * @param user User instance + */ + private void addUserNameEmailAddress (final User user) { + // Make sure the entry is not added yet + if (this.userNameList.contains(user.getUserName())) { + // Abort here + throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N + } else if (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress())) { + // Already added + throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N + } + + // Add user name + this.userNameList.add(user.getUserName()); + + // Add email addres + this.emailAddressList.add(user.getUserContact().getContactEmailAddress()); + } + + /** + * Clears all data in this bean + */ + private void clearData () { + // Clear all data + // - personal data + this.setUserId(null); + this.setGender(Gender.UNKNOWN); + this.setUserProfileMode(null); + this.setFirstName(null); + this.setFamilyName(null); + this.setStreet(null); + this.setHouseNumber(null); + this.setZipCode(null); + this.setCity(null); + this.setCountry(null); + + // - contact data + this.setEmailAddress(null); + this.setEmailAddressRepeat(null); + this.setPhoneAreaCode(null); + this.setCellphoneCarrier(null); + this.setFaxAreaCode(null); + + // - other data + this.setBirthday(null); + this.setComment(null); + this.setUserName(null); + this.setUserPassword(null); + this.setUserPasswordRepeat(null); + } + + /** + * Copies given user into the controller + *

+ * @param user User instance + */ + private void copyUser (final User user) { + // Copy all fields: + // - base data + this.setUserId(user.getUserId()); + this.setUserProfileMode(user.getUserProfileMode()); + this.setGender(user.getUserContact().getContactGender()); + this.setFirstName(user.getUserContact().getContactFirstName()); + this.setFamilyName(user.getUserContact().getContactFamilyName()); + this.setStreet(user.getUserContact().getContactStreet()); + this.setHouseNumber(user.getUserContact().getContactHouseNumber()); + this.setZipCode(user.getUserContact().getContactZipCode()); + this.setCity(user.getUserContact().getContactCity()); + this.setCountry(user.getUserContact().getContactCountry()); + + // Get cellphone, phone and fax instance + DialableCellphoneNumber cellphone = user.getUserContact().getContactCellphoneNumber(); + DialableFaxNumber fax = user.getUserContact().getContactFaxNumber(); + DialableLandLineNumber phone = user.getUserContact().getContactLandLineNumber(); + + // - contact data + if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) { + this.setPhoneCountry(phone.getPhoneCountry()); + this.setPhoneAreaCode(phone.getPhoneAreaCode()); + this.setPhoneNumber(phone.getPhoneNumber()); + } + if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof SmsProvider)) { + this.setCellphoneCarrier(cellphone.getCellphoneProvider()); + this.setCellphoneNumber(cellphone.getPhoneNumber()); + } + if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) { + this.setFaxCountry(fax.getPhoneCountry()); + this.setFaxAreaCode(fax.getPhoneAreaCode()); + this.setFaxNumber(fax.getPhoneNumber()); + } + this.setEmailAddress(user.getUserContact().getContactEmailAddress()); + + // -- other data + this.setBirthday(user.getUserContact().getContactBirthday()); + this.setComment(user.getUserContact().getContactComment()); + } +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java new file mode 100644 index 00000000..74b7d5b1 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.user; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import org.mxchange.jcontacts.contact.gender.Gender; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; +import org.mxchange.jusercore.events.login.UserLoggedInEvent; +import org.mxchange.jusercore.events.registration.UserRegisteredEvent; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; + +/** + * An interface for user beans + *

+ * @author Roland Haeder + */ +public interface PizzaUserWebSessionController extends Serializable { + + /** + * Tries to lookup user by given id number. If the user is not found or the + * account status is not CONFIRMED proper exceptions are thrown. + *

+ * @param userId User id + *

+ * @return User instance + *

+ * @throws UserNotFoundException If the user is not found + */ + User lookupUserById (final Long userId) throws UserNotFoundException; + + /** + * Event observer for new user registrations + *

+ * @param event User registration event + */ + void afterRegistrationEvent (final UserRegisteredEvent event); + + /** + * Event observer for logged-in user + *

+ * @param event Event instance + */ + void afterUserLogin (final UserLoggedInEvent event); + + /** + * All public user profiles + *

+ * @return A list of all public user profiles + */ + List allVisibleUsers (); + + /** + * Creates an instance from all properties + *

+ * @return A user instance + */ + User createUserInstance (); + + /** + * Getter for birth day + *

+ * @return Birth day + */ + Date getBirthday (); + + /** + * Setter for birth day + *

+ * @param birthday Birth day + */ + void setBirthday (final Date birthday); + + /** + * Getter for ellphone number's carrier + *

+ * @return Cellphone number's carrier + */ + SmsProvider getCellphoneCarrier (); + + /** + * Setter for cellphone number's carrier prefix + *

+ * @param cellphoneCarrier Cellphone number's carrier prefix + */ + void setCellphoneCarrier (final SmsProvider cellphoneCarrier); + + /** + * Getter for ellphone number + *

+ * @return Cellphone number + */ + Long getCellphoneNumber (); + + /** + * Setter for ellphone number + *

+ * @param cellphoneNumber Cellphone number + */ + void setCellphoneNumber (final Long cellphoneNumber); + + /** + * City + *

+ * @return the city + */ + String getCity (); + + /** + * City + *

+ * @param city the city to set + */ + void setCity (final String city); + + /** + * Getter for comments + *

+ * @return Comments + */ + String getComment (); + + /** + * Setter for comment + *

+ * @param comment Comments + */ + void setComment (final String comment); + + /** + * Getter for country instance + *

+ * @return Country instance + */ + Country getCountry (); + + /** + * Setter for country instance + *

+ * @param country Country instance + */ + void setCountry (final Country country); + + /** + * Getter for email address + *

+ * @return Email address + */ + String getEmailAddress (); + + /** + * Setter for email address + *

+ * @param emailAddress Email address + */ + void setEmailAddress (final String emailAddress); + + /** + * Getter for email address 1 (changing) + *

+ * @return Email address + */ + String getEmailAddress1 (); + + /** + * Setter for email address 1 (changing) + *

+ * @param emailAddress1 Email address 1 + */ + void setEmailAddress1 (final String emailAddress1); + + /** + * Getter for email address 2 (repeat changing) + *

+ * @return Email address 2 + */ + String getEmailAddress2 (); + + /** + * Setter for email address 2 (repeat changing) + *

+ * @param emailAddress2 Email address 2 + */ + void setEmailAddress2 (final String emailAddress2); + + /** + * Getter for email address, repeated + *

+ * @return the emailAddress, repeated + */ + String getEmailAddressRepeat (); + + /** + * Setter for email address repeated + *

+ * @param emailAddressRepeat the emailAddress to set + */ + void setEmailAddressRepeat (final String emailAddressRepeat); + + /** + * Family name + *

+ * @return the familyName + */ + String getFamilyName (); + + /** + * Family name + *

+ * @param familyName the familyName to set + */ + void setFamilyName (final String familyName); + + /** + * Getter for fax number's area code + *

+ * @return Fax number's area code + */ + Integer getFaxAreaCode (); + + /** + * Setter for fax number's area code + *

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

+ * @return Fax' country instance + */ + Country getFaxCountry (); + + /** + * Setter for fax's country instance + *

+ * @param faxCountry Fax' country instance + */ + void setFaxCountry (final Country faxCountry); + + /** + * Getter for fax number + *

+ * @return Fax number + */ + Long getFaxNumber (); + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + void setFaxNumber (final Long faxNumber); + + /** + * First name + *

+ * @return the first name + */ + String getFirstName (); + + /** + * First name + *

+ * @param firstName the first name to set + */ + void setFirstName (final String firstName); + + /** + * Gender of the contact + *

+ * @return the gender + */ + Gender getGender (); + + /** + * Gender of the contact + *

+ * @param gender the gender to set + */ + void setGender (final Gender gender); + + /** + * House number + *

+ * @return the houseNumber + */ + Short getHouseNumber (); + + /** + * House number + *

+ * @param houseNumber the houseNumber to set + */ + void setHouseNumber (final Short houseNumber); + + /** + * Getter for phone number's area code + *

+ * @return Phone number's area code + */ + Integer getPhoneAreaCode (); + + /** + * Setter for phone number's area code + *

+ * @param phoneAreaCode Phone number's area code + */ + void setPhoneAreaCode (final Integer phoneAreaCode); + + /** + * Getter for phone number's country instance + *

+ * @return Phone number's country instance + */ + Country getPhoneCountry (); + + /** + * Setter for phone number's country instance + *

+ * @param phoneCountry Phone number's country instance + */ + void setPhoneCountry (final Country phoneCountry); + + /** + * Getter for phone number + *

+ * @return Phone number + */ + Long getPhoneNumber (); + + /** + * Setter for phone number + *

+ * @param phoneNumber Phone number + */ + void setPhoneNumber (final Long phoneNumber); + + /** + * Street + *

+ * @return the street + */ + String getStreet (); + + /** + * Street + *

+ * @param street the street to set + */ + void setStreet (final String street); + + /** + * Getter for user id + *

+ * @return User id + */ + Long getUserId (); + + /** + * Setter for user id + *

+ * @param userId User id + */ + void setUserId (final Long userId); + + /** + * Getter for user name + *

+ * @return User name + */ + String getUserName (); + + /** + * Setter for user name + *

+ * @param userName User name + */ + void setUserName (final String userName); + + /** + * Getter for unencrypted user password + *

+ * @return Unencrypted user password + */ + String getUserPassword (); + + /** + * Setter for unencrypted user password + *

+ * @param userPassword Unencrypted user password + */ + void setUserPassword (final String userPassword); + + /** + * Getter for unencrypted user password repeated + *

+ * @return Unencrypted user password repeated + */ + String getUserPasswordRepeat (); + + /** + * Setter for unencrypted user password repeated + *

+ * @param userPasswordRepeat Unencrypted user password repeated + */ + void setUserPasswordRepeat (final String userPasswordRepeat); + + /** + * Getter for user profile mode + *

+ * @return User profile mode + */ + ProfileMode getUserProfileMode (); + + /** + * Setter for user profile mode + *

+ * @param userProfileMode User profile mode + */ + void setUserProfileMode (final ProfileMode userProfileMode); + + /** + * ZIP code + *

+ * @return the zipCode + */ + Integer getZipCode (); + + /** + * ZIP code + *

+ * @param zipCode the zipCode to set + */ + void setZipCode (final Integer zipCode); + + /** + * Checks whether user instance's email address is used + *

+ * @param user User instance's email address to check + *

+ * @return Whether it is already used + */ + boolean isEmailAddressRegistered (final User user); + + /** + * Checks whether all required personal data is set + *

+ * @return Whether the required personal data is set + */ + boolean isRequiredPersonalDataSet (); + + /** + * Checks whether all required personal data is set for changing them + *

+ * @return Whether the required personal data is set + */ + boolean isRequiredChangePersonalDataSet (); + + /** + * Checks whether same email addresses have been entered + *

+ * @return Whether same email addresses have been entered + */ + boolean isSameEmailAddressEntered (); + + /** + * Checks whether same passwords has been entered + *

+ * @return Whether same passwords has been entered + */ + boolean isSamePasswordEntered (); + + /** + * Checks whether given user instance's name is used + *

+ * @param user User instance's name to check + *

+ * @return Whether it is already used + */ + boolean isUserNameRegistered (final User user); + + /** + * Checks whether a public user account is registered. This means that at + * least one user profile has its flag "public user profile" enabled. + *

+ * @return Whether at least one user has a public profile + */ + boolean isVisibleUserFound (); + + /** + * Checks if the user id is empty + *

+ * @return Whether the user id is empty + */ + boolean isUserIdEmpty (); +} diff --git a/src/java/org/mxchange/pizzaservice/converter/country/PizzaCountryConverter.java b/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java similarity index 96% rename from src/java/org/mxchange/pizzaservice/converter/country/PizzaCountryConverter.java rename to src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java index f9eec18a..e913d873 100644 --- a/src/java/org/mxchange/pizzaservice/converter/country/PizzaCountryConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.pizzaservice.converter.country; +package org.mxchange.pizzaapplication.converter.country; import java.text.MessageFormat; import java.util.List; @@ -63,7 +63,7 @@ public class PizzaCountryConverter implements Converter { this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N // ... and country bean - this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/pizza-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote"); //NOI18N + this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/PizzaService-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw it throw new RuntimeException("context.lookup() failed.", ex); //NOI18N diff --git a/src/java/org/mxchange/pizzaservice/converter/smsprovider/PizzaSmsProviderConverter.java b/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java similarity index 95% rename from src/java/org/mxchange/pizzaservice/converter/smsprovider/PizzaSmsProviderConverter.java rename to src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java index bc1c94b4..b2e3e453 100644 --- a/src/java/org/mxchange/pizzaservice/converter/smsprovider/PizzaSmsProviderConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/smsprovider/PizzaSmsProviderConverter.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.pizzaservice.converter.smsprovider; +package org.mxchange.pizzaapplication.converter.smsprovider; import java.text.MessageFormat; import java.util.List; @@ -63,7 +63,7 @@ public class PizzaSmsProviderConverter implements Converter { this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N /// and SMS provider controller - this.providerController = (SmsProviderSingletonBeanRemote) context.lookup("java:global/addressbook-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.PizzaSmsProviderSingletonBeanRemote"); //NOI18N + this.providerController = (SmsProviderSingletonBeanRemote) context.lookup("java:global/PizzaService-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw it throw new RuntimeException("context.lookup() failed.", ex); //NOI18N diff --git a/src/java/org/mxchange/pizzaservice/converter/user/PizzaUserConverter.java b/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java similarity index 91% rename from src/java/org/mxchange/pizzaservice/converter/user/PizzaUserConverter.java rename to src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java index 5eb27066..6abdb3a2 100644 --- a/src/java/org/mxchange/pizzaservice/converter/user/PizzaUserConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.pizzaservice.converter.user; +package org.mxchange.pizzaapplication.converter.user; import java.text.MessageFormat; import javax.faces.component.UIComponent; @@ -25,11 +25,11 @@ import javax.faces.convert.FacesConverter; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; import org.mxchange.jcoreeelogger.beans.local.logger.Log; import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.model.user.User; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController; /** * Converter for user id <-> valid user instance @@ -48,7 +48,7 @@ public class PizzaUserConverter implements Converter { /** * User bean */ - private AddressbookUserWebSessionController userController; + private PizzaUserWebSessionController userController; /** * Initialization of this converter @@ -63,7 +63,7 @@ public class PizzaUserConverter implements Converter { this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N // ... and user controller - this.userController = (AddressbookUserWebSessionController) context.lookup("java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N + this.userController = (PizzaUserWebSessionController) context.lookup("java:global/PizzaService-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw it throw new RuntimeException("context.lookup() failed.", ex); //NOI18N -- 2.39.5