]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
added administrative edit/delete for categories and products
authorRoland Haeder <roland@mxchange.org>
Sun, 10 Apr 2016 18:20:35 +0000 (20:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 10 Apr 2016 18:20:35 +0000 (20:20 +0200)
12 files changed:
nbproject/faces-config.NavData
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/admin/admin_category.xhtml [deleted file]
web/admin/admin_category_delete.xhtml [new file with mode: 0644]
web/admin/admin_category_edit.xhtml [new file with mode: 0644]
web/admin/admin_category_list.xhtml [new file with mode: 0644]
web/admin/admin_product.xhtml [deleted file]
web/admin/admin_product_delete.xhtml [new file with mode: 0644]
web/admin/admin_product_edit.xhtml [new file with mode: 0644]
web/admin/admin_product_list.xhtml [new file with mode: 0644]

index 8236ca1cb7984be676f17ea7d64997696e96a762..374409e221cb10cae18ff1a235e4d4f8013befdf 100644 (file)
@@ -2,30 +2,34 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="customer/checkout2.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="admin/admin_user_delete.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="customer/checkout2.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="admin/admin_user_delete.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="privacy.xhtml" x="150" y="300" zoom="true"/>
         <Node id="customer/checkout.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="privacy.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="admin/index.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="basket.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="customer/register.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="item_added.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="admin/admin_user_list.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="terms.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="admin/index.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="basket.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="customer/register.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="item_added.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="admin/admin_user_list.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="terms.xhtml" x="400" y="300" zoom="true"/>
         <Node id="admin/admin_logout.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="customer/lost_passwd.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="admin/admin_user_add.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="admin/admin_user_edit.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="errorHandler.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="index.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="logout.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="admin/admin_category.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="customer/checkout_done.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="admin/admin_user_unlock.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="*" x="1650" y="150" zoom="true"/>
-        <Node id="customer/login.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="imprint.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="admin/admin_product.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="admin/admin_user_edit.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="customer/lost_passwd.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="admin/admin_user_add.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="errorHandler.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="index.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="logout.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="customer/checkout_done.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="admin/admin_user_unlock.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/admin_category_list.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="*" x="650" y="450" zoom="true"/>
+        <Node id="customer/login.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="imprint.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/admin_category_delete.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="admin/admin_product_delete.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/admin_product_edit.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="admin/admin_category_edit.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="admin/admin_product_list.xhtml" x="650" y="150" zoom="true"/>
         <Node id="customer/empty_basket.xhtml" x="1150" y="450" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
index 20710956069bdadc6a5c92f259c48efb5293370d..455fd1176a1f77989ca01e36da9a3bbc575468c9 100644 (file)
@@ -152,8 +152,6 @@ PERSONAL_DATA_LEGEND=Bitte Ihre Daten eingeben:
 GUEST_PAYMENT_WITHOUT_REGISTRATION_TITLE=Bezahlung ohne Anmeldung
 PAGE_TITLE_CUSTOMER_LOGIN=Einloggen
 CONTENT_TITLE_CUSTOMER_LOGIN=Zum Kundenbereich einloggen:
-PAGE_TITLE_CUSTOMER_LOST_PASSWORD=Passwort vergessen
-CONTENT_TITLE_CUSTOMER_LOST_PASSWORD=Stellen Sie Ihr Passwort wieder her:
 GUEST_LOST_PASSWORD_TITLE=Sie haben Ihr Passwort vergessen?
 GUEST_LOST_PASSWORD_LEGEND_TITLE=Bitte Daten eingeben:
 GUEST_LOST_PASSWORD_LEGEND=Bitte Daten eingeben:
@@ -245,3 +243,19 @@ ADMIN_ENTER_PRODUCT_PRICE_EXAMPLE=(z.B. 50.0</em>
 ADMIN_TITLE_PRODUCT_NUMBER=Produktnummer:
 ADMIN_TITLE_PRODUCT_TITLE=Produktbezeichnung:
 ADMIN_ENTER_SINGLE_PRODUCT_PRICE=Einzelpreis:
+#@TODO Fix German umlauts!
+PAGE_TITLE_ADMIN_EDIT_CATEGORY=Kategorie aendern
+#@TODO Fix German umlauts!
+CONTENT_TITLE_ADMIN_EDIT_CATEGORY=Kategorie aendern:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_DELETE_CATEGORY=Kategorie loeschen
+#@TODO Fix German umlauts!
+CONTENT_TITLE_ADMIN_DELETE_CATEGORY=Kategorie loeschen:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_DELETE_PRODUCT=Produkt loeschen
+#@TODO Please fix German umlauts!
+CONTENT_TITLE_ADMIN_DELETE_PRODUCT=Produkt loeschen:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_EDIT_PRODUCT=Produkt aendern
+#@TODO Please fix German umlauts!
+CONTENT_TITLE_ADMIN_EDIT_PRODUCT=Produkt aendern:
index 492c8c57254ccb02bb5af2b60e05eaf2d681310a..1268e8375bbbabd7e4112fa6104e58f737c611e1 100644 (file)
@@ -116,8 +116,6 @@ PAGE_TITLE_INDEX_CHECKOUT2=Checkout without login
 CONTENT_TITLE_INDEX_CHECKOUT2=Checkout without login:
 GUEST_CHECKOUT_WITHOUT_REGISTRATION_TITLE=You can checkout without registration
 CONTENT_TITLE_CUSTOMER_CHECKOUT=Choose checkout option:
-PAGE_TITLE_USER_LOGIN=Login
-CONTENT_TITLE_USER_LOGIN=Login to user area:
 LINK_CHECKOUT_OPTION_LOGIN=Continue to customer login
 LINK_CHECKOUT_OPTION_REGISTRATION=Continue with new customer registration
 LINK_CHECKOUT_OPTION_GUEST=Checkout without registration
@@ -239,3 +237,11 @@ ADMIN_ENTER_PRODUCT_PRICE_EXAMPLE=(example: 50.0)
 ADMIN_TITLE_PRODUCT_NUMBER=Product number:
 ADMIN_TITLE_PRODUCT_TITLE=Product title:
 ADMIN_ENTER_SINGLE_PRODUCT_PRICE=Single product price:
+PAGE_TITLE_ADMIN_EDIT_CATEGORY=Edit category
+CONTENT_TITLE_ADMIN_EDIT_CATEGORY=Edit category:
+PAGE_TITLE_ADMIN_DELETE_CATEGORY=Delete category
+CONTENT_TITLE_ADMIN_DELETE_CATEGORY=Delete category:
+PAGE_TITLE_ADMIN_DELETE_PRODUCT=Delete product
+CONTENT_TITLE_ADMIN_DELETE_PRODUCT=Delete product:
+PAGE_TITLE_ADMIN_EDIT_PRODUCT=Edit product
+CONTENT_TITLE_ADMIN_EDIT_PRODUCT=Edit product:
index 6b5c7a4ec583c2bd9addc0beb890835da7552ea5..1d335632134c7a6cd64860f0e4af52a4cad2c514 100644 (file)
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_product</from-outcome>
-                       <to-view-id>/admin/admin_product.xhtml</to-view-id>
+                       <to-view-id>/admin/admin_product_list.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_category</from-outcome>
-                       <to-view-id>/admin/admin_category.xhtml</to-view-id>
+                       <to-view-id>/admin/admin_category_list.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_index</from-outcome>
                        <to-view-id>/*</to-view-id>
                </navigation-case>
        </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/admin_product_list.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_edit_product</from-outcome>
+                       <to-view-id>/admin/admin_product_edit.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/admin_category_list.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_edit_category</from-outcome>
+                       <to-view-id>/admin/admin_category_edit.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
 </faces-config>
diff --git a/web/admin/admin_category.xhtml b/web/admin/admin_category.xhtml
deleted file mode 100644 (file)
index 92c84ce..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?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 xmlns="http://www.w3.org/1999/xhtml"
-         xmlns:ui="http://java.sun.com/jsf/facelets"
-         xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
-
-       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
-               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_CATEGORIES}</ui:define>
-
-               <ui:define name="content_header">
-                       #{msg.CONTENT_TITLE_ADMIN_CATEGORIES}
-               </ui:define>
-
-               <ui:define name="content">
-                       <div class="para">
-                               <h:form id="form">
-                                       <h:dataTable id="categories" var="cat" value="#{shopController.allCategories}" styleClass="table" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_CATEGORY}">
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.SELECT_ENTRY}</f:facet>
-                                                       #{cat.categoryId}:
-                                                       <h:selectBooleanCheckbox class="input" value="true" />
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.ADMIN_ENTER_CATEGORY_TITLE}</f:facet>
-                                                               #{cat.categoryTitle}
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.ADMIN_PARENT_CATEGORY}</f:facet>
-                                                               #{cat.parentCategory.categoryId}
-                                               </h:column>
-                                       </h:dataTable>
-
-                                       <div class="table_footer">
-                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton class="submit" type="submit" id="edit" action="#{adminCategoryController.editCategory(cat)}" value="#{msg.ADMIN_BUTTON_EDIT_ENTRIES}" />
-                                               <h:commandButton class="delete" type="submit" id="delete" action="#{adminCategoryController.deleteCategory(cat)}" value="#{msg.ADMIN_BUTTON_DELETE_ENTRIES}" />
-                                       </div>
-                               </h:form>
-                       </div>
-
-                       <div class="para">
-                               <h:form id="add_category">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       #{msg.ADMIN_ADD_CATEGORY_TITLE}
-                                               </div>
-
-                                               <fieldset id="product_data">
-                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.ADMIN_ENTER_CATEGORY_TITLE}
-                                                                       <div class="tiny">#{msg.ADMIN_ENTER_CATEGORY_TITLE_EXAMPLE}</div>
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <h:inputText class="input" id="guest_title" value="#{adminCategoryController.categoryTitle}" size="10" maxlength="255" required="true" />
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.ADMIN_PARENT_CATEGORY}
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <ui:include src="/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl" />
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-                                               </fieldset>
-
-                                               <div class="table_footer">
-                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton class="submit" type="submit" action="#{adminCategoryController.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
-                                               </div>
-                                       </div>
-                               </h:form>
-                       </div>
-               </ui:define>
-       </ui:composition>
-</html>
diff --git a/web/admin/admin_category_delete.xhtml b/web/admin/admin_category_delete.xhtml
new file mode 100644 (file)
index 0000000..f623931
--- /dev/null
@@ -0,0 +1,20 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_DELETE_CATEGORY}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_DELETE_CATEGORY}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_category_edit.xhtml b/web/admin/admin_category_edit.xhtml
new file mode 100644 (file)
index 0000000..4bbf69a
--- /dev/null
@@ -0,0 +1,20 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_EDIT_CATEGORY}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_EDIT_CATEGORY}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_category_list.xhtml b/web/admin/admin_category_list.xhtml
new file mode 100644 (file)
index 0000000..58b5b9b
--- /dev/null
@@ -0,0 +1,83 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_CATEGORIES}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_CATEGORIES}
+               </ui:define>
+
+               <ui:define name="content">
+                       <div class="para">
+                               <h:dataTable id="categories" var="cat" value="#{shopController.allCategories}" styleClass="table" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_CATEGORY}">
+                                       <h:column>
+                                               <f:facet name="header">#{msg.SELECT_ENTRY}</f:facet>
+                                               <h:link outcome="admin_edit_category" title="#{msg.ADMIN_LINK_EDIT_DELETE_CATEFORY_TITLE}" value="#{cat.categoryId}">
+                                                       <f:param name="categoryId" value="#{cat.categoryId}" />
+                                               </h:link>
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.ADMIN_ENTER_CATEGORY_TITLE}</f:facet>
+                                                       #{cat.categoryTitle}
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.ADMIN_PARENT_CATEGORY}</f:facet>
+                                                       #{cat.parentCategory.categoryId}
+                                       </h:column>
+                               </h:dataTable>
+                       </div>
+
+                       <div class="para">
+                               <h:form id="add_category">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       #{msg.ADMIN_ADD_CATEGORY_TITLE}
+                                               </div>
+
+                                               <fieldset id="product_data">
+                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_ENTER_CATEGORY_TITLE}
+                                                                       <div class="tiny">#{msg.ADMIN_ENTER_CATEGORY_TITLE_EXAMPLE}</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="guest_title" value="#{adminCategoryController.categoryTitle}" size="10" maxlength="255" required="true" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_PARENT_CATEGORY}
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <ui:include src="/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+                                               </fieldset>
+
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" action="#{adminCategoryController.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
+                                               </div>
+                                       </div>
+                               </h:form>
+                       </div>
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_product.xhtml b/web/admin/admin_product.xhtml
deleted file mode 100644 (file)
index 67d1b68..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?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 xmlns="http://www.w3.org/1999/xhtml"
-         xmlns:ui="http://java.sun.com/jsf/facelets"
-         xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
-
-       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
-               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_PRODUCTS}</ui:define>
-
-               <ui:define name="content_header">
-                       #{msg.CONTENT_TITLE_ADMIN_PRODUCTS}
-               </ui:define>
-
-               <ui:define name="content">
-                       <div class="para">
-                               <h:form id="form">
-                                       <h:dataTable id="product_table" var="product" value="#{adminProductController.allProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_ADMIN_PRODUCTS}">
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.ADMIN_TITLE_PRODUCT_NUMBER}</f:facet>
-                                                       #{product.productId}:<h:selectBooleanCheckbox class="input" value="true" />
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.ADMIN_TITLE_PRODUCT_TITLE}</f:facet>
-                                                               #{product.productTitle}
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.SINGLE_PRODUCT_PRICE}</f:facet>
-                                                               #{product.productPrice}
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.CATEGORY}</f:facet>
-                                                               #{product.productCategory.categoryTitle}
-                                               </h:column>
-
-                                               <h:column>
-                                                       <f:facet name="header">#{msg.IS_AVAILABLE}</f:facet>
-                                                               #{product.productAvailability}
-                                               </h:column>
-                                       </h:dataTable>
-
-                                       <div  class="table_footer">
-                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton class="submit" type="submit" id="edit" action="#{adminProductController.editProduct(product)}" value="#{msg.ADMIN_BUTTON_EDIT_ENTRIES}" />
-                                               <h:commandButton class="delete" type="submit" id="delete" action="#{adminProductController.deleteProduct(product)}" value="#{msg.ADMIN_BUTTON_DELETE_ENTRIES}" />
-                                       </div>
-                               </h:form>
-                       </div>
-
-                       <div class="para">
-                               <h:form id="add_product">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       #{msg.ADMIN_ADD_PRODUCT_TITLE}
-                                               </div>
-
-                                               <fieldset id="product_data">
-                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.ADMIN_ENTER_PRODUCT_TITLE}
-                                                                       <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE}</div>
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <h:inputText class="input" id="product_title" size="10" maxlength="255" required="true" value="#{adminProductController.productTitle}" />
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.ADMIN_ENTER_SINGLE_PRODUCT_PRICE}
-                                                                       <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_PRICE_EXAMPLE}</div>
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <h:inputText class="input" id="product_price" size="10" maxlength="255" required="true" value="#{adminProductController.productPrice}" />
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.CATEGORY}
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <ui:include src="/WEB-INF/templates/admin/admin_category_selection_box.tpl" />
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       #{msg.IS_AVAILABLE}
-                                                               </div>
-
-                                                               <div class="table_right">
-                                                                       <h:selectOneListbox required="true" id="available" value="#{adminProductController.productAvailability}" size="1" class="select">
-                                                                               <f:selectItem itemValue="true" itemLabel="#{msg.YES}" />
-                                                                               <f:selectItem itemValue="false" itemLabel="#{msg.NO}" />
-                                                                       </h:selectOneListbox>
-                                                               </div>
-
-                                                               <div class="clear"></div>
-                                                       </div>
-                                               </fieldset>
-
-                                               <div class="table_footer">
-                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton class="submit" type="submit" id="add" action="#{adminProductController.addProduct()}" value="#{msg.ADMIN_BUTTON_ADD_PRODUCT}" />
-                                               </div>
-                                       </div>
-                               </h:form>
-                       </div>
-
-                       <div class="para">
-                               #{msg.ADMIN_ADD_PRODUCT_NOTICE_TITLE}
-                               <ul>
-                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE1}</li>
-                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE2}</li>
-                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE3}</li>
-                               </ul>
-                       </div>
-               </ui:define>
-       </ui:composition>
-</html>
diff --git a/web/admin/admin_product_delete.xhtml b/web/admin/admin_product_delete.xhtml
new file mode 100644 (file)
index 0000000..f2eaed2
--- /dev/null
@@ -0,0 +1,20 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_DELETE_PRODUCT}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_DELETE_PRODUCT}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_product_edit.xhtml b/web/admin/admin_product_edit.xhtml
new file mode 100644 (file)
index 0000000..6ef494f
--- /dev/null
@@ -0,0 +1,20 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_EDIT_PRODUCT}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_EDIT_PRODUCT}
+               </ui:define>
+
+               <ui:define name="content">
+                       Here goes your content.
+               </ui:define>
+       </ui:composition>
+</html>
diff --git a/web/admin/admin_product_list.xhtml b/web/admin/admin_product_list.xhtml
new file mode 100644 (file)
index 0000000..3ee0944
--- /dev/null
@@ -0,0 +1,130 @@
+<?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 xmlns="http://www.w3.org/1999/xhtml"
+         xmlns:ui="http://java.sun.com/jsf/facelets"
+         xmlns:h="http://xmlns.jcp.org/jsf/html"
+         xmlns:f="http://xmlns.jcp.org/jsf/core"
+         >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_PRODUCTS}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_PRODUCTS}
+               </ui:define>
+
+               <ui:define name="content">
+                       <div class="para">
+                               <h:dataTable id="product_table" var="product" value="#{adminProductController.allProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_ADMIN_PRODUCTS}">
+                                       <h:column>
+                                               <f:facet name="header">#{msg.ADMIN_TITLE_PRODUCT_NUMBER}</f:facet>
+                                               <h:link outcome="admin_edit_product" title="#{msg.ADMIN_LINK_EDIT_DELETE_PRODUCT_TITLE}" value="#{product.productId}">
+                                                       <f:param name="productId" value="#{product.productId}" />
+                                               </h:link>
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.ADMIN_TITLE_PRODUCT_TITLE}</f:facet>
+                                                       #{product.productTitle}
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.SINGLE_PRODUCT_PRICE}</f:facet>
+                                                       #{product.productPrice}
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.CATEGORY}</f:facet>
+                                                       #{product.productCategory.categoryTitle}
+                                       </h:column>
+
+                                       <h:column>
+                                               <f:facet name="header">#{msg.IS_AVAILABLE}</f:facet>
+                                                       #{product.productAvailability}
+                                       </h:column>
+                               </h:dataTable>
+                       </div>
+
+                       <div class="para">
+                               <h:form id="add_product">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       #{msg.ADMIN_ADD_PRODUCT_TITLE}
+                                               </div>
+
+                                               <fieldset id="product_data">
+                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_ENTER_PRODUCT_TITLE}
+                                                                       <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE}</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="product_title" size="10" maxlength="255" required="true" value="#{adminProductController.productTitle}" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_ENTER_SINGLE_PRODUCT_PRICE}
+                                                                       <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_PRICE_EXAMPLE}</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="product_price" size="10" maxlength="255" required="true" value="#{adminProductController.productPrice}" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.CATEGORY}
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <ui:include src="/WEB-INF/templates/admin/admin_category_selection_box.tpl" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.IS_AVAILABLE}
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <h:selectOneListbox required="true" id="available" value="#{adminProductController.productAvailability}" size="1" class="select">
+                                                                               <f:selectItem itemValue="true" itemLabel="#{msg.YES}" />
+                                                                               <f:selectItem itemValue="false" itemLabel="#{msg.NO}" />
+                                                                       </h:selectOneListbox>
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+                                               </fieldset>
+
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" id="add" action="#{adminProductController.addProduct()}" value="#{msg.ADMIN_BUTTON_ADD_PRODUCT}" />
+                                               </div>
+                                       </div>
+                               </h:form>
+                       </div>
+
+                       <div class="para">
+                               #{msg.ADMIN_ADD_PRODUCT_NOTICE_TITLE}
+                               <ul>
+                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE1}</li>
+                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE2}</li>
+                                       <li>#{msg.ADMIN_ADD_PRODUCT_NOTICE_LINE3}</li>
+                               </ul>
+                       </div>
+               </ui:define>
+       </ui:composition>
+</html>