GUEST_RESEND_CONFIRMATION_LINK_NOTICE=Der alte Best\u00e4tigungslink wird hiernach verfallen, bitte dann den aus der neueren Mail verwenden.
RESEND_CONFIRMATION_LINK_LEGEND=Email-Adresse eingeben:
RESEND_CONFIRMATION_LINK_LEGEND_TITLE=Bitte geben Sie Ihre Email-Adresse ein, die Sie bei der Anmeldung verwendet haben.
+PAGE_TITLE_INDEX_CONFIRM_ACCOUNT=Anmeldung best\u00e4tigen
+CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT=Benutzeranmeldung best\u00e4tigen:
+GUEST_CONFIRMATION_LINK_INVALID=Best\u00e4tigungslink nicht mehr g\u00fcltig. Bitte lassen Sie sich einen neuen Link zusenden oder wenden Sie sich an den Support.
+GUEST_CONFIRMATION_KEY_NOT_SET=Es wurde keine Best\u00e4tigungsschl\u00fcssel angegeben. Bitte pr\u00fcfen Sie den Link aus der Mail.
+GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Vielen Dank f\u00fcr die Best\u00e4tigung
+GUEST_USER_CONFIRM_ACCOUNT_DONE=Hallo {0} {1} {2}. Sie haben soeben Ihren Account best\u00e4tigt. Es ist eine Mail mit weiteren Details an Sie unterwegs.
+BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Account best\u00e4tigen
LINK_LOGIN_CHANGE_PASSWORD_TITLE=Change here your password, if you want another one.
LINK_LOGIN_CHANGE_EMAIL_ADDRESS=Change your email address
LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD=Restore your password
+PAGE_TITLE_INDEX_CONFIRM_ACCOUNT=Confirm registration
+CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT=Confirm user registration:
+GUEST_CONFIRMATION_LINK_INVALID=Confirmation link is no longer valid. Please try to send a new link to your email address or contact support.
+GUEST_CONFIRMATION_KEY_NOT_SET=No confirmation key was provided. Please check the link from the mail.
+GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Thank you for confirmation of your account
+GUEST_USER_CONFIRM_ACCOUNT_DONE=Hello {0} {1} {2}. You have successfully confirmed your account. An email with more details is on it's way to you.
+BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Confirm account
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.confirmlink;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcoreee.utils.FacesUtils;
+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.pizzaapplication.beans.BasePizzaController;
+import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController;
+import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
+
+/**
+ * A web request bean for confirmation link handling
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("confirmationLinkController")
+@RequestScoped
+public class PizzaConfirmationLinkWebRequestBean extends BasePizzaController implements PizzaConfirmationLinkWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 57_637_182_796_370L;
+
+ /**
+ * Admin helper instance
+ */
+ @Inject
+ private PizzaWebRequestController beanHelper;
+
+ /**
+ * Confirmation key
+ */
+ private String confirmationKey;
+
+ /**
+ * Remote user bean
+ */
+ private final UserSessionBeanRemote userBean;
+
+ /**
+ * User controller
+ */
+ @Inject
+ private PizzaUserWebSessionController userController;
+
+ /**
+ * Default constructor
+ */
+ public PizzaConfirmationLinkWebRequestBean () {
+ // Try it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Try to lookup
+ this.userBean = (UserSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+ } catch (final NamingException e) {
+ // Throw again
+ throw new FaceletException(e);
+ }
+ }
+
+ @Override
+ public String getConfirmationKey () {
+ return this.confirmationKey;
+ }
+
+ @Override
+ public void setConfirmationKey (final String confirmationKey) {
+ this.confirmationKey = confirmationKey;
+ }
+
+ @Override
+ public void maybeConfirmUserAccount () {
+ // Is the confirmation key set?
+ if (this.getConfirmationKey() == null) {
+ // May be null if not set
+ return;
+ } else if (this.getConfirmationKey().isEmpty()) {
+ // Is empty string
+ return;
+ }
+
+ // Now try to find the user in user list, first get the whole list
+ List<User> users = this.userController.allUsers();
+
+ // Get iterator from it
+ Iterator<User> iterator = users.iterator();
+
+ // Init instance
+ User user = null;
+
+ // Then loop through all
+ while (iterator.hasNext()) {
+ // Get next user
+ User next = iterator.next();
+
+ // Same confirmation key?
+ if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) {
+ // Found it, then set it and abort loop
+ user = next;
+ break;
+ }
+ }
+
+ // Is the user instance null?
+ if ((null == user) || (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED)) {
+ // Then clear this bean and the helper
+ this.beanHelper.setUser(null);
+ } else {
+ // Set user ...
+ this.beanHelper.setUser(user);
+
+ // ... and copy it to the controller
+ this.beanHelper.copyUserToController();
+
+ // Try to confirm it
+ this.confirmUserAccount();
+ }
+ }
+
+ /**
+ * Tries to confirm the currently set user instance (in helper).
+ */
+ private void confirmUserAccount () {
+ // Get user instance
+ User user = this.beanHelper.getUser();
+
+ // Should be set
+ if (null == user) {
+ // Throw NPE
+ throw new NullPointerException("user is null");
+ } else if (user.getUserId() == null) {
+ // Abort here
+ throw new NullPointerException("user.userId is null"); //NOI18N
+ } else if (user.getUserId() < 1) {
+ // Invalid number
+ throw new IllegalArgumentException(MessageFormat.format("userId is not valid: {0}", user.getUserId())); //NOI18N
+ } else if (user.getUserAccountStatus() == UserAccountStatus.CONFIRMED) {
+ // Account is already confirmed
+ throw new FaceletException(new UserStatusConfirmedException(user));
+ } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) {
+ // Account is already confirmed
+ throw new FaceletException(new UserStatusLockedException(user));
+ } else if (user.getUserConfirmKey() == null) {
+ // Throw NPE
+ throw new NullPointerException("user.userConfirmKey is null"); //NOI18N
+ }
+
+ // Updated user instance
+ User updatedUser;
+
+ try {
+ // Get base URL
+ String baseUrl = FacesUtils.generateBaseUrl();
+
+ // Confirm account
+ updatedUser = this.userBean.confirmAccount(user, baseUrl);
+ } catch (final UserStatusConfirmedException | UserStatusLockedException ex) {
+ // Something unexpected happened
+ throw new FaceletException(MessageFormat.format("Cannot confirm user account {0}", user.getUserName()), ex); //NOI18N
+ }
+
+ // Set it again in helper
+ this.beanHelper.setUser(updatedUser);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.confirmlink;
+
+import java.io.Serializable;
+
+/**
+ * An interface for an email change controller
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface PizzaConfirmationLinkWebRequestController extends Serializable {
+
+ /**
+ * Getter for confirmation key
+ * <p>
+ * @return Confirmation key
+ */
+ String getConfirmationKey ();
+
+ /**
+ * Setter for confirmation key
+ * <p>
+ * @param confirmationKey Confirmation key
+ */
+ void setConfirmationKey (final String confirmationKey);
+
+ /**
+ * Tries to lookup the user by currently set confirmation key and if found
+ * tries to confirm it. If no user is found, the instance beanHelper.user is
+ * set to null. Other methods or JSF pages should then respond on this
+ * accordingly.
+ */
+ void maybeConfirmUserAccount ();
+
+}
import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.pizzaapplication.beans.BasePizzaController;
-import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController;
+import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController;
/**
* Administrative user bean (controller)
* Admin helper instance
*/
@Inject
- private PizzaAdminWebRequestController adminHelper;
+ private PizzaWebRequestController beanHelper;
/**
* Birth day
@Override
public String editContactData () {
// Get contact instance
- Contact contact = this.adminHelper.getContact();
+ Contact contact = this.beanHelper.getContact();
// Check if contact instance is in helper and valid
if (null == contact) {
// Throw NPE
- throw new NullPointerException("adminHelper.contact is null"); //NOI18N
+ throw new NullPointerException("beanHelper.contact is null"); //NOI18N
} else if (contact.getContactId() == null) {
// Throw NPE again
- throw new NullPointerException("adminHelper.contact.contactId is null"); //NOI18N //NOI18N
+ throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
} else if (contact.getContactId() < 1) {
// Invalid id
- throw new IllegalStateException(MessageFormat.format("adminHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+ throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
}
// Update all data in contact
import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus;
import org.mxchange.pizzaapplication.beans.BasePizzaController;
import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
-import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController;
import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote;
import org.mxchange.pizzaapplication.model.customer.PizzaCustomer;
+import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController;
/**
* Administrative customer bean (controller)
* Admin helper instance
*/
@Inject
- private PizzaAdminWebRequestController adminHelper;
+ private PizzaWebRequestController adminHelper;
/**
* An event being fired when an administrator has added a new customer
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * 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.pizzaapplication.beans.helper;
-
-import java.io.Serializable;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcustomercore.model.customer.Customer;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * An interface for general bean helper
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface PizzaAdminWebRequestController extends Serializable {
-
- /**
- * Getter for user instance
- * <p>
- * @return User instance
- */
- User getUser ();
-
- /**
- * Setter for user instance
- * <p>
- * @param user User instance
- */
- void setUser (final User user);
-
- /**
- * Copies currently set user instance's data to adminUserController
- */
- void copyUserToController ();
-
- /**
- * Returns a message key depending on if this contact is a user and/or a
- * contact. If this contact is unused, a default key is returned.
- * <p>
- * @param contact Contact instance to check
- * <p>
- * @return Message key
- */
- String getContactUsageMessageKey (final Contact contact);
-
- /**
- * Getter for contact instance
- * <p>
- * @return Contact instance
- */
- Contact getContact ();
-
- /**
- * Setter for contact instance
- * <p>
- * @param contact Contact instance
- */
- void setContact (final Contact contact);
-
- /**
- * Getter for customer instance
- * <p>
- * @return Customer instance
- */
- Customer getCustomer ();
-
- /**
- * Setter for customer instance
- * <p>
- * @param customer Contact instance
- */
- void setCustomer (final Customer customer);
-
- /**
- * Copies currently set contact instance's data to adminContactController
- */
- void copyContactToController ();
-
- /**
- * Copies currently set customer instance's data to adminCustomerController
- */
- void copyCustomerToController ();
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * 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.pizzaapplication.beans.helper;
-
-import java.text.MessageFormat;
-import javax.enterprise.context.RequestScoped;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcustomercore.model.customer.Customer;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
-import org.mxchange.pizzaapplication.beans.customer.PizzaAdminCustomerWebRequestController;
-import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionController;
-import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
-
-/**
- * A general helper for administrative beans
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Named ("adminHelper")
-@RequestScoped
-public class PizzaAdminWebRequestHelper implements PizzaAdminWebRequestController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 17_258_793_567_145_701L;
-
- /**
- * Regular contact controller
- */
- @Inject
- private PizzaAdminContactWebRequestController adminContactController;
-
- /**
- * Administrative user controller
- */
- @Inject
- private PizzaAdminCustomerWebRequestController adminCustomerController;
-
- /**
- * Contact instance
- */
- private Contact contact;
-
- /**
- * Contact instance
- */
- private Customer customer;
-
- /**
- * General user controller
- */
- @Inject
- private PizzaCustomerWebSessionController customerController;
-
- /**
- * User instance
- */
- private User user;
-
- /**
- * Regular user controller
- */
- @Inject
- private PizzaUserWebSessionController userController;
-
- /**
- * Default constructor
- */
- public PizzaAdminWebRequestHelper () {
- }
-
- @Override
- public void copyContactToController () {
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - CALLED!"); //NOI18N
-
- // Validate user instance
- if (this.getContact() == null) {
- // Throw NPE
- throw new NullPointerException("this.contact is null"); //NOI18N
- } else if (this.getContact().getContactId() == null) {
- // Throw NPE again
- throw new NullPointerException("this.contact.contactId is null"); //NOI18N
- } else if (this.getContact().getContactId() < 1) {
- // Not valid
- throw new IllegalStateException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId())); //NOI18N
- }
-
- // Set all fields: user
- this.adminContactController.copyContactToController(this.getContact());
-
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - EXIT!"); //NOI18N
- }
-
- @Override
- public void copyCustomerToController () {
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyCustomerToController - CALLED!"); //NOI18N
-
- // Validate user instance
- if (this.getCustomer() == null) {
- // Throw NPE
- throw new NullPointerException("this.customer is null"); //NOI18N
- } else if (this.getCustomer().getCustomerId() == null) {
- // Throw NPE again
- throw new NullPointerException("this.customer.customerId is null"); //NOI18N
- } else if (this.getCustomer().getCustomerId() < 1) {
- // Not valid
- throw new IllegalStateException(MessageFormat.format("this.customer.customerId={0} is not valid.", this.getCustomer().getCustomerId())); //NOI18N
- }
-
- // Set all fields: user
- this.adminCustomerController.copyCustomerToController(this.getCustomer());
-
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyCustomerToController - EXIT!"); //NOI18N
- }
-
- @Override
- public void copyUserToController () {
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - CALLED!"); //NOI18N
-
- // Validate user instance
- if (this.getUser() == null) {
- // Throw NPE
- throw new NullPointerException("this.user is null"); //NOI18N
- } else if (this.getUser().getUserId() == null) {
- // Throw NPE again
- throw new NullPointerException("this.user.userId is null"); //NOI18N
- } else if (this.getUser().getUserId() < 1) {
- // Not valid
- throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId())); //NOI18N
- }
-
- // Set all fields: user
- this.userController.setUserName(this.getUser().getUserName());
-
- // Log message
- //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - EXIT!"); //NOI18N
- }
-
- @Override
- public Contact getContact () {
- return this.contact;
- }
-
- @Override
- public void setContact (final Contact contact) {
- this.contact = contact;
- }
-
- @Override
- public String getContactUsageMessageKey (final Contact contact) {
- // The contact must be valid
- if (null == contact) {
- // Throw NPE
- throw new NullPointerException("contact is null"); //NOI18N
- } else if (contact.getContactId() == null) {
- // Throw again ...
- throw new NullPointerException("contact.contactId is null"); //NOI18N
- } else if (contact.getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
- }
-
- // Default key is "unused"
- String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
-
- // Check user/customer
- boolean isUserContact = this.userController.isContactFound(contact);
- boolean isCustomerContact = this.customerController.isContactFound(contact);
-
- // Check user first
- if (isUserContact && isCustomerContact) {
- // Is both
- messageKey = "CONTACT_IS_USER_CUSTOMER"; //NOI18N
- } else if (isUserContact) {
- // Only user
- messageKey = "CONTACT_IS_USER"; //NOI18N
- } else if (isCustomerContact) {
- // Only customer
- messageKey = "CONTACT_IS_CUSTOMER"; //NOI18N
- }
-
- // Return message key
- return messageKey;
- }
-
- @Override
- public Customer getCustomer () {
- return this.customer;
- }
-
- @Override
- public void setCustomer (final Customer customer) {
- this.customer = customer;
- }
-
- @Override
- public User getUser () {
- return this.user;
- }
-
- @Override
- public void setUser (final User user) {
- this.user = user;
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.helper;
+
+import java.io.Serializable;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcustomercore.model.customer.Customer;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An interface for general bean helper
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface PizzaWebRequestController extends Serializable {
+
+ /**
+ * Getter for user instance
+ * <p>
+ * @return User instance
+ */
+ User getUser ();
+
+ /**
+ * Setter for user instance
+ * <p>
+ * @param user User instance
+ */
+ void setUser (final User user);
+
+ /**
+ * Copies currently set user instance's data to adminUserController
+ */
+ void copyUserToController ();
+
+ /**
+ * Returns a message key depending on if this contact is a user and/or a
+ * contact. If this contact is unused, a default key is returned.
+ * <p>
+ * @param contact Contact instance to check
+ * <p>
+ * @return Message key
+ */
+ String getContactUsageMessageKey (final Contact contact);
+
+ /**
+ * Getter for contact instance
+ * <p>
+ * @return Contact instance
+ */
+ Contact getContact ();
+
+ /**
+ * Setter for contact instance
+ * <p>
+ * @param contact Contact instance
+ */
+ void setContact (final Contact contact);
+
+ /**
+ * Getter for customer instance
+ * <p>
+ * @return Customer instance
+ */
+ Customer getCustomer ();
+
+ /**
+ * Setter for customer instance
+ * <p>
+ * @param customer Contact instance
+ */
+ void setCustomer (final Customer customer);
+
+ /**
+ * Copies currently set contact instance's data to adminContactController
+ */
+ void copyContactToController ();
+
+ /**
+ * Copies currently set customer instance's data to adminCustomerController
+ */
+ void copyCustomerToController ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * 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.pizzaapplication.beans.helper;
+
+import java.text.MessageFormat;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcustomercore.model.customer.Customer;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
+import org.mxchange.pizzaapplication.beans.customer.PizzaAdminCustomerWebRequestController;
+import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionController;
+import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
+
+/**
+ * A general helper for beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("beanHelper")
+@RequestScoped
+public class PizzaWebRequestHelper implements PizzaWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 17_258_793_567_145_701L;
+
+ /**
+ * Regular contact controller
+ */
+ @Inject
+ private PizzaAdminContactWebRequestController adminContactController;
+
+ /**
+ * Administrative user controller
+ */
+ @Inject
+ private PizzaAdminCustomerWebRequestController adminCustomerController;
+
+ /**
+ * Contact instance
+ */
+ private Contact contact;
+
+ /**
+ * Contact instance
+ */
+ private Customer customer;
+
+ /**
+ * General user controller
+ */
+ @Inject
+ private PizzaCustomerWebSessionController customerController;
+
+ /**
+ * User instance
+ */
+ private User user;
+
+ /**
+ * Regular user controller
+ */
+ @Inject
+ private PizzaUserWebSessionController userController;
+
+ /**
+ * Default constructor
+ */
+ public PizzaWebRequestHelper () {
+ }
+
+ @Override
+ public void copyContactToController () {
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - CALLED!"); //NOI18N
+
+ // Validate user instance
+ if (this.getContact() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.contact is null"); //NOI18N
+ } else if (this.getContact().getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.contact.contactId is null"); //NOI18N
+ } else if (this.getContact().getContactId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId())); //NOI18N
+ }
+
+ // Set all fields: user
+ this.adminContactController.copyContactToController(this.getContact());
+
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - EXIT!"); //NOI18N
+ }
+
+ @Override
+ public void copyCustomerToController () {
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyCustomerToController - CALLED!"); //NOI18N
+
+ // Validate user instance
+ if (this.getCustomer() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.customer is null"); //NOI18N
+ } else if (this.getCustomer().getCustomerId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.customer.customerId is null"); //NOI18N
+ } else if (this.getCustomer().getCustomerId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("this.customer.customerId={0} is not valid.", this.getCustomer().getCustomerId())); //NOI18N
+ }
+
+ // Set all fields: user
+ this.adminCustomerController.copyCustomerToController(this.getCustomer());
+
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyCustomerToController - EXIT!"); //NOI18N
+ }
+
+ @Override
+ public void copyUserToController () {
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - CALLED!"); //NOI18N
+
+ // Validate user instance
+ if (this.getUser() == null) {
+ // Throw NPE
+ throw new NullPointerException("this.user is null"); //NOI18N
+ } else if (this.getUser().getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.user.userId is null"); //NOI18N
+ } else if (this.getUser().getUserId() < 1) {
+ // Not valid
+ throw new IllegalStateException(MessageFormat.format("this.user.userId={0} is not valid.", this.getUser().getUserId())); //NOI18N
+ }
+
+ // Set all fields: user
+ this.userController.setUserName(this.getUser().getUserName());
+
+ // Log message
+ //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - EXIT!"); //NOI18N
+ }
+
+ @Override
+ public Contact getContact () {
+ return this.contact;
+ }
+
+ @Override
+ public void setContact (final Contact contact) {
+ this.contact = contact;
+ }
+
+ @Override
+ public String getContactUsageMessageKey (final Contact contact) {
+ // The contact must be valid
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("contact.contactId is null"); //NOI18N
+ } else if (contact.getContactId() < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
+ }
+
+ // Default key is "unused"
+ String messageKey = "CONTACT_IS_UNUSED"; //NOI18N
+
+ // Check user/customer
+ boolean isUserContact = this.userController.isContactFound(contact);
+ boolean isCustomerContact = this.customerController.isContactFound(contact);
+
+ // Check user first
+ if (isUserContact && isCustomerContact) {
+ // Is both
+ messageKey = "CONTACT_IS_USER_CUSTOMER"; //NOI18N
+ } else if (isUserContact) {
+ // Only user
+ messageKey = "CONTACT_IS_USER"; //NOI18N
+ } else if (isCustomerContact) {
+ // Only customer
+ messageKey = "CONTACT_IS_CUSTOMER"; //NOI18N
+ }
+
+ // Return message key
+ return messageKey;
+ }
+
+ @Override
+ public Customer getCustomer () {
+ return this.customer;
+ }
+
+ @Override
+ public void setCustomer (final Customer customer) {
+ this.customer = customer;
+ }
+
+ @Override
+ public User getUser () {
+ return this.user;
+ }
+
+ @Override
+ public void setUser (final User user) {
+ this.user = user;
+ }
+
+}
*/
package org.mxchange.pizzaapplication.beans.user;
-import org.mxchange.pizzaapplication.beans.BasePizzaController;
import java.text.MessageFormat;
import java.util.Objects;
import javax.annotation.PostConstruct;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
import org.mxchange.jusercore.container.login.UserLoginContainer;
import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
import org.mxchange.jusercore.model.user.UserUtils;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController;
-import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController;
-import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
+import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController;
/**
* Administrative user bean (controller)
private Event<AdminAddedUserEvent> addedUserEvent;
/**
- * Admin helper instance
+ * Bean helper instance
*/
@Inject
- private PizzaAdminWebRequestController adminHelper;
-
- /**
- * Remote user bean
- */
- private final ContactSessionBeanRemote contactBean;
+ private PizzaWebRequestController beanHelper;
/**
* Regular contact controller
@Inject
private PizzaUserWebSessionController userController;
- /**
- * Login bean (controller)
- */
- @Inject
- private PizzaUserLoginWebSessionController userLoginController;
-
/**
* User name
*/
// Try to lookup
this.userBean = (UserSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
-
- // Try to lookup
- this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
} catch (final NamingException e) {
// Throw again
throw new FaceletException(e);
} else if (this.getUserName().isEmpty()) {
// Is empty
throw new IllegalArgumentException("userName is null"); //NOI18N
- } else if (this.adminHelper.getContact() == null) {
+ } else if (this.beanHelper.getContact() == null) {
// No contact instance set, so test required fields: gender, first name and family name
if (this.contactController.getGender() == null) {
// Throw NPE again
Contact contact;
// Is a contact instance in helper set?
- if (this.adminHelper.getContact() instanceof Contact) {
+ if (this.beanHelper.getContact() instanceof Contact) {
// Then use it for contact linking
- contact = this.adminHelper.getContact();
+ contact = this.beanHelper.getContact();
} else {
// Create contact instance
contact = this.contactController.createContactInstance();
if (this.userController.isUserNameRegistered(user)) {
// User name is already used
throw new FaceletException(new UserNameAlreadyRegisteredException(user));
- } else if ((this.adminHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) {
+ } else if ((this.beanHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) {
// Email address is already used
throw new FaceletException(new EmailAddressAlreadyRegisteredException(user));
} else if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) {
try {
// Now, that all is set, call EJB
- if (this.adminHelper.getContact() instanceof Contact) {
+ if (this.beanHelper.getContact() instanceof Contact) {
// Link contact with this user
updatedUser = this.userBean.linkUser(user);
// Remove contact instance
- this.adminHelper.setContact(null);
+ this.beanHelper.setContact(null);
} else {
// Add new contact
updatedUser = this.userBean.addUser(user);
}
// Clear helper
- this.adminHelper.setContact(null);
+ this.beanHelper.setContact(null);
// Fire event
this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser));
@Override
public String editUserData () {
// Get user instance
- User user = this.adminHelper.getUser();
+ User user = this.beanHelper.getUser();
// Null password means not setting it
String encryptedPassword = null;
// Check if user instance is in helper and valid
if (null == user) {
// Throw NPE
- throw new NullPointerException("adminHelper.user is null"); //NOI18N
+ throw new NullPointerException("beanHelper.user is null"); //NOI18N
} else if (user.getUserId() == null) {
// Throw NPE again
- throw new NullPointerException("adminHelper.user.userId is null"); //NOI18N //NOI18N
+ throw new NullPointerException("beanHelper.user.userId is null"); //NOI18N //NOI18N
} else if (user.getUserId() < 1) {
// Invalid id
- throw new IllegalStateException(MessageFormat.format("adminHelper.user.userId={0} is invalid", user.getUserId())); //NOI18N //NOI18N
+ throw new IllegalStateException(MessageFormat.format("beanHelper.user.userId={0} is invalid", user.getUserId())); //NOI18N //NOI18N
} else if (this.getUserName() == null) {
// Not all required fields are set
throw new NullPointerException("this.userName is null"); //NOI18N
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
- <h:panelGrid id="user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CONTACT}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty adminHelper.contact}">
- <f:facet name="header">
- <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CONTACT}">
- <f:param value="#{adminHelper.contact.contactId}" />
- </h:outputFormat>
- </f:facet>
-
- <h:column>
- <h:outputLabel for="contactId" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ID}" />
-
- <h:outputText id="contactId" styleClass="data_field" value="#{adminHelper.contact.contactId}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactCreated" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CREATED}" />
-
- <h:outputText id="contactCreated" styleClass="data_field" value="#{adminHelper.contact.contactCreated.time}">
- <f:convertDateTime for="contactCreated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactUpdated" styleClass="data_label" value="#{msg.ADMIN_CONTACT_UPDATED}" />
-
- <h:outputText id="contactUpdated" styleClass="data_field" value="#{adminHelper.contact.contactUpdated.time}">
- <f:convertDateTime for="contactUpdated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="isOwnContact" styleClass="data_label" value="#{msg.ADMIN_CONTACT_IS_OWN_CONTACT}" />
-
- <h:outputText id="isOwnContact" styleClass="data_field" value="#{adminHelper.contact.isOwnContact()}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />
-
- <h:outputText id="contactGender" styleClass="data_field" value="#{msg[adminHelper.contact.contactGender.messageKey]}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />
-
- <h:outputText id="contactTitle" styleClass="data_field" value="#{adminHelper.contact.contactTitle}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
-
- <h:outputText id="contactFirstName" styleClass="data_field" value="#{adminHelper.contact.contactFirstName}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
-
- <h:outputText id="contactFamilyName" styleClass="data_field" value="#{adminHelper.contact.contactFamilyName}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactStreet" styleClass="data_label" value="#{msg.ADMIN_CONTACT_STREET}" />
-
- <h:outputText id="contactStreet" styleClass="data_field" value="#{adminHelper.contact.contactStreet}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactHouseNumber" styleClass="data_label" value="#{msg.ADMIN_CONTACT_HOUSE_NUMBER}" />
-
- <h:outputText id="contactHouseNumber" styleClass="data_field" value="#{adminHelper.contact.contactHouseNumber}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactZipCode" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ZIP_CODE}" />
-
- <h:outputText id="contactZipCode" styleClass="data_field" value="#{adminHelper.contact.contactZipCode}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactCity" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CITY}" />
-
- <h:outputText id="contactCity" styleClass="data_field" value="#{adminHelper.contact.contactCity}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />
-
- <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{adminHelper.contact.contactEmailAddress}">
- <h:outputText value="#{adminHelper.contact.contactEmailAddress}" />
- </h:outputLink>
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactBirthday" styleClass="data_label" value="#{msg.ADMIN_CONTACT_BIRTHDAY}" />
-
- <h:outputText id="contactBirthday" styleClass="data_field" value="#{adminHelper.contact.contactBirthday.time}">
- <f:convertDateTime for="contactBirthday" type="date" />
- </h:outputText>
- </h:column>
- </h:panelGrid>
-</ui:composition>
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<ui:composition\r
+ xmlns="http://www.w3.org/1999/xhtml"\r
+ xmlns:f="http://java.sun.com/jsf/core"\r
+ xmlns:h="http://java.sun.com/jsf/html"\r
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">\r
+\r
+ <h:panelGrid id="user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_CONTACT}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty beanHelper.contact}">\r
+ <f:facet name="header">\r
+ <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CONTACT}">\r
+ <f:param value="#{beanHelper.contact.contactId}" />\r
+ </h:outputFormat>\r
+ </f:facet>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactId" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ID}" />\r
+\r
+ <h:outputText id="contactId" styleClass="data_field" value="#{beanHelper.contact.contactId}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactCreated" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CREATED}" />\r
+\r
+ <h:outputText id="contactCreated" styleClass="data_field" value="#{beanHelper.contact.contactCreated.time}">\r
+ <f:convertDateTime for="contactCreated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactUpdated" styleClass="data_label" value="#{msg.ADMIN_CONTACT_UPDATED}" />\r
+\r
+ <h:outputText id="contactUpdated" styleClass="data_field" value="#{beanHelper.contact.contactUpdated.time}">\r
+ <f:convertDateTime for="contactUpdated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="isOwnContact" styleClass="data_label" value="#{msg.ADMIN_CONTACT_IS_OWN_CONTACT}" />\r
+\r
+ <h:outputText id="isOwnContact" styleClass="data_field" value="#{beanHelper.contact.isOwnContact()}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />\r
+\r
+ <h:outputText id="contactGender" styleClass="data_field" value="#{msg[beanHelper.contact.contactGender.messageKey]}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />\r
+\r
+ <h:outputText id="contactTitle" styleClass="data_field" value="#{beanHelper.contact.contactTitle}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />\r
+\r
+ <h:outputText id="contactFirstName" styleClass="data_field" value="#{beanHelper.contact.contactFirstName}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />\r
+\r
+ <h:outputText id="contactFamilyName" styleClass="data_field" value="#{beanHelper.contact.contactFamilyName}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactStreet" styleClass="data_label" value="#{msg.ADMIN_CONTACT_STREET}" />\r
+\r
+ <h:outputText id="contactStreet" styleClass="data_field" value="#{beanHelper.contact.contactStreet}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactHouseNumber" styleClass="data_label" value="#{msg.ADMIN_CONTACT_HOUSE_NUMBER}" />\r
+\r
+ <h:outputText id="contactHouseNumber" styleClass="data_field" value="#{beanHelper.contact.contactHouseNumber}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactZipCode" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ZIP_CODE}" />\r
+\r
+ <h:outputText id="contactZipCode" styleClass="data_field" value="#{beanHelper.contact.contactZipCode}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactCity" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CITY}" />\r
+\r
+ <h:outputText id="contactCity" styleClass="data_field" value="#{beanHelper.contact.contactCity}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />\r
+\r
+ <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{beanHelper.contact.contactEmailAddress}">\r
+ <h:outputText value="#{beanHelper.contact.contactEmailAddress}" />\r
+ </h:outputLink>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactBirthday" styleClass="data_label" value="#{msg.ADMIN_CONTACT_BIRTHDAY}" />\r
+\r
+ <h:outputText id="contactBirthday" styleClass="data_field" value="#{beanHelper.contact.contactBirthday.time}">\r
+ <f:convertDateTime for="contactBirthday" type="date" />\r
+ </h:outputText>\r
+ </h:column>\r
+ </h:panelGrid>\r
+</ui:composition>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+ <h:form id="register_page2_form">
+ <div class="table">
+ <div class="table_header">
+ #{msg.GUEST_REGISTRATION_PAGE2_TITLE}
+ </div>
+
+ <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton styleClass="submit" type="submit" id="finish_registration" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
+ </div>
+ </div>
+ </h:form>
+</ui:composition>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
+ <h:commandButton styleClass="submit" type="submit" id="finish_registration_single" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
</div>
</div>
</h:form>
>
<f:metadata>
- <f:viewParam name="contactId" value="#{adminHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyContactToController()}" />
+ <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
+ <f:viewAction action="#{beanHelper.copyContactToController()}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
</ui:define>
<ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty adminHelper.contact}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty beanHelper.contact}" />
- <h:form id="admin_edit_user" rendered="#{not empty adminHelper.contact}">
+ <h:form id="admin_edit_user" rendered="#{not empty beanHelper.contact}">
<div class="table">
<div class="table_header">
<h:outputFormat value="#{msg.ADMIN_DELETE_CONTACT_TITLE}">
- <f:param value="#{adminHelper.contact.contactId}" />
+ <f:param value="#{beanHelper.contact.contactId}" />
</h:outputFormat>
</div>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="delete_button" type="submit" id="register" value="#{msg.BUTTON_ADMIN_DELETE_CONTACT}" action="#{adminContactController.deleteContactData()}" />
+ <h:commandButton styleClass="delete_button" type="submit" id="delete_contact" value="#{msg.BUTTON_ADMIN_DELETE_CONTACT}" action="#{adminContactController.deleteContactData()}" />
</div>
</div>
</h:form>
>
<f:metadata>
- <f:viewParam name="contactId" value="#{adminHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyContactToController()}" />
+ <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
+ <f:viewAction action="#{beanHelper.copyContactToController()}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
</ui:define>
<ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty adminHelper.contact}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty beanHelper.contact}" />
- <h:form id="admin_edit_user" rendered="#{not empty adminHelper.contact}">
+ <h:form id="admin_edit_user" rendered="#{not empty beanHelper.contact}">
<div class="table">
<div class="table_header">
<h:outputFormat value="#{msg.ADMIN_EDIT_CONTACT_TITLE}">
- <f:param value="#{adminHelper.contact.contactId}" />
+ <f:param value="#{beanHelper.contact.contactId}" />
</h:outputFormat>
</div>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_EDIT_CONTACT}" action="#{adminContactController.editContactData()}" />
+ <h:commandButton styleClass="submit" type="submit" id="edit_contact" value="#{msg.BUTTON_ADMIN_EDIT_CONTACT}" action="#{adminContactController.editContactData()}" />
</div>
</div>
</h:form>
<h:column>
<f:facet name="header">#{msg.ADMIN_CONTACT_USAGE}</f:facet>
- <h:outputText value="#{msg[adminHelper.getUserCustomerUsageMessageKey(contact)]}" />
+ <h:outputText value="#{msg[beanHelper.getUserCustomerUsageMessageKey(contact)]}" />
</h:column>
<h:column>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_CONTACT}" action="#{adminContactController.addContact()}" />
+ <h:commandButton styleClass="submit" type="submit" id="add_contact" value="#{msg.BUTTON_ADMIN_ADD_CONTACT}" action="#{adminContactController.addContact()}" />
</div>
</h:form>
</div>
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <f:metadata>
- <f:viewParam name="contactId" value="#{adminHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyContactToController()}" />
- </f:metadata>
-
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
- <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_SHOW_CONTACT}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_ADMIN_SHOW_CONTACT}
- </ui:define>
-
- <ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty adminHelper.contact}" />
-
- <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_data.tpl" />
-
- <div>
- <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_links.tpl">
- <ui:param name="contact" value="#{adminHelper.contact}" />
- </ui:include>
- </div>
-
- <div>
- <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">
- <ui:param name="cellphoneNumber" value="#{adminHelper.contact.contactCellphoneNumber}" />
- <ui:param name="contact" value="#{adminHelper.contact}" />
- </ui:include>
- </div>
- </ui:define>
- </ui:composition>
-</html>
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html\r
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"\r
+ xmlns="http://www.w3.org/1999/xhtml"\r
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"\r
+ xmlns:h="http://xmlns.jcp.org/jsf/html"\r
+ xmlns:f="http://xmlns.jcp.org/jsf/core"\r
+ >\r
+\r
+ <f:metadata>\r
+ <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" />\r
+ <f:viewAction action="#{beanHelper.copyContactToController()}" />\r
+ </f:metadata>\r
+\r
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">\r
+ <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_SHOW_CONTACT}</ui:define>\r
+\r
+ <ui:define name="content_header">\r
+ #{msg.CONTENT_TITLE_ADMIN_SHOW_CONTACT}\r
+ </ui:define>\r
+\r
+ <ui:define name="content">\r
+ <h:outputText styleClass="errors" value="#{msg.ERROR_CONTACT_ID_NOT_FOUND}" rendered="#{empty beanHelper.contact}" />\r
+\r
+ <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_data.tpl" />\r
+\r
+ <div>\r
+ <ui:include src="/WEB-INF/templates/admin/contact/admin_contact_links.tpl">\r
+ <ui:param name="contact" value="#{beanHelper.contact}" />\r
+ </ui:include>\r
+ </div>\r
+\r
+ <div>\r
+ <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">\r
+ <ui:param name="cellphoneNumber" value="#{beanHelper.contact.contactCellphoneNumber}" />\r
+ <ui:param name="contact" value="#{beanHelper.contact}" />\r
+ </ui:include>\r
+ </div>\r
+ </ui:define>\r
+ </ui:composition>\r
+</html>\r
</h:column>
</h:dataTable>
- <h:form id="add_country">
+ <h:form id="form_add_country">
<div class="table_medium">
<div class="table_header">
#{msg.ADMIN_ADD_COUNTRY_TITLE}
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}" action="#{adminCountryController.addCountry()}" />
+ <h:commandButton styleClass="submit" type="submit" id="add_country" value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}" action="#{adminCountryController.addCountry()}" />
</div>
</div>
</h:column>
</h:dataTable>
- <h:form id="add_provider">
+ <h:form id="form_add_mobile_provider">
<div class="table_medium">
<div class="table_header">
#{msg.ADMIN_ADD_MOBILE_PROVIDER_TITLE}
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_MOBILE_PROVIDER}" action="#{adminMobileProviderController.addMobileProvider()}" />
+ <h:commandButton styleClass="submit" type="submit" id="add_mobile_provider" value="#{msg.BUTTON_ADMIN_ADD_MOBILE_PROVIDER}" action="#{adminMobileProviderController.addMobileProvider()}" />
</div>
</div>
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <f:metadata>
- <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyUserToController()}" />
- </f:metadata>
-
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
- <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_DELETE_USER}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_ADMIN_DELETE_USER}
- </ui:define>
-
- <ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty adminHelper.user}" />
-
- Here goes your content.
- </ui:define>
- </ui:composition>
-</html>
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html\r
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"\r
+ xmlns="http://www.w3.org/1999/xhtml"\r
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"\r
+ xmlns:h="http://xmlns.jcp.org/jsf/html"\r
+ xmlns:f="http://xmlns.jcp.org/jsf/core"\r
+ >\r
+\r
+ <f:metadata>\r
+ <f:viewParam name="userId" value="#{beanHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />\r
+ <f:viewAction action="#{beanHelper.copyUserToController()}" />\r
+ </f:metadata>\r
+\r
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">\r
+ <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_DELETE_USER}</ui:define>\r
+\r
+ <ui:define name="content_header">\r
+ #{msg.CONTENT_TITLE_ADMIN_DELETE_USER}\r
+ </ui:define>\r
+\r
+ <ui:define name="content">\r
+ <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />\r
+\r
+ Here goes your content.\r
+ </ui:define>\r
+ </ui:composition>\r
+</html>\r
>
<f:metadata>
- <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyUserToController()}" />
+ <f:viewParam name="userId" value="#{beanHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
+ <f:viewAction action="#{beanHelper.copyUserToController()}" />
</f:metadata>
<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
</ui:define>
<ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty adminHelper.user}" />
+ <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />
- <h:form id="admin_edit_user" rendered="#{not empty adminHelper.user}">
+ <h:form id="form_edit_user" rendered="#{not empty beanHelper.user}">
<div class="table">
<div class="table_header">
#{msg.ADMIN_EDIT_USER_TITLE}
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_EDIT_USER}" action="#{adminUserController.editUserData()}" />
+ <h:commandButton styleClass="submit" type="submit" id="edit_user" value="#{msg.BUTTON_ADMIN_EDIT_USER}" action="#{adminUserController.editUserData()}" />
</div>
</div>
</h:form>
</div>
<div class="table_right_medium">
- <h:selectOneMenu styleClass="select" id="userContact" value="#{adminHelper.contact}" converter="ContactConverter">
+ <h:selectOneMenu styleClass="select" id="userContact" value="#{beanHelper.contact}" converter="ContactConverter">
<f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{userController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactGender.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
</h:selectOneMenu>
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_USER}" action="#{adminUserController.addUser()}" />
+ <h:commandButton styleClass="submit" type="submit" id="add_user" value="#{msg.BUTTON_ADMIN_ADD_USER}" action="#{adminUserController.addUser()}" />
</div>
</h:form>
</div>
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <f:metadata>
- <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyUserToController()}" />
- </f:metadata>
-
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
- <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_SHOW_USER}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_ADMIN_SHOW_USER}
- </ui:define>
-
- <ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty adminHelper.user}" />
-
- <h:panelGrid id="user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty adminHelper.user}">
- <f:facet name="header">
- <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_USER}">
- <f:param value="#{adminHelper.user.userName}" />
- <f:param value="#{adminHelper.user.userId}" />
- </h:outputFormat>
- </f:facet>
-
- <h:column>
- <h:outputLabel for="userId" styleClass="data_label" value="#{msg.ADMIN_USER_ID}" />
-
- <h:outputText id="userId" styleClass="data_field" value="#{adminHelper.user.userId}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="userName" styleClass="data_label" value="#{msg.ADMIN_USER_NAME}" />
-
- <h:outputText id="userName" styleClass="data_field" value="#{adminHelper.user.userName}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="userCreated" styleClass="data_label" value="#{msg.ADMIN_USER_CREATED}" />
-
- <h:outputText id="userCreated" styleClass="data_field" value="#{adminHelper.user.userCreated.time}">
- <f:convertDateTime for="userCreated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="userUpdated" styleClass="data_label" value="#{msg.ADMIN_USER_UPDATED}" />
-
- <h:outputText id="userUpdated" styleClass="data_field" value="#{adminHelper.user.userUpdated.time}">
- <f:convertDateTime for="userUpdated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="userAccountStatus" styleClass="data_label" value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />
-
- <h:outputText id="userAccountStatus" styleClass="data_field #{adminHelper.user.userAccountStatus.styleClass}" value="#{msg[adminHelper.user.userAccountStatus.messageKey]}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="userProfileMode" styleClass="data_label" value="#{msg.ADMIN_USER_PROFILE_MODE}" />
-
- <h:outputText id="userProfileMode" styleClass="data_field" value="#{msg[adminHelper.user.userProfileMode.messageKey]}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="userLastLocked" styleClass="data_label" value="#{msg.ADMIN_USER_LAST_LOCKED}" />
-
- <h:outputText id="userLastLocked" styleClass="data_field" value="#{adminHelper.user.userLastLocked.time}">
- <f:convertDateTime for="userLastLocked" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="lastLockedReason" styleClass="data_label" value="#{msg.ADMIN_USER_LAST_LOCKED_REASON}" />
-
- <h:outputText id="lastLockedReason" styleClass="data_field" value="#{adminHelper.user.userLastLockedReason}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactCreated" styleClass="data_label" value="#{msg.ADMIN_USER_CONTACT_CREATED}" />
-
- <h:outputText id="contactCreated" styleClass="data_field" value="#{adminHelper.user.userContact.contactCreated.time}">
- <f:convertDateTime for="contactCreated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactUpdated" styleClass="data_label" value="#{msg.ADMIN_USER_CONTACT_UPDATED}" />
-
- <h:outputText id="contactUpdated" styleClass="data_field" value="#{adminHelper.user.userContact.contactUpdated.time}">
- <f:convertDateTime for="contactUpdated" type="both" />
- </h:outputText>
- </h:column>
-
- <h:column>
- <h:outputLabel for="isOwnContact" styleClass="data_label" value="#{msg.ADMIN_CONTACT_IS_OWN_CONTACT}" />
-
- <h:outputText id="isOwnContact" styleClass="data_field" value="#{adminHelper.user.userContact.isOwnContact()}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />
-
- <h:outputText id="contactGender" styleClass="data_field" value="#{msg[adminHelper.user.userContact.contactGender.messageKey]}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />
-
- <h:outputText id="contactTitle" styleClass="data_field" value="#{adminHelper.user.userContact.contactTitle}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
-
- <h:outputText id="contactFirstName" styleClass="data_field" value="#{adminHelper.user.userContact.contactFirstName}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
-
- <h:outputText id="contactFamilyName" styleClass="data_field" value="#{adminHelper.user.userContact.contactFamilyName}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactStreet" styleClass="data_label" value="#{msg.ADMIN_CONTACT_STREET}" />
-
- <h:outputText id="contactStreet" styleClass="data_field" value="#{adminHelper.user.userContact.contactStreet}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactHouseNumber" styleClass="data_label" value="#{msg.ADMIN_CONTACT_HOUSE_NUMBER}" />
-
- <h:outputText id="contactHouseNumber" styleClass="data_field" value="#{adminHelper.user.userContact.contactHouseNumber}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactZipCode" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ZIP_CODE}" />
-
- <h:outputText id="contactZipCode" styleClass="data_field" value="#{adminHelper.user.userContact.contactZipCode}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactCity" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CITY}" />
-
- <h:outputText id="contactCity" styleClass="data_field" value="#{adminHelper.user.userContact.contactCity}" />
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />
-
- <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{adminHelper.user.userContact.contactEmailAddress}">
- <h:outputText value="#{adminHelper.user.userContact.contactEmailAddress}" />
- </h:outputLink>
- </h:column>
-
- <h:column>
- <h:outputLabel for="contactBirthday" styleClass="data_label" value="#{msg.ADMIN_CONTACT_BIRTHDAY}" />
-
- <h:outputText id="contactBirthday" styleClass="data_field" value="#{adminHelper.user.userContact.contactBirthday.time}">
- <f:convertDateTime for="contactBirthday" type="date" />
- </h:outputText>
- </h:column>
- </h:panelGrid>
-
- <div>
- <ui:include src="/WEB-INF/templates/admin/user/admin_user_links.tpl">
- <ui:param name="user" value="#{adminHelper.user}" />
- </ui:include>
- </div>
-
- <div>
- <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">
- <ui:param name="cellphoneNumber" value="#{adminHelper.user.userContact.contactCellphoneNumber}" />
- <ui:param name="contact" value="#{adminHelper.user.userContact}" />
- </ui:include>
- </div>
- </ui:define>
- </ui:composition>
-</html>
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html\r
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"\r
+ xmlns="http://www.w3.org/1999/xhtml"\r
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"\r
+ xmlns:h="http://xmlns.jcp.org/jsf/html"\r
+ xmlns:f="http://xmlns.jcp.org/jsf/core"\r
+ >\r
+\r
+ <f:metadata>\r
+ <f:viewParam name="userId" value="#{beanHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />\r
+ <f:viewAction action="#{beanHelper.copyUserToController()}" />\r
+ </f:metadata>\r
+\r
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">\r
+ <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_SHOW_USER}</ui:define>\r
+\r
+ <ui:define name="content_header">\r
+ #{msg.CONTENT_TITLE_ADMIN_SHOW_USER}\r
+ </ui:define>\r
+\r
+ <ui:define name="content">\r
+ <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />\r
+\r
+ <h:panelGrid id="user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER}" headerClass="table_header_column" styleClass="table_big" columns="3" rendered="#{not empty beanHelper.user}">\r
+ <f:facet name="header">\r
+ <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_USER}">\r
+ <f:param value="#{beanHelper.user.userName}" />\r
+ <f:param value="#{beanHelper.user.userId}" />\r
+ </h:outputFormat>\r
+ </f:facet>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userId" styleClass="data_label" value="#{msg.ADMIN_USER_ID}" />\r
+\r
+ <h:outputText id="userId" styleClass="data_field" value="#{beanHelper.user.userId}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userName" styleClass="data_label" value="#{msg.ADMIN_USER_NAME}" />\r
+\r
+ <h:outputText id="userName" styleClass="data_field" value="#{beanHelper.user.userName}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userCreated" styleClass="data_label" value="#{msg.ADMIN_USER_CREATED}" />\r
+\r
+ <h:outputText id="userCreated" styleClass="data_field" value="#{beanHelper.user.userCreated.time}">\r
+ <f:convertDateTime for="userCreated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userUpdated" styleClass="data_label" value="#{msg.ADMIN_USER_UPDATED}" />\r
+\r
+ <h:outputText id="userUpdated" styleClass="data_field" value="#{beanHelper.user.userUpdated.time}">\r
+ <f:convertDateTime for="userUpdated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userAccountStatus" styleClass="data_label" value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />\r
+\r
+ <h:outputText id="userAccountStatus" styleClass="data_field #{beanHelper.user.userAccountStatus.styleClass}" value="#{msg[beanHelper.user.userAccountStatus.messageKey]}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userProfileMode" styleClass="data_label" value="#{msg.ADMIN_USER_PROFILE_MODE}" />\r
+\r
+ <h:outputText id="userProfileMode" styleClass="data_field" value="#{msg[beanHelper.user.userProfileMode.messageKey]}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="userLastLocked" styleClass="data_label" value="#{msg.ADMIN_USER_LAST_LOCKED}" />\r
+\r
+ <h:outputText id="userLastLocked" styleClass="data_field" value="#{beanHelper.user.userLastLocked.time}">\r
+ <f:convertDateTime for="userLastLocked" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="lastLockedReason" styleClass="data_label" value="#{msg.ADMIN_USER_LAST_LOCKED_REASON}" />\r
+\r
+ <h:outputText id="lastLockedReason" styleClass="data_field" value="#{beanHelper.user.userLastLockedReason}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactCreated" styleClass="data_label" value="#{msg.ADMIN_USER_CONTACT_CREATED}" />\r
+\r
+ <h:outputText id="contactCreated" styleClass="data_field" value="#{beanHelper.user.userContact.contactCreated.time}">\r
+ <f:convertDateTime for="contactCreated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactUpdated" styleClass="data_label" value="#{msg.ADMIN_USER_CONTACT_UPDATED}" />\r
+\r
+ <h:outputText id="contactUpdated" styleClass="data_field" value="#{beanHelper.user.userContact.contactUpdated.time}">\r
+ <f:convertDateTime for="contactUpdated" type="both" />\r
+ </h:outputText>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="isOwnContact" styleClass="data_label" value="#{msg.ADMIN_CONTACT_IS_OWN_CONTACT}" />\r
+\r
+ <h:outputText id="isOwnContact" styleClass="data_field" value="#{beanHelper.user.userContact.isOwnContact()}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactGender" styleClass="data_label" value="#{msg.ADMIN_CONTACT_GENDER}" />\r
+\r
+ <h:outputText id="contactGender" styleClass="data_field" value="#{msg[beanHelper.user.userContact.contactGender.messageKey]}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactTitle" styleClass="data_label" value="#{msg.ADMIN_CONTACT_TITLE}" />\r
+\r
+ <h:outputText id="contactTitle" styleClass="data_field" value="#{beanHelper.user.userContact.contactTitle}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactFirstName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />\r
+\r
+ <h:outputText id="contactFirstName" styleClass="data_field" value="#{beanHelper.user.userContact.contactFirstName}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactFamilyName" styleClass="data_label" value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />\r
+\r
+ <h:outputText id="contactFamilyName" styleClass="data_field" value="#{beanHelper.user.userContact.contactFamilyName}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactStreet" styleClass="data_label" value="#{msg.ADMIN_CONTACT_STREET}" />\r
+\r
+ <h:outputText id="contactStreet" styleClass="data_field" value="#{beanHelper.user.userContact.contactStreet}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactHouseNumber" styleClass="data_label" value="#{msg.ADMIN_CONTACT_HOUSE_NUMBER}" />\r
+\r
+ <h:outputText id="contactHouseNumber" styleClass="data_field" value="#{beanHelper.user.userContact.contactHouseNumber}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactZipCode" styleClass="data_label" value="#{msg.ADMIN_CONTACT_ZIP_CODE}" />\r
+\r
+ <h:outputText id="contactZipCode" styleClass="data_field" value="#{beanHelper.user.userContact.contactZipCode}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactCity" styleClass="data_label" value="#{msg.ADMIN_CONTACT_CITY}" />\r
+\r
+ <h:outputText id="contactCity" styleClass="data_field" value="#{beanHelper.user.userContact.contactCity}" />\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactEmailAddress" styleClass="data_label" value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />\r
+\r
+ <h:outputLink id="contactEmailAddress" styleClass="data_field" value="mailto:#{beanHelper.user.userContact.contactEmailAddress}">\r
+ <h:outputText value="#{beanHelper.user.userContact.contactEmailAddress}" />\r
+ </h:outputLink>\r
+ </h:column>\r
+\r
+ <h:column>\r
+ <h:outputLabel for="contactBirthday" styleClass="data_label" value="#{msg.ADMIN_CONTACT_BIRTHDAY}" />\r
+\r
+ <h:outputText id="contactBirthday" styleClass="data_field" value="#{beanHelper.user.userContact.contactBirthday.time}">\r
+ <f:convertDateTime for="contactBirthday" type="date" />\r
+ </h:outputText>\r
+ </h:column>\r
+ </h:panelGrid>\r
+\r
+ <div>\r
+ <ui:include src="/WEB-INF/templates/admin/user/admin_user_links.tpl">\r
+ <ui:param name="user" value="#{beanHelper.user}" />\r
+ </ui:include>\r
+ </div>\r
+\r
+ <div>\r
+ <ui:include src="/WEB-INF/templates/admin/cellphone/admin_cellphone_add_show.tpl">\r
+ <ui:param name="cellphoneNumber" value="#{beanHelper.user.userContact.contactCellphoneNumber}" />\r
+ <ui:param name="contact" value="#{beanHelper.user.userContact}" />\r
+ </ui:include>\r
+ </div>\r
+ </ui:define>\r
+ </ui:composition>\r
+</html>\r
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <f:metadata>
- <f:viewParam name="userId" value="#{adminHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />
- <f:viewAction action="#{adminHelper.copyUserToController()}" />
- </f:metadata>
-
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
- <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_UNLOCK_USER}</ui:define>
-
- <ui:define name="content_header">
- #{msg.CONTENT_TITLE_ADMIN_UNLOCK_USER}
- </ui:define>
-
- <ui:define name="content">
- <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty adminHelper.user}" />
-
- Here goes your content.
- </ui:define>
- </ui:composition>
-</html>
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html\r
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"\r
+ xmlns="http://www.w3.org/1999/xhtml"\r
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"\r
+ xmlns:h="http://xmlns.jcp.org/jsf/html"\r
+ xmlns:f="http://xmlns.jcp.org/jsf/core"\r
+ >\r
+\r
+ <f:metadata>\r
+ <f:viewParam name="userId" value="#{beanHelper.user}" converter="UserConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_USER_ID_NOT_SET}" />\r
+ <f:viewAction action="#{beanHelper.copyUserToController()}" />\r
+ </f:metadata>\r
+\r
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">\r
+ <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_UNLOCK_USER}</ui:define>\r
+\r
+ <ui:define name="content_header">\r
+ #{msg.CONTENT_TITLE_ADMIN_UNLOCK_USER}\r
+ </ui:define>\r
+\r
+ <ui:define name="content">\r
+ <h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />\r
+\r
+ Here goes your content.\r
+ </ui:define>\r
+ </ui:composition>\r
+</html>\r
<ui:define name="content">
<ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
- <h:form id="resend_link_form">
+ <h:form id="form_resend_link">
<div class="table">
<div class="table_header">
<h:outputText value="#{msg.GUEST_RESEND_LINK_TITLE}" />
<div class="table_footer">
<h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_RESEND_CONFIRMATION_LINK}" action="#{resendController.doResendLink()}" />
+ <h:commandButton styleClass="submit" type="submit" id="resend_link" value="#{msg.BUTTON_RESEND_CONFIRMATION_LINK}" action="#{resendController.doResendLink()}" />
</div>
</div>
</h:form>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <f:metadata>
+ <f:viewParam name="confirmKey" value="#{confirmationLinkController.confirmationKey}" />
+ <f:viewAction onPostback="true" action="#{confirmationLinkController.maybeConfirmUserAccount()}" />
+ </f:metadata>
+
+ <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
+ <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_CONFIRM_ACCOUNT}</ui:define>
+
+ <ui:define name="content_header">
+ #{msg.CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT}
+ </ui:define>
+
+ <ui:define name="content">
+ <ui:fragment rendered="#{not empty confirmationLinkController.confirmationKey}">
+ <ui:fragment rendered="#{not empty beanHelper.user}">
+ <div class="table">
+ <div class="table_header">
+ <h:outputText value="#{msg.GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE}" />
+ </div>
+
+ <div class="table_row">
+ <h:outputFormat value="#{msg.GUEST_USER_CONFIRM_ACCOUNT_DONE}">
+ <f:param value="#{msg[beanHelper.user.userContact.contactGender.messageKey]}" />
+ <f:param value="#{beanHelper.user.userContact.contactFirstName}" />
+ <f:param value="#{beanHelper.user.userContact.contactFamilyName}" />
+ </h:outputFormat>
+ </div>
+ </div>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{empty beanHelper.user}">
+ <h:outputText styleClass="errors" value="#{msg.GUEST_CONFIRMATION_LINK_INVALID}" />
+ </ui:fragment>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{empty confirmationLinkController.confirmationKey}">
+ <h:outputText styleClass="errors" value="#{msg.GUEST_CONFIRMATION_KEY_NOT_SET}" />
+ </ui:fragment>
+ </ui:define>
+ </ui:composition>
+</html>