]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with project:
authorRoland Haeder <roland@mxchange.org>
Thu, 13 Aug 2015 11:42:33 +0000 (13:42 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 13 Aug 2015 13:36:11 +0000 (15:36 +0200)
- added doAdminAddCategory() and doAdminAddProduct()
- it is getParameter() for HttpServletRequest instances to get the actual POST/GET *parameter*
- Ignored more strings for internationalization
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java
src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java
web/form_handler/admin/do_category.jsp
web/form_handler/admin/do_product.jsp

index 22901cab914be13d1075ac80ad6aa90523b067b6..80983bf1337ff6f4ce6f8d07678461a55edfab5a 100644 (file)
@@ -231,4 +231,18 @@ public interface PizzaApplication extends Application {
         * @throws javax.servlet.ServletException If something unexpected happened
         */
        public void markAllChoosenProductsAsOrdered (final HttpServletRequest request, final HttpSession session) throws ServletException;
+
+       /**
+        * Adds given category data from request to database
+        *
+        * @param request Request instance
+        */
+       public void doAdminAddCategory (final HttpServletRequest request);
+
+       /**
+        * Adds given product data from request to database
+        *
+        * @param request Request instance
+        */
+       public void doAdminAddProduct (final HttpServletRequest request);
 }
index 1603c70f859e9fabcb96429159c6e437db6d3eec..550d3f9436fdc4a19dbc5f14fc267c80492e3b0d 100644 (file)
@@ -243,17 +243,17 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
 
        @Override
        public void doBootstrap () {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
        }
 
        @Override
        public void doMainLoop () {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
        }
 
        @Override
        public void doShutdown () {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
        }
 
        /**
@@ -477,7 +477,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
         */
        @Override
        public String getPrintableProduktAvailability (final Product product) {
-               throw new UnsupportedOperationException(MessageFormat.format("Not supported yet: product={0}", product));
+               throw new UnsupportedOperationException(MessageFormat.format("Not supported yet: product={0}", product)); //NOI18N
        }
 
        /**
@@ -749,7 +749,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
        @Override
        public void markAllChoosenProductsAsOrdered (final HttpServletRequest request, final HttpSession session) throws ServletException {
                // Trace message
-               this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session));
+               this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
 
                // Init iterator
                Iterator<Product> iterator = this.getProducts();
@@ -760,7 +760,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                        Product product = iterator.next();
 
                        // Debug message
-                       this.getLogger().debug(MessageFormat.format("product={0}", product));
+                       this.getLogger().debug(MessageFormat.format("product={0}", product)); //NOI18N
 
                        // Is it choosen?
                        if (this.isProductChoosen(product, request, session)) {
@@ -770,7 +770,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                }
 
                // Trace message
-               this.getLogger().trace("EXIT!");
+               this.getLogger().trace("EXIT!"); //NOI18N
        }
 
        /**
@@ -1005,15 +1005,15 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                // Check request method
                if (!"POST".equals(request.getMethod())) { //NOI18N
                        // Not POST, so get from session
-                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session));
+                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session)); //NOI18N
                        return this.getChooseFromSession(product, session);
                } else if (this.isProductOrdered(product, session)) {
                        // Product is ordered
-                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session));
+                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session)); //NOI18N
                        return this.getChooseFromSession(product, session);
                } else if (!this.getChooseFromSession(product, session).isEmpty()) {
                        // Found in session
-                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session));
+                       this.getLogger().trace(MessageFormat.format("Calling this.getChooseFromSession({0},{1}) ... - EXIT!", product.getId(), session)); //NOI18N
                        return this.getChooseFromSession(product, session);
                }
 
@@ -1154,4 +1154,32 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                        this.getLogger().debug(MessageFormat.format("entry {0}={1}", entry.getKey(), entry.getValue())); //NOI18N
                }
        }
+
+       /**
+        * Adds given category data from request to database
+        *
+        * @param request Request instance
+        */
+       @Override
+       public void doAdminAddCategory (final HttpServletRequest request) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("request={0} - CALLED!", request)); //NOI18N
+
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
+
+       /**
+        * Adds given product data from request to database
+        *
+        * @param request Request instance
+        */
+       @Override
+       public void doAdminAddProduct (final HttpServletRequest request) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("request={0} - CALLED!", request)); //NOI18N
+
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
 }
index 611df6f4b551364dea41c94e9bbced381199c37c..d917e2a93f019f1218776d19288d777ef6a6fe0b 100644 (file)
        // Is it post?
        if ("POST".equals(request.getMethod())) { //NOI18N
                // Is "add/edit/delete" set?
-               if (request.getAttribute("add") != null) { //NOI18N
+               if (request.getParameter("add") != null) { //NOI18N
                        // Add new category
                        app.doAdminAddCategory(request);
-               } else if (request.getAttribute("edit") != null) { //NOI18N
+               } else if (request.getParameter("edit") != null) { //NOI18N
                        // @TODO
-               } else if (request.getAttribute("delete") != null) { //NOI18N
+               } else if (request.getParameter("delete") != null) { //NOI18N
                        // @TODO
                }
 
index e94cdca5ce8615ea8583847cc57848d1202e5d34..679f21b2acda0b9e82f7f9301cc886f3aa5470bd 100644 (file)
        // Is it post?
        if ("POST".equals(request.getMethod())) { //NOI18N
                // Is "add/edit/delete" set?
-               if (request.getAttribute("add") != null) { //NOI18N
+               if (request.getParameter("add") != null) { //NOI18N
                        // Add new product
                        app.doAdminAddProduct(request);
-               } else if (request.getAttribute("edit") != null) { //NOI18N
+               } else if (request.getParameter("edit") != null) { //NOI18N
                        // @TODO
-               } else if (request.getAttribute("delete") != null) { //NOI18N
+               } else if (request.getParameter("delete") != null) { //NOI18N
                        // @TODO
                }