</target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
- <copyfiles files="${reference.PizzaService-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcore.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcoreee.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jshop-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jshop-ee-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${reference.PizzaService-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.cdi-api.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.gf-client.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.log4j-api-2.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
- <copyfiles files="${reference.PizzaService-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jcoreee.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jshop-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jshop-ee-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${reference.PizzaService-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.cdi-api.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.gf-client.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.log4j-api-2.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-build.xml.data.CRC32=1edfee4e
+build.xml.data.CRC32=ae8d1d07
build.xml.script.CRC32=82213886
build.xml.stylesheet.CRC32=651128d4@1.68.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=1edfee4e
-nbproject/build-impl.xml.script.CRC32=055d9dec
+nbproject/build-impl.xml.data.CRC32=ae8d1d07
+nbproject/build-impl.xml.script.CRC32=6b50b9cf
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
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
j2ee.server.type=gfv3ee6
jar.compress=false
javac.classpath=\
- ${reference.PizzaService-lib.jar}:\
${file.reference.jcore.jar}:\
${file.reference.jcoreee.jar}:\
${file.reference.jshop-core.jar}:\
${file.reference.jshop-ee-lib.jar}:\
+ ${reference.PizzaService-lib.jar}:\
${file.reference.cdi-api.jar}:\
${file.reference.gf-client.jar}:\
${file.reference.log4j-api-2.3.jar}:\
<name>PizzaService-war</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries>
- <library dirs="200">
- <file>${reference.PizzaService-lib.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
<library dirs="200">
<file>${file.reference.jcore.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
<file>${file.reference.jshop-ee-lib.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
+ <library dirs="200">
+ <file>${reference.PizzaService-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
<library dirs="200">
<file>${file.reference.cdi-api.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
package org.mxchange.pizzaapplication.beans.basket;
import java.io.Serializable;
+import org.mxchange.jshopcore.model.product.Product;
/**
* An interface for a basket
* @return Whether the basket is empty
*/
public boolean hasItems ();
+
+ /**
+ * Setter for current product instance
+ *
+ * @param product Product instance
+ */
+ public void setCurrentProduct (final Product product);
}
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
-import org.mxchange.jshopeelib.beans.remote.basket.BasketSessionBeanRemote;
+import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote;
+import org.mxchange.jshopcore.model.product.Product;
/**
* A bean for the basket
*/
private final BasketSessionBeanRemote basket;
+ /**
+ * Current product instance
+ */
+ private Product currentProduct;
+
/**
* Default constructor
*
// Call super init first
super.genericInit();
}
+
+ @Override
+ public void setCurrentProduct (final Product product) {
+ this.currentProduct = 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.util.Deque;
+import javax.faces.view.facelets.FaceletException;
+import org.mxchange.jshopcore.model.category.Category;
+import org.mxchange.jshopcore.model.product.Product;
+
+/**
+ * An interface for product controllers for "ADMIN" role
+ *
+ * @author Roland Haeder
+ */
+public interface AdminProductWebController {
+
+ /**
+ * Adds given category data from request to database
+ *
+ * @param category Category instance
+ * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
+ */
+ public void doAdminAddCategory (final Category category) throws FaceletException;
+
+ /**
+ * Adds given product data from request to database
+ *
+ * @param product Product instance
+ * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
+ */
+ public void doAdminAddProduct (final Product product) throws FaceletException;
+
+ /**
+ * Some "getter" for a linked list of all products
+ *
+ * @return All products
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
+ */
+ public Deque<Product> getAllProducts () throws FaceletException;
+}
*/
package org.mxchange.pizzaapplication.beans.controller;
-import java.io.IOException;
import java.rmi.RemoteException;
import java.util.Deque;
import javax.annotation.PostConstruct;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
-import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
-import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
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.jshopeelib.beans.remote.shop.ShopSessionBeanRemote;
+import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
/**
* Main application class
private static final long serialVersionUID = 58_137_539_530_279L;
/**
- * Remote bean
+ * Remote bean for categories
*/
- private final ShopSessionBeanRemote shop;
+ private final CategorySessionBeanRemote category;
+
+ /**
+ * Remote bean for products
+ */
+ private final ProductSessionBeanRemote product;
/**
* Default constructor
InitialContext context = new InitialContext();
// Try to lookup the bean
- this.shop = (ShopSessionBeanRemote) context.lookup("ejb/stateless-shop"); //NOI18N
+ this.category = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N
+
+ // Try to lookup the bean
+ this.product = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N
}
@PostConstruct
@Override
public Deque<Product> getAvailableProducts () throws FacesException {
try {
- return this.getShop().getAvailableProducts();
- } catch (final RemoteException ex) {
- // Continue to throw
- throw new FacesException(ex);
- }
- }
-
- @Override
- public Deque<Product> getAllProducts () throws FacesException {
- try {
- return this.getShop().getAllProducts();
+ return this.getProduct().getAvailableProducts();
} catch (final RemoteException ex) {
// Continue to throw
throw new FacesException(ex);
@Override
public Deque<Category> getAllCategories () throws FacesException {
try {
- return this.getShop().getAllCategories();
- } catch (final RemoteException ex) {
- // Continue to throw
- throw new FacesException(ex);
- }
- }
+ // Fake zero category
+ Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L);
- @Override
- public void doAdminAddCategory (final Category category) throws FacesException {
- try {
- this.getShop().doAdminAddCategory(category);
- } catch (final IOException | CategoryTitleAlreadyUsedException ex) {
+ // Get List back
+ Deque<Category> deque = this.getCategory().getAllCategories();
+
+ // Add fake category
+ deque.addFirst(c);
+
+ // Return it
+ return deque;
+ } catch (final RemoteException ex) {
// Continue to throw
throw new FacesException(ex);
}
}
- @Override
- public void doAdminAddProduct (final Product product) throws FacesException {
- try {
- this.getShop().doAdminAddProduct(product);
- } catch (final IOException | ProductTitleAlreadyUsedException ex) {
- // Continue to throw
- throw new FacesException(ex);
- }
+ /**
+ * Getter for shop remote bean
+ *
+ * @return Remote shop bean
+ */
+ private CategorySessionBeanRemote getCategory () {
+ return this.category;
}
/**
*
* @return Remote shop bean
*/
- private ShopSessionBeanRemote getShop () {
- return this.shop;
+ private ProductSessionBeanRemote getProduct () {
+ return this.product;
}
}
*/
public Deque<Product> getAvailableProducts () throws FaceletException;
- /**
- * Some "getter" for a linked list of all products
- *
- * @return All products
- * @throws javax.faces.view.facelets.FaceletException If anything went wrong
- */
- public Deque<Product> getAllProducts () throws FaceletException;
-
/**
* Some "getter" for a linked list of all categories
*
* @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
public Deque<Category> getAllCategories () throws FaceletException;
-
- /**
- * Adds given category data from request to database
- *
- * @param category Category instance
- * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
- */
- public void doAdminAddCategory (final Category category) throws FaceletException;
-
- /**
- * Adds given product data from request to database
- *
- * @param product Product instance
- * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
- */
- public void doAdminAddProduct (final Product product) throws FaceletException;
}
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
-import org.mxchange.jshopeelib.beans.remote.customer.CustomerSessionBeanRemote;
+import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote;
/**
* A customer bean which hides the customer instance
+++ /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.data;
-
-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 DataWebBean extends Serializable {
-
- /**
- * Getter for all genders as array
- *
- * @return All genders as array
- */
- public Gender[] allGenders ();
-
- /**
- * Getter for only selectable genders as array, UNKNOWN is not selectable
- *
- * @return All genders as array
- */
- public List<Gender> selectableGenders ();
-}
+++ /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.data;
-
-import java.util.List;
-import javax.annotation.PostConstruct;
-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.jcoreee.beans.BaseFrameworkBean;
-import org.mxchange.jshopeelib.beans.remote.data.ShopDataBeanRemote;
-
-/**
- * A customer bean which hides the customer instance
- *
- * @author Roland Haeder
- */
-@Named ("data")
-@ApplicationScoped
-public class PizzaServiceDataWebBean extends BaseFrameworkBean implements DataWebBean {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 835_482_364_189L;
-
- /**
- * Remote bean
- */
- private final ShopDataBeanRemote data;
-
- /**
- * Default constructor
- *
- * @throws javax.naming.NamingException If something happens?
- */
- public PizzaServiceDataWebBean () throws NamingException {
- // Get initial context
- InitialContext context = new InitialContext();
-
- // Try to lookup bean
- this.data = (ShopDataBeanRemote) context.lookup("ejb/stateless-data"); //NOI18N
- }
-
- @Override
- public Gender[] allGenders () {
- // Return it
- return this.getData().allGenders();
- }
-
- @Override
- public List<Gender> selectableGenders () {
- // Init array
- // TODO Call EJB here?
- List<Gender> genders = this.getData().selectableGenders();
-
- // Return it
- return genders;
- }
-
- /**
- * Getter for data remote bean
- *
- * @return data remote bean
- */
- private ShopDataBeanRemote getData () {
- return this.data;
- }
-
- @PostConstruct
- public void init () throws RuntimeException {
- // Call super method
- super.genericInit();
- }
-}
--- /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 GenderWebBean extends Serializable {
+
+ /**
+ * Getter for all genders as array
+ *
+ * @return All genders as array
+ */
+ public Gender[] allGenders ();
+
+ /**
+ * Getter for only selectable genders as array, UNKNOWN is not selectable
+ *
+ * @return All genders as array
+ */
+ public List<Gender> selectableGenders ();
+}
--- /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.annotation.PostConstruct;
+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;
+ }
+
+ @PostConstruct
+ public void init () throws RuntimeException {
+ // Call super method
+ super.genericInit();
+ }
+}
<validator-id>NameValidator</validator-id>
<validator-class>org.mxchange.jcoreee.validator.string.names.NameValidator</validator-class>
</validator>
+ <navigation-rule>
+ <from-view-id>*</from-view-id>
+ <navigation-case>
+ <from-outcome>customer_register</from-outcome>
+ <to-view-id>/customer/register.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>index</from-outcome>
+ <to-view-id>/index.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>customer_lost_passwd</from-outcome>
+ <to-view-id>/customer/lost_passwd.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>customer_login</from-outcome>
+ <to-view-id>/customer/login.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>terms</from-outcome>
+ <to-view-id>/terms.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>privacy</from-outcome>
+ <to-view-id>/privacy.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>imprint</from-outcome>
+ <to-view-id>/imprint.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>logout</from-outcome>
+ <to-view-id>/bye.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>admin_product</from-outcome>
+ <to-view-id>/admin/product.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>admin_category</from-outcome>
+ <to-view-id>/admin/category.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>*</from-view-id>
+ <navigation-case>
+ <from-outcome>admin_index</from-outcome>
+ <to-view-id>/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
</faces-config>
+++ /dev/null
-<%--
- Document : admin_category_selection_box
- Created on : 14.08.2015, 12:51:05
- Author : Roland Haeder
---%>
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
-<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
-
-<select class="select" name="categoryId" size="1">
- <c:forEach var="category" items="${controller.allCategoriesIterator}">
- <option value="${category.categoryId}">${category.decodedTitle}</option>
- </c:forEach>
-</select>
+++ /dev/null
-<%--
- Document : admin_footer
- Created on : 11.08.2015, 12:28:03
- Author : Roland Haeder
---%>
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<c:set var="basePath" value="${pageContext.request.contextPath}" />
-
-<div class="footer">
- <ul class="footer_nav">
- <li><a href="${basePath}/">Zur Webseite</a></li>
- </ul>
-</div>
-
-<div class="clear"></div>
+++ /dev/null
-<%--
- Document : admin_menu
- Created on : 06.08.2015, 12:41:44
- Author : Roland Haeder
---%>
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<c:set var="basePath" value="${pageContext.request.contextPath}" />
-
-<div id="menu">
- <ul>
- <li><a href="${basePath}/admin/" title="Eingangsseite">Home</a></li>
- <li><a href="${basePath}/admin/category.jsp" title="Kazegorie">Kategorie</a></li>
- <li><a href="${basePath}/admin/product.jsp" title="Produkt">Produkt</a></li>
- </ul>
-
- <ul>
- <li><a href="${basePath}/admin/logout.jsp" title="Ausloggen">Ausloggen</a></li>
- <li><a href="${basePath}/" title="Zur Webseite, aber eingeloggt bleiben">Webseite aufrufen</a></li>
- </ul>
-</div>
+++ /dev/null
-<%--
- Document : admin_parent_category_selection_box
- Created on : 14.08.2015, 12:51:05
- Author : Roland Haeder
---%>
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
-<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
-
-<select class="select" name="parentId" size="1">
- <option value="">Ist oberste Kategorie</option>
- <c:forEach var="category" items="${controller.allCategoriesIterator}">
- <option value="${category.categoryId}">${category.decodedTitle}</option>
- </c:forEach>
-</select>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+ <ui:define name="admin_title">Your page's title here</ui:define>
+
+ <ui:define name="menu">
+ <ui:include id="menu" class="admin_menu" src="/WEB-INF/templates/admin/admin_menu.tpl" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ Your header above content here
+ </ui:define>
+
+ <ui:define name="content">
+ Here goes your content.
+ </ui:define>
+
+ <ui:define name="footer">
+ <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/admin/admin_footer.tpl" />
+ </ui:define>
+ </ui:composition>
+</html>
>
<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
- <ui:define name="title">Your page's title here</ui:define>
+ <ui:define name="guest_title">Your page's title here</ui:define>
<ui:define name="menu">
<ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
--- /dev/null
+<ui:composition
+ template="/WEB-INF/templates/base.tpl"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <ui:define name="title">Administration - <ui:insert name="admin_title" class="admin_title" /></ui:define>
+
+ <!--
+ TODO: Add something here that should be displayed on all admin pages
+ //-->
+</ui:composition>
--- /dev/null
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ 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>
+</ui:composition>
--- /dev/null
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <div class="footer">
+ <ul class="footer_nav">
+ <li><h:link outcome="index" value="Zur Webseite" /></li>
+ </ul>
+ </div>
+
+ <div class="clear"></div>
+</ui:composition>
--- /dev/null
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <div id="menu">
+ <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>
+ </ul>
+
+ <ul>
+ <li><h:link title="Ausloggen" outcome="admin_logout" value="Ausloggen" /></li>
+ <li><h:link title="Zur Webseite, aber eingeloggt bleiben" outcome="index" value="Webseite aufrufen" /></li>
+ </ul>
+ </div>
+</ui:composition>
--- /dev/null
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <h:selectOneMenu class="select" id="parent_id">
+ <f:selectItems value="#{controller.allCategories}" var="categoryId" itemValue="#{categoryId.categoryId}" itemLabel="#{categoryId.title}" />
+ </h:selectOneMenu>
+</ui:composition>
<ui:insert name="menu">Default menu</ui:insert>
</div>
- <div id="content" class="left_content">
- <ui:insert name="content_header">Default content header</ui:insert>
- <ui:insert name="content">Default content</ui:insert>
+ <div id="content_outer" class="left_content">
+ <div id="content_header">
+ <ui:insert name="content_header">Default content header</ui:insert>
+ </div>
+ <div id="content">
+ <ui:insert name="content">Default content</ui:insert>
+ </div>
</div>
<div class="clear"></div>
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <ui:define name="title"><ui:insert name="guest_title" class="guest_title" /></ui:define>
+
<!--
Show basket if it contains items, else show an empty basket.
//-->
<ul>
<li><h:link title="Eingangsseite" outcome="index" value="Home" /></li>
<li><h:link title="Zum Warenkorb" outcome="basket" value="Zum Warenkorb" /></li>
- <li><h:link title="Sitzung beennden" outcome="bye" value="Sitzung beenden" /></li>
+ <li><h:link title="Sitzung beennden" outcome="logout" value="Sitzung beenden" /></li>
</ul>
<div class="menu_header">
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
- <filter>
- <description>A servlet filter for setting character encoding to UTF-8</description>
- <filter-name>Utf8ServletFilter</filter-name>
- <filter-class>org.mxchange.jcoreee.filter.servlet.utf8.Utf8ServletFilter</filter-class>
- </filter>
- <filter>
- <description>A servlet filter for logging</description>
- <filter-name>Log4jServletFilter</filter-name>
- <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
- </filter>
<!--
TODO: No longer used
<filter>
<url-pattern>/form_handler/add_item.jsp</url-pattern>
</filter-mapping>
//-->
- <filter-mapping>
- <filter-name>Log4jServletFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>Utf8ServletFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+++ /dev/null
-<%--
- Document : category
- Created on : 05.08.2015, 10:51:14
- Author : Roland Haeder
---%>
-
-<%--<%@page errorPage="errorHandler.jsp" %>--%>
-<%@page import="org.mxchange.jshopejb.category.Category"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
-
-<jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
-<jsp:setProperty name="controller" property="session" value="${pageContext.session}" />
-
-<%
- // TODO: Can be removed later
- controller.init();
-%>
-
-<c:set var="basePath" value="${pageContext.request.contextPath}" />
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="${basePath}/style.css" type="text/css" />
- <title>Pizza-Service - Kategorien</title>
- </head>
-
- <body>
- <div id="header">
- <div id="title">
- <h1>Pizza-Service - Kategorien</h1>
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_menu.jsp" flush="false" />
-
- <div id="content_outer">
- <div id="content_title">
- <h2>Kategorien administrieren:</h2>
- </div>
-
- <div id="content">
- <div class="para">
- <form action="${basePath}/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="form" method="post">
- <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>
- <c:forEach var="category" items="${controller.allCategoriesIterator}">
- <tr>
- <td>
- ${category.categoryId}:
- <input class="input" type="checkbox" name="categoryId[${category.categoryId}]" value="1" />
- </td>
- <td>
- ${category.decodedTitle}
- </td>
- <td>
- ${controller.generateLinkForParent(category)}
- </td>
- </tr>
- </c:forEach>
-
- <tr>
- <td colspan="3" class="table_footer">
- <input class="reset" type="reset" value="Formular zurücksetzen" />
- <input class="submit" type="submit" name="edit" value="Ändern" />
- <input class="delete" type="submit" name="delete" value="Löschen" />
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
-
- <div class="para">
- <form action="${basePath}/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="add_category" method="post">
- <div class="table">
- <div class="table_header">
- Neue Kategorie hinzufügen:
- </div>
-
- <fieldset id="product_data">
- <legend>Bitte alle Felder ausfüllen:</legend>
-
- <div class="table_row">
- <div class="table_left">
- Bezeichnung:
- <div class="tiny">(z.B. <em>Pizzen</em>)</div>
- </div>
-
- <div class="table_right">
- <input class="input" type="text" name="title" size="10" maxlength="255" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- Elternkategorie:
- </div>
-
- <div class="table_right">
- <jsp:include flush="false" page="/WEB-INF/static/admin/admin_parent_category_selection_box.jsp" />
- </div>
-
- <div class="clear"></div>
- </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" />
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_footer.jsp" flush="false" />
- </body>
-</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+ <ui:define name="admin_title">Kategorien</ui:define>
+
+ <ui:define name="menu">
+ <ui:include id="menu" class="admin_menu" src="/WEB-INF/templates/admin/admin_menu.tpl" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ Kategorien administrieren
+ </ui:define>
+
+ <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:form>
+ </div>
+
+ <div class="para">
+ <h:form acceptcharset="utf-8" id="add_category">
+ <div class="table">
+ <div class="table_header">
+ Neue Kategorie hinzufügen:
+ </div>
+
+ <fieldset id="product_data">
+ <legend>Bitte alle Felder ausfüllen:</legend>
+
+ <div class="table_row">
+ <div class="table_left">
+ Bezeichnung:
+ <div class="tiny">(z.B. <em>Pizzen</em>)</div>
+ </div>
+
+ <div class="table_right">
+ <input class="input" type="text" name="title" size="10" maxlength="255" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ Elternkategorie:
+ </div>
+
+ <div class="table_right">
+ <ui:include src="/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ </fieldset>
+
+ <div class="table_footer">
+ <h:commandButton class="reset" type="reset" value="Formular zurücksetzen" />
+ <h:commandButton class="submit" type="submit" action="#{admin_category.addCategory()}" value="Hinzufügen" />
+ </div>
+ </div>
+ </h:form>
+ </div>
+ </ui:define>
+
+ <ui:define name="footer">
+ <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/admin/admin_footer.tpl" />
+ </ui:define>
+ </ui:composition>
+</html>
+++ /dev/null
-<%--
- Document : index
- Created on : 04.08.2015, 10:33:10
- Author : Roland Haeder
---%>
-
-<%--<%@page errorPage="errorHandler.jsp" %>--%>
-<%@page import="java.util.Map"%>
-<%@page import="java.util.Iterator"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
-<%@page import="org.mxchange.jshopejb.product.Product"%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<c:set var="basePath" value="${pageContext.request.contextPath}" />
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="${basePath}/style.css" type="text/css" />
- <title>Pizza-Service - Administration</title>
- </head>
-
- <body>
- <div id="header">
- <div id="title">
- <h1>Pizza-Service - Administration</h1>
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_menu.jsp" flush="false" />
-
- <div id="content_outer">
- <div id="content_title">
- <h2>Willkommen zur Administration:</h2>
- </div>
-
- <div id="content">
- Einiges kann hier eingestellt werden.
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_footer.jsp" flush="false" />
- </body>
-</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+ <ui:define name="admin_title">Willkommen</ui:define>
+
+ <ui:define name="menu">
+ <ui:include id="menu" class="admin_menu" src="/WEB-INF/templates/admin/admin_menu.tpl" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ Willkommen zur Administration
+ </ui:define>
+
+ <ui:define name="content">
+ Einiges kann hier eingestellt werden.
+ </ui:define>
+
+ <ui:define name="footer">
+ <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/admin/admin_footer.tpl" />
+ </ui:define>
+ </ui:composition>
+</html>
+++ /dev/null
-<%--
- Document : product
- Created on : 04.08.2015, 10:55:10
- Author : Roland Haeder
---%>
-
-<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%--<%@page errorPage="errorHandler.jsp" %>--%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
-<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
-<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
-
-<jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
-<jsp:setProperty name="controller" property="session" value="${pageContext.session}" />
-
-<%
- // TODO: Can be removed later
- controller.init();
-%>
-
-<c:set var="basePath" value="${pageContext.request.contextPath}" />
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="${basePath}/style.css" type="text/css" />
- <title>Pizza-Service - Produkte</title>
- </head>
-
- <body>
- <div id="header">
- <div id="title">
- <h1>Pizza-Service - Produkte</h1>
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_menu.jsp" flush="false" />
-
- <div id="content_outer">
- <div id="content_title">
- <h2>Diese Produkte wurden eingestellt:</h2>
- </div>
-
- <div id="content">
- <div class="para">
- <form action="${basePath}/form_handler/admin/do_product.jsp" accept-charset="utf-8" id="form" method="post">
- <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>
- <c:forEach var="product" items="${controller.allProductsIterator}">
- <tr>
- <td>
- ${product.itemId}:
- <input class="input" type="checkbox" name="itemId[${product.itemId}]" value="1" />
- </td>
- <td>
- ${product.title}
- </td>
- <td>
- ${product.price}
- </td>
- <td>
- ${controller.getPrintableProduktCategory(product)}
- </td>
- <td>
- ${controller.getPrintableProductAvailability(product)}
- </td>
- </tr>
- </c:forEach>
- <tr>
- <td colspan="5" class="table_footer">
- <input class="reset" type="reset" value="Formular zurücksetzen" />
- <input class="submit" type="submit" name="edit" value="Ändern" />
- <input class="delete" type="submit" name="delete" value="Löschen" />
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
-
- <div class="para">
- <form action="${basePath}/form_handler/admin/do_product.jsp" accept-charset="utf-8" id="add" method="post">
- <div class="table">
- <div class="table_header">
- Neues Produkt hinzufügen:
- </div>
-
- <fieldset id="product_data">
- <legend>Bitte alle Felder ausfüllen:</legend>
-
- <div class="table_row">
- <div class="table_left">
- Produktbezeichnung:
- <div class="tiny">(z.B. <em>Pizza Italia</em>)</div>
- </div>
-
- <div class="table_right">
- <input class="input" type="text" name="title" size="10" maxlength="255" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- Einzelpreis:
- <div class="tiny">(z.B. <em>50.0</em>)</div>
- </div>
-
- <div class="table_right">
- <input class="input" type="text" name="price" size="10" maxlength="255" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- Kategorie:
- </div>
-
- <div class="table_right">
- <jsp:include flush="false" page="/WEB-INF/static/admin/admin_category_selection_box.jsp" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- Verfügbar:
- </div>
-
- <div class="table_right">
- <select class="select" name="available" size="1">
- <option value="true">Ja</option>
- <option value="false">Nein</option>
- </select>
- </div>
-
- <div class="clear"></div>
- </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" />
- </div>
- </div>
- </form>
- </div>
-
- <div class="para">
- Hinweise zum Hinzufügen von Produkten:
- <ul>
- <li>Beim Preis keine Währungszeichen (wie € usw.) eingeben.</li>
- <li>Kommastellen mit Punkt, nicht mit Komma abtrennen.</li>
- <li>Keine Tausendertrenner verwenden, auch keine Leerschritte.</li>
- </ul>
- </div>
- </div>
- </div>
-
- <jsp:include page="/WEB-INF/static/admin/admin_footer.jsp" flush="false" />
- </body>
-</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+ <ui:define name="admin_title">Produkte</ui:define>
+
+ <ui:define name="menu">
+ <ui:include id="menu" class="admin_menu" src="/WEB-INF/templates/admin/admin_menu.tpl" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ Diese Produkte wurden eingestellt
+ </ui:define>
+
+ <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:form>
+ </div>
+
+ <div class="para">
+ <h:form acceptcharset="utf-8" id="add_category">
+ <div class="table">
+ <div class="table_header">
+ Neues Produkt hinzufügen:
+ </div>
+
+ <fieldset id="product_data">
+ <legend>Bitte alle Felder ausfüllen:</legend>
+
+ <div class="table_row">
+ <div class="table_left">
+ Produktbezeichnung:
+ <div class="tiny">(z.B. <em>Pizza Italia</em>)</div>
+ </div>
+
+ <div class="table_right">
+ <h:inputText class="input" id="title" size="10" maxlength="255" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ Einzelpreis:
+ <div class="tiny">(z.B. <em>50.0</em>)</div>
+ </div>
+
+ <div class="table_right">
+ <h:inputText class="input" id="price" size="10" maxlength="255" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ Kategorie:
+ </div>
+
+ <div class="table_right">
+ <ui:include src="/WEB-INF/templates/admin/admin_category_selection_box.tpl" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ Verfügbar:
+ </div>
+
+ <div class="table_right">
+ <select class="select" name="available" size="1">
+ <option value="true">Ja</option>
+ <option value="false">Nein</option>
+ </select>
+ </div>
+
+ <div class="clear"></div>
+ </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" />
+ </div>
+ </div>
+ </h:form>
+ </div>
+
+ <div class="para">
+ Hinweise zum Hinzufügen von Produkten:
+ <ul>
+ <li>Beim Preis keine Währungszeichen (wie EUR usw.) eingeben.</li>
+ <li>Kommastellen mit Punkt, nicht mit Komma abtrennen.</li>
+ <li>Keine Tausendertrenner verwenden, auch keine Leerschritte.</li>
+ </ul>
+ </div>
+ </ui:define>
+
+ <ui:define name="footer">
+ <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/admin/admin_footer.tpl" />
+ </ui:define>
+ </ui:composition>
+</html>
</div>
<div class="para">
- <h:link id="customer_lost_password" outcome="customer_register" title="Passwort wiederherstellen" value="Passwort vergessen?" />
+ <h:link id="customer_lost_password" outcome="customer_lost_passwd" title="Passwort wiederherstellen" value="Passwort vergessen?" />
</div>
</ui:define>
</ui:define>
<ui:define name="content_header">
- Eingangsseite (dummy)
+ Willkommen zum Pizza-Service
</ui:define>
<ui:define name="content">
<tbody>
<ui:repeat var="product" value="#{controller.availableProducts}">
- <!-- Cache isAdded call to reduce calls //-->
- <c:set var="isAdded" value="#{basket.isAdded(product)}" />
- <ui:fragment rendered="#{isAdded == true}">
+ <f:viewAction action="#{basket.setCurrentProduct(product)}" />
+
+ <ui:fragment rendered="#{basket.isCurrentProductAdded() == true}">
<tr>
<td class="table_data_column">
<h:link outcome="basket" title="Zum Warenkorb" value="Warenkorb" />
</tr>
</ui:fragment>
- <ui:fragment rendered="#{isAdded == false}">
+ <ui:fragment rendered="#{basket.isCurrentProductAdded() == false}">
<tr>
<td class="table_data_column">
<h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basket.addToBasket(product)}" />
.table_header {
text-align: center;
font-weight: bold;
- font-size: 20px;
+}
+
+#content_header {
+ font-weight: bold;
+ font-size: 18px;
}
.table_header_column {
>
<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
- <ui:define name="title">Allgemeine Geschäftsbedingungen</ui:define>
+ <ui:define name="title">Allgemeine Geschäftsbedingungen</ui:define>
<ui:define name="menu">
<ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
</ui:define>
<ui:define name="content_header">
- Allgemeine Geschäftsbedingungen
+ Allgemeine Geschäftsbedingungen
</ui:define>
<ui:define name="content">
- Hier kommen die allgemeinen Geschäftsbedingungen hin.
+ Hier kommen die allgemeinen Geschäftsbedingungen hin.
</ui:define>
<ui:define name="footer">