From: Roland Haeder Date: Thu, 15 Oct 2015 14:36:30 +0000 (+0200) Subject: organized members and formatted project X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ed4ddfa30b3689bfcb94b087503153d846b2e76b;p=addressbook-war.git organized members and formatted project --- diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml index 2d5f8778..3c015605 100644 --- a/nbproject/ant-deploy.xml +++ b/nbproject/ant-deploy.xml @@ -1,111 +1,111 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 3240e969..bd72160b 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -821,9 +821,9 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f The libs.CopyLibs.classpath property is not set up. -This property must point to +This property must point to org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part -of NetBeans IDE installation and is usually located at +of NetBeans IDE installation and is usually located at <netbeans_installation>/java<version>/ant/extra folder. Either open the project in the IDE and make sure CopyLibs library exists or setup the property manually. For example like this: @@ -1372,7 +1372,7 @@ exists or setup the property manually. For example like this: @@ -1411,7 +1411,7 @@ exists or setup the property manually. For example like this: @@ -1447,7 +1447,7 @@ exists or setup the property manually. For example like this: @@ -1469,35 +1469,35 @@ exists or setup the property manually. For example like this: - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + CLEANUP SECTION + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/faces-config.NavData b/nbproject/faces-config.NavData index 50c17165..d8adf687 100644 --- a/nbproject/faces-config.NavData +++ b/nbproject/faces-config.NavData @@ -1,61 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/project.xml b/nbproject/project.xml index 75f2f1bb..1fc23e4b 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -1,84 +1,84 @@ - org.netbeans.modules.web.project - - - addressbook-war - 1.6.5 - - - ${file.reference.jcore.jar} - WEB-INF/lib - - - ${file.reference.jcoreee.jar} - WEB-INF/lib - - - ${file.reference.jcore-logger-lib.jar} - WEB-INF/lib - - - ${file.reference.jcountry-core.jar} - WEB-INF/lib - - - ${file.reference.jcontacts-core.jar} - WEB-INF/lib - - - ${file.reference.jcontacts-business-core.jar} - WEB-INF/lib - - - ${file.reference.jcontacts-lib.jar} - WEB-INF/lib - - - ${file.reference.jphone-core.jar} - WEB-INF/lib - - - ${file.reference.juser-core.jar} - WEB-INF/lib - - - ${file.reference.juser-lib.jar} - WEB-INF/lib - - - ${reference.addressbook-lib.jar} - WEB-INF/lib - - - ${file.reference.cdi-api.jar} - WEB-INF/lib - - - ${file.reference.gf-client.jar} - WEB-INF/lib - - - - - - - - - - - - .\lib\nblibraries.properties - - - - addressbook-lib - jar - - jar - clean - jar - - - + org.netbeans.modules.web.project + + + addressbook-war + 1.6.5 + + + ${file.reference.jcore.jar} + WEB-INF/lib + + + ${file.reference.jcoreee.jar} + WEB-INF/lib + + + ${file.reference.jcore-logger-lib.jar} + WEB-INF/lib + + + ${file.reference.jcountry-core.jar} + WEB-INF/lib + + + ${file.reference.jcontacts-core.jar} + WEB-INF/lib + + + ${file.reference.jcontacts-business-core.jar} + WEB-INF/lib + + + ${file.reference.jcontacts-lib.jar} + WEB-INF/lib + + + ${file.reference.jphone-core.jar} + WEB-INF/lib + + + ${file.reference.juser-core.jar} + WEB-INF/lib + + + ${file.reference.juser-lib.jar} + WEB-INF/lib + + + ${reference.addressbook-lib.jar} + WEB-INF/lib + + + ${file.reference.cdi-api.jar} + WEB-INF/lib + + + ${file.reference.gf-client.jar} + WEB-INF/lib + + + + + + + + + + + + .\lib\nblibraries.properties + + + + addressbook-lib + jar + + jar + clean + jar + + + diff --git a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java index d1ec119b..8282a2f5 100644 --- a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java @@ -57,17 +57,17 @@ public class UserRegisterWebBean implements UserRegisterWebController { private UserRegistrationSessionBeanRemote registerBean; /** - * User controller + * An en event fireable when a new user has registered */ @Inject - private UserWebController userController; + @Any + private Event registeredEvent; /** - * An en event fireable when a new user has registered + * User controller */ @Inject - @Any - private Event registeredEvent; + private UserWebController userController; /** * Default constructor diff --git a/src/java/org/mxchange/addressbook/beans/shares/SharesWebController.java b/src/java/org/mxchange/addressbook/beans/shares/SharesWebController.java index 3433c634..b1480f03 100644 --- a/src/java/org/mxchange/addressbook/beans/shares/SharesWebController.java +++ b/src/java/org/mxchange/addressbook/beans/shares/SharesWebController.java @@ -55,6 +55,7 @@ public interface SharesWebController extends Serializable { /** * Checks if the sharee's user id is empty. + *

* @return Whether the sharee's user id is empty. */ boolean isShareeUserIdEmpty (); diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 06a727b7..de95d2ef 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -226,112 +226,43 @@ public class UserWebBean implements UserWebController { } } - /** - * 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 have a public - * profile on registration. - *

- * @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 + @Override + public void afterRegistration (final @Observes UserRegisteredEvent event) { + // 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 } - // Add user name - this.userNameList.add(user.getUserName()); + // Get user instance + User registeredUser = event.getUser(); - // Add email addres - this.emailAddressList.add(user.getUserContact().getContactEmailAddress()); - } + // Copy all data from registered->user + this.copyUser(registeredUser); - @Override - public List allPublicUsers () { - // Return it - return Collections.unmodifiableList(this.publicUserList); - } + // Add user name and email address + this.addUserNameEmailAddress(registeredUser); - /** - * Clears all data in this bean - */ - private void clearData () { // Clear all data - // - personal data - this.setUserId(null); - this.setUserProfilePublic(null); - this.setGender(Gender.UNKNOWN); - 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); + this.clearData(); - // - other data - this.setBirthday(null); - this.setComment(null); - this.setUserName(null); - this.setUserPassword(null); - this.setUserPasswordRepeat(null); + // Set user id again + this.setUserId(registeredUser.getUserId()); } - /** - * 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.setUserProfilePublic(user.getUserPublicProfile()); - 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().getContactPhoneNumber(); - - // - 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()); + @Override + public List allPublicUsers () { + // Return it + return Collections.unmodifiableList(this.publicUserList); } @Override @@ -435,39 +366,6 @@ public class UserWebBean implements UserWebController { return user; } - @Override - public void afterRegistration (final @Observes UserRegisteredEvent event) { - // 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(); - - // 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()); - } - @Override public Date getBirthday () { return this.birthday; @@ -742,19 +640,19 @@ public class UserWebBean implements UserWebController { @Override public boolean isRequiredPersonalDataSet () { - return ((this.getUserName() != null) - && (this.getUserProfilePublic() != 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)); + return ((this.getUserName() != null) && + (this.getUserProfilePublic() != 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 @@ -771,4 +669,106 @@ public class UserWebBean implements UserWebController { public boolean isUserNameRegistered (final User user) { return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName()))); } + + /** + * 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 have a public + * profile on registration. + *

+ * @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.setUserProfilePublic(null); + this.setGender(Gender.UNKNOWN); + 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.setUserProfilePublic(user.getUserPublicProfile()); + 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().getContactPhoneNumber(); + + // - 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/web/WEB-INF/templates/base.tpl b/web/WEB-INF/templates/base.tpl index a8f8d63c..6f7fcfa0 100644 --- a/web/WEB-INF/templates/base.tpl +++ b/web/WEB-INF/templates/base.tpl @@ -18,7 +18,7 @@

-