From 749056db48433594c579101a6013b1bcfbaca98e Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 13 Aug 2015 13:21:21 +0200 Subject: [PATCH] =?utf8?q?Continued=20with=20project:=20-=20added=20placeh?= =?utf8?q?older=20class=20for=20category=20datbase=20constants=20-=20added?= =?utf8?q?=20stub=20JSPs=20for=20handling=20category=20and=20product=20req?= =?utf8?q?uests=20in=20admin=20area=20-=20improved=20category=20handling?= =?utf8?q?=20a=20little=20more=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../PizzaCategoryDatabaseConstants.java | 45 ++++++++++++++ web/admin/category.jsp | 24 ++++---- web/form_handler/admin/do_category.jsp | 61 +++++++++++++++++++ web/form_handler/admin/do_product.jsp | 61 +++++++++++++++++++ web/form_handler/do_order.jsp | 2 +- 5 files changed, 181 insertions(+), 12 deletions(-) create mode 100644 src/java/org/mxchange/pizzaapplication/database/category/PizzaCategoryDatabaseConstants.java create mode 100644 web/form_handler/admin/do_category.jsp create mode 100644 web/form_handler/admin/do_product.jsp 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); -- 2.39.5