From: Roland Haeder Date: Wed, 9 Sep 2015 20:14:33 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=50fa67e49ff4f23fab5cbc9a0fcf440d49b8fa30;p=pizzaservice-war.git Continued: - update jcore.jar, jcoreee.jar, jshop-core.jar, jshop-ee-lib.jar - applied naming convention: Bean interfaces ends with Controller, Bean classes with Bean and "Web" must be pre-last word - a lot fixes applied Signed-off-by:Roland Häder --- diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar index 2fd44525..0b6d194d 100644 Binary files a/lib/jcore-ee-logger.jar and b/lib/jcore-ee-logger.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index ea3515c9..54ec8aa1 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 543a51b1..e78b86d5 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/jshop-core.jar b/lib/jshop-core.jar index fde0104c..f182f19d 100644 Binary files a/lib/jshop-core.jar and b/lib/jshop-core.jar differ diff --git a/lib/jshop-ee-lib.jar b/lib/jshop-ee-lib.jar index e477017b..f8d5b590 100644 Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 71fed62f..b904f934 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -50,7 +50,7 @@ j2ee.compile.on.save=true j2ee.copy.static.files.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.7 -j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar +j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.persistence.jar j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java new file mode 100644 index 00000000..ce782214 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.basket; + +import java.rmi.RemoteException; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.faces.FacesException; +import javax.inject.Named; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; +import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote; +import org.mxchange.jshopcore.model.product.Product; + +/** + * A bean for the basket + * + * @author Roland Haeder + */ +@Named("basket") +@SessionScoped +public class BasketWebBean extends BaseFrameworkBean implements BasketWebController { + + /** + * Serial number + */ + private static final long serialVersionUID = 5_476_347_320_198L; + + /** + * Basket bean + */ + private final BasketSessionBeanRemote basketBean; + + /** + * Current product instance + */ + private Product currentProduct; + + /** + * Default constructor + * + * @throws javax.naming.NamingException If something happened? + */ + public BasketWebBean () throws NamingException { + // Get initial context + InitialContext context = new InitialContext(); + + // Try to lookup + this.basketBean = (BasketSessionBeanRemote) context.lookup("ejb/stateless-basket"); //NOI18N + } + + @Override + public boolean isEmpty () { + try { + // Call remote bean + return this.getBasketBean().isEmpty(); + } catch (final RemoteException ex) { + // Continued to throw + throw new FacesException(ex); + } + } + + @Override + public boolean hasItems () { + // Call above and invert it + return (!this.isEmpty()); + } + + @PostConstruct + public void init () throws RuntimeException { + // Call super init first + super.genericInit(); + } + + @Override + public void setCurrentProduct (final Product product) { + this.currentProduct = product; + } + + /** + * Getter for basket bean instance + * + * @return Basket bean instance + */ + private BasketSessionBeanRemote getBasketBean () { + return basketBean; + } +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java new file mode 100644 index 00000000..3f78e540 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.basket; + +import java.io.Serializable; +import org.mxchange.jshopcore.model.product.Product; + +/** + * An interface for a basket + * + * @author Roland Haeder + */ +public interface BasketWebController extends Serializable { + /** + * Checks whether the basket is empty + * + * @return Whether the basket is empty + */ + public boolean isEmpty (); + + /** + * Checks whether the basket has items in it. This method is wrapper to isEmpty() + * + * @return Whether the basket is empty + */ + public boolean hasItems (); + + /** + * Setter for current product instance + * + * @param product Product instance + */ + public void setCurrentProduct (final Product product); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java deleted file mode 100644 index 12b55bc1..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.basket; - -import java.io.Serializable; -import org.mxchange.jshopcore.model.product.Product; - -/** - * An interface for a basket - * - * @author Roland Haeder - */ -public interface PizzaBasketWebBean extends Serializable { - /** - * Checks whether the basket is empty - * - * @return Whether the basket is empty - */ - public boolean isEmpty (); - - /** - * Checks whether the basket has items in it. This method is wrapper to isEmpty() - * - * @return Whether the basket is empty - */ - public boolean hasItems (); - - /** - * Setter for current product instance - * - * @param product Product instance - */ - public void setCurrentProduct (final Product product); -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java deleted file mode 100644 index eca1f9eb..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.basket; - -import java.rmi.RemoteException; -import javax.annotation.PostConstruct; -import javax.enterprise.context.SessionScoped; -import javax.faces.FacesException; -import javax.inject.Named; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote; -import org.mxchange.jshopcore.model.product.Product; - -/** - * A bean for the basket - * - * @author Roland Haeder - */ -@Named("basket") -@SessionScoped -public class PizzaServiceBasketWebBean extends BaseFrameworkBean implements PizzaBasketWebBean { - - /** - * Serial number - */ - private static final long serialVersionUID = 5_476_347_320_198L; - - /** - * Basket bean - */ - private final BasketSessionBeanRemote basket; - - /** - * Current product instance - */ - private Product currentProduct; - - /** - * Default constructor - * - * @throws javax.naming.NamingException If something happened? - */ - public PizzaServiceBasketWebBean () throws NamingException { - // Get initial context - InitialContext context = new InitialContext(); - - // Try to lookup - this.basket = (BasketSessionBeanRemote) context.lookup("ejb/stateless-basket"); //NOI18N - } - - @Override - public boolean isEmpty () { - try { - // Call remote bean - return this.basket.isEmpty(); - } catch (final RemoteException ex) { - // Continued to throw - throw new FacesException(ex); - } - } - - @Override - public boolean hasItems () { - // Call above and invert it - return (!this.isEmpty()); - } - - @PostConstruct - public void init () throws RuntimeException { - // Call super init first - super.genericInit(); - } - - @Override - public void setCurrentProduct (final Product product) { - this.currentProduct = product; - } -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java index 9d76d3d9..dccb3b3a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java @@ -26,6 +26,7 @@ import org.mxchange.jcoreee.beans.BaseFrameworkBean; import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException; import org.mxchange.jshopcore.model.category.Category; import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote; +import org.mxchange.jshopcore.model.category.ProductCategory; /** * Main application class @@ -43,7 +44,17 @@ public class AdminCategoryWebBean extends BaseFrameworkBean implements AdminCate /** * Remote bean for categories */ - private final CategorySessionBeanRemote category; + private final CategorySessionBeanRemote categoryBean; + + /** + * Category title + */ + private String title; + + /** + * Parent id + */ + private Long parentId; /** * Default constructor @@ -55,17 +66,42 @@ public class AdminCategoryWebBean extends BaseFrameworkBean implements AdminCate InitialContext context = new InitialContext(); // Try to lookup the bean - this.category = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N + this.categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N } @Override - public void addCategory (final Category category) throws FaceletException { + public void addCategory () throws FaceletException { try { + // Create category + Category category = new ProductCategory(); + category.setParentId(this.getParentId()); + category.setTitle(this.getTitle()); + // Deligate to bean - this.category.doAdminAddCategory(category); + this.categoryBean.doAdminAddCategory(category); } catch (final CategoryTitleAlreadyUsedException | RemoteException ex) { // Continue to throw throw new FaceletException(ex); } } + + @Override + public String getTitle () { + return this.title; + } + + @Override + public void setTitle (final String title) { + this.title = title; + } + + @Override + public Long getParentId () { + return this.parentId; + } + + @Override + public void setTitle (final Long parentId) { + this.parentId = parentId; + } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebController.java b/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebController.java index 934c2dc3..2db0eb35 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebController.java @@ -17,7 +17,6 @@ package org.mxchange.pizzaapplication.beans.category; import javax.faces.view.facelets.FaceletException; -import org.mxchange.jshopcore.model.category.Category; /** * An interface for product controllers for "ADMIN" role @@ -29,8 +28,35 @@ public interface AdminCategoryWebController { /** * Adds given category data from request to database * - * @param category Category instance * @throws javax.faces.view.facelets.FaceletException If something unexpected happened */ - public void addCategory (final Category category) throws FaceletException; + public void addCategory () throws FaceletException; + + /** + * Getter for title + * + * @return the title + */ + public String getTitle (); + + /** + * Setter for title + * + * @param title the title to set + */ + public void setTitle (final String title); + + /** + * Getter for parent id + * + * @return Parent id + */ + public Long getParentId (); + + /** + * Setter for parent id + * + * @param parentId Parent id to set + */ + public void setTitle (final Long parentId); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java deleted file mode 100644 index c184dbcf..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.controller; - -import java.rmi.RemoteException; -import java.sql.SQLException; -import java.util.Deque; -import java.util.Queue; -import javax.annotation.PostConstruct; -import javax.enterprise.context.SessionScoped; -import javax.faces.FacesException; -import javax.inject.Named; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopcore.model.category.Category; -import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote; -import org.mxchange.jshopcore.model.category.ProductCategory; -import org.mxchange.jshopcore.model.product.Product; -import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote; - -/** - * Main application class - * - * @author Roland Haeder - */ -@Named("controller") -@SessionScoped -public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBean { - /** - * Serial id - */ - private static final long serialVersionUID = 58_137_539_530_279L; - - /** - * Remote bean for categories - */ - private final CategorySessionBeanRemote category; - - /** - * Remote bean for products - */ - private final ProductSessionBeanRemote product; - - /** - * Default constructor - * - * @throws javax.naming.NamingException Something happened here? - */ - public PizzaServiceWebBean () throws NamingException { - // Get initial context - InitialContext context = new InitialContext(); - - // Try to lookup the bean - this.category = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N - - // Try to lookup the bean - this.product = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N - } - - @PostConstruct - public void init () throws RuntimeException { - // Call super init first - super.genericInit(); - } - - @Override - public Queue getAvailableProducts () throws FacesException { - try { - return this.getProduct().getAvailableProducts(); - } catch (final RemoteException ex) { - // Continue to throw - throw new FacesException(ex); - } - } - - @Override - public Queue getAllCategories () throws FacesException { - try { - // Fake zero category - Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L); - - // Get List back - Deque deque = this.getCategory().getAllCategories(); - - // Add fake category - deque.addFirst(c); - - // Return it - return deque; - } catch (final SQLException ex) { - // Continue to throw - throw new FacesException(ex); - } - } - - /** - * Getter for shop remote bean - * - * @return Remote shop bean - */ - private CategorySessionBeanRemote getCategory () { - return this.category; - } - - /** - * Getter for shop remote bean - * - * @return Remote shop bean - */ - private ProductSessionBeanRemote getProduct () { - return this.product; - } -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebBean.java new file mode 100644 index 00000000..211e86c1 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebBean.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.controller; + +import java.rmi.RemoteException; +import java.sql.SQLException; +import java.util.Deque; +import java.util.Queue; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.faces.FacesException; +import javax.inject.Named; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; +import org.mxchange.jshopcore.model.category.Category; +import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote; +import org.mxchange.jshopcore.model.category.ProductCategory; +import org.mxchange.jshopcore.model.product.Product; +import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote; + +/** + * Main application class + * + * @author Roland Haeder + */ +@Named("controller") +@SessionScoped +public class PizzaShopWebBean extends BaseFrameworkBean implements PizzaShopWebController { + /** + * Serial id + */ + private static final long serialVersionUID = 58_137_539_530_279L; + + /** + * Remote bean for categories + */ + private final CategorySessionBeanRemote categoryBean; + + /** + * Remote bean for products + */ + private final ProductSessionBeanRemote productBean; + + /** + * Default constructor + * + * @throws javax.naming.NamingException Something happened here? + */ + public PizzaShopWebBean () throws NamingException { + // Get initial context + InitialContext context = new InitialContext(); + + // Try to lookup the bean + this.categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N + + // Try to lookup the bean + this.productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N + } + + @PostConstruct + public void init () throws RuntimeException { + // Call super init first + super.genericInit(); + } + + @Override + public Queue getAvailableProducts () throws FacesException { + try { + return this.getProductBean().getAvailableProducts(); + } catch (final RemoteException ex) { + // Continue to throw + throw new FacesException(ex); + } + } + + @Override + public Queue getAllCategories () throws FacesException { + try { + // Fake zero categoryBean + Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L); + + // Get List back + Deque deque = this.getCategoryBean().getAllCategories(); + + // Add fake categoryBean + deque.addFirst(c); + + // Return it + return deque; + } catch (final SQLException ex) { + // Continue to throw + throw new FacesException(ex); + } + } + + /** + * Getter for shop remote bean + * + * @return Remote shop bean + */ + private CategorySessionBeanRemote getCategoryBean () { + return this.categoryBean; + } + + /** + * Getter for shop remote bean + * + * @return Remote shop bean + */ + private ProductSessionBeanRemote getProductBean () { + return this.productBean; + } +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebController.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebController.java new file mode 100644 index 00000000..4998aa4b --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaShopWebController.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.controller; + +import java.io.Serializable; +import java.util.Queue; +import javax.faces.view.facelets.FaceletException; +import org.mxchange.jshopcore.model.category.Category; +import org.mxchange.jshopcore.model.product.Product; + +/** + * An interface for the shop + * + * @author Roland Haeder + */ +public interface PizzaShopWebController extends Serializable { + + /** + * Some "getter" for a linked list of only available products + * + * @return Only available products + * @throws javax.faces.view.facelets.FaceletException If anything went wrong + */ + public Queue getAvailableProducts () throws FaceletException; + + /** + * Some "getter" for a linked list of all categories + * + * @return All categories + * @throws javax.faces.view.facelets.FaceletException If anything went wrong + */ + public Queue getAllCategories () throws FaceletException; +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java deleted file mode 100644 index 24117527..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.controller; - -import java.io.Serializable; -import java.util.Queue; -import javax.faces.view.facelets.FaceletException; -import org.mxchange.jshopcore.model.category.Category; -import org.mxchange.jshopcore.model.product.Product; - -/** - * An interface for the shop - * - * @author Roland Haeder - */ -public interface PizzaWebBean extends Serializable { - - /** - * Some "getter" for a linked list of only available products - * - * @return Only available products - * @throws javax.faces.view.facelets.FaceletException If anything went wrong - */ - public Queue getAvailableProducts () throws FaceletException; - - /** - * Some "getter" for a linked list of all categories - * - * @return All categories - * @throws javax.faces.view.facelets.FaceletException If anything went wrong - */ - public Queue getAllCategories () throws FaceletException; -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java index f2934771..703a87dc 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java @@ -16,12 +16,252 @@ */ package org.mxchange.pizzaapplication.beans.customer; -import java.io.Serializable; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcore.model.contact.gender.Gender; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; +import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote; /** - * An interface for customer beans + * A customer bean which hides the customer instance * * @author Roland Haeder */ -public interface CustomerWebBean extends Serializable { +@Named("customer") +@SessionScoped +public class CustomerWebBean extends BaseFrameworkBean implements CustomerWebController { + /** + * Serial number + */ + private static final long serialVersionUID = 542_145_347_916L; + + /** + * Remote customer bean + */ + private final CustomerSessionBeanRemote customerBean; + + /** + * Cellphone number + */ + private String cellphoneNumber; + + /** + * City + */ + private String city; + + /** + * Optional comments + */ + private String comment; + + /** + * Company name + */ + private String companyName; + + /** + * Country code + */ + private String countryCode; + + /** + * Email address + */ + private String emailAddress; + + /** + * Gender instance + */ + private Gender gender; + + /** + * Family name + */ + private String familyName; + + /** + * Fax number + */ + private String faxNumber; + + /** + * First name + */ + private String firstName; + + /** + * House number + */ + private Long houseNumber; + + /** + * Phone number + */ + private String phoneNumber; + + /** + * Street + */ + private String street; + + /** + * ZIP code + */ + private Long zipCode; + + /** + * Default constructor + * + * @throws javax.naming.NamingException If something happens? + */ + public CustomerWebBean () throws NamingException { + // Get initial context + InitialContext context = new InitialContext(); + + // Set gender to UNKNOWN + this.gender = Gender.UNKNOWN; + + // Try to lookup + this.customerBean = (CustomerSessionBeanRemote) context.lookup("ejb/stateless-customer"); + } + + @PostConstruct + public void init () throws RuntimeException { + // Call super init first + super.genericInit(); + } + + @Override + public Gender getGender () { + return this.gender; + } + + @Override + public void setGender (final Gender gender) { + this.gender = gender; + } + + @Override + public String getCompanyName () { + return this.companyName; + } + + @Override + public void setCompanyName (final String companyName) { + this.companyName = companyName; + } + + @Override + public String getFirstName () { + return this.firstName; + } + + @Override + public void setFirstName (final String firstName) { + this.firstName = firstName; + } + + @Override + public String getFamilyName () { + return this.familyName; + } + + @Override + public void setFamilyName (final String familyName) { + this.familyName = familyName; + } + + @Override + public String getStreet () { + return this.street; + } + + @Override + public void setStreet (final String street) { + this.street = street; + } + + @Override + public Long getHouseNumber () { + return this.houseNumber; + } + + @Override + public void setHouseNumber (final Long houseNumber) { + this.houseNumber = houseNumber; + } + + @Override + public Long getZipCode () { + return this.zipCode; + } + + @Override + public void setZipCode (final Long zipCode) { + this.zipCode = zipCode; + } + + @Override + public String getCity () { + return this.city; + } + + @Override + public void setCity (final String city) { + this.city = city; + } + + @Override + public String getCountryCode () { + return this.countryCode; + } + + @Override + public void setCountryCode (final String countryCode) { + this.countryCode = countryCode; + } + + @Override + public String getEmailAddress () { + return this.emailAddress; + } + + @Override + public void setEmailAddress (final String emailAddress) { + this.emailAddress = emailAddress; + } + + @Override + public String getPhoneNumber () { + return this.phoneNumber; + } + + @Override + public void setPhoneNumber (final String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public String getFaxNumber () { + return this.faxNumber; + } + + @Override + public void setFaxNumber (final String faxNumber) { + this.faxNumber = faxNumber; + } + + @Override + public String getCellphoneNumber () { + return this.cellphoneNumber; + } + + @Override + public void setCellphoneNumber (final String cellphoneNumber) { + this.cellphoneNumber = cellphoneNumber; + } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java new file mode 100644 index 00000000..6ee25f7b --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java @@ -0,0 +1,210 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.customer; + +import java.io.Serializable; +import org.mxchange.jcore.model.contact.gender.Gender; + +/** + * An interface for customer beans + * + * @author Roland Haeder + */ +public interface CustomerWebController extends Serializable { + + /** + * Gender of the contact + * + * @return the gender + */ + public Gender getGender (); + + /** + * Gender of the contact + * + * @param gender the gender to set + */ + public void setGender (final Gender gender); + + /** + * Company name + * + * @return the companyName + */ + public String getCompanyName (); + + /** + * Company name + * + * @param companyName the companyName to set + */ + public void setCompanyName (final String companyName); + + /** + * First name + * + * @return the first name + */ + public String getFirstName (); + + /** + * First name + * + * @param firstName the first name to set + */ + public void setFirstName (final String firstName); + + /** + * Family name + * + * @return the familyName + */ + public String getFamilyName (); + + /** + * Family name + * + * @param familyName the familyName to set + */ + public void setFamilyName (final String familyName); + + /** + * Street + * + * @return the street + */ + public String getStreet (); + + /** + * Street + * + * @param street the street to set + */ + public void setStreet (final String street); + + /** + * House number + * + * @return the houseNumber + */ + public Long getHouseNumber (); + + /** + * House number + * + * @param houseNumber the houseNumber to set + */ + public void setHouseNumber (final Long houseNumber); + + /** + * ZIP code + * + * @return the zipCode + */ + public Long getZipCode (); + + /** + * ZIP code + * + * @param zipCode the zipCode to set + */ + public void setZipCode (final Long zipCode); + + /** + * City + * + * @return the city + */ + public String getCity (); + + /** + * City + * + * @param city the city to set + */ + public void setCity (final String city); + + /** + * Country code + * + * @return the countryCode + */ + public String getCountryCode (); + + /** + * Country code + * + * @param countryCode the countryCode to set + */ + public void setCountryCode (final String countryCode); + + /** + * Email address + * + * @return the emailAddress + */ + public String getEmailAddress (); + + /** + * Email address + * + * @param emailAddress the emailAddress to set + */ + public void setEmailAddress (final String emailAddress); + + /** + * Phone number + * + * @return the phoneNumber + */ + public String getPhoneNumber (); + + /** + * Phone number + * + * @param phoneNumber the phoneNumber to set + */ + public void setPhoneNumber (final String phoneNumber); + + /** + * Fax number + * + * @return the faxNumber + */ + public String getFaxNumber (); + + /** + * Fax number + * + * @param faxNumber the faxNumber to set + */ + public void setFaxNumber (final String faxNumber); + + /** + * Cellphone number + * + * @return the cellphoneNumber + */ + public String getCellphoneNumber (); + + /** + * Cellphone number + * + * @param cellphoneNumber the cellphoneNumber to set + */ + public void setCellphoneNumber (final String cellphoneNumber); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java deleted file mode 100644 index 089590f0..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.customer; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.SessionScoped; -import javax.inject.Named; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote; - -/** - * A customer bean which hides the customer instance - * - * @author Roland Haeder - */ -@Named("customer") -@SessionScoped -public class PizzaServiceCustomerWebBean extends BaseFrameworkBean implements CustomerWebBean { - /** - * Serial number - */ - private static final long serialVersionUID = 542_145_347_916L; - - /** - * Remote customer bean - */ - private final CustomerSessionBeanRemote customer; - - /** - * Default constructor - * - * @throws javax.naming.NamingException If something happens? - */ - public PizzaServiceCustomerWebBean () throws NamingException { - // Get initial context - InitialContext context = new InitialContext(); - - // Try to lookup - this.customer = (CustomerSessionBeanRemote) context.lookup("ejb/stateless-consumer"); - } - - @PostConstruct - public void init () throws RuntimeException { - // Call super init first - super.genericInit(); - } -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java index e6c44081..b993c1a4 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java @@ -16,28 +16,69 @@ */ package org.mxchange.pizzaapplication.beans.gender; -import java.io.Serializable; import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import javax.naming.InitialContext; +import javax.naming.NamingException; import org.mxchange.jcore.model.contact.gender.Gender; +import org.mxchange.jcore.model.contact.gender.GenderSessionBeanRemote; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; /** - * An interface for data beans + * A customer bean which hides the customer instance * * @author Roland Haeder */ -public interface GenderWebBean extends Serializable { +@Named ("gender") +@ApplicationScoped +public class GenderWebBean extends BaseFrameworkBean implements GenderWebController { /** - * Getter for all genders as array - * - * @return All genders as array + * Serial number + */ + private static final long serialVersionUID = 835_482_364_189L; + + /** + * Remote bean */ - public Gender[] allGenders (); + private final GenderSessionBeanRemote genderBean; + + /** + * Default constructor + * + * @throws javax.naming.NamingException If something happens? + */ + public GenderWebBean () throws NamingException { + // Get initial context + InitialContext context = new InitialContext(); + + // Try to lookup bean + this.genderBean = (GenderSessionBeanRemote) context.lookup("ejb/stateful-gender"); //NOI18N + } + + @Override + public Gender[] getAllGenders () { + // Return it + return this.getGenderBean().allGenders(); + } + + @Override + public List getSelectableGenders () { + // Init array + // TODO Call EJB here? + List genders = this.getGenderBean().selectableGenders(); + + // Return it + return genders; + } /** - * Getter for only selectable genders as array, UNKNOWN is not selectable + * Getter for data remote bean * - * @return All genders as array + * @return data remote bean */ - public List selectableGenders (); + private GenderSessionBeanRemote getGenderBean () { + return this.genderBean; + } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebController.java b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebController.java new file mode 100644 index 00000000..48e2e8af --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebController.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.gender; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jcore.model.contact.gender.Gender; + +/** + * An interface for data beans + * + * @author Roland Haeder + */ +public interface GenderWebController extends Serializable { + + /** + * Getter for all genders as array + * + * @return All genders as array + */ + public Gender[] getAllGenders (); + + /** + * Getter for only selectable genders as array, UNKNOWN is not selectable + * + * @return All genders as array + */ + public List getSelectableGenders (); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java deleted file mode 100644 index 49c2c4d7..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.gender; - -import java.util.List; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Named; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcore.model.contact.gender.Gender; -import org.mxchange.jcore.model.contact.gender.GenderSessionBeanRemote; -import org.mxchange.jcoreee.beans.BaseFrameworkBean; - -/** - * A customer bean which hides the customer instance - * - * @author Roland Haeder - */ -@Named ("data") -@ApplicationScoped -public class PizzaServiceGenderController extends BaseFrameworkBean implements GenderWebBean { - - /** - * Serial number - */ - private static final long serialVersionUID = 835_482_364_189L; - - /** - * Remote bean - */ - private final GenderSessionBeanRemote gender; - - /** - * Default constructor - * - * @throws javax.naming.NamingException If something happens? - */ - public PizzaServiceGenderController () throws NamingException { - // Get initial context - InitialContext context = new InitialContext(); - - // Try to lookup bean - this.gender = (GenderSessionBeanRemote) context.lookup("ejb/stateless-data"); //NOI18N - } - - @Override - public Gender[] allGenders () { - // Return it - return this.getGender().allGenders(); - } - - @Override - public List selectableGenders () { - // Init array - // TODO Call EJB here? - List genders = this.getGender().selectableGenders(); - - // Return it - return genders; - } - - /** - * Getter for data remote bean - * - * @return data remote bean - */ - private GenderSessionBeanRemote getGender () { - return this.gender; - } -} diff --git a/web/WEB-INF/templates/admin/admin_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl index 8783f813..e986ccec 100644 --- a/web/WEB-INF/templates/admin/admin_category_selection_box.tpl +++ b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl @@ -4,7 +4,7 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> - - + + diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl index 9e984152..ab15a72f 100644 --- a/web/WEB-INF/templates/admin/admin_menu.tpl +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -8,7 +8,7 @@
  • -
  • +
    diff --git a/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl index e3c4ad26..8b6d8815 100644 --- a/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl +++ b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl @@ -4,7 +4,7 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> - + diff --git a/web/WEB-INF/templates/generic/gender_selection_box.tpl b/web/WEB-INF/templates/generic/gender_selection_box.tpl index a6fff29a..940d90e2 100644 --- a/web/WEB-INF/templates/generic/gender_selection_box.tpl +++ b/web/WEB-INF/templates/generic/gender_selection_box.tpl @@ -4,10 +4,7 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> - - - + + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 83bfa265..496a039e 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -4,18 +4,6 @@ javax.faces.PROJECT_STAGE Development - Faces Servlet javax.faces.webapp.FacesServlet diff --git a/web/admin/category.xhtml b/web/admin/category.xhtml index 2cd077e3..d00596f5 100644 --- a/web/admin/category.xhtml +++ b/web/admin/category.xhtml @@ -19,49 +19,30 @@
    - - - - - - - - - - - - - - - - - - - -
    - Auswählen: - - Bezeichnung: - - Elternkategorie: -
    + + + Auswählen: + #{cat.categoryId}: + + + + + Bezeichnung: + #{cat.title} + + + + Elternkategorie: + #{cat.categoryId}: + #{controller.generateLinkForParent(cat)} + + + +
    diff --git a/web/admin/product.xhtml b/web/admin/product.xhtml index cfb743a5..30039b91 100644 --- a/web/admin/product.xhtml +++ b/web/admin/product.xhtml @@ -19,57 +19,36 @@
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Produktnummer: - - Produktbezeichnung: - - Einzelpreis: - - Kategorie: - - Verfügbar: -
    - #{product.itemId}: - - - #{product.title} - - #{product.price} - - ${controller.getPrintableProduktCategory(product)} - - ${controller.getPrintableProductAvailability(product)} -
    + + + Produktnummer: + #{pro.id}: + + + + + Produktbezeichnung: + #{pro.title} + + + Einzelpreis: + #{pro.price} + + + Kategorie: + ${controller.getPrintableProduktCategory(product)} + + + Verfügbar: + ${controller.getPrintableProductAvailability(product)} + + + +
    @@ -138,8 +117,8 @@ diff --git a/web/index.xhtml b/web/index.xhtml index c7f13834..c8f01264 100644 --- a/web/index.xhtml +++ b/web/index.xhtml @@ -100,7 +100,7 @@ - +