From: Roland Haeder Date: Thu, 13 Aug 2015 11:21:21 +0000 (+0200) Subject: Continued with project: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=749056db48433594c579101a6013b1bcfbaca98e;p=pizzaservice-war.git Continued with project: - added placeholder class for category datbase constants - added stub JSPs for handling category and product requests in admin area - improved category handling a little more Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/database/category/PizzaCategoryDatabaseConstants.java b/src/java/org/mxchange/pizzaapplication/database/category/PizzaCategoryDatabaseConstants.java new file mode 100644 index 00000000..7ccc897f --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/database/category/PizzaCategoryDatabaseConstants.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.database.category; + +/** + * Holder class for database columns for product frontend + * + * @author Roland Haeder + */ +public final class PizzaCategoryDatabaseConstants { + /** + * Column name for "id" + */ + public static final String COLUMN_ID = "id"; + + /** + * Column name for "parent" + */ + public static final String COLUMN_PARENT = "parent"; + + /** + * Column name for "title" + */ + public static final String COLUMN_TITLE = "title"; + + /** + * No instance from this class + */ + private PizzaCategoryDatabaseConstants () { + } +} diff --git a/web/admin/category.jsp b/web/admin/category.jsp index 35e87919..246fd5b5 100644 --- a/web/admin/category.jsp +++ b/web/admin/category.jsp @@ -7,6 +7,7 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%--<%@page errorPage="errorHandler.jsp" %>--%> <%@page import="org.mxchange.pizzaapplication.category.Category"%> +<%@page import="org.mxchange.pizzaapplication.database.category.PizzaCategoryDatabaseConstants"%> <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%> <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> @@ -43,13 +44,13 @@ - Produktname: (Schlüssel) + Auswählen: - Produktbezeichnung: + Bezeichnung: - Einzelpreis: + Elternkategorie: @@ -58,13 +59,13 @@ - ${category.getId()} + ${category.getTitle()} - ${category.getPrice()} + ${category.getPrintableParent()} @@ -93,12 +94,12 @@
- Produktbezeichnung: -
(z.B. Pizza Italia)
+ Bezeichnung: +
(z.B. Pizzen)
- +
@@ -106,12 +107,13 @@
- Einzelpreis: -
(z.B. 50.0)
+ Elternkategorie:
- +
diff --git a/web/form_handler/admin/do_category.jsp b/web/form_handler/admin/do_category.jsp new file mode 100644 index 00000000..611df6f4 --- /dev/null +++ b/web/form_handler/admin/do_category.jsp @@ -0,0 +1,61 @@ +<%-- + Document : order + Created on : 07.08.2015, 14:58:21 + Author : Roland Haeder +--%> + +<%--<%@page errorPage="errorHandler.jsp" %>--%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%> +<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%> +<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %> +<%@page import="org.mxchange.pizzaapplication.product.Product"%> + +<% + // Init application instance + PizzaApplication app = PizzaServiceApplication.getInstance(application); + + // Is it post? + if ("POST".equals(request.getMethod())) { //NOI18N + // Is "add/edit/delete" set? + if (request.getAttribute("add") != null) { //NOI18N + // Add new category + app.doAdminAddCategory(request); + } else if (request.getAttribute("edit") != null) { //NOI18N + // @TODO + } else if (request.getAttribute("delete") != null) { //NOI18N + // @TODO + } + + // Redirect to proper URL + // @TODO Commented out for developing: + //response.sendRedirect(request.getContextPath() + "/finished.jsp"); + } +%> + + + + + + + <%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler + + + +
+

<%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler

+
+ + + +
+
+

Bitte nicht direkt aufrufen:

+
+ +
+ Bitte rufen Sie diese Seite nicht direkt auf. +
+
+ + diff --git a/web/form_handler/admin/do_product.jsp b/web/form_handler/admin/do_product.jsp new file mode 100644 index 00000000..e94cdca5 --- /dev/null +++ b/web/form_handler/admin/do_product.jsp @@ -0,0 +1,61 @@ +<%-- + Document : order + Created on : 07.08.2015, 14:58:21 + Author : Roland Haeder +--%> + +<%--<%@page errorPage="errorHandler.jsp" %>--%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%> +<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%> +<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %> +<%@page import="org.mxchange.pizzaapplication.product.Product"%> + +<% + // Init application instance + PizzaApplication app = PizzaServiceApplication.getInstance(application); + + // Is it post? + if ("POST".equals(request.getMethod())) { //NOI18N + // Is "add/edit/delete" set? + if (request.getAttribute("add") != null) { //NOI18N + // Add new product + app.doAdminAddProduct(request); + } else if (request.getAttribute("edit") != null) { //NOI18N + // @TODO + } else if (request.getAttribute("delete") != null) { //NOI18N + // @TODO + } + + // Redirect to proper URL + // @TODO Commented out for developing: + //response.sendRedirect(request.getContextPath() + "/finished.jsp"); + } +%> + + + + + + + <%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler + + + +
+

<%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler

+
+ + + +
+
+

Bitte nicht direkt aufrufen:

+
+ +
+ Bitte rufen Sie diese Seite nicht direkt auf. +
+
+ + diff --git a/web/form_handler/do_order.jsp b/web/form_handler/do_order.jsp index e0901b2a..7305c365 100644 --- a/web/form_handler/do_order.jsp +++ b/web/form_handler/do_order.jsp @@ -18,7 +18,7 @@ // Is it post? if ("POST".equals(request.getMethod())) { //NOI18N // @TODO Handle saving customer data and such things - + // Mark all choosen products as ordered app.markAllChoosenProductsAsOrdered(request, session);