- fixed bugs of previous cherry-picking season ...
Signed-off-by: Roland Häder <roland@mxchange.org>
${file.reference.jcontacts-lib.jar}:\
${file.reference.jcontacts-business-core.jar}:\
${file.reference.jcontacts-business-lib.jar}:\
- ${file.reference.jcustomer-core.jar}:\
- ${file.reference.jcustomer-lib.jar}:\
${file.reference.jphone-core.jar}:\
${file.reference.jphone-lib.jar}:\
${file.reference.juser-core.jar}:\
javadoc.reference.jcoreee.jar=https://docs.mxchange.org/javadoc/jcoreee/
javadoc.reference.jcountry-core.jar=https://docs.mxchange.org/javadoc/jcountry-core/
javadoc.reference.jcountry-lib.jar=https://docs.mxchange.org/javadoc/jcountry-lib/
-javadoc.reference.jcustomer-core.jar=https://docs.mxchange.org/javadoc/jcustomer-core/
-javadoc.reference.jcustomer-lib.jar=https://docs.mxchange.org/javadoc/jcustomer-lib/
javadoc.reference.jphone-core.jar=https://docs.mxchange.org/javadoc/jphone-core/
javadoc.reference.jphone-lib.jar=https://docs.mxchange.org/javadoc/jphone-lib/
javadoc.reference.juser-activity-core.jar=https://docs.mxchange.org/javadoc/juser-activity-core/
<library dirs="200">
<file>${file.reference.jcontacts-business-lib.jar}</file>
</library>
- <library dirs="200">
- <file>${file.reference.jcustomer-core.jar}</file>
- </library>
- <library dirs="200">
- <file>${file.reference.jcustomer-lib.jar}</file>
- </library>
<library dirs="200">
<file>${file.reference.jphone-core.jar}</file>
</library>
<file>${file.reference.juser-activity-core.jar}</file>
</library>
<library dirs="200">
- <file>${file.reference.juser-login-core.jar}</file>
- </library>
- <library dirs="200">
- <file>${file.reference.juser-login-lib.jar}</file>
+ <file>${file.reference.juser-activity-lib.jar}</file>
</library>
<library dirs="200">
- <file>${file.reference.juser-activity-lib.jar}</file>
+ <file>${file.reference.juser-login-core.jar}</file>
</library>
<library dirs="200">
- <file>${file.reference.jcontacts-business-lib.jar}</file>
+ <file>${file.reference.juser-login-lib.jar}</file>
</library>
<library dirs="200">
<file>${reference.jjobs-core.jar}</file>
@Inject
private Event<ObservableUpdatedContactEvent> contactUpdatedEvent;
- /**
- * Event being fired when a user has updated his contact data
- */
- @Any
- @Inject
- private Event<ObservableUpdatedContactEvent> contactUpdatedEvent;
-
/**
* Country instance
*/
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2020 Free Software Foundation
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.user.action;
+
+import java.text.MessageFormat;
+import javax.ejb.EJB;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.faces.FacesException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
+import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
+import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
+import org.mxchange.jusercore.events.user.update.post.ObservablePostUserPersonalDataUpdatedEvent;
+import org.mxchange.jusercore.events.user.update.post.PostUserPersonalDataUpdatedEvent;
+import org.mxchange.jusercore.events.user.update.pre.ObservablePreUserPersonalDataUpdatedEvent;
+import org.mxchange.jusercore.events.user.update.pre.PreUserPersonalDataUpdatedEvent;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
+
+/**
+ * A user action bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("userActionController")
+@RequestScoped
+public class JobsUserActionWebRequestBean extends BaseJobsBean implements JobsUserActionWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 542_145_347_920L;
+
+ /**
+ * General contact controller
+ */
+ @Inject
+ private JobsContactWebRequestController contactController;
+
+ /**
+ * Features controller
+ */
+ @Inject
+ private JobsFeaturesWebApplicationController featureController;
+
+ /**
+ * Event being fired when user updated personal data
+ */
+ @Inject
+ @Any
+ private Event<ObservablePostUserPersonalDataUpdatedEvent> postUpdatedPersonalDataEvent;
+
+ /**
+ * Event being fired when user updated personal data
+ */
+ @Inject
+ @Any
+ private Event<ObservablePreUserPersonalDataUpdatedEvent> preUpdatedPersonalDataEvent;
+
+ /**
+ * Remote user bean
+ */
+ @EJB (lookup = "java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
+ private UserSessionBeanRemote userBean;
+
+ /**
+ * Login controller (bean)
+ */
+ @Inject
+ private JobsUserLoginWebSessionController userLoginController;
+
+ /**
+ * Default constructor
+ */
+ public JobsUserActionWebRequestBean () {
+ // Call super constructor
+ super();
+ }
+
+ @Override
+ public String doChangePersonalData () {
+ // This method shall only be called if the user is logged-in
+ if (!this.userLoginController.isUserLoggedIn()) {
+ // Not logged-in
+ throw new IllegalStateException("User is not logged-in"); //NOI18N
+ } else if (!this.contactController.isRequiredChangePersonalDataSet()) {
+ // Not all required fields are set
+ throw new FacesException("Not all required fields are set."); //NOI18N
+ } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
+ // Password not matching
+ throw new FacesException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()));
+ } else if (!this.featureController.isFeatureEnabled("change_user_personal_data")) { //NOI18N
+ // Editing is not allowed
+ throw new IllegalStateException("User tried to edit personal data."); //NOI18N
+ }
+
+ // Get user instance
+ final User user = this.userLoginController.getLoggedInUser();
+
+ // Fire pre-update event
+ this.preUpdatedPersonalDataEvent.fire(new PreUserPersonalDataUpdatedEvent(user));
+
+ // It should be there, so run some tests on it
+ assert (user instanceof User) : "Instance userLoginController.loggedInUser is null"; //NOI18N
+ assert (user.getUserId() instanceof Long) : "Instance userLoginController.loggedInUser.userId is null"; //NOI18N
+ assert (user.getUserId() > 0) : MessageFormat.format("userLoginController.loggedInUser.userId={0} is invalid", user.getUserId()); //NOI18N
+ assert (user.getUserContact() instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N
+ assert (user.getUserContact().getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N
+ assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N
+
+ // Send it to the EJB
+ final User updatedUser = this.userBean.updateUserPersonalData(user);
+
+ // Fire post-update event
+ this.postUpdatedPersonalDataEvent.fire(new PostUserPersonalDataUpdatedEvent(updatedUser));
+
+ // All fine
+ return "user_contact_data_saved"; //NOI18N
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 - 2020 Free Software Foundation
- *
- * 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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.user.action;
-
-import java.text.MessageFormat;
-import javax.ejb.EJB;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-import javax.faces.FacesException;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
-import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
-import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.events.user.update.post.ObservablePostUserPersonalDataUpdatedEvent;
-import org.mxchange.jusercore.events.user.update.post.PostUserPersonalDataUpdatedEvent;
-import org.mxchange.jusercore.events.user.update.pre.ObservablePreUserPersonalDataUpdatedEvent;
-import org.mxchange.jusercore.events.user.update.pre.PreUserPersonalDataUpdatedEvent;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
-import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
-
-/**
- * A user action bean (controller)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("userActionController")
-@RequestScoped
-public class JobssUserActionWebRequestBean extends BaseJobsBean implements JobsUserActionWebRequestController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 542_145_347_920L;
-
- /**
- * General contact controller
- */
- @Inject
- private JobsContactWebRequestController contactController;
-
- /**
- * Features controller
- */
- @Inject
- private JobsFeaturesWebApplicationController featureController;
-
- /**
- * Event being fired when user updated personal data
- */
- @Inject
- @Any
- private Event<ObservablePostUserPersonalDataUpdatedEvent> postUpdatedPersonalDataEvent;
-
- /**
- * Event being fired when user updated personal data
- */
- @Inject
- @Any
- private Event<ObservablePreUserPersonalDataUpdatedEvent> preUpdatedPersonalDataEvent;
-
- /**
- * Remote user bean
- */
- @EJB (lookup = "java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
- private UserSessionBeanRemote userBean;
-
- /**
- * Login controller (bean)
- */
- @Inject
- private JobsUserLoginWebSessionController userLoginController;
-
- /**
- * Default constructor
- */
- public JobssUserActionWebRequestBean () {
- // Call super constructor
- super();
- }
-
- @Override
- public String doChangePersonalData () {
- // This method shall only be called if the user is logged-in
- if (!this.userLoginController.isUserLoggedIn()) {
- // Not logged-in
- throw new IllegalStateException("User is not logged-in"); //NOI18N
- } else if (!this.contactController.isRequiredChangePersonalDataSet()) {
- // Not all required fields are set
- throw new FacesException("Not all required fields are set."); //NOI18N
- } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
- // Password not matching
- throw new FacesException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()));
- } else if (!this.featureController.isFeatureEnabled("change_user_personal_data")) { //NOI18N
- // Editing is not allowed
- throw new IllegalStateException("User tried to edit personal data."); //NOI18N
- }
-
- // Get user instance
- final User user = this.userLoginController.getLoggedInUser();
-
- // Fire pre-update event
- this.preUpdatedPersonalDataEvent.fire(new PreUserPersonalDataUpdatedEvent(user));
-
- // It should be there, so run some tests on it
- assert (user instanceof User) : "Instance userLoginController.loggedInUser is null"; //NOI18N
- assert (user.getUserId() instanceof Long) : "Instance userLoginController.loggedInUser.userId is null"; //NOI18N
- assert (user.getUserId() > 0) : MessageFormat.format("userLoginController.loggedInUser.userId={0} is invalid", user.getUserId()); //NOI18N
- assert (user.getUserContact() instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N
- assert (user.getUserContact().getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N
- assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N
-
- // Send it to the EJB
- final User updatedUser = this.userBean.updateUserPersonalData(user);
-
- // Fire post-update event
- this.postUpdatedPersonalDataEvent.fire(new PostUserPersonalDataUpdatedEvent(updatedUser));
-
- // All fine
- return "user_contact_data_saved"; //NOI18N
- }
-
-}
// Is the instance there?
if (null == BASIC_DATA_LIST_CONTROLLER) {
// Get bean from CDI directly
- BASIC_DATA_LIST_CONTROLLER = CDI.current().select(JobssBasicDataListWebViewBean.class).get();
+ BASIC_DATA_LIST_CONTROLLER = CDI.current().select(JobsBasicDataListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == BRANCH_OFFICE_LIST_CONTROLLER) {
// Get bean from CDI directly
- BRANCH_OFFICE_LIST_CONTROLLER = CDI.current().select(JobssBranchOfficeListWebViewBean.class).get();
+ BRANCH_OFFICE_LIST_CONTROLLER = CDI.current().select(JobsBranchOfficeListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == EMPLOYEE_LIST_CONTROLLER) {
// Get bean from CDI directly
- EMPLOYEE_LIST_CONTROLLER = CDI.current().select(JobssEmployeeListWebViewBean.class).get();
+ EMPLOYEE_LIST_CONTROLLER = CDI.current().select(JobsEmployeeListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == DEPARTMENT_LIST_CONTROLLER) {
// Get bean from CDI directly
- DEPARTMENT_LIST_CONTROLLER = CDI.current().select(JobssDepartmentListWebViewBean.class).get();
+ DEPARTMENT_LIST_CONTROLLER = CDI.current().select(JobsDepartmentListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == HEADQUARTER_LIST_CONTROLLER) {
// Set it now
- HEADQUARTER_LIST_CONTROLLER = CDI.current().select(JobssHeadquarterListWebViewBean.class).get();
+ HEADQUARTER_LIST_CONTROLLER = CDI.current().select(JobsHeadquarterListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == CONTACT_LIST_CONTROLLER) {
// Get bean from CDI directly
- CONTACT_LIST_CONTROLLER = CDI.current().select(JobssContactListWebViewBean.class).get();
+ CONTACT_LIST_CONTROLLER = CDI.current().select(JobsContactListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == COUNTRY_LIST_CONTROLLER) {
// Get bean from CDI directly
- COUNTRY_LIST_CONTROLLER = CDI.current().select(JobssCountryListWebViewBean.class).get();
+ COUNTRY_LIST_CONTROLLER = CDI.current().select(JobsCountryListWebViewBean.class).get();
}
// Try this better
// Is the instance there?
if (null == PHONE_LIST_CONTROLLER) {
// Get bean from CDI directly
- PHONE_LIST_CONTROLLER = CDI.current().select(JobssPhoneListWebViewBean.class).get();
+ PHONE_LIST_CONTROLLER = CDI.current().select(JobsPhoneListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == PHONE_LIST_CONTROLLER) {
// Get bean from CDI directly
- PHONE_LIST_CONTROLLER = CDI.current().select(JobssPhoneListWebViewBean.class).get();
+ PHONE_LIST_CONTROLLER = CDI.current().select(JobsPhoneListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == MOBILE_LIST_CONTROLLER) {
// Get bean from CDI directly
- MOBILE_LIST_CONTROLLER = CDI.current().select(JobssMobileListWebViewBean.class).get();
+ MOBILE_LIST_CONTROLLER = CDI.current().select(JobsMobileListWebViewBean.class).get();
}
try {
// Is the instance there?
if (null == MOBILE_PROVIDER_LIST_CONTROLLER) {
// Get bean from CDI directly
- MOBILE_PROVIDER_LIST_CONTROLLER = CDI.current().select(JobssMobileProviderListWebViewBean.class).get();
+ MOBILE_PROVIDER_LIST_CONTROLLER = CDI.current().select(JobsMobileProviderListWebViewBean.class).get();
}
// Try this better
// Is the instance there?
if (null == USER_LIST_CONTROLLER) {
// Get bean from CDI directly
- USER_LIST_CONTROLLER = CDI.current().select(JobssUserListWebViewBean.class).get();
+ USER_LIST_CONTROLLER = CDI.current().select(JobsUserListWebViewBean.class).get();
}
try {