]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with resending confirmation links:
authorRoland Häder <roland@mxchange.org>
Fri, 13 May 2016 14:16:28 +0000 (16:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 13 May 2016 19:55:24 +0000 (21:55 +0200)
- added form for resending confirmation link, surely the user only knows the registered email address
- added controller (object and interface) for it
- added missing i18n strings

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/resendlink/PIzzaResendLinkWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionController.java [new file with mode: 0644]
web/customer/empty_basket.xhtml

index 6429fd1e3c5ccc8dd7204c6bf3b95fae9c92f5b6..7e24534d4f758cc4b903cf07a0bb7be089808f70 100644 (file)
@@ -501,3 +501,9 @@ ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Fehler: Erneutes Aussenden des
 ERROR_GUEST_USER_PROFILE_DEACTIVATED=Fehler: \u00d6ffentliche Benutzerprofile sind administrativ deaktiviert.
 EMAIL_ADDRESS_NOT_ENTERED=Bitte geben Sie Ihre Email-Adresse ein.
 EMAIL_ADDRESS_REPEAT_NOT_ENTERED=Bitte wiederholen Sie Ihre Email-Adresse.
+BUTTON_RESEND_CONFIRMATION_LINK=Best\u00e4tigungslink erneut aussenden
+GUEST_RESEND_LINK_TITLE=Best\u00e4tigungslink erneut aussenden
+GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS=Bitte bei der Anmeldung verwendete Email-Adresse eingeben:
+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.
index b0d5a1d0fe378e2b698b7c41e01c29e58a74de65..ebb59280180a1ef604b072fd740b8de9124c210d 100644 (file)
@@ -462,3 +462,9 @@ ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Error: Resending confirmation l
 ERROR_GUEST_USER_PROFILE_DEACTIVATED=Error: Public user profiles are deactivated by administrators.
 EMAIL_ADDRESS_NOT_ENTERED=Please enter your email address.
 EMAIL_ADDRESS_REPEAT_NOT_ENTERED=Please repeat your email address.
+BUTTON_RESEND_CONFIRMATION_LINK=Resend confirmation link
+GUEST_RESEND_LINK_TITLE=Resend confirmation link
+GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS=Please enter email address you have used on registration:
+GUEST_RESEND_CONFIRMATION_LINK_NOTICE=The old confirmation link won't work after this. Please always use the one from newer email.
+RESEND_CONFIRMATION_LINK_LEGEND=Enter email address:
+RESEND_CONFIRMATION_LINK_LEGEND_TITLE=Please enter your email address you have used on registration.
diff --git a/src/java/org/mxchange/pizzaapplication/beans/resendlink/PIzzaResendLinkWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/resendlink/PIzzaResendLinkWebSessionBean.java
new file mode 100644 (file)
index 0000000..3c7928f
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * 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.resendlink;
+
+import javax.enterprise.context.SessionScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
+
+/**
+ * A web session bean for resending confirmation link
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("resendController")
+@SessionScoped
+public class PIzzaResendLinkWebSessionBean extends BasePizzaController implements PizzaResendLinkWebSessionController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 186_078_724_659_153L;
+
+       /**
+        * Email address 1 (changing)
+        */
+       private String emailAddress;
+
+       /**
+        * EJB for resending confirmation link
+        */
+       private ResendLinkSessionBeanRemote emailBean;
+
+       /**
+        * Default constructor
+        */
+       public PIzzaResendLinkWebSessionBean () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.emailBean = (ResendLinkSessionBeanRemote) context.lookup(""); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+       }
+
+       @Override
+       public String doResendLink () {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public String getEmailAddress () {
+               return this.emailAddress;
+       }
+
+       @Override
+       public void setEmailAddress (final String emailAddress) {
+               this.emailAddress = emailAddress;
+       }
+
+       /**
+        * Clears email address fields so the user has to re-enter them
+        */
+       private void clear () {
+               // Clear fields
+               this.setEmailAddress(null);
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionController.java
new file mode 100644 (file)
index 0000000..d65b256
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.resendlink;
+
+import java.io.Serializable;
+
+/**
+ * An interface for an email change controller
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface PizzaResendLinkWebSessionController extends Serializable {
+
+       /**
+        * Getter for email address 1 (changing)
+        * <p>
+        * @return Email address
+        */
+       String getEmailAddress ();
+
+       /**
+        * Setter for email address 1 (changing)
+        * <p>
+        * @param emailAddress Email address 1
+        */
+       void setEmailAddress (final String emailAddress);
+
+       /**
+        * Resends (new) confirmation link to given email address, if found.
+        * Otherwise an exception is thrown. On success a redirect takes place.
+        * <p>
+        * @return Redirection target
+        */
+       String doResendLink ();
+
+}
index 770172b2e64c07dd794eddc2c20fa0bd860f85d8..0865128c280a22b6f01fdd9496e4c90b365ce356 100644 (file)
 
                <ui:define name="content">
                        <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
-                               Here goes your content.
+                               <h:form id="resend_link_form">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       <h:outputText value="#{msg.GUEST_RESEND_LINK_TITLE}" />
+                                               </div>
+
+                                               <fieldset id="email_address_notice">
+                                                       <legend title="#{msg.RESEND_CONFIRMATION_LINK_LEGEND_TITLE}">#{msg.RESEND_CONFIRMATION_LINK_LEGEND}</legend>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left25">
+                                                                       <h:outputLabel for="emailAddress" value="#{msg.GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS}" />
+                                                               </div>
+
+                                                               <div class="table_right75">
+                                                                       <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}">
+                                                                               <f:validator validatorId="EmailAddressValidator" />
+                                                                       </h:inputText>
+                                                               </div>
+                                                       </div>
+
+                                                       <div class="table_row">
+                                                               <h:outputText value="#{msg.GUEST_RESEND_CONFIRMATION_LINK_NOTICE}" />
+                                                       </div>
+                                               </fieldset>
+
+                                               <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()}" />
+                                               </div>
+                                       </div>
+                               </h:form>
                        </ui:fragment>
 
                        <ui:fragment rendered="#{not registerController.isResendConfirmationLinkEnabled()}">