]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit with fixing:
authorRoland Häder <roland@mxchange.org>
Sun, 6 Aug 2017 19:37:03 +0000 (21:37 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 6 Aug 2017 19:37:03 +0000 (21:37 +0200)
- added missing method isRequiredPersonalDataSet() to administrative contact
  controller
- removed more methods from interfaces which are for JSF views only
- moved JNDI lookup into PostConstruct-annotated method, still not really
  fixing it as this will be invoked on construction of bean instances (in web
  container). This later really needs to be rewritten to a service-locator
  approach
- added observer method afterCustomerCreatedEvent() which will wait for events
  being fired when a customer instance has been created
- JSF views should normally not have HTML declaration, but Mojarra has a long
  outstanding bug that will not render doctype when the declaration is in the
  "master" template (see WEB-INF/templates/base.tpl)

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestController.java
web/WEB-INF/web.xml
web/admin/customer/admin_customer_list.xhtml
web/basket.xhtml
web/customer/checkout.xhtml
web/customer/checkout2.xhtml
web/customer/checkout_done.xhtml
web/customer/empty_basket.xhtml

index 1045da40fe418936a4a77c65f37a42cbbe228e9f..1637ecc19cd22d534fad18b4845ae149b13f769d 100644 (file)
@@ -1081,6 +1081,18 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                return isRequired;
        }
 
+       @Override
+       public boolean isRequiredPersonalDataSet () {
+               return ((this.getPersonalTitle() != null) &&
+                               (this.getFirstName() != null) &&
+                               (this.getFamilyName() != null) &&
+                               (this.getStreet() != null) &&
+                               (this.getHouseNumber() != null) &&
+                               (this.getZipCode() != null) &&
+                               (this.getCity() != null) &&
+                               (this.getEmailAddress() != null));
+       }
+
        @Override
        public void validateContactData () {
                if (this.getPersonalTitle() == null) {
@@ -1142,9 +1154,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        /**
         * Checks whether the given contact is found
         * <p>
-        * @param contact Contact inastance
-        *
-        * @return Wether contact has been found
+        * @param contact Contact instance
+        * <p>
+        * @return Whether contact has been found
         */
        private boolean isSameContactFound (final Contact contact) {
                // Default is not found
index edbff61e2593b2aad84c1d1b72783dffc393f9c1..2daa988fa87904d72d4a80798b4f16410b55a169 100644 (file)
@@ -66,4 +66,11 @@ public interface PizzaAdminContactWebRequestController extends Serializable {
        @Deprecated
        boolean isPersonalTitleRequired ();
 
+       /**
+        * Checks whether all required personal data is set
+        * <p>
+        * @return Whether the required personal data is set
+        */
+       boolean isRequiredPersonalDataSet ();
+
 }
index 6ab779f7297fdda42b8a3bb7e178138f12aca726..f998d3dbafa011b61440bfd34a7f202baaf562e7 100644 (file)
@@ -20,6 +20,7 @@ import java.text.MessageFormat;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
@@ -28,10 +29,10 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcustomercore.events.customer.added.AdminAddedCustomerEvent;
 import org.mxchange.jcustomercore.events.customer.added.ObservableAdminAddedCustomerEvent;
+import org.mxchange.jcustomercore.events.customer.created.ObservableCreatedCustomerEvent;
 import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;
 import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus;
@@ -72,6 +73,11 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem
        @Inject
        private PizzaWebRequestHelperController beanHelper;
 
+       /**
+        * Contact instance
+        */
+       private Contact contact;
+
        /**
         * An event being fired when an administrator has added a new customer
         */
@@ -89,56 +95,50 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem
         * Default constructor
         */
        public PizzaAdminCustomerWebRequestBean () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.adminCustomerBean = (PizzaAdminCustomerSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/admincustomer!org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
        }
 
-       @Override
+       /**
+        * Adds customer to database if not already added. This method should return
+        * a redirect outcome on success.
+        * <p>
+        * @return Redirect outcome
+        */
        public String addCustomer () {
                // Are at least some fields added?
-               if ((this.beanHelper.getContact() == null) && (!this.isCustomerDataSet())) {
+               if ((this.getContact() == null) && (!this.isCustomerDataSet())) {
                        // Not all customer data is set
                        throw new FaceletException("Please provide minimum personal data: gender, first_name, family_name"); //NOI18N
                }
 
                // Init contact
-               Contact contact;
+               Contact customerContact;
 
                // Is the contact set in helper?
-               if (this.beanHelper.getContact() instanceof Contact) {
+               if (this.getContact() instanceof Contact) {
                        // Get from helper
-                       contact = this.beanHelper.getContact();
+                       customerContact = this.getContact();
                } else {
                        // Get new contact instance
-                       contact = this.adminContactController.createContactInstance();
+                       customerContact = this.adminContactController.createContactInstance();
                }
 
                // Ask the EJB for a free customer number
                String customerNumber = this.adminCustomerBean.createCustomerNumber();
 
                // Create new customer instance
-               Customer customer = new PizzaCustomer(CustomerAccountStatus.CONFIRMED, contact, customerNumber);
+               Customer customer = new PizzaCustomer(CustomerAccountStatus.CONFIRMED, customerContact, customerNumber);
 
                // Init instance
                Customer updatedCustomer;
 
                try {
                        // Add/link customer and return updated
-                       if (this.beanHelper.getContact() instanceof Contact) {
+                       if (this.getContact() instanceof Contact) {
                                // Link customer
                                updatedCustomer = this.adminCustomerBean.linkCustomer(customer);
 
                                // Remove contact instance
-                               this.beanHelper.setContact(null);
+                               this.setContact(null);
                        } else {
                                // Add new customer instance
                                updatedCustomer = this.adminCustomerBean.addCustomer(customer);
@@ -155,37 +155,73 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem
                return "admin_list_customer"; //NOI18N
        }
 
-       @Override
-       public void copyCustomerToController (final Customer customer) {
-               // Parameters must be valid
-               if (null == customer) {
+       /**
+        * Observes an even when a customer has been created
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterCustomerCreatedEvent (final @Observes ObservableCreatedCustomerEvent event) {
+               // The event instance must be valid
+               if (null == event) {
+                       // Throw NPE again
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getCreatedCustomer() == null) {
                        // Throw NPE
-                       throw new NullPointerException("customer is null"); //NOI18N
-               } else if (customer.getCustomerId() == null) {
+                       throw new NullPointerException("event.createdCustomer is null"); //NOI18N
+               } else if (event.getCreatedCustomer().getCustomerId() == null) {
                        // Throw again ...
-                       throw new NullPointerException("customer.customerId is null"); //NOI18N
-               } else if (customer.getCustomerId() < 1) {
+                       throw new NullPointerException("event.createdCustomer.customerId is null"); //NOI18N
+               } else if (event.getCreatedCustomer().getCustomerId() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("customer.customerId={0} is not valid", customer.getCustomerId())); //NOI18N
-               } else if (customer.getCustomerContact() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("event.createdCustomer.customerId={0} is not valid", event.getCreatedCustomer().getCustomerId())); //NOI18N
+               } else if (event.getCreatedCustomer().getCustomerContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("customer.customerContact is null"); //NOI18N
-               } else if (customer.getCustomerContact().getContactId() == null) {
+                       throw new NullPointerException("event.createdCustomer.customerContact is null"); //NOI18N
+               } else if (event.getCreatedCustomer().getCustomerContact().getContactId() == null) {
                        // .. and again
-                       throw new NullPointerException("customer.customerContact.contactId is null"); //NOI18N
-               } else if (customer.getCustomerContact().getContactId() < 1) {
+                       throw new NullPointerException("event.createdCustomer.customerContact.contactId is null"); //NOI18N
+               } else if (event.getCreatedCustomer().getCustomerContact().getContactId() < 1) {
                        // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("event.createdCustomer.customerContact.contactId={0} is not valid", event.getCreatedCustomer().getCustomerContact().getContactId())); //NOI18N
                }
 
                // @TODO Set all data
        }
 
+       /**
+        * Getter for contact instance
+        * <p>
+        * @return Contact instance
+        */
+       public Contact getContact () {
+               return this.contact;
+       }
+
+       /**
+        * Setter for contact instance
+        * <p>
+        * @param contact Contact instance
+        */
+       public void setContact (final Contact contact) {
+               this.contact = contact;
+       }
+
        /**
         * Post-initialization of this class
         */
        @PostConstruct
        public void init () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.adminCustomerBean = (PizzaAdminCustomerSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/admincustomer!org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
        }
 
        /**
@@ -195,11 +231,7 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem
         */
        private boolean isCustomerDataSet () {
                // Check all
-               return ((this.adminContactController.getPersonalTitle() instanceof PersonalTitle) &&
-                               (this.adminContactController.getFirstName() != null) &&
-                               (!this.adminContactController.getFirstName().isEmpty()) &&
-                               (this.adminContactController.getFamilyName() != null) &&
-                               (!this.adminContactController.getFamilyName().isEmpty()));
+               return this.adminContactController.isRequiredPersonalDataSet();
        }
 
 }
index c4c912324b2d3bc3af6ee3fc2196d5ec9a670f2f..e2796530a473990bf2077f03ea256409430f3c51 100644 (file)
 package org.mxchange.pizzaapplication.beans.customer;
 
 import java.io.Serializable;
-import javax.ejb.Local;
-import org.mxchange.jcustomercore.model.customer.Customer;
 
 /**
  * An interface for user beans
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface PizzaAdminCustomerWebRequestController extends Serializable {
 
-       /**
-        * Copies given customer to this controller
-        * <p>
-        * @param customer Customer instance to copy
-        */
-       void copyCustomerToController (final Customer customer);
-
-       /**
-        * Adds customer to database if not already added. This method should return
-        * a redirect outcome on success.
-        * <p>
-        * @return Redirect outcome
-        */
-       String addCustomer ();
-
 }
index 16b8c5c01e4394b5e82172004c128fa020368660..0e5f62a3720bae260b5730c83bd0d722c0d08437 100644 (file)
@@ -48,7 +48,7 @@
         <param-value>true</param-value>
     </context-param>
     <context-param>
-        <description>Wether the personal title is required for using the general contact controller.</description>
+        <description>Whether the personal title is required for using the general contact controller.</description>
         <param-name>is_feature_general_personal_title_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
index 4dce8ecbd8a30bf6ec4613599b1d2d0db70f553e..3fb4f11b3ac07bf283a0e1427e24bc177eb68c6e 100644 (file)
@@ -98,7 +98,7 @@
                                                                </div>
 
                                                                <div class="table_right_medium">
-                                                                       <h:selectOneMenu class="select" id="customerContact" value="#{beanHelper.contact}" converter="ContactConverter">
+                                                                       <h:selectOneMenu class="select" id="customerContact" value="#{adminCustomerController.contact}" converter="ContactConverter">
                                                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
                                                                                <f:selectItems value="#{customerController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactGender.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
                                                                        </h:selectOneMenu>
index 11877d7770b4e0ac7552b8eddcd80c5e2542f8da..6bc127228357ed9a021b24ea946a400c631dd393 100644 (file)
@@ -1,83 +1,77 @@
 <?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"
-       >
+<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
+                               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">
+       <ui:define name="guest_title">
+               <h:outputText value="#{msg.PAGE_TITLE_INDEX_SHOW_BASKET}" />
+       </ui:define>
 
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
-               <ui:define name="guest_title">
-                       <h:outputText value="#{msg.PAGE_TITLE_INDEX_SHOW_BASKET}" />
-               </ui:define>
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_INDEX_SHOW_BASKET}" />
+       </ui:define>
 
-               <ui:define name="content_header">
-                       <h:outputText value="#{msg.CONTENT_TITLE_INDEX_SHOW_BASKET}" />
-               </ui:define>
+       <ui:define name="content">
+               <h:dataTable id="table_show_basket" var="item" value="#{basketController.allItems()}" styleClass="table" summary="#{msg.TABLE_SUMMARY_SHOW_BASKET}" rendered="#{basketController.hasItems()}">
+                       <h:column>
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.GUEST_ITEM_TITLE}" />
+                               </f:facet>
 
-               <ui:define name="content">
-                       <h:dataTable id="table_show_basket" var="item" value="#{basketController.allItems()}" styleClass="table" summary="#{msg.TABLE_SUMMARY_SHOW_BASKET}" rendered="#{basketController.hasItems()}">
-                               <h:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.GUEST_ITEM_TITLE}" />
-                                       </f:facet>
+                               <ui:fragment rendered="#{item.isProductType()}">
+                                       <h:outputText value="#{item.itemProduct.productTitle}" />
+                               </ui:fragment>
+                       </h:column>
 
+                       <h:column>
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.SINGLE_PRODUCT_PRICE}" />
+                               </f:facet>
+
+                               <div class="item_price">
                                        <ui:fragment rendered="#{item.isProductType()}">
-                                               <h:outputText value="#{item.itemProduct.productTitle}" />
+                                               <h:outputText styleClass="price" value="#{item.itemProduct.productPrice}">
+                                                       <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+                                               </h:outputText>
                                        </ui:fragment>
-                               </h:column>
-
-                               <h:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.SINGLE_PRODUCT_PRICE}" />
-                                       </f:facet>
+                               </div>
+                       </h:column>
 
-                                       <div class="item_price">
-                                               <ui:fragment rendered="#{item.isProductType()}">
-                                                       <h:outputText styleClass="price" value="#{item.itemProduct.productPrice}">
-                                                               <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
-                                                       </h:outputText>
-                                               </ui:fragment>
-                                       </div>
-                               </h:column>
+                       <h:column>
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.CHANGE_ITEM_AMOUNT}" />
+                               </f:facet>
 
-                               <h:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.CHANGE_ITEM_AMOUNT}" />
-                                       </f:facet>
+                               <h:form id="form_add_item">
+                                       <h:commandButton class="submit" id="add" value="#{msg.BUTTON_CHANGE_ITEM_AMOUNT}" action="#{basketController.doChangeItem(item)}" title="#{msg.BUTTON_TITLE_CHANGE_ITEM_AMOUNT}" />
 
-                                       <h:form id="form_add_item">
-                                               <h:commandButton class="submit" id="add" value="#{msg.BUTTON_CHANGE_ITEM_AMOUNT}" action="#{basketController.doChangeItem(item)}" title="#{msg.BUTTON_TITLE_CHANGE_ITEM_AMOUNT}" />
+                                       <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{item.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
+                                               <!--
+                                               If the customer wants to order more, he need to call in.
+                                               //-->
+                                               <f:validator for="amount" validatorId="ItemAmountValidator" />
+                                       </h:inputText>
+                               </h:form>
+                       </h:column>
 
-                                               <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{item.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
-                                                       <!--
-                                                       If the customer wants to order more, he need to call in.
-                                                       //-->
-                                                       <f:validator for="amount" validatorId="ItemAmountValidator" />
-                                               </h:inputText>
-                                       </h:form>
-                               </h:column>
+                       <h:column>
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.TOTAL_ITEM_PRICE}" />
+                               </f:facet>
 
-                               <h:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.TOTAL_ITEM_PRICE}" />
-                                       </f:facet>
-
-                                       <div class="item_total_price">
-                                               <h:outputText styleClass="price" id="item_price" value="#{basketController.calculateItemPrice(item)}" rendered="#{item.isProductType()}">
-                                                       <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
-                                               </h:outputText>
-                                       </div>
-                               </h:column>
-                       </h:dataTable>
+                               <div class="item_total_price">
+                                       <h:outputText styleClass="price" id="item_price" value="#{basketController.calculateItemPrice(item)}" rendered="#{item.isProductType()}">
+                                               <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+                                       </h:outputText>
+                               </div>
+                       </h:column>
+               </h:dataTable>
 
-                       <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
+               <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
 
-                       <div class="continue_checkout">
-                               <h:link class="checkout_link" id="checkout" value="#{msg.LINK_CONTINUE_TO_CHECKOUT}" outcome="checkout" />
-                       </div>
-               </ui:define>
-       </ui:composition>
-</html>
+               <div class="continue_checkout">
+                       <h:link class="checkout_link" id="checkout" value="#{msg.LINK_CONTINUE_TO_CHECKOUT}" outcome="checkout" />
+               </div>
+       </ui:define>
+</ui:composition>
index fa95d5dbf043eb1bd448d333bc00882b61ab2aa7..283801a1b0f2122873d9a89584c94e21e1e51416 100644 (file)
@@ -1,72 +1,66 @@
 <?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"
-       >
+<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
+                               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">
+       <ui:define name="guest_title">
+               <h:outputText value="#{msg.PAGE_TITLE_USER_CHECKOUT}" />
+       </ui:define>
 
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
-               <ui:define name="guest_title">
-                       <h:outputText value="#{msg.PAGE_TITLE_USER_CHECKOUT}" />
-               </ui:define>
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT}" />
+       </ui:define>
 
-               <ui:define name="content_header">
-                       <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT}" />
-               </ui:define>
+       <ui:define name="content">
+               <div class="basket_content">
+                       <ui:include src="/WEB-INF/templates/basket/full_basket.tpl" />
 
-               <ui:define name="content">
-                       <div class="basket_content">
-                               <ui:include src="/WEB-INF/templates/basket/full_basket.tpl" />
+                       <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
+               </div>
 
-                               <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
+               <div class="checkout_outer">
+                       <div class="checkout_title">
+                               <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT}" />
                        </div>
 
-                       <div class="checkout_outer">
-                               <div class="checkout_title">
-                                       <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT}" />
-                               </div>
+                       <div class="checkout_options">
+                               <ul>
+                                       <li>
+                                               <div class="checkout_option_title">
+                                                       <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION1_TITLE}" />
+                                               </div>
 
-                               <div class="checkout_options">
-                                       <ul>
-                                               <li>
-                                                       <div class="checkout_option_title">
-                                                               <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION1_TITLE}" />
-                                                       </div>
+                                               <div class="checkout_option_content">
+                                                       <h:link class="checkout_option_link" id="checkout_option_login" outcome="user_login" value="#{msg.LINK_CHECKOUT_OPTION_LOGIN}">
+                                                               <f:param name="redirect" value="login_checkout" />
+                                                       </h:link>
+                                               </div>
+                                       </li>
 
-                                                       <div class="checkout_option_content">
-                                                               <h:link class="checkout_option_link" id="checkout_option_login" outcome="user_login" value="#{msg.LINK_CHECKOUT_OPTION_LOGIN}">
-                                                                       <f:param name="redirect" value="login_checkout" />
-                                                               </h:link>
-                                                       </div>
-                                               </li>
+                                       <li>
+                                               <div class="checkout_option_title">
+                                                       <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION2_TITLE}" />
+                                               </div>
 
-                                               <li>
-                                                       <div class="checkout_option_title">
-                                                               <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION2_TITLE}" />
-                                                       </div>
+                                               <div class="checkout_option_content">
+                                                       <h:link class="checkout_option_link" id="checkout_option_register" outcome="user_register" value="#{msg.LINK_CHECKOUT_OPTION_REGISTRATION}">
+                                                               <f:param name="redirect" value="login_checkout" />
+                                                       </h:link>
+                                               </div>
+                                       </li>
 
-                                                       <div class="checkout_option_content">
-                                                               <h:link class="checkout_option_link" id="checkout_option_register" outcome="user_register" value="#{msg.LINK_CHECKOUT_OPTION_REGISTRATION}">
-                                                                       <f:param name="redirect" value="login_checkout" />
-                                                               </h:link>
-                                                       </div>
-                                               </li>
+                                       <li>
+                                               <div class="checkout_option_title">
+                                                       <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION3_TITLE}" />
+                                               </div>
 
-                                               <li>
-                                                       <div class="checkout_option_title">
-                                                               <h:outputText value="#{msg.CUSTOMER_CHECKOUT_OPTION3_TITLE}" />
-                                                       </div>
-
-                                                       <div class="checkout_option_content">
-                                                               <h:link class="checkout_option_link" id="checkout_option_guest" outcome="checkout2" value="#{msg.LINK_CHECKOUT_OPTION_GUEST}" />
-                                                       </div>
-                                               </li>
-                                       </ul>
-                               </div>
+                                               <div class="checkout_option_content">
+                                                       <h:link class="checkout_option_link" id="checkout_option_guest" outcome="checkout2" value="#{msg.LINK_CHECKOUT_OPTION_GUEST}" />
+                                               </div>
+                                       </li>
+                               </ul>
                        </div>
-               </ui:define>
-       </ui:composition>
-</html>
+               </div>
+       </ui:define>
+</ui:composition>
index fa688bc28fc9973bee9699ddac4c9827510a988e..3a019542df2a1655e7ba4805d8123557818262f4 100644 (file)
@@ -1,58 +1,52 @@
 <?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"
-       >
-
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
-               <ui:define name="guest_title">
-                       <h:outputText value="#{msg.PAGE_TITLE_INDEX_CHECKOUT2}" />
-               </ui:define>
-
-               <ui:define name="content_header">
-                       <h:outputText value="#{msg.CONTENT_TITLE_INDEX_CHECKOUT2}" />
-               </ui:define>
-
-               <ui:define name="content">
-                       <div class="basket_content">
-                               <ui:include src="/WEB-INF/templates/basket/full_basket.tpl" />
-
-                               <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
+<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
+                               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">
+       <ui:define name="guest_title">
+               <h:outputText value="#{msg.PAGE_TITLE_INDEX_CHECKOUT2}" />
+       </ui:define>
+
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_INDEX_CHECKOUT2}" />
+       </ui:define>
+
+       <ui:define name="content">
+               <div class="basket_content">
+                       <ui:include src="/WEB-INF/templates/basket/full_basket.tpl" />
+
+                       <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
+               </div>
+
+               <div class="checkout_outer">
+                       <div class="checkout_title">
+                               <h:outputText value="#{msg.GUEST_CHECKOUT_WITHOUT_REGISTRATION_TITLE}" />
                        </div>
 
-                       <div class="checkout_outer">
-                               <div class="checkout_title">
-                                       <h:outputText value="#{msg.GUEST_CHECKOUT_WITHOUT_REGISTRATION_TITLE}" />
-                               </div>
-
-                               <div class="registration_form">
-                                       <h:form id="checkout_form">
-                                               <div class="table">
-                                                       <div class="table_header">
-                                                               <h:outputText value="#{msg.GUEST_PAYMENT_WITHOUT_REGISTRATION_TITLE}" />
-                                                       </div>
+                       <div class="registration_form">
+                               <h:form id="checkout_form">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       <h:outputText value="#{msg.GUEST_PAYMENT_WITHOUT_REGISTRATION_TITLE}" />
+                                               </div>
 
-                                                       <ui:include src="/WEB-INF/templates/generic/form_personal_data.tpl" />
+                                               <ui:include src="/WEB-INF/templates/generic/form_personal_data.tpl" />
 
-                                                       <div class="para">
-                                                               <!-- @TODO Move this to i18n bundle //-->
-                                                               Derzeit ist nur eine Bezahlung gegen Rechnung möglich.
-                                                       </div>
+                                               <div class="para">
+                                                       <!-- @TODO Move this to i18n bundle //-->
+                                                       Derzeit ist nur eine Bezahlung gegen Rechnung möglich.
+                                               </div>
 
-                                                       <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+                                               <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
 
-                                                       <div class="table_footer">
-                                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                               <h:commandButton class="submit" type="submit" id="checkout" value="#{msg.BUTTON_COMPLETE_ORDER}" action="#{checkoutController.doCheckout()}" />
-                                                       </div>
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" id="checkout" value="#{msg.BUTTON_COMPLETE_ORDER}" action="#{checkoutController.doCheckout()}" />
                                                </div>
-                                       </h:form>
-                               </div>
+                                       </div>
+                               </h:form>
                        </div>
-               </ui:define>
-       </ui:composition>
-</html>
+               </div>
+       </ui:define>
+</ui:composition>
index 165658931401e7a34034a16db81e49d7eb08f349..879562b7c254b1e84ae42c42851f0ed4e66e52a4 100644 (file)
@@ -1,29 +1,23 @@
 <?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"
-       >
+<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
+                               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">
+       <ui:define name="guest_title">
+               <h:outputText value="#{msg.PAGE_TITLE_USER_CHECKOUT_DONE}" />
+       </ui:define>
 
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
-               <ui:define name="guest_title">
-                       <h:outputText value="#{msg.PAGE_TITLE_USER_CHECKOUT_DONE}" />
-               </ui:define>
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT_DONE}" />
+       </ui:define>
 
-               <ui:define name="content_header">
-                       <h:outputText value="#{msg.CONTENT_TITLE_USER_CHECKOUT_DONE}" />
-               </ui:define>
-
-               <ui:define name="content">
-                       <!-- @TODO Move this to i18n bundle //-->
-                       Rechnung abrufen:
-                       <h:link class="receipt_link" id="receipt" outcome="pdf" value="#{msg.LINK_OPEN_RECEIPT}" target="_blank">
-                               <f:param name="customer" value="#{beanHelper.customer.customerId}" />
-                               <f:param name="key" value="#{receiptController.fetchAccessKey()}" />
-                       </h:link>
-               </ui:define>
-       </ui:composition>
-</html>
+       <ui:define name="content">
+               <!-- @TODO Move this to i18n bundle //-->
+               Rechnung abrufen:
+               <h:link class="receipt_link" id="receipt" outcome="pdf" value="#{msg.LINK_OPEN_RECEIPT}" target="_blank">
+                       <f:param name="customer" value="#{beanHelper.customer.customerId}" />
+                       <f:param name="key" value="#{receiptController.fetchAccessKey()}" />
+               </h:link>
+       </ui:define>
+</ui:composition>
index d2735a71427355abc333841a3bba8e3d913d486a..b7d53cd6d4ee765bb01da071edd18089656791db 100644 (file)
@@ -1,63 +1,58 @@
-<!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"
-       >
-
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
-               <ui:define name="guest_title">
-                       <h:outputText value="#{msg.PAGE_TITLE_USER_EMPTY_BASKET}" />
-               </ui:define>
-
-               <ui:define name="content_header">
-                       <h:outputText value="#{msg.CONTENT_TITLE_USER_EMPTY_BASKET}" />
-               </ui:define>
-
-               <ui:define name="content">
-                       <!-- @TODO resend_link.xhtml is here! //-->
-                       <h:form id="form_resend_link" rendered="#{featureController.isFeatureEnabled('user_resend_confirmation_link')}">
-                               <div class="table">
-                                       <div class="table_header">
-                                               <h:outputText value="#{msg.GUEST_RESEND_LINK_TITLE}" />
-                                       </div>
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
+                               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">
+       <ui:define name="guest_title">
+               <h:outputText value="#{msg.PAGE_TITLE_USER_EMPTY_BASKET}" />
+       </ui:define>
+
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_USER_EMPTY_BASKET}" />
+       </ui:define>
+
+       <ui:define name="content">
+               <!-- @TODO resend_link.xhtml is here! //-->
+               <h:form id="form_resend_link" rendered="#{featureController.isFeatureEnabled('user_resend_confirmation_link')}">
+                       <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}">
+                                               <h:outputText value="#{msg.RESEND_CONFIRMATION_LINK_LEGEND}" />
+                                       </legend>
 
-                                       <fieldset id="email_address_notice">
-                                               <legend title="#{msg.RESEND_CONFIRMATION_LINK_LEGEND_TITLE}">
-                                                       <h:outputText value="#{msg.RESEND_CONFIRMATION_LINK_LEGEND}" />
-                                               </legend>
-
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               <h:outputLabel for="resendEmailAddress" value="#{msg.GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS}" />
-                                                       </div>
-
-                                                       <div class="table_right">
-                                                               <h:inputText styleClass="input" id="resendEmailAddress" size="20" maxlength="255" value="#{userResendConfirmationController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}">
-                                                                       <f:validator validatorId="EmailAddressValidator" />
-                                                               </h:inputText>
-                                                       </div>
+                                       <div class="table_row">
+                                               <div class="table_left">
+                                                       <h:outputLabel for="resendEmailAddress" value="#{msg.GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS}" />
                                                </div>
-                                       </fieldset>
 
-                                       <div>
-                                               <h:message for="resendEmailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
+                                               <div class="table_right">
+                                                       <h:inputText styleClass="input" id="resendEmailAddress" size="20" maxlength="255" value="#{userResendConfirmationController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}">
+                                                               <f:validator validatorId="EmailAddressValidator" />
+                                                       </h:inputText>
+                                               </div>
                                        </div>
+                               </fieldset>
 
-                                       <div class="table_row">
-                                               <h:outputText value="#{msg.GUEST_RESEND_CONFIRMATION_LINK_NOTICE}" />
-                                       </div>
+                               <div>
+                                       <h:message for="resendEmailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
+                               </div>
 
-                                       <div class="table_footer">
-                                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton styleClass="submit" type="submit" id="resend_link" value="#{msg.BUTTON_RESEND_CONFIRMATION_LINK}" action="#{userResendConfirmationController.doResendLink()}" />
-                                       </div>
+                               <div class="table_row">
+                                       <h:outputText value="#{msg.GUEST_RESEND_CONFIRMATION_LINK_NOTICE}" />
+                               </div>
+
+                               <div class="table_footer">
+                                       <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                       <h:commandButton styleClass="submit" type="submit" id="resend_link" value="#{msg.BUTTON_RESEND_CONFIRMATION_LINK}" action="#{userResendConfirmationController.doResendLink()}" />
                                </div>
-                       </h:form>
+                       </div>
+               </h:form>
 
-                       <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RESEND_LINK_DEACTIVATED}" rendered="#{not featureController.isFeatureEnabled('user_resend_confirmation_link')}" />
-               </ui:define>
-       </ui:composition>
-</html>
+               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RESEND_LINK_DEACTIVATED}" rendered="#{not featureController.isFeatureEnabled('user_resend_confirmation_link')}" />
+       </ui:define>
+</ui:composition>