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
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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;
+ }
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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);
+}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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);
-}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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;
- }
-}
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
/**
* Remote bean for categories
*/
- private final CategorySessionBeanRemote category;
+ private final CategorySessionBeanRemote categoryBean;
+
+ /**
+ * Category title
+ */
+ private String title;
+
+ /**
+ * Parent id
+ */
+ private Long parentId;
/**
* Default constructor
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;
+ }
}
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
/**
* 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);
}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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<Product> getAvailableProducts () throws FacesException {
- try {
- return this.getProduct().getAvailableProducts();
- } catch (final RemoteException ex) {
- // Continue to throw
- throw new FacesException(ex);
- }
- }
-
- @Override
- public Queue<Category> getAllCategories () throws FacesException {
- try {
- // Fake zero category
- Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L);
-
- // Get List back
- Deque<Category> 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;
- }
-}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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<Product> getAvailableProducts () throws FacesException {
+ try {
+ return this.getProductBean().getAvailableProducts();
+ } catch (final RemoteException ex) {
+ // Continue to throw
+ throw new FacesException(ex);
+ }
+ }
+
+ @Override
+ public Queue<Category> getAllCategories () throws FacesException {
+ try {
+ // Fake zero categoryBean
+ Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L);
+
+ // Get List back
+ Deque<Category> 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;
+ }
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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<Product> 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<Category> getAllCategories () throws FaceletException;
+}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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<Product> 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<Category> getAllCategories () throws FaceletException;
-}
*/
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;
+ }
}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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);
+}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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();
- }
-}
*/
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<Gender> getSelectableGenders () {
+ // Init array
+ // TODO Call EJB here?
+ List<Gender> 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<Gender> selectableGenders ();
+ private GenderSessionBeanRemote getGenderBean () {
+ return this.genderBean;
+ }
}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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<Gender> getSelectableGenders ();
+}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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<Gender> selectableGenders () {
- // Init array
- // TODO Call EJB here?
- List<Gender> genders = this.getGender().selectableGenders();
-
- // Return it
- return genders;
- }
-
- /**
- * Getter for data remote bean
- *
- * @return data remote bean
- */
- private GenderSessionBeanRemote getGender () {
- return this.gender;
- }
-}
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:selectOneMenu class="select" id="category_id">
- <f:selectItems value="#{controller.allCategories}" var="categoryId" itemValue="#{categoryId.categoryId}" itemLabel="#{categoryId.title}" />
+ <h:selectOneMenu class="select" id="category">
+ <f:selectItems value="#{controller.allCategories}" var="cat" itemValue="#{cat.categoryId}" itemLabel="#{cat.title}" />
</h:selectOneMenu>
</ui:composition>
<ul>
<li><h:link title="Zur Willkommensseite" outcome="admin_index" value="Home" /></li>
<li><h:link title="Kategorie" outcome="admin_category" value="Kategorie" /></li>
- <li><h:link title="Produkt" outcome="admin_product" value="Produkt" /></li>
+ <li><h:link title="Produkt" outcome="admin_product" value="Produkte" /></li>
</ul>
<ul>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:selectOneMenu class="select" id="parent_id">
+ <h:selectOneMenu class="select" id="parentId">
<f:selectItems value="#{controller.allCategories}" var="parent_category" itemValue="#{parent_category.categoryId}" itemLabel="#{parent_category.title}" />
</h:selectOneMenu>
</ui:composition>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
- <!--
- TODO: Missing pre-select of chosen gender?
- //-->
- <h:selectOneMenu class="select" id="gender" value="#{customer.gender}">
- <f:selectItems value="#{data.selectableGenders}" var="gender" itemValue="#{gender}" itemLabel="#{msg[gender.messageKey]}" />
+ <h:selectOneMenu class="select" id="gender_selection" value="#{customer.gender}">
+ <f:selectItems value="#{gender.selectableGenders}" var="g" itemValue="#{g}" itemLabel="#{msg[g.messageKey]}" />
</h:selectOneMenu>
</ui:composition>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
- <!--
- TODO: No longer used
- <filter>
- <description>A filter for handling added basket items</description>
- <filter-name>BasketItemAddedFilter</filter-name>
- <filter-class>org.mxchange.jshopejb.filter.servlet.basket.BasketItemAddedFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>BasketItemAddedFilter</filter-name>
- <url-pattern>/form_handler/add_item.jsp</url-pattern>
- </filter-mapping>
- //-->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<ui:define name="content">
<div class="para">
<h:form acceptcharset="utf-8" id="form">
- <table class="table">
- <thead>
- <tr>
- <th class="table_header_column">
- Auswählen:
- </th>
- <th class="table_header_column">
- Bezeichnung:
- </th>
- <th class="table_header_column">
- Elternkategorie:
- </th>
- </tr>
- </thead>
-
- <tbody>
- <ui:repeat var="category" value="#{controller.allCategories}" rendered="#{category != null}">
- <h:outputText value="#{category}" />
- <!--
- <tr>
- <td>
- #{category.categoryId}:
- <h:selectBooleanCheckbox class="input" id="categoryId" binding="#{category.categoryId}" value="true" />
- </td>
- <td>
- #{category.title}
- </td>
- <td>
- #{controller.generateLinkForParent(category)}
- </td>
- </tr>
- //-->
- </ui:repeat>
-
- <tr>
- <td colspan="3" class="table_footer">
- <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
- <h:commandButton class="submit" type="submit" id="edit" action="#{admin_category.editCategory(category)}" value="Ändern" />
- <h:commandButton class="delete" type="submit" id="delete" action="#{admin_category.deleteCategory(category)}" value="Löschen" />
- </td>
- </tr>
- </tbody>
- </table>
+ <h:dataTable headerClass="table_header_column" rowClasses="table_row" styleClass="table" id="categories" value="#{controller.allCategories}" var="cat" rendered="#{cat != null}">
+ <h:column>
+ <f:facet name="header">Auswählen:</f:facet>
+ #{cat.categoryId}:
+ <h:selectBooleanCheckbox class="input" value="true" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">Bezeichnung:</f:facet>
+ #{cat.title}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">Elternkategorie:</f:facet>
+ #{cat.categoryId}:
+ #{controller.generateLinkForParent(cat)}
+ </h:column>
+ </h:dataTable>
+
+ <div class="table_footer">
+ <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
+ <h:commandButton class="submit" type="submit" id="edit" action="#{admin_category.editCategory(category)}" value="Ändern" />
+ <h:commandButton class="delete" type="submit" id="delete" action="#{admin_category.deleteCategory(category)}" value="Löschen" />
+ </div>
</h:form>
</div>
<ui:define name="content">
<div class="para">
<h:form acceptcharset="utf-8" id="form">
- <table class="table">
- <thead>
- <tr>
- <th class="table_header_column">
- Produktnummer:
- </th>
- <th class="table_header_column">
- Produktbezeichnung:
- </th>
- <th class="table_header_column">
- Einzelpreis:
- </th>
- <th class="table_header_column">
- Kategorie:
- </th>
- <th class="table_header_column">
- Verfügbar:
- </th>
- </tr>
- </thead>
-
- <tbody>
- <ui:repeat var="product" value="#{admin_product.allProducts}" rendered="#{product != null}">
- <tr>
- <td>
- #{product.itemId}:
- <h:selectBooleanCheckbox class="input" id="item_id" binding="#{product.itemId}" value="true" />
- </td>
- <td>
- #{product.title}
- </td>
- <td>
- #{product.price}
- </td>
- <td>
- ${controller.getPrintableProduktCategory(product)}
- </td>
- <td>
- ${controller.getPrintableProductAvailability(product)}
- </td>
- </tr>
- </ui:repeat>
- <tr>
- <td colspan="5" class="table_footer">
- <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
- <h:commandButton class="submit" type="submit" id="edit" action="#{admin_product.ediProduct(product)}" value="Ändern" />
- <h:commandButton class="delete" type="submit" id="delete" action="#{admin_category.deleteProduct(product)}" value="Löschen" />
- </td>
- </tr>
- </tbody>
- </table>
+ <h:dataTable columnClasses="table_row" headerClass="table_header_column" id="product_table" var="pro" value="#{admin_product.allProducts}">
+ <h:column>
+ <f:facet name="header">Produktnummer:</f:facet>
+ #{pro.id}:
+ <h:selectBooleanCheckbox class="input" value="true" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">Produktbezeichnung:</f:facet>
+ #{pro.title}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Einzelpreis:</f:facet>
+ #{pro.price}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Kategorie:</f:facet>
+ ${controller.getPrintableProduktCategory(product)}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Verfügbar:</f:facet>
+ ${controller.getPrintableProductAvailability(product)}
+ </h:column>
+ </h:dataTable>
+
+ <div class="table_footer">
+ <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
+ <h:commandButton class="submit" type="submit" id="edit" action="#{admin_product.ediProduct(product)}" value="Ändern" />
+ <h:commandButton class="delete" type="submit" id="delete" action="#{admin_category.deleteProduct(product)}" value="Löschen" />
+ </div>
</h:form>
</div>
</fieldset>
<div class="table_footer">
- <input class="reset" type="reset" value="Formular zurücksetzen" />
- <input class="submit" type="submit" name="add" value="Hinzufügen" />
+ <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
+ <h:commandButton class="submit" type="submit" id="add" action="#{admin_product.addProduct()}" value="Hinzufügen" />
</div>
</div>
</h:form>
<tr>
<td class="table_data_column">
<h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basket.addToBasket(product)}" />
- <h:inputHidden id="itemId" value="#{product.itemId}" />
+ <h:inputHidden id="itemId" value="#{product.id}" />
<h:inputHidden id="itemType" value="Product" />
</td>