import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.mxchange.jcoreee.events.helper.clear.HelperCleanupEvent;
+import org.mxchange.jcoreee.events.helper.clear.ObservableHelperCleanupEvent;
import org.mxchange.jcoreee.utils.FacesUtils;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
+import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
+import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.confirmation.UserConfirmedAccountEvent;
import org.mxchange.pizzaapplication.beans.BasePizzaController;
import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestHelperController;
import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
@Inject
private PizzaWebRequestHelperController beanHelper;
+ /**
+ * Event being fired when a bean helper should be cleaned
+ */
+ @Inject
+ @Any
+ private Event<ObservableHelperCleanupEvent> cleanHelperEvent;
+
/**
* Confirmation key
*/
@Inject
private PizzaUserWebSessionController userController;
+ /**
+ * Event for when a user instance was created
+ */
+ @Any
+ @Inject
+ private Event<ObservableCreatedUserEvent> userCreatedEvent;
+
/**
* Default constructor
*/
// Is the user instance null?
if ((null == user) || (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED)) {
// Then clear this bean and the helper
- this.beanHelper.setUser(null);
+ this.cleanHelperEvent.fire(new HelperCleanupEvent());
} else {
// Try to confirm it
this.confirmUserAccount(user);
// Debug message
System.out.println(MessageFormat.format("{0}.confirmUserAccount: updatedUser={1}", this.getClass().getSimpleName(), updatedUser)); //NOI18N
- // Set it again in helper
- this.beanHelper.setUser(updatedUser);
-
- // ... and copy it to the controller
- this.beanHelper.copyUserToController();
+ // Fire event
+ this.userCreatedEvent.fire(new CreatedUserEvent(updatedUser));
// Trace message
System.out.println(MessageFormat.format("{0}.confirmUserAccount: EXIT!", this.getClass().getSimpleName())); //NOI18N