From 41fceee4732f757e045650dbaab3908940e90ac4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 1 Sep 2015 15:26:42 +0200 Subject: [PATCH] Refacturing towards JSF: - Well, this sucks a bit: getAvailableProducts() needs to return something that is Collection and not Iterator (which worked in JSP) - Added initial index.xhtml and CSS layout for upcoming rewrite (origin: NetBeans) - updated jcore/jshop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by:Roland Häder --- lib/jcore.jar | Bin 120581 -> 120623 bytes lib/jshop.jar | Bin 77372 -> 81778 bytes nbproject/faces-config.NavData | 0 nbproject/project.properties | 1 + .../application/PizzaApplication.java | 31 +++- .../application/PizzaServiceApplication.java | 55 +++++-- .../beans/controller/PizzaBean.java | 37 ++++- .../beans/controller/PizzaServiceBean.java | 66 +++------ .../servlet/basket/BasketItemAddedFilter.java | 95 ++++++------ .../tags/basket/MiniBasketTag.java | 6 +- web/WEB-INF/faces-config.xml | 7 + web/WEB-INF/templates/base.tpl | 43 ++++++ web/WEB-INF/templates/guest/guest_footer.tpl | 16 +++ web/WEB-INF/templates/guest/guest_menu.tpl | 19 +++ web/WEB-INF/web.xml | 4 +- web/admin/category.jsp | 2 +- web/admin/product.jsp | 2 +- web/index.jsp | 3 +- web/index.xhtml | 135 +++++++++++++++++ web/resources/css/cssLayout.css | 136 ++++++++++++++++++ web/resources/css/default.css | 28 ++++ .../admin/admin_category_selection_box.jsp | 2 +- .../admin_parent_category_selection_box.jsp | 2 +- 23 files changed, 561 insertions(+), 129 deletions(-) create mode 100644 nbproject/faces-config.NavData create mode 100644 web/WEB-INF/faces-config.xml create mode 100644 web/WEB-INF/templates/base.tpl create mode 100644 web/WEB-INF/templates/guest/guest_footer.tpl create mode 100644 web/WEB-INF/templates/guest/guest_menu.tpl create mode 100644 web/index.xhtml create mode 100644 web/resources/css/cssLayout.css create mode 100644 web/resources/css/default.css diff --git a/lib/jcore.jar b/lib/jcore.jar index 8b05d574954f3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u> zb{vX1%$=nbjvdkHA%SD!AOgqyO0nGJVZ8YWwh+sfuY*s@*~l?<_oK-TN2mvcnlvum zn+jR`@u{3M{C^Fb3*_)&rf8-=Zty9wg=XV;Fz8XL*iA7C&-4{5eLC(qoWI26j8kCB`9y!6h1?gF1*( zLRPC!Se<^K=!PS|U*SE$8a=Mj6B>zgXmku(kh87efR{*y(bh>E*exY+9S=a-$vEF? z2Wd@k_)W@zLsNr@S`k|Qs)2!2ZWytcwZ0K4vwWy@DXqW)n)K-XF zHnF4_E%^4;(H>V^G-G?j5Gk$o{!9l9;nT6`pGjY!D0OanoUBi=1ktDZ8^^FB*S3B`zy~abo*2_2K zrc@`NaiF0oC7Anmkel*wKI4*`snNVczBf00)RSxErKU-#yf+9pzSDg;A3eUTzAQg2 z^eykpeWgCo7wzc(cVCv@0{RlOc%;-dSv*$i!&y8+>YuZ?RO+$)c(l|z`*E559OrZP z=X4>G)t@ht#>@NjG_1s*ZDD{K6JYDLj0X#$M6$5zMIloHuy*Yr(659VTPJVFG`nP}6zCo(U z8R46q#~DIpdmhI*rjPSgSDw9Y94!~<5TJQaJtoTVs@zS?L0P2+AnKkq9-GF zmn*-OH0|G{&644x%u(&W@V6Uve+4+mR1?-j${B|_SwaCOdvJ%{9;`NY(0ywP*lSX1 z_i?@*rEnkKNKpwlr1)wFg1h!-K!hJXwEpei)cBx1x|19T#hRnr9lf*;###;@HAmYg zF-uU4Yyb+;ho$cq#FSJL$9rT^E zGe*kQp7**h?9rZ`hdII5ztEP=z(c3+xEFemOMXw||J%Rmqp!_3%0eQ2J7l!T=FQqS zzW%~M0*I@pe<FsEB)~w+>!gb${!Q54>>EK|{xh2Bi(a|?Cm%S#P!lw>=Uy9f!*MN3(I>ng7 YeP88pm~UJfhx(=t;mF|o getAvailableProducts () throws ServletException; + + /** + * Some "getter" for a linked list of all products + * + * @return All products + * @throws javax.servlet.ServletException If anything went wrong + */ + public Deque getAllProducts () throws ServletException; + + /** + * Some "getter" for a linked list of all categories + * + * @return All categories + * @throws javax.servlet.ServletException If anything went wrong + */ + public Deque getAllCategories () throws ServletException; + /** * Initializes this instance with given ServletContext * @@ -98,7 +123,7 @@ public interface PizzaApplication extends Application { * @return Only available products * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAvailableProducts () throws ServletException; + public Iterator getAvailableProductsIterator () throws ServletException; /** * Some "getter" for a an array of all products @@ -106,7 +131,7 @@ public interface PizzaApplication extends Application { * @return All products * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAllProducts () throws ServletException; + public Iterator getAllProductsIterator () throws ServletException; /** * Some "getter" for a an array of all categories @@ -114,7 +139,7 @@ public interface PizzaApplication extends Application { * @return All categories * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAllCategories () throws ServletException; + public Iterator getAllCategoriesIterator () throws ServletException; /** * Checks if given Product instance is available and returns a printable diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index a5e35eb3..9bf32b49 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -21,6 +21,7 @@ import java.io.UnsupportedEncodingException; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; +import java.util.Deque; import java.util.Iterator; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -50,12 +51,12 @@ import org.mxchange.pizzaapplication.BasePizzaServiceSystem; */ public class PizzaServiceApplication extends BasePizzaServiceSystem implements PizzaApplication { /** - * Frontend for products + * Database frontend for products */ private ProductFrontend productFrontend; /** - * Frontend for categories + * Database frontend for categories */ private CategoryFrontend categoryFrontend; @@ -67,6 +68,39 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P this.getLogger().trace("CALLED!"); //NOI18N } + @Override + public Deque getAllCategories () throws ServletException { + try { + // Deligate to frontend + return this.categoryFrontend.getAllCategories(); + } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + // Continue to throw + throw new ServletException(ex); + } + } + + @Override + public Deque getAllProducts () throws ServletException { + try { + // Deligate to frontend + return this.productFrontend.getAllProducts(); + } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + // Continue to throw + throw new ServletException(ex); + } + } + + @Override + public Deque getAvailableProducts () throws ServletException { + try { + // Deligate to frontend + return this.productFrontend.getAllAvailableProducts(); + } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + // Continue to throw + throw new ServletException(ex); + } + } + @Override public void init (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException { // Trace message @@ -119,7 +153,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P // Init/declare total price and iterator int totalAmount = 0; - Iterator iterator = this.getAvailableProducts(); + Iterator iterator = this.getAvailableProductsIterator(); // "Walk" over all products while (iterator.hasNext()) { @@ -295,7 +329,8 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } @Override - public Iterator getAvailableProducts () throws ServletException { + @SuppressWarnings ("unchecked") + public Iterator getAvailableProductsIterator () throws ServletException { // categoryFrontend must be set if (null == this.productFrontend) { // Abort here @@ -304,14 +339,15 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P try { // Ask frontend for a list of products - return this.productFrontend.getAvailableProducts(); + return (Iterator) this.productFrontend.getAvailableProductsIterator(); } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { throw new ServletException(ex); } } @Override - public Iterator getAllProducts () throws ServletException { + @SuppressWarnings ("unchecked") + public Iterator getAllProductsIterator () throws ServletException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -323,14 +359,15 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P try { // Ask frontend for a list of products - return this.productFrontend.getAllProducts(); + return (Iterator) this.productFrontend.getAllProductsIterator(); } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { throw new ServletException(ex); } } @Override - public Iterator getAllCategories () throws ServletException { + @SuppressWarnings ("unchecked") + public Iterator getAllCategoriesIterator () throws ServletException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -342,7 +379,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P try { // Ask frontend for a list of categories - return this.categoryFrontend.getAllCategories(); + return (Iterator) this.categoryFrontend.getAllCategoriesIterator(); } catch (final IOException | BadTokenException | SQLException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { throw new ServletException(ex); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java index 1a7eda3f..18bed800 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.controller; +import java.util.Deque; import java.util.Iterator; import javax.faces.FacesException; import javax.servlet.ServletException; @@ -70,28 +71,52 @@ public interface PizzaBean extends FrameworkBean { public void setValueInSession (final HttpSession session, final String key, final Object value); /** - * Some "getter" for a an array of only available products + * Some "getter" for an iterator of only available products * * @return Only available products * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAvailableProducts () throws ServletException; + public Iterator getAvailableProductsIterator () throws ServletException; /** - * Some "getter" for a an array of all products + * Some "getter" for an iterator of all products * * @return All products * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAllProducts () throws ServletException; + public Iterator getAllProductsIterator () throws ServletException; /** - * Some "getter" for a an array of all categories + * Some "getter" for an iterator of all categories * * @return All categories * @throws javax.servlet.ServletException If anything went wrong */ - public Iterator getAllCategories () throws ServletException; + public Iterator getAllCategoriesIterator () throws ServletException; + + /** + * Some "getter" for a linked list of only available products + * + * @return Only available products + * @throws javax.servlet.ServletException If anything went wrong + */ + public Deque getAvailableProducts () throws ServletException; + + /** + * Some "getter" for a linked list of all products + * + * @return All products + * @throws javax.servlet.ServletException If anything went wrong + */ + public Deque getAllProducts () throws ServletException; + + /** + * Some "getter" for a linked list of all categories + * + * @return All categories + * @throws javax.servlet.ServletException If anything went wrong + */ + public Deque getAllCategories () throws ServletException; /** * Checks if given Product instance is available and returns a printable diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java index 86b10097..a61838d6 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java @@ -19,6 +19,7 @@ package org.mxchange.pizzaapplication.beans.controller; import java.io.IOException; import java.sql.SQLException; import java.text.MessageFormat; +import java.util.Deque; import java.util.Iterator; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; @@ -93,80 +94,51 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { } } - /** - * 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 - */ @Override public String getCheckedHtmlFromProduct (final Product product, final ServletRequest request, final HttpSession session) { return this.app.getCheckedHtmlFromProduct(product, request, 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 - */ @Override public String getDisabledHtmlFromSession (final ServletRequest request, final HttpSession session) throws ServletException { return this.app.getDisabledHtmlFromSession(request, session); } - /** - * 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 - */ @Override public String getPrintableProduktAvailability (final Product product) { return this.app.getPrintableProduktAvailability(product); } - /** - * Some "getter" for a an array of only available products - * - * @return All products - */ @Override - public Iterator getAvailableProducts () throws ServletException { + public Iterator getAvailableProductsIterator () throws ServletException { + return this.app.getAvailableProductsIterator(); + } + + @Override + public Iterator getAllProductsIterator () throws ServletException { + return this.app.getAllProductsIterator(); + } + + @Override + public Deque getAvailableProducts () throws ServletException { return this.app.getAvailableProducts(); } - /** - * Some "getter" for a an array of all products - * - * @return All products - */ @Override - public Iterator getAllProducts () throws ServletException { + public Deque getAllProducts () throws ServletException { return this.app.getAllProducts(); } - /** - * Some "getter" for a an array of all categories - * - * @return All categories - */ @Override - public Iterator getAllCategories () throws ServletException { + public Iterator getAllCategoriesIterator () throws ServletException { + return this.app.getAllCategoriesIterator(); + } + + @Override + public Deque getAllCategories () throws ServletException { return this.app.getAllCategories(); } - /** - * Somewhat setter in session - * - * @param session Session instance - * @param key Session key to set - * @param value Value to set - */ @Override public void setValueInSession (final HttpSession session, final String key, final Object value) { this.app.setValueInSession(session, key, value); diff --git a/src/java/org/mxchange/pizzaapplication/filter/servlet/basket/BasketItemAddedFilter.java b/src/java/org/mxchange/pizzaapplication/filter/servlet/basket/BasketItemAddedFilter.java index 66089c88..c2475b4c 100644 --- a/src/java/org/mxchange/pizzaapplication/filter/servlet/basket/BasketItemAddedFilter.java +++ b/src/java/org/mxchange/pizzaapplication/filter/servlet/basket/BasketItemAddedFilter.java @@ -17,8 +17,6 @@ package org.mxchange.pizzaapplication.filter.servlet.basket; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; import java.text.MessageFormat; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -28,8 +26,6 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jshop.beans.basket.BasketBean; import org.mxchange.jshop.item.AddableBasketItem; import org.mxchange.pizzaapplication.filter.servlet.BaseServletFilter; @@ -83,60 +79,55 @@ public class BasketItemAddedFilter extends BaseServletFilter implements Filter { // Debug message this.getLogger().debug(MessageFormat.format("item.id={0},item.itemId={1},item.itemType={2},item.amount={3}", item.getId(), item.getItemId(), item.getItemType(), item.getAmount())); //NOI18N - try { - // Cast to servlet request - HttpServletRequest servletRequest = (HttpServletRequest) request; + // Cast to servlet request + HttpServletRequest servletRequest = (HttpServletRequest) request; - // Get session instance - HttpSession session = servletRequest.getSession(); + // Get session instance + HttpSession session = servletRequest.getSession(); - // Debug message - this.getLogger().debug(MessageFormat.format("session={0}", session)); //NOI18N + // Debug message + this.getLogger().debug(MessageFormat.format("session={0}", session)); //NOI18N - // Should not be null - if (null == session) { - // session is null - throw new NullPointerException("session is null"); //NOI18N - } + // Should not be null + if (null == session) { + // session is null + throw new NullPointerException("session is null"); //NOI18N + } - // Get basket instance - BasketBean basket = (BasketBean) session.getAttribute("basket"); //NOI18N + // Get basket instance + BasketBean basket = (BasketBean) session.getAttribute("basket"); //NOI18N + // Debug message + this.getLogger().debug(MessageFormat.format("basket={0}", basket)); //NOI18N + + // Is the item already added? + if (item.getItemId() == null) { + // Item id is not set + throw new NullPointerException(MessageFormat.format("item id of item={0} is null", item)); //NOI18N + } else if (item.getItemType() == null) { + // Item type is not set + throw new NullPointerException(MessageFormat.format("item type of item={0} is null", item)); //NOI18N + } else if ((item.getAmount() == null) || (item.getAmount() == 0)) { // Debug message - this.getLogger().debug(MessageFormat.format("basket={0}", basket)); //NOI18N - - // Is the item already added? - if (item.getItemId() == null) { - // Item id is not set - throw new NullPointerException(MessageFormat.format("item id of item={0} is null", item)); //NOI18N - } else if (item.getItemType() == null) { - // Item type is not set - throw new NullPointerException(MessageFormat.format("item type of item={0} is null", item)); //NOI18N - } else if ((item.getAmount() == null) || (item.getAmount() == 0)) { - // Debug message - this.getLogger().debug(MessageFormat.format("Amount for item {0} is null - EXIT!", item)); //NOI18N - - // Amount is not entered - return; - } else if (basket.isItemAdded(item)) { - // Yes, then throw exception here - throw new ServletException(MessageFormat.format("item id={0} has already been added.", item.getItemId())); //NOI18N - } - - // Register item with it - basket.addItem(item); - - // Is amount null or zero? - if ((item.getAmount() == null) || (item.getAmount() == 0)) { - // Then redirect to added=0 - ((HttpServletResponse) response).sendRedirect(servletRequest.getContextPath() + "/?add=0"); //NOI18N - } else { - // Redirect to proper URL - ((HttpServletResponse) response).sendRedirect(servletRequest.getContextPath() + "/?add=1"); //NOI18N - } - } catch (final SQLException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { - // Continue to throw - throw new ServletException(ex); + this.getLogger().debug(MessageFormat.format("Amount for item {0} is null - EXIT!", item)); //NOI18N + + // Amount is not entered + return; + } else if (basket.isItemAdded(item)) { + // Yes, then throw exception here + throw new ServletException(MessageFormat.format("item id={0} has already been added.", item.getItemId())); //NOI18N + } + + // Register item with it + basket.addItem(item); + + // Is amount null or zero? + if ((item.getAmount() == null) || (item.getAmount() == 0)) { + // Then redirect to added=0 + ((HttpServletResponse) response).sendRedirect(servletRequest.getContextPath() + "/?add=0"); //NOI18N + } else { + // Redirect to proper URL + ((HttpServletResponse) response).sendRedirect(servletRequest.getContextPath() + "/?add=1"); //NOI18N } // Trace message diff --git a/src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java b/src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java index 9cdd3cd2..0154ed8e 100644 --- a/src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java +++ b/src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java @@ -17,16 +17,12 @@ package org.mxchange.pizzaapplication.tags.basket; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; import java.text.MessageFormat; import javax.servlet.ServletException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyTagSupport; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jshop.beans.basket.BasketBean; import org.mxchange.jshop.item.AddableBasketItem; import org.mxchange.jshop.product.Product; @@ -138,7 +134,7 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag { out.append(" \n"); //NOI18N out.append("\n"); //NOI18N } - } catch (final ServletException | IOException | SQLException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + } catch (final ServletException ex) { // Continue to throw throw new JspException(ex); } diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml new file mode 100644 index 00000000..eef85cfe --- /dev/null +++ b/web/WEB-INF/faces-config.xml @@ -0,0 +1,7 @@ + + + + diff --git a/web/WEB-INF/templates/base.tpl b/web/WEB-INF/templates/base.tpl new file mode 100644 index 00000000..07d3cf50 --- /dev/null +++ b/web/WEB-INF/templates/base.tpl @@ -0,0 +1,43 @@ + + + + + + + + + Pizza-Service - <ui:insert name="title">Default title</ui:insert> + + + +
+ + + +
+ +
+
+ Default menu +
+ +
+ Default content header + Default content +
+ +
+
+ + +
+ diff --git a/web/WEB-INF/templates/guest/guest_footer.tpl b/web/WEB-INF/templates/guest/guest_footer.tpl new file mode 100644 index 00000000..a3c9ec7e --- /dev/null +++ b/web/WEB-INF/templates/guest/guest_footer.tpl @@ -0,0 +1,16 @@ + + + +
+
diff --git a/web/WEB-INF/templates/guest/guest_menu.tpl b/web/WEB-INF/templates/guest/guest_menu.tpl new file mode 100644 index 00000000..cf2ebcf8 --- /dev/null +++ b/web/WEB-INF/templates/guest/guest_menu.tpl @@ -0,0 +1,19 @@ + + + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 0851cde8..6ddf5b86 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -76,7 +76,7 @@ - - index.jsp + faces/index.xhtml + diff --git a/web/admin/category.jsp b/web/admin/category.jsp index 47da4f06..8aefece3 100644 --- a/web/admin/category.jsp +++ b/web/admin/category.jsp @@ -63,7 +63,7 @@ - + ${category.categoryId}: diff --git a/web/admin/product.jsp b/web/admin/product.jsp index 67d48d0d..49af00a1 100644 --- a/web/admin/product.jsp +++ b/web/admin/product.jsp @@ -68,7 +68,7 @@ - + ${product.itemId}: diff --git a/web/index.jsp b/web/index.jsp index 7d3dbe81..ec70c2df 100644 --- a/web/index.jsp +++ b/web/index.jsp @@ -45,6 +45,7 @@
+ @@ -74,7 +75,7 @@
- + diff --git a/web/index.xhtml b/web/index.xhtml new file mode 100644 index 00000000..958400df --- /dev/null +++ b/web/index.xhtml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + Willkommen! + + + + + + + Eingangsseite (dummy) + + + + + + + + + + + + + + + + + + + + +
+ Folgendes kann bestellt werden: +
+ Bestellen? + + Anzahl: + + Produkt: + + Einzelpreis: +
+ + + + + + + + + + + + + + + + + +
+ Warenkorb + + #{controller.basket.item.amount} + + #{product.title} + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + + + #{product.title} + + + + +
+
+
+
+
+ + + + +
+ diff --git a/web/resources/css/cssLayout.css b/web/resources/css/cssLayout.css new file mode 100644 index 00000000..3d3b2cb1 --- /dev/null +++ b/web/resources/css/cssLayout.css @@ -0,0 +1,136 @@ +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#footer { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + +/** +div { + border: 1px solid #ff0000; +} +/**/ + +table, .table { + margin: 0px; + padding: 0px; +} + +.table { + width: 500px; +} + +.table_row { + width: 100%; +} + +.table_left { + width: 250px; + float: left; +} + +.table_right { + width: 200px; + float: right; +} + +.table_left25 { + width: 20px; + float: left; +} + +.table_right75 { + width: 430px; + float: right; +} + +.para { + padding: 5px 5px 5px 5px; +} + +.clear { + clear: both; +} + +ul.footer_nav { + text-align: center; + width : 500px; + list-style: none; + margin: 0px; +} + +ul.footer_nav li { + float: left; + width: 100px; +} + +.menu ul { + list-style: none; + padding-left: 5px; +} + +.table_header { + text-align: center; + font-weight: bold; + font-size: 20px; +} + +.table_header_column { + width: 100px; +} + +.table_data_column { + width: 100px; +} diff --git a/web/resources/css/default.css b/web/resources/css/default.css new file mode 100644 index 00000000..c658b11b --- /dev/null +++ b/web/resources/css/default.css @@ -0,0 +1,28 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: lucida; + color: #000000; + margin: 10px; +} + +h1 { + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/web/static/admin/admin_category_selection_box.jsp b/web/static/admin/admin_category_selection_box.jsp index 920de9f4..e1d2bece 100644 --- a/web/static/admin/admin_category_selection_box.jsp +++ b/web/static/admin/admin_category_selection_box.jsp @@ -10,7 +10,7 @@ diff --git a/web/static/admin/admin_parent_category_selection_box.jsp b/web/static/admin/admin_parent_category_selection_box.jsp index eb98e8de..c00a925e 100644 --- a/web/static/admin/admin_parent_category_selection_box.jsp +++ b/web/static/admin/admin_parent_category_selection_box.jsp @@ -11,7 +11,7 @@ -- 2.39.5