X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Fpizzaapplication%2Fapplication%2FPizzaApplication.java;h=09993d40a28168e02561b2c89f63e799627d9fa8;hb=ad3a217eb62ab36fab7004786b42e44edc063171;hp=c1ebe25236b649f57b64e7096987071f3c0a4c20;hpb=f1fe01b9c668895ec8a95c4759c8f13bd645f6b4;p=pizzaservice-war.git diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java index c1ebe252..09993d40 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -16,11 +16,17 @@ */ package org.mxchange.pizzaapplication.application; +import java.io.IOException; +import java.sql.SQLException; import java.util.Iterator; +import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.mxchange.jcore.application.Application; +import org.mxchange.jcore.exceptions.BadTokenException; +import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.pizzaapplication.category.Category; import org.mxchange.pizzaapplication.exceptions.CategoryTitleAlreadyUsedException; import org.mxchange.pizzaapplication.exceptions.ProductTitleAlreadyUsedException; @@ -37,9 +43,14 @@ public interface PizzaApplication extends Application { public static final String HTTP_PARAM_AMOUNT = "amount"; //NOI18N /** - * HTTP parameter "choose" + * HTTP parameter "id" */ - public static final String HTTP_PARAM_CHOOSE = "choose"; //NOI18N + public static final String HTTP_PARAM_ITEM_ID = "id"; //NOI18N + + /** + * HTTP parameter "type" + */ + public static final String HTTP_PARAM_ITEM_TYPE = "type"; //NOI18N /** * Session key "ordered" @@ -48,8 +59,10 @@ public interface PizzaApplication extends Application { /** * Mask for all parameters + * @deprecated Please refacture! */ - public static final String HTTP_PARAM_MASK = "%s[%s]"; //NOI18N + @Deprecated + static final String HTTP_PARAM_MASK = "%s[%s]"; //NOI18N /** * Some "getter" for amount from session @@ -100,6 +113,17 @@ public interface PizzaApplication extends Application { */ public float getTotalPositionPriceFromRequestSession (final Product product, final HttpServletRequest request, final HttpSession session); + /** + * Initializes this instance with given ServletContext + * + * @param context Servlet context + * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the backend is unsupported + * @throws java.sql.SQLException If an SQL error occurs + * @throws java.io.IOException If an IO error occurs + * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found + */ + public void init (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException; + /** * Checks whether the given product is choosen, request overules session. * @@ -269,15 +293,6 @@ public interface PizzaApplication extends Application { */ public void doAdminAddProduct (final HttpServletRequest request) throws ServletException, ProductTitleAlreadyUsedException; - /** - * Checks if product's title is already used. - * - * @param request Request instance - * @return Whether the product's title has already been used - * @throws javax.servlet.ServletException If something unexpected happened - */ - public boolean isProductTitleUsed (final HttpServletRequest request) throws ServletException; - /** * Generates link HTML code for given category's parent id, if set. This * link then points to products.jsp?category_id=x @@ -286,4 +301,22 @@ public interface PizzaApplication extends Application { * @return HTML code */ public String generateLinkForParent (final Category category); + + /** + * Handles admin product form requests + * + * @param request Request instance + * @param response Response instance + * @throws ServletException If something unexpected happened + */ + public void doAdminHandleProductForms (final HttpServletRequest request, final HttpServletResponse response) throws ServletException; + + /** + * Handles admin category form requests + * + * @param request Request instance + * @param response Response instance + * @throws ServletException If something unexpected happened + */ + public void doAdminHandleCategoryForms (final HttpServletRequest request, final HttpServletResponse response) throws ServletException; }