]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Added old method back + marked some others as deprecated
authorRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 17:50:57 +0000 (19:50 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 17:50:57 +0000 (19:50 +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 bb2963fb45b298f5b6bc7545b56816eb7120766e..f22e33d9537ddb8cdbf08ae5af4df8a28313eb5e 100644 (file)
@@ -134,13 +134,26 @@ public interface PizzaApplication extends Application {
         */
        public Iterator<Category> getAllCategoriesIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
 
+       /**
+        * Generates a link for category's parent category. If none is given, the method will return only a small
+        * note.
+        *
+        * @param category Category instance
+        * @return HTML link for category's parent category
+        * @deprecated Old lost code
+        */
+       @Deprecated
+       public String generateLinkForParent (final Category category);
+
        /**
         * Checks if given Product instance is available and returns a printable
         * (human-readable) string.
         * 
         * @param product Product instance to check
         * @return Human-readable version of product availability
+        * @deprecated Old lost code
         */
+       @Deprecated
        public String getPrintableProduktAvailability (final Product product);
 
        /**
@@ -155,7 +168,9 @@ public interface PizzaApplication extends Application {
         * @throws java.lang.reflect.InvocationTargetException If something else happens?
         * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
         * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged
+        * @deprecated Old lost code
         */
+       @Deprecated
        public String getPrintableProductCategory (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
 
        /**
index 5052fa56a3a28d1e8fc3bd4618bbc498f325a91c..da3ff07ddda809e722d6d3a1297cde06df92dbf9 100644 (file)
@@ -373,6 +373,32 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
        }
 
        @Override
+       @Deprecated
+       public String generateLinkForParent (final Category category) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
+
+               // category must not be null
+               if (null == category) {
+                       // Is null
+                       throw new NullPointerException("category is null"); //NOI18N
+               }
+
+               // Get parent id
+               Long parentId = category.getParentId();
+
+               // Is the id set?
+               if (parentId > 0) {
+                       // Product HTML code for link
+                       throw new UnsupportedOperationException(MessageFormat.format("parentId={0} - Unfinished!", parentId)); //NOI18N
+               }
+
+               // No parent set
+               return "Keine";
+       }
+
+       @Override
+       @Deprecated
        public String getPrintableProductCategory (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
                // Trace message
                this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
index 70a7c7ae9c1ce5b9e3d82e89c5dad59285a97486..ff23c12711485d92e5e96d7220ee9bae7ae0e5e0 100644 (file)
@@ -89,13 +89,26 @@ public interface PizzaBean extends FrameworkBean {
         */
        public Deque<Category> getAllCategories () throws ServletException;
 
+       /**
+        * Generates a link for category's parent category. If none is given, the method will return only a small
+        * note.
+        *
+        * @param category Category instance
+        * @return HTML link for category's parent category
+        * @deprecated Old lost code
+        */
+       @Deprecated
+       public String generateLinkForParent (final Category category);
+
        /**
         * Checks if given Product instance is available and returns a printable
         * (human-readable) string.
         * 
         * @param product Product instance to check
         * @return Human-readable version of product availability
+        * @deprecated Old lost code
         */
+       @Deprecated
        public String getPrintableProduktAvailability (final Product product);
 
        /**
@@ -104,7 +117,9 @@ public interface PizzaBean extends FrameworkBean {
         * @param product Product instance to check
         * @return Human-readable version of product availability
         * @throws javax.servlet.ServletException If something unexpected happened
+        * @deprecated Old lost code
         */
+       @Deprecated
        public String getPrintableProduktCategory (final Product product) throws ServletException;
 
        /**
index 026c6ae931b7246492dbf2cfea629ff7acb91da1..76cedd683624a4a01e89958df7cafb2dc8fb2b8d 100644 (file)
@@ -96,6 +96,7 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean {
        }
 
        @Override
+       @Deprecated
        public String getPrintableProduktAvailability (final Product product) {
                return this.app.getPrintableProduktAvailability(product);
        }
@@ -181,6 +182,7 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean {
        }
 
        @Override
+       @Deprecated
        public String getPrintableProduktCategory (final Product product) throws ServletException {
                try {
                        return this.app.getPrintableProductCategory(product);
@@ -220,4 +222,11 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean {
                        throw new ServletException(ex);
                }
        }
+
+       @Override
+       @Deprecated
+       public String generateLinkForParent (final Category category) {
+               // Deligate to app
+               return this.app.generateLinkForParent(category);
+       }
 }