From c9f3fe99d29c4816def2c80fcc432b2397e4536e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 22 Jun 2017 23:13:00 +0200 Subject: [PATCH] Don't cherry-pick: - moved EJBs to proper package as they are user-related beans - handled over randomPassword parameter to sendEmail() - or null if not possible/wanted - changed jar-dependency jjobs-core.jar to project-dependency MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- lib/jjobs-core.jar | Bin 17487 -> 0 bytes lib/jjobs-mailer.jar | Bin 9612 -> 0 bytes nbproject/build-impl.xml | 61 ++++++++++++------ nbproject/project.properties | 6 +- nbproject/project.xml | 17 ++++- .../model/login/JobsUserLoginSessionBean.java | 2 +- .../model/user/JobsAdminUserSessionBean.java | 28 ++++---- .../model/user/JobsUserSessionBean.java | 6 +- .../JobsUserEmailChangeSessionBean.java | 7 +- .../JobsUserRegistrationSessionBean.java | 19 ++++-- .../resendlink/JobsResendLinkSessionBean.java | 6 +- 11 files changed, 98 insertions(+), 54 deletions(-) delete mode 100644 lib/jjobs-core.jar delete mode 100644 lib/jjobs-mailer.jar rename src/java/org/mxchange/jusercore/model/{ => user}/email_address/JobsUserEmailChangeSessionBean.java (95%) rename src/java/org/mxchange/jusercore/model/{ => user}/register/JobsUserRegistrationSessionBean.java (89%) rename src/java/org/mxchange/{jjobs/beans => jusercore/model/user}/resendlink/JobsResendLinkSessionBean.java (94%) diff --git a/lib/jjobs-core.jar b/lib/jjobs-core.jar deleted file mode 100644 index 5f7ce3aedb0df2d2a059c9fb227f7f23b4022cb7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17487 zcmcIs31D1R)jsEClJ`29Zb`R53j-8rn`K&Bx}*&>X;WxPN^M%YfZ!x~O{Yv|!px)# zwa5;FvI$6w0xGK_3PRgZ7Apl57d90UL^cr>6cjhwAO7#$``(*3lgYxbf1q#fyZ4-P z&pr3tv%NR7?4+VVkjN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RO@{EF))MR0Pcj#^PGOb2gTk@UrKL&nazG_3A5dWTuE3q+@gSC{leU8uM^WoH zyn<>Is!sWJObyn&dkd*j|wZ9+`{>D+$+vZgFQDkEP%3sLmj{)4#y}euO6db*UeT=DNZtI-8oCR9!^hdxmT*MDa6Nw$_9HZcoMvQ) zU{|;enl~^9SK}?(qA>FU78tTklP$+a%%h~xEO2{TK}-r%E5FB-?9!l5F9F5ZT_Fhich>dh>IThRzVs zvNOy=owXd17oe+f?pcV3Q3jY1EpE-(QaY4 zYOAzOddam)#iDQ`c03irD~IVO8(Q=CrDhQ~*tcu7w!qNr?( zb7NAGA6gLrQ*^w?gq8#RJRzmB>OT?u{#Q%3<=uHieDLo`6`3>`d|)=Y(d^IUV@{}X zgLH=Jv}6@rR-=S>fH52Z_`VUio|SQf=h`IT+4n5}mqINBX`~_PF>GY%Hh}39b8pz8 zoCyE#;QnS`CZ>oF<>2qj&a#T}T;yl`MuMt~vpkn2evnV1N)gVujWjVw){Z6UPoMzu z&h38V6_lZTEUykA#=<=lez}(4E#yCTRh2*6t9P*q!!1#^W|E_`TtY%I`V&A7(up&R@YAe*`BxYzXG2vSf zkpgPH2N4Oo|AU3)qqia=snu%b_aY*xe}U8}N6t01O64A};FE7nL|xW;ZzAmU(CuwV z&9f@^1l}s}e{qiwwbn2BQGY5N=|uaB{eUOm)rj{}YoQ+Xavxp|iWE7^vb|bd^=dN` zcjnS6aaC*2YDv{~PbBHD%ibqRmT;Gl`ycro=_>#L diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 42a0ae9..df7c1f5 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -806,6 +806,9 @@ exists or setup the property manually. For example like this: COMPILATION SECTION --> + + + @@ -817,6 +820,9 @@ exists or setup the property manually. For example like this: + + + @@ -840,18 +846,21 @@ exists or setup the property manually. For example like this: + + - - + + + - + @@ -859,57 +868,66 @@ exists or setup the property manually. For example like this: + + - - + + + - + - + - - - - - - + + + + + + - - - - - + + + + + + + + + + - - + + + - + @@ -1296,6 +1314,7 @@ exists or setup the property manually. For example like this: CLEANUP SECTION --> + diff --git a/nbproject/project.properties b/nbproject/project.properties index 98c1ef8..ca3162f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -31,7 +31,6 @@ file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar file.reference.jcoreee.jar=lib/jcoreee.jar file.reference.jcountry-core.jar=lib/jcountry-core.jar file.reference.jcountry-lib.jar=lib/jcountry-lib.jar -file.reference.jjobs-core.jar=lib/jjobs-core.jar file.reference.jjobs-mailer.jar=lib/jjobs-mailer.jar file.reference.jletter-lib.jar=lib/jletter-lib.jar file.reference.jmailer-ee.jar=lib/jmailer-ee.jar @@ -73,7 +72,7 @@ javac.classpath=\ ${file.reference.jaddressbook-core.jar}:\ ${file.reference.jaddressbook-lib.jar}:\ ${file.reference.jmailer-ee.jar}:\ - ${file.reference.jjobs-core.jar}:\ + ${reference.jjobs-core.jar}:\ ${reference.jjobs-lib.jar}:\ ${reference.jjobs-mailer.jar}:\ ${file.reference.cdi-api.jar} @@ -104,11 +103,13 @@ javadoc.windowtitle=Jobs EJB meta.inf=${source.root}/conf meta.inf.excludes=sun-cmp-mappings.xml platform.active=default_platform +project.jjobs-core=../../NetBeansProjects/jjobs-core project.jjobs-lib=../jjobs-lib project.jjobs-mailer=../jjobs-mailer project.juser-core=../juser-core project.license=agpl30 project.serviceLocator.class=org.mxchange.jjobs.mailer.model.delivery.JobsMailer +reference.jjobs-core.jar=${project.jjobs-core}/dist/jjobs-core.jar reference.jjobs-lib.jar=${project.jjobs-lib}/dist/jjobs-lib.jar reference.jjobs-mailer.jar=${project.jjobs-mailer}/dist/jjobs-mailer.jar resource.dir=setup @@ -128,7 +129,6 @@ source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ source.reference.jcoreee.jar=../jcoreee/src/ source.reference.jcountry-core.jar=../jcountry-core/src/ source.reference.jcountry-lib.jar=../jcountry-lib/src/ -source.reference.jjobs-core.jar=../jjobs-core/src/ source.reference.jjobs-mailer.jar=../jjobs-mailer/src/ source.reference.jletter-lib.jar=../jletter-lib/src/ source.reference.jmailer-ee.jar=../jmailer-ee/src/ diff --git a/nbproject/project.xml b/nbproject/project.xml index 50b4fc2..521ac6d 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -7,18 +7,21 @@ 1.6.5 file.reference.jcoreee.jar file.reference.jcore-logger-lib.jar + file.reference.jcontacts-core.jar + file.reference.jcontacts-lib.jar file.reference.jcountry-core.jar file.reference.jcountry-lib.jar file.reference.jphone-core.jar file.reference.jphone-lib.jar - file.reference.jcontacts-core.jar - file.reference.jcontacts-lib.jar file.reference.juser-core.jar file.reference.juser-lib.jar file.reference.juser-activity-core.jar file.reference.juser-activity-lib.jar + file.reference.jletter-lib.jar + file.reference.jaddressbook-core.jar + file.reference.jaddressbook-lib.jar file.reference.jmailer-ee.jar - file.reference.jjobs-core.jar + reference.jjobs-core.jar reference.jjobs-lib.jar reference.jjobs-mailer.jar file.reference.cdi-api.jar @@ -33,6 +36,14 @@ ./lib/nblibraries.properties + + jjobs-core + jar + + jar + clean + jar + jjobs-lib jar diff --git a/src/java/org/mxchange/jusercore/model/login/JobsUserLoginSessionBean.java b/src/java/org/mxchange/jusercore/model/login/JobsUserLoginSessionBean.java index be35b3c..53b20cf 100644 --- a/src/java/org/mxchange/jusercore/model/login/JobsUserLoginSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/login/JobsUserLoginSessionBean.java @@ -25,7 +25,7 @@ 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.register.UserRegistrationSessionBeanRemote; +import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; diff --git a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java index 7b5c7a1..f06f0df 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java @@ -32,7 +32,7 @@ import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; -import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; +import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; /** @@ -144,13 +144,13 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad } // Get a managed instance - User managedUser = this.getManagedUser(user); + User updatedUser = this.getManagedUser(user); // Should be found! - assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N + assert (updatedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Delete it - this.getEntityManager().remove(managedUser); + this.getEntityManager().remove(updatedUser); // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteUser: EXIT!", this.getClass().getSimpleName())); //NOI18N @@ -263,14 +263,14 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad user.setUserLastLockedReason(userLockReason); // Update user - User managedUser = this.userBean.updateUserData(user); + User updatedUser = this.userBean.updateUserData(user); // Init variable Address emailAddress; try { // Create email address and set - emailAddress = new InternetAddress(managedUser.getUserContact().getContactEmailAddress()); + emailAddress = new InternetAddress(updatedUser.getUserContact().getContactEmailAddress()); } catch (final AddressException ex) { // Throw again throw new EJBException(ex); @@ -278,13 +278,13 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad // Send out email // @TODO externalize subject line - this.sendEmail("Account locked", "account_locked", emailAddress, managedUser, baseUrl); //NOI18N + this.sendEmail("User account locked", "user_account_locked", emailAddress, updatedUser, baseUrl, null); //NOI18N // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.lockUserAccount: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.lockUserAccount: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N // Return detached (and updated) user - return managedUser; + return updatedUser; } @Override @@ -332,14 +332,14 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad user.setUserAccountStatus(UserAccountStatus.CONFIRMED); // Update user - User managedUser = this.userBean.updateUserData(user); + User updatedUser = this.userBean.updateUserData(user); // Init variable Address emailAddress; try { // Create email address and set - emailAddress = new InternetAddress(managedUser.getUserContact().getContactEmailAddress()); + emailAddress = new InternetAddress(updatedUser.getUserContact().getContactEmailAddress()); } catch (final AddressException ex) { // Throw again throw new EJBException(ex); @@ -347,13 +347,13 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad // Send out email // @TODO externalize subject line - this.sendEmail("Account unlocked", "account_unlocked", emailAddress, managedUser, baseUrl); //NOI18N + this.sendEmail("User account unlocked", "user_account_unlocked", emailAddress, updatedUser, baseUrl, null); //NOI18N // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.lockUserAccount: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.lockUserAccount: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N // Return changed account - return managedUser; + return updatedUser; } } diff --git a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java index dd68947..4598a86 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java @@ -37,10 +37,10 @@ import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; -import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.password_history.PasswordHistory; import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; +import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; /** @@ -188,7 +188,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes } // Send out email - this.sendEmail("Account confirmed", "account_confirmed", emailAddress, updatedUser, baseUrl); //NOI18N + this.sendEmail("User account confirmed", "user_account_confirmed", emailAddress, updatedUser, baseUrl, null); //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.confirmAccount: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N @@ -674,7 +674,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes } // Send email to user - this.sendEmail("User password change", "user_password_change", emailAddress, user, baseUrl); //NOI18N + this.sendEmail("User password change", "user_password_change", emailAddress, user, baseUrl, null); //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPassword: entry.userPasswordHistoryId={1} - EXIT!", this.getClass().getSimpleName(), entry.getUserPasswordHistoryId())); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/email_address/JobsUserEmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.java similarity index 95% rename from src/java/org/mxchange/jusercore/model/email_address/JobsUserEmailChangeSessionBean.java rename to src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.java index a5324ff..e96e462 100644 --- a/src/java/org/mxchange/jusercore/model/email_address/JobsUserEmailChangeSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.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.jusercore.model.email_address; +package org.mxchange.jusercore.model.user.email_address; import java.text.MessageFormat; import java.util.GregorianCalendar; @@ -28,6 +28,9 @@ import javax.mail.internet.InternetAddress; import javax.persistence.NoResultException; import javax.persistence.Query; import org.mxchange.jjobs.database.BaseJobsDatabaseBean; +import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; +import org.mxchange.jusercore.model.email_address.EmailAddressChange; +import org.mxchange.jusercore.model.email_address.UserEmailChangeSessionBeanRemote; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; @@ -127,7 +130,7 @@ public class JobsUserEmailChangeSessionBean extends BaseJobsDatabaseBean impleme } // Send email - this.sendEmail("Email change", "email_change", emailAddress, emailChange.getEmailChangeUser(), baseUrl); //NOI18N + this.sendEmail("User email change", "user_email_change", emailAddress, emailChange.getEmailChangeUser(), baseUrl, null); //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.enqueueEmailAddressForChange - EXIT!", this.getClass().getSimpleName())); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/register/JobsUserRegistrationSessionBean.java b/src/java/org/mxchange/jusercore/model/user/register/JobsUserRegistrationSessionBean.java similarity index 89% rename from src/java/org/mxchange/jusercore/model/register/JobsUserRegistrationSessionBean.java rename to src/java/org/mxchange/jusercore/model/user/register/JobsUserRegistrationSessionBean.java index 5c92f4d..303ba29 100644 --- a/src/java/org/mxchange/jusercore/model/register/JobsUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/register/JobsUserRegistrationSessionBean.java @@ -14,9 +14,10 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.register; +package org.mxchange.jusercore.model.user.register; import java.text.MessageFormat; +import java.util.Objects; import javax.ejb.EJB; import javax.ejb.EJBException; import javax.ejb.Stateless; @@ -151,9 +152,9 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem } @Override - public User registerUser (final User user, final String baseUrl) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException { + public User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException { // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: user={1},baseUrl={2} - CALLED!", this.getClass().getSimpleName(), user, baseUrl)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: user={1},baseUrl={2},randomPassword[]={3} - CALLED!", this.getClass().getSimpleName(), user, baseUrl, Objects.toString(randomPassword))); //NOI18N // user should not be null if (null == user) { @@ -193,9 +194,18 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem throw new EJBException(ex); } + // Default template is with no random password + String templateName = "user_registration"; //NOI18N + + // Is password set? + if ((randomPassword instanceof String) && (!randomPassword.isEmpty())) { + // Switch to other template + templateName = "user_registration_random"; //NOI18N + } + // Send email // @TODO: Internationlize the subject line somehow - this.sendEmail("Registration", "registration", emailAddress, addedUser, baseUrl); //NOI18N + this.sendEmail("Registration", templateName, emailAddress, addedUser, baseUrl, randomPassword); //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: addedUser={1},addedUser.userId={2} - EXIT!", this.getClass().getSimpleName(), addedUser, addedUser.getUserId())); //NOI18N @@ -203,4 +213,5 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem // Return it return addedUser; } + } diff --git a/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkSessionBean.java b/src/java/org/mxchange/jusercore/model/user/resendlink/JobsResendLinkSessionBean.java similarity index 94% rename from src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkSessionBean.java rename to src/java/org/mxchange/jusercore/model/user/resendlink/JobsResendLinkSessionBean.java index 62e2216..22b0673 100644 --- a/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/resendlink/JobsResendLinkSessionBean.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.jjobs.beans.resendlink; +package org.mxchange.jusercore.model.user.resendlink; import java.text.MessageFormat; import java.util.Locale; @@ -28,11 +28,11 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; -import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote; 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.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; /** @@ -122,7 +122,7 @@ public class JobsResendLinkSessionBean extends BaseJobsDatabaseBean implements R // Send email // @TODO: Internationlize the subject line somehow - this.sendEmail("Resend confirmation link", "resend_confirmation_link", emailAddress, user, baseUrl); //NOI18N + this.sendEmail("Resend user confirmation link", "user_resend_confirmation_link", emailAddress, user, baseUrl, null); //NOI18N // Log trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: EXIT!", this.getClass().getSimpleName())); //NOI18N -- 2.39.5