From: Roland Haeder Date: Wed, 2 Sep 2015 17:50:57 +0000 (+0200) Subject: Added old method back + marked some others as deprecated X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aa49257dbc881b5eecbc6099eb2cfb1c42bb5611;p=pizzaservice-war.git Added old method back + marked some others as deprecated Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java index bb2963fb..f22e33d9 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -134,13 +134,26 @@ public interface PizzaApplication extends Application { */ public Iterator 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; /** diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 5052fa56..da3ff07d 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -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 diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java index 70a7c7ae..ff23c127 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java @@ -89,13 +89,26 @@ public interface PizzaBean extends FrameworkBean { */ public Deque 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; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java index 026c6ae9..76cedd68 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java @@ -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); + } }