]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Removed more old methods
authorRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 17:02:38 +0000 (19:02 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 17:02:38 +0000 (19:02 +0200)
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
src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java
src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java

index aa400cea89b2fdc8a9fe1905e1b1d25cd19b0902..eba91b9f8fb4bcbde633083b9bf6710be76bc27d 100644 (file)
@@ -88,26 +88,6 @@ public interface PizzaApplication extends Application {
         */
        public void init (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException;
 
-       /**
-        * Some "getter" for HTML code 'checked="checked"' if the product is choosen
-        *
-        * @param product Product instance
-        * @param request Request instance
-        * @param session Session instance
-        * @return Whether the product is choosen
-        */
-       public String getCheckedHtmlFromProduct (final Product product, final ServletRequest request, final HttpSession session);
-
-       /**
-        * Some "getter" for HTML code 'disabled="disabled"' for e.g. submit buttons
-        *
-        * @param request Request instance
-        * @param session Session instance
-        * @return Whether the product is choosen
-        * @throws javax.servlet.ServletException If something unexpected happened
-        */
-       public String getDisabledHtmlFromSession (final ServletRequest request, final HttpSession session) throws ServletException;
-
        /**
         * Somewhat setter in session
         *
index 9bf32b496dc024ae15d3de1f897d46738e5cd5ac..920ada7540a7df5f38bda863d6e141f1e111679e 100644 (file)
@@ -129,59 +129,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                this.getLogger().trace("EXIT!"); //NOI18N
        }
 
-       /**
-        * Calculates total amount of all choosen products
-        *
-        * @param request Request instance
-        * @param session Session instance
-        * @return Total amount of all choosen products
-        * @deprecated Old lost 
-        */
-       @Deprecated
-       private int calculateTotalAmount (final ServletRequest request, final HttpSession session) throws ServletException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
-
-               // Is product and session set?
-               if (null == request) {
-                       // Not set
-                       throw new NullPointerException("request is null"); //NOI18N
-               } else if (null == session) {
-                       // Not set
-                       throw new NullPointerException("session is null"); //NOI18N
-               }
-
-               // Init/declare total price and iterator
-               int totalAmount = 0;
-               Iterator<Product> iterator = this.getAvailableProductsIterator();
-
-               // "Walk" over all products
-               while (iterator.hasNext()) {
-                       // Get next product
-                       Product product = iterator.next();
-
-                       // Is this choosen?
-                       if (this.isProductChoosen(product, request, session)) {
-                               // Then add ordered amount
-                               this.getLogger().debug(MessageFormat.format("Counting {0} ...", product.getItemId())); //NOI18N
-
-                               // Getting amount
-                               String amount = this.getAmountFromSession(product, session);
-
-                               // Add it up
-                               this.getLogger().debug(MessageFormat.format("amount={0}", amount)); //NOI18N
-                               totalAmount += Integer.valueOf(amount);
-                       }
-                       this.getLogger().debug(MessageFormat.format("product={0},totalAmount={1}", product.getItemId(), totalAmount)); //NOI18N
-               }
-
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("totalAmount={0} - EXIT!", totalAmount)); //NOI18N
-
-               // Return total price
-               return totalAmount;
-       }
-
        @Override
        public void doBootstrap () {
                throw new UnsupportedOperationException("Not supported yet."); //NOI18N
@@ -197,116 +144,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                throw new UnsupportedOperationException("Not supported yet."); //NOI18N
        }
 
-       /**
-        * Some "getter" for amount from session
-        *
-        * @param product Product instance
-        * @param session Session instance
-        * @return Amount as string
-        * @deprecated Old lost code
-        */
-       @Deprecated
-       private String getAmountFromSession (final Product product, final HttpSession session) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("product={0},session={1} - CALLED!", product, session)); //NOI18N
-
-               // Is product and session set?
-               if (null == product) {
-                       // Not set
-                       throw new NullPointerException("product is null"); //NOI18N
-               } else if (null == session) {
-                       // Not set
-                       throw new NullPointerException("session is null"); //NOI18N
-               }
-
-               // Get attribute
-               Object object = this.getValueFromSession(product, session, HTTP_PARAM_AMOUNT);
-
-               // Is the object null?
-               if (null == object) {
-                       // Trace message
-                       this.getLogger().trace("Returning 0 - EXIT!"); //NOI18N
-
-                       // Not found
-                       return "0"; //NOI18N
-               }
-
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("object={0} - EXIT!", object)); //NOI18N
-
-               // Cast to string and return it
-               return (String) object;
-       }
-
-       @Override
-       public String getCheckedHtmlFromProduct (final Product product, final ServletRequest request, final HttpSession session) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("product={0},request={1},session={2} - CALLED!", product, request, session)); //NOI18N
-
-               // Is product and session set?
-               if (null == product) {
-                       // Not set
-                       throw new NullPointerException("product is null"); //NOI18N
-               } else if (null == request) {
-                       // Not set
-                       throw new NullPointerException("request is null"); //NOI18N
-               } else if (null == session) {
-                       // Not set
-                       throw new NullPointerException("session is null"); //NOI18N
-               }
-
-               // First let's check if the product is choosen
-               if (this.isProductChoosen(product, request, session)) {
-                       // Trace message
-                       this.getLogger().trace("Returning checked=\"checked\" - EXIT!"); //NOI18N
-
-                       // Is choosen
-                       return "checked=\"checked\""; //NOI18N
-               } else {
-                       // Trace message
-                       this.getLogger().trace("Returning empty string - EXIT!"); //NOI18N
-
-                       // Not choosen
-                       return ""; //NOI18N
-               }
-       }
-
-       @Override
-       public String getDisabledHtmlFromSession (final ServletRequest request, final HttpSession session) throws ServletException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
-
-               // Is product and session set?
-               if (null == request) {
-                       // Not set
-                       throw new NullPointerException("request is null"); //NOI18N
-               } else if (null == session) {
-                       // Not set
-                       throw new NullPointerException("session is null"); //NOI18N
-               }
-
-               // Get "enabled" from request scope
-               Boolean enabled = Boolean.parseBoolean((String) request.getAttribute("enabled")); //NOI18N
-
-               // Debug message
-               this.getLogger().debug(MessageFormat.format("enabled={0}", enabled)); //NOI18N
-
-               // Is something selected?
-               if ((enabled) || (this.calculateTotalAmount(request, session) > 0)) {
-                       // Trace message
-                       this.getLogger().trace("Returning empty string - EXIT!"); //NOI18N
-
-                       // Something has been choosen
-                       return ""; //NOI18N
-               } else {
-                       // Trace message
-                       this.getLogger().trace("Returning disabled=\"disabled\" - EXIT!"); //NOI18N
-
-                       // Nothing choosen yet
-                       return "disabled=\"disabled\""; //NOI18N
-               }
-       }
-
        @Override
        public String getPrintableProduktAvailability (final Product product) {
                // Trace message
index 18bed800e96b98a921add576836d0399aebf5f8e..c15dcfe79d814de7e5f52c6afa2608d0d3591a49 100644 (file)
@@ -41,26 +41,6 @@ public interface PizzaBean extends FrameworkBean {
         */
        public void init () throws FacesException;
 
-       /**
-        * Some "getter" for HTML code 'checked="checked"' if the product is choosen
-        *
-        * @param product Product instance
-        * @param request Request instance
-        * @param session Session instance
-        * @return Whether the product is choosen
-        */
-       public String getCheckedHtmlFromProduct (final Product product, final ServletRequest request, final HttpSession session);
-
-       /**
-        * Some "getter" for HTML code 'disabled="disabled"' for e.g. submit buttons
-        *
-        * @param request Request instance
-        * @param session Session instance
-        * @return Whether the product is choosen
-        * @throws javax.servlet.ServletException If something unexpected happened
-        */
-       public String getDisabledHtmlFromSession (final ServletRequest request, final HttpSession session) throws ServletException;
-
        /**
         * Somewhat setter in session
         *
index a61838d646be21a93b67b228e1f9c15f9dc28fbb..681aad76d261a312c9ae7edc337b29485d68f00a 100644 (file)
@@ -94,16 +94,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean {
                }
        }
 
-       @Override
-       public String getCheckedHtmlFromProduct (final Product product, final ServletRequest request, final HttpSession session) {
-               return this.app.getCheckedHtmlFromProduct(product, request, session);
-       }
-
-       @Override
-       public String getDisabledHtmlFromSession (final ServletRequest request, final HttpSession session) throws ServletException {
-               return this.app.getDisabledHtmlFromSession(request, session);
-       }
-
        @Override
        public String getPrintableProduktAvailability (final Product product) {
                return this.app.getPrintableProduktAvailability(product);