From: Roland Häder Date: Thu, 22 Jun 2017 20:50:18 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc5e9dc5a60281fadef37263969fba1bddffd49b;p=jjobs-core.git Please cherry-pick: - sendEmail() will now accept randomPassword parameter. Set to NULL if you don't want/can set it. Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java b/src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java index 6d60701..3f5eeff 100644 --- a/src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java +++ b/src/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java @@ -113,7 +113,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { /** * Returns a managed instance from given mobile number *

- * @param mobileNumber Mobile number + * @param mobileNumber Mobile instance * @param fetchedNumber Found mobile number in database *

* @return Managed instance @@ -156,8 +156,8 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { /** * Returns a managed instance from given land-line number *

- * @param landLineNumber Land-line number - * @param fetchedNumber Found land-line number in database + * @param landLineNumber Land-line instance + * @param fetchedNumber Found land-line number in database *

* @return Managed instance */ @@ -199,7 +199,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { /** * Returns a managed instance from given fax number *

- * @param faxNumber Fax number + * @param faxNumber Fax instance * @param fetchedNumber Found fax number in database *

* @return Managed instance @@ -432,13 +432,15 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { * Sends an email with given subject line, template name to given recipient * and user data *

- * @param subjectLine Subject line - * @param templateName Template name - * @param emailAddress Recipient's email address - * @param user User instance - * @param baseUrl Base URL + * @param subjectLine Subject line + * @param templateName Template name + * @param emailAddress Recipient's email address + * @param user User instance + * @param baseUrl Base URL + * @param randomPassword A randomly-generated password or NULL if user had + * to enter it. */ - protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl) { + protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl, final String randomPassword) { // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},emailAddress={2},user={3},baseUrl={4} - CALLED!", subjectLine, templateName, emailAddress, user, baseUrl)); //NOI18N @@ -458,7 +460,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { } else if (null == emailAddress) { // Throw NPE throw new NullPointerException("emailAddress is null"); //NOI18N - }else if (null == user) { + } else if (null == user) { // Throw NPE throw new NullPointerException("user is null"); //NOI18N } else if (user.getUserId() == null) { @@ -496,8 +498,9 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { // Set all values Properties variables = UserUtils.getAllUserFields(user); - // Set base URL + // Set base URL and random password variables.put("baseUrl", baseUrl); //NOI18N + variables.put("randomPassword", randomPassword); //NOI18N // Set all // @TODO Language from message bundle @@ -528,7 +531,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { * should be the same. *

* @param contact Contact to set instances - * @param other Other contact to get instances from + * @param other Other contact to get instances from */ protected void setAllContactPhoneEntries (final Contact contact, final Contact other) { // Trace message @@ -607,13 +610,13 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { /** * Updates all contact's phone entry's updated timestamps *

- * @param contact Contact instance to update - * @param isMobileUnlinked Whether a cellphone entry has been unlinked in - * contact instance + * @param contact Contact instance to update + * @param isMobileUnlinked Whether a mobile entry has been unlinked in + * contact instance * @param isLandlineUnlinked Whether a land-line entry has been unlinked in - * contact instance - * @param isFaxUnlinked Whether a fax entry has been unlinked in contact - * instance + * contact instance + * @param isFaxUnlinked Whether a fax entry has been unlinked in + * contact instance */ protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) { // Trace message