From: Roland Haeder Date: Sat, 10 Oct 2015 20:02:27 +0000 (+0200) Subject: Rewrite: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a4d79790896b92b38d4b6516d3c6589f8ebf4077;p=addressbook-war.git Rewrite: - introduced jcountry-core which is a library for handling country-related data, e.g. dial prefix, country code ... - introduced jphone-core which is a library for handling phone, fax and cell phone numbers - these both new libraries required a rewrite of many parts --- diff --git a/.gitignore b/.gitignore index 22f399f1..0383bcc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ -/dist/ -/build/ /nbproject/private/ +/nbproject/*~ +/manifest.mf +/build/ +/dist/ +/data/* +/*.properties diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar index 9607d5ca..5665c860 100644 Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index 98ca6170..855385dc 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar index c1c68c3b..a736f4c6 100644 Binary files a/lib/jcontacts-lib.jar and b/lib/jcontacts-lib.jar differ diff --git a/lib/jcore-logger-lib.jar b/lib/jcore-logger-lib.jar index 8e5a5b95..4cb7da51 100644 Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index 57a3b6ce..1a75fc00 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 3900e4e4..76ac2d38 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/jcountry-core.jar b/lib/jcountry-core.jar new file mode 100644 index 00000000..ed089991 Binary files /dev/null and b/lib/jcountry-core.jar differ diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar new file mode 100644 index 00000000..480f9f8e Binary files /dev/null and b/lib/jphone-core.jar differ diff --git a/lib/juser-core.jar b/lib/juser-core.jar index 764cab64..ae1dbfb3 100644 Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ diff --git a/lib/juser-lib.jar b/lib/juser-lib.jar index 0d4d6af3..2d9fa050 100644 Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml index 3c015605..2d5f8778 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 4de471dc..a20c1a6a 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: @@ -1036,6 +1036,8 @@ exists or setup the property manually. For example like this: + + @@ -1051,6 +1053,8 @@ exists or setup the property manually. For example like this: + + @@ -1368,7 +1372,7 @@ exists or setup the property manually. For example like this: @@ -1407,7 +1411,7 @@ exists or setup the property manually. For example like this: @@ -1443,7 +1447,7 @@ exists or setup the property manually. For example like this: @@ -1465,35 +1469,35 @@ exists or setup the property manually. For example like this: - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + CLEANUP SECTION + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 8245c238..a923f677 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=be5f34f7 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=d8bc4ea8 -nbproject/build-impl.xml.script.CRC32=855e3438 +nbproject/build-impl.xml.data.CRC32=80fe4962 +nbproject/build-impl.xml.script.CRC32=498d3940 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 7e91062f..f47c2cdf 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -43,6 +43,8 @@ file.reference.jcontacts-lib.jar=lib/jcontacts-lib.jar file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar file.reference.jcore.jar=lib/jcore.jar file.reference.jcoreee.jar=lib/jcoreee.jar +file.reference.jcountry-core.jar=lib/jcountry-core.jar +file.reference.jphone-core.jar=lib/jphone-core.jar file.reference.juser-core.jar=lib/juser-core.jar file.reference.juser-lib.jar=lib/juser-lib.jar includes=** @@ -65,6 +67,8 @@ javac.classpath=\ ${file.reference.jcontacts-core.jar}:\ ${file.reference.jcontacts-business-core.jar}:\ ${file.reference.jcontacts-lib.jar}:\ + ${file.reference.jcountry-core.jar}:\ + ${file.reference.jphone-core.jar}:\ ${file.reference.juser-core.jar}:\ ${file.reference.juser-lib.jar}:\ ${reference.addressbook-lib.jar}:\ @@ -115,6 +119,8 @@ source.reference.jcontacts-lib.jar=../jcontacts-lib/src/ source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ source.reference.jcore.jar=../jcore/src/ source.reference.jcoreee.jar=../jcoreee/src/ +source.reference.jcountry-core.jar=../jcountry-core/src/ +source.reference.jphone-core.jar=../jphone-core/src/ source.reference.juser-core.jar=../juser-core/src/ source.reference.juser-lib.jar=../juser-lib/src/ source.root=src diff --git a/nbproject/project.xml b/nbproject/project.xml index a7f5af57..d6e38d45 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -1,76 +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.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.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.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.jcountry-core.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/addressbook/AddressbookWebBean.java b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java index 078626ab..b007703e 100644 --- a/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/addressbook/AddressbookWebBean.java @@ -18,6 +18,7 @@ package org.mxchange.addressbook.beans.addressbook; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.GregorianCalendar; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; @@ -119,11 +120,11 @@ public class AddressbookWebBean implements AddressbookWebController { throw new FaceletException("This method can only be called as logged-in user."); //NOI18N } else if (this.getAddressbookName() == null) { // Address book name is null - throw new IllegalStateException("addressbookName is null"); + throw new NullPointerException("addressbookName is null"); } else if (this.getAddressbookName().isEmpty()) { // Address book name is empty throw new IllegalStateException("addressbookName is empty."); - } else if (!this.isAddressbookNameUsed(this.getAddressbookName())) { + } else if (this.isAddressbookNameUsed(this.getAddressbookName())) { // Already used by this user throw new FaceletException(MessageFormat.format("Address book name {0} already used.", this.getAddressbookName())); //NOI18N } @@ -134,6 +135,7 @@ public class AddressbookWebBean implements AddressbookWebController { // Set default status to UNLOCKED and owner addressbook.setAddressbookStatus(AddressbokStatus.UNLOCKED); addressbook.setAddressbookUser(this.loginController.getLoggedInUser()); + addressbook.setAddressbookCreated(new GregorianCalendar()); try { // Register this address book diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 9739db93..3bc0d362 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -31,6 +31,10 @@ 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.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; @@ -58,7 +62,7 @@ public class UserWebBean implements UserWebController { /** * Cellphone number */ - private String cellphoneNumber; + private DialableCellphoneNumber cellphoneNumber; /** * City @@ -71,9 +75,9 @@ public class UserWebBean implements UserWebController { private String comment; /** - * Country code + * Country instance */ - private String countryCode; + private Country country; /** * Email address @@ -98,7 +102,7 @@ public class UserWebBean implements UserWebController { /** * Fax number */ - private String faxNumber; + private DialableFaxNumber faxNumber; /** * First name @@ -118,7 +122,7 @@ public class UserWebBean implements UserWebController { /** * Phone number */ - private String phoneNumber; + private DialableLandLineNumber phoneNumber; /** * Street @@ -210,7 +214,7 @@ public class UserWebBean implements UserWebController { this.setHouseNumber(null); this.setZipCode(null); this.setCity(null); - this.setCountryCode(null); + this.setCountry(null); // - contact data this.setEmailAddress(null); @@ -239,7 +243,7 @@ public class UserWebBean implements UserWebController { this.setHouseNumber(user.getUserContact().getHouseNumber()); this.setZipCode(user.getUserContact().getZipCode()); this.setCity(user.getUserContact().getCity()); - this.setCountryCode(user.getUserContact().getCountryCode()); + this.setCountry(user.getUserContact().getCountry()); // - contact data this.setPhoneNumber(user.getUserContact().getPhoneNumber()); @@ -270,7 +274,7 @@ public class UserWebBean implements UserWebController { contact.setHouseNumber(this.getHouseNumber()); contact.setZipCode(this.getZipCode()); contact.setCity(this.getCity()); - contact.setCountryCode(this.getCountryCode()); + contact.setCountry(this.getCountry()); contact.setEmailAddress(this.getEmailAddress()); contact.setPhoneNumber(this.getPhoneNumber()); contact.setFaxNumber(this.getFaxNumber()); @@ -303,12 +307,12 @@ public class UserWebBean implements UserWebController { } @Override - public String getCellphoneNumber () { + public DialableCellphoneNumber getCellphoneNumber () { return this.cellphoneNumber; } @Override - public void setCellphoneNumber (final String cellphoneNumber) { + public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { this.cellphoneNumber = cellphoneNumber; } @@ -333,13 +337,13 @@ public class UserWebBean implements UserWebController { } @Override - public String getCountryCode () { - return this.countryCode; + public Country getCountry () { + return this.country; } @Override - public void setCountryCode (final String countryCode) { - this.countryCode = countryCode; + public void setCountry (final Country country) { + this.country = country; } @Override @@ -373,12 +377,12 @@ public class UserWebBean implements UserWebController { } @Override - public String getFaxNumber () { + public DialableFaxNumber getFaxNumber () { return this.faxNumber; } @Override - public void setFaxNumber (final String faxNumber) { + public void setFaxNumber (final DialableFaxNumber faxNumber) { this.faxNumber = faxNumber; } @@ -413,12 +417,12 @@ public class UserWebBean implements UserWebController { } @Override - public String getPhoneNumber () { + public DialableLandLineNumber getPhoneNumber () { return this.phoneNumber; } @Override - public void setPhoneNumber (final String phoneNumber) { + public void setPhoneNumber (final DialableLandLineNumber phoneNumber) { this.phoneNumber = phoneNumber; } diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java index 56b2da08..3da777b1 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java @@ -19,6 +19,10 @@ package org.mxchange.addressbook.beans.user; import java.io.Serializable; import java.util.Date; import org.mxchange.jcontacts.contact.gender.Gender; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jusercore.model.user.User; /** @@ -73,14 +77,14 @@ public interface UserWebController extends Serializable { *

* @return the cellphoneNumber */ - public String getCellphoneNumber (); + public DialableCellphoneNumber getCellphoneNumber (); /** * Cellphone number *

* @param cellphoneNumber the cellphoneNumber to set */ - public void setCellphoneNumber (final String cellphoneNumber); + public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); /** * City @@ -115,14 +119,14 @@ public interface UserWebController extends Serializable { *

* @return the countryCode */ - public String getCountryCode (); + public Country getCountry (); /** * Country code *

* @param countryCode the countryCode to set */ - public void setCountryCode (final String countryCode); + public void setCountry (final Country countryCode); /** * Getter for email address @@ -171,14 +175,14 @@ public interface UserWebController extends Serializable { *

* @return the faxNumber */ - public String getFaxNumber (); + public DialableFaxNumber getFaxNumber (); /** * Fax number *

* @param faxNumber the faxNumber to set */ - public void setFaxNumber (final String faxNumber); + public void setFaxNumber (final DialableFaxNumber faxNumber); /** * First name @@ -227,14 +231,14 @@ public interface UserWebController extends Serializable { *

* @return the phoneNumber */ - public String getPhoneNumber (); + public DialableLandLineNumber getPhoneNumber (); /** * Phone number *

* @param phoneNumber the phoneNumber to set */ - public void setPhoneNumber (final String phoneNumber); + public void setPhoneNumber (final DialableLandLineNumber phoneNumber); /** * Street