annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options=
+auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false
+auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css
+auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options=
+auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false
+auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css
+auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets
+auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=js/libs
build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
${file.reference.log4j-core-2.3.jar}:\
${file.reference.log4j-web-2.3.jar}
# Space-separated list of extra javac options
-javac.compilerargs=
+javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
javac.debug=true
-javac.deprecation=false
+javac.deprecation=true
javac.processorpath=\
${javac.classpath}
javac.source=1.7
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
-javadoc.author=false
+javadoc.author=true
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.preview=true
-javadoc.private=false
+javadoc.private=true
javadoc.splitindex=true
javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
+javadoc.version=true
+javadoc.windowtitle=Pizza-Service Application
lib.dir=${web.docbase.dir}/WEB-INF/lib
persistence.xml.dir=${conf.dir}
platform.active=default_platform
+project.license=gpl30
project.PizzaService-lib=../pizzaservice-lib
reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar
resource.dir=setup
--- /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 org.mxchange.jcoreee.beans.FrameworkBean;
+
+/**
+ * An interface for a basket
+ *
+ * @author Roland Haeder
+ */
+public interface PizzaBasketWebBean extends FrameworkBean {
+ /**
+ * 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 ();
+}
--- /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 javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Named;
+import org.mxchange.jcoreee.beans.BaseFrameworkBean;
+
+/**
+ * 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 = 5476347320198L;
+
+ @Override
+ public boolean isEmpty () {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean hasItems () {
+ // Call above and invert it
+ return (!this.isEmpty());
+ }
+
+ @Override
+ @PostConstruct
+ public void init () throws RuntimeException {
+ // Call super init first
+ super.localInit();
+ }
+}
package org.mxchange.pizzaapplication.beans.controller;
import java.io.IOException;
-import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.Deque;
import java.util.Iterator;
@Override
@PostConstruct
- public void init () throws FacesException {
- // Trace message
- this.getLogger().trace("CALLED!"); //NOI18N
-
- // Super call
- super.init();
+ public void init () throws RuntimeException {
+ // Call super init first
+ super.localInit();
}
@Override
- public Iterator<Product> getAvailableProductsIterator () throws RemoteException {
+ public Iterator<Product> getAvailableProductsIterator () throws FacesException {
try {
return this.remote.getAvailableProductsIterator();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAvailableProductsIterator() failed", ex);
+ throw new FacesException(ex);
}
}
@Override
- public Iterator<Product> getAllProductsIterator () throws RemoteException {
+ public Iterator<Product> getAllProductsIterator () throws FacesException {
try {
return this.remote.getAllProductsIterator();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAllProductsIterator() failed.", ex);
+ throw new FacesException(ex);
}
}
@Override
- public Deque<Product> getAvailableProducts () throws RemoteException {
+ public Deque<Product> getAvailableProducts () throws FacesException {
try {
return this.remote.getAvailableProducts();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAvailableProducts() failed.", ex);
+ throw new FacesException(ex);
}
}
@Override
- public Deque<Product> getAllProducts () throws RemoteException {
+ public Deque<Product> getAllProducts () throws FacesException {
try {
return this.remote.getAllProducts();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAllProducts() failed", ex);
+ throw new FacesException(ex);
}
}
@Override
- public Iterator<Category> getAllCategoriesIterator () throws RemoteException {
+ public Iterator<Category> getAllCategoriesIterator () throws FacesException {
try {
return this.remote.getAllCategoriesIterator();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAllCategoriesIterator() failed.", ex);
+ throw new FacesException(ex);
}
}
@Override
- public Deque<Category> getAllCategories () throws RemoteException {
+ public Deque<Category> getAllCategories () throws FacesException {
try {
return this.remote.getAllCategories();
} catch (final IOException | SQLException ex) {
// Continue to throw
- throw new RemoteException("getAllCategories() failed.", ex);
+ throw new FacesException(ex);
}
}
@Override
- public void doAdminAddCategory (final Category category) throws RemoteException {
+ public void doAdminAddCategory (final Category category) throws FacesException {
try {
this.remote.doAdminAddCategory(category);
} catch (final IOException | SQLException | CategoryTitleAlreadyUsedException ex) {
// Continue to throw
- throw new RemoteException("doAdminAddCategory() failed.", ex);
+ throw new FacesException(ex);
}
}
@Override
- public void doAdminAddProduct (final Product product) throws RemoteException {
+ public void doAdminAddProduct (final Product product) throws FacesException {
try {
this.remote.doAdminAddProduct(product);
} catch (final IOException | SQLException | ProductTitleAlreadyUsedException ex) {
// Continue to throw
- throw new RemoteException("doAdminAddProduct() failed.", ex);
+ throw new FacesException(ex);
}
}
}
*/
package org.mxchange.pizzaapplication.beans.controller;
-import java.rmi.RemoteException;
import java.util.Deque;
import java.util.Iterator;
+import javax.faces.view.facelets.FaceletException;
import org.mxchange.jcoreee.beans.FrameworkBean;
import org.mxchange.jshopcore.model.category.Category;
import org.mxchange.jshopcore.model.product.Product;
/**
+ * An interface for the shop
*
* @author Roland Haeder
*/
* Some "getter" for an iterator of only available products
*
* @return Only available products
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Iterator<Product> getAvailableProductsIterator () throws RemoteException;
+ public Iterator<Product> getAvailableProductsIterator () throws FaceletException;
/**
* Some "getter" for an iterator of all products
*
* @return All products
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Iterator<Product> getAllProductsIterator () throws RemoteException;
+ public Iterator<Product> getAllProductsIterator () throws FaceletException;
/**
* Some "getter" for an iterator of all categories
*
* @return All categories
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Iterator<Category> getAllCategoriesIterator () throws RemoteException;
+ public Iterator<Category> getAllCategoriesIterator () throws FaceletException;
/**
* Some "getter" for a linked list of only available products
*
* @return Only available products
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Deque<Product> getAvailableProducts () throws RemoteException;
+ public Deque<Product> getAvailableProducts () throws FaceletException;
/**
* Some "getter" for a linked list of all products
*
* @return All products
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Deque<Product> getAllProducts () throws RemoteException;
+ public Deque<Product> getAllProducts () throws FaceletException;
/**
* Some "getter" for a linked list of all categories
*
* @return All categories
- * @throws java.rmi.RemoteException If anything went wrong
+ * @throws javax.faces.view.facelets.FaceletException If anything went wrong
*/
- public Deque<Category> getAllCategories () throws RemoteException;
+ public Deque<Category> getAllCategories () throws FaceletException;
/**
* Adds given category data from request to database
*
* @param category Category instance
- * @throws java.rmi.RemoteException If something unexpected happened
+ * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
*/
- public void doAdminAddCategory (final Category category) throws RemoteException;
+ public void doAdminAddCategory (final Category category) throws FaceletException;
/**
* Adds given product data from request to database
*
* @param product Product instance
- * @throws java.rmi.RemoteException If something unexpected happened
+ * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
*/
- public void doAdminAddProduct (final Product product) throws RemoteException;
+ public void doAdminAddProduct (final Product product) throws FaceletException;
}
*/
package org.mxchange.pizzaapplication.beans.customer;
+import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
*/
public PizzaServiceCustomerWebBean () {
}
+
+ @Override
+ @PostConstruct
+ public void init () throws RuntimeException {
+ // Call super init first
+ super.localInit();
+ }
}
--- /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 org.mxchange.jcore.model.contact.gender.Gender;
+import org.mxchange.jcoreee.beans.FrameworkBean;
+
+/**
+ * An interface for data beans
+ *
+ * @author Roland Haeder
+ */
+public interface DataWebBean extends FrameworkBean {
+
+ /**
+ * 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.text.MessageFormat;
+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.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 = 835482364189L;
+
+ /**
+ * Remote bean
+ */
+ private final ShopDataBeanRemote remote;
+
+ /**
+ * 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.remote = (ShopDataBeanRemote) context.lookup("ejb/stateless-data");
+ }
+
+ @Override
+ public Gender[] allGenders () {
+ // Trace message
+ this.getLogger().trace("CALLED!");
+
+ // Return it
+ return this.getRemote().allGenders();
+ }
+
+ @Override
+ public List<Gender> selectableGenders () {
+ // Trace message
+ this.getLogger().trace("CALLED!"); //NOI18N
+
+ // Init array
+ // TODO Call EJB here?
+ List<Gender> genders = this.getRemote().selectableGenders();
+
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("genders={0} - EXIT!", genders)); //NOI18N
+
+ // Return it
+ return genders;
+ }
+
+ /**
+ * @return the remote
+ */
+ private ShopDataBeanRemote getRemote () {
+ return this.remote;
+ }
+}
+++ /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.enums;
-
-import java.util.List;
-import org.mxchange.jcore.model.contact.gender.Gender;
-import org.mxchange.jcoreee.beans.FrameworkBean;
-
-/**
- * An interface for data beans
- *
- * @author Roland Haeder
- */
-public interface DataWebBean extends FrameworkBean {
-
- /**
- * 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.enums;
-
-import java.text.MessageFormat;
-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.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 = 835482364189L;
-
- /**
- * Remote bean
- */
- private final ShopDataBeanRemote remote;
-
- /**
- * 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.remote = (ShopDataBeanRemote) context.lookup("ejb/stateless-data");
- }
-
- @Override
- public Gender[] allGenders () {
- // Trace message
- this.getLogger().trace("CALLED!");
-
- // Return it
- return this.getRemote().allGenders();
- }
-
- @Override
- public List<Gender> selectableGenders () {
- // Trace message
- this.getLogger().trace("CALLED!"); //NOI18N
-
- // Init array
- // TODO Call EJB here?
- List<Gender> genders = this.getRemote().selectableGenders();
-
- // Trace message
- this.getLogger().trace(MessageFormat.format("genders={0} - EXIT!", genders)); //NOI18N
-
- // Return it
- return genders;
- }
-
- /**
- * @return the remote
- */
- private ShopDataBeanRemote getRemote () {
- return this.remote;
- }
-}
--- /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="mini_basket_box">
+ <div class="mini_basket_header">
+ #{msg.mini_basket.header}
+ </div>
+
+ <div class="mini_basket_last">
+ #{msg.mini_basket.last_item}
+ </div>
+
+ <div class="mini_basket_more">
+ #{msg.mini_basket.additional_items}
+ </div>
+
+ <div class="mini_basket_link">
+ <h:link id="to_basket" outcome="basket" title="#{msg.mini_basket.to_basket}" value="#{msg.mini_basket.to_basket}" />
+ </div>
+ </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 class="mini_basket_box">
+ #{MiniBasketTag.basket_is_empty}
+ </div>
+</ui:composition>
<ui:composition
template="/WEB-INF/templates/base.tpl"
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">
<!--
- TODO Unused:
- xmlns:basket="http://mxchange.org/jshop/tags/basket"
- <basket:mini_basket basket="#{basket}" />
+ Show basket if it contains items, else show an empty basket.
//-->
+ <ui:fragment rendered="#{basket.isEmpty()}">
+ <ui:include src="/WEB-INF/templates/basket/mini_basket_empty.tpl" />
+ </ui:fragment>
+ <ui:fragment rendered="#{basket.hasItems()}">
+ <ui:include src="/WEB-INF/templates/basket/mini_basket.tpl" />
+ </ui:fragment>
</ui:composition>