1 <?xml version='1.0' encoding='UTF-8' ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
4 xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
5 xmlns:f="http://xmlns.jcp.org/jsf/core">
6 <ui:param name="path" value="#{request.contextPath}" />
8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
9 <link rel="stylesheet" href="#{path}/style.css" type="text/css"/>
10 <title>Willkommen</title>
19 <ui:include src="/static/guest/guest_menu.xhtml" id="menu" />
21 <div id="content_outer">
22 <div id="content_title">
23 <h2>Folgendes kann bestellt werden:</h2>
27 <h:panelGrid class="table" columns="4">
28 <h:column class="table_header_column">Bestellen?</h:column>
29 <h:column class="table_header_column">Anzahl:</h:column>
30 <h:column class="table_header_column">Produkt:</h:column>
31 <h:column class="table_header_column">Einzelpreis:</h:column>
36 PizzaApplication app = PizzaServiceApplication.getInstance(application);
39 Iterator<Product> iterator = app.getAvailableProducts();
41 // "Walk" through all products and unmark them as ordered
42 while (iterator.hasNext()) {
43 // Get product instance
44 Product product = iterator.next();
46 // Get basket instance
47 Basket<AddableBasketItem> basket = ItemBasket.getInstance(session);
49 // Create an item instance form this product
50 AddableBasketItem item = basket.getItem(product);
52 // Has it been already added to the basket?
54 // Some nice output ...
56 <h:panelGrid class="table" columns="4">
57 <h:column class="table_header_column"><a href="#{path}/basket.jsp" title="Zum Warenkorb">Warenkorb</a></h:column>
58 <h:column class="table_header_column"><%=item.getAmount()%></h:column>
59 <h:column class="table_header_column"><%=product.getTitle()%></h:column>
60 <h:column class="table_header_column"><f:convertNumber type="currency"><%=product.getPrice()%></f:convertNumber></h:column>
63 // Then skip this item
68 app.unmarkProductAsOrdered(product, session);
71 <h:panelGrid class="table" columns="4">
72 <h:column class="table_header_column">
73 <h:commandButton action="#{path}/form_handler/add_item.jsp" class="submit" value="Hinzufügen" />
74 <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_ID%>" value="<%=product.getId()%>" />
75 <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_TYPE%>" value="Product" />
77 <h:column class="table_header_column">
78 <!--<h:inputText class="input" size="3" maxlength="20" />-->
79 <input class="input" type="text" name="<%=PizzaApplication.HTTP_PARAM_AMOUNT%>" size="3" maxlength="20" />
81 <h:column class="table_header_column">
82 <%=product.getTitle()%>
84 <h:column class="table_header_column right">
85 <f:convertNumber type="currency"><%=product.getPrice()%></f:convertNumber>
95 <ui:include src="/static/guest/guest_footer.xhtml" id="footer" />