]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Binded to jshop-core + added it
authorRoland Haeder <roland@mxchange.org>
Fri, 4 Sep 2015 21:42:30 +0000 (23:42 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 4 Sep 2015 21:42:30 +0000 (23:42 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jshop-core.jar [new file with mode: 0644]
nbproject/build-impl.xml
nbproject/genfiles.properties
nbproject/project.properties
nbproject/project.xml
src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java [deleted file]
src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java [deleted file]
src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java
src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java

diff --git a/lib/jshop-core.jar b/lib/jshop-core.jar
new file mode 100644 (file)
index 0000000..feda701
Binary files /dev/null and b/lib/jshop-core.jar differ
index ef45db9e0ae87b03f2f49d3f9292d457103b3a07..ccedafe379858be604201dff7b592e5df14ec665 100644 (file)
@@ -1022,30 +1022,32 @@ exists or setup the property manually. For example like this:
     </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="${file.reference.jcore.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jsfcore.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.jshop.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.commons-codec-1.10.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.commons-lang3-3.4.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.jsfcore.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.jshop.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"/>
         <copyfiles files="${file.reference.log4j-core-2.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.log4j-web-2.3.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"/>
         <mkdir dir="${build.web.dir}/META-INF"/>
         <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="${file.reference.jcore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.jsfcore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.jshop.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.commons-codec-1.10.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.commons-lang3-3.4.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.jsfcore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.jshop.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.log4j-api-2.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.log4j-core-2.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.log4j-web-2.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.jshop-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
     </target>
     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
         <delete dir="${build.web.dir}/WEB-INF/lib"/>
index 3c858bbd05d5dad091e4b63536733a7453513f18..d9320034a7fe9060f7f7bd0d7da75b2f5eb3a44e 100644 (file)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=d470fc14
+build.xml.data.CRC32=46935672
 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=d470fc14
-nbproject/build-impl.xml.script.CRC32=617ba396
+nbproject/build-impl.xml.data.CRC32=46935672
+nbproject/build-impl.xml.script.CRC32=1654f0fc
 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
index 54cd9348aef81b33e89ad387b7c0396ab272a2e6..5a0eb9bbd44cfc80e95b8878b85dcd0bfa6211cc 100644 (file)
@@ -34,6 +34,7 @@ file.reference.commons-lang3-3.4.jar=lib/commons-lang3-3.4.jar
 file.reference.gf-client.jar=lib/gf-client.jar
 file.reference.jcore.jar=lib/jcore.jar
 file.reference.jsfcore.jar=lib/jsfcore.jar
+file.reference.jshop-core.jar=lib/jshop-core.jar
 file.reference.jshop.jar=lib/jshop.jar
 file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar
 file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar
@@ -61,7 +62,8 @@ javac.classpath=\
     ${file.reference.commons-lang3-3.4.jar}:\
     ${file.reference.log4j-api-2.3.jar}:\
     ${file.reference.log4j-core-2.3.jar}:\
-    ${file.reference.log4j-web-2.3.jar}
+    ${file.reference.log4j-web-2.3.jar}:\
+    ${file.reference.jshop-core.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.debug=true
@@ -100,6 +102,7 @@ runmain.jvmargs=
 source.encoding=UTF-8
 source.reference.jcore.jar=../jcore/src/
 source.reference.jsfcore.jar=../jsfcore/src/
+source.reference.jshop-core.jar=../jshop-core/src/
 source.reference.jshop.jar=../jshop/src/
 source.root=src
 src.dir=${source.root}/java
index b8af222cf8fbacc81a929ccace638bcde1ad8074..2ce44c6d34c3204db3789c785e56d215af76905f 100644 (file)
@@ -7,31 +7,31 @@
             <minimum-ant-version>1.6.5</minimum-ant-version>
             <web-module-libraries>
                 <library dirs="200">
-                    <file>${file.reference.cdi-api.jar}</file>
+                    <file>${file.reference.jcore.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.gf-client.jar}</file>
+                    <file>${file.reference.jsfcore.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.commons-codec-1.10.jar}</file>
+                    <file>${file.reference.jshop.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.commons-lang3-3.4.jar}</file>
+                    <file>${file.reference.cdi-api.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.jcore.jar}</file>
+                    <file>${file.reference.gf-client.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.jsfcore.jar}</file>
+                    <file>${file.reference.commons-codec-1.10.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.jshop.jar}</file>
+                    <file>${file.reference.commons-lang3-3.4.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
                     <file>${file.reference.log4j-web-2.3.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
+                <library dirs="200">
+                    <file>${file.reference.jshop-core.jar}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
             </web-module-libraries>
             <web-module-additional-libraries/>
             <source-roots>
diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java
deleted file mode 100644 (file)
index e0d4385..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.pizzaapplication.application;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.sql.SQLException;
-import java.util.Deque;
-import java.util.Iterator;
-import org.mxchange.jcore.application.Application;
-import org.mxchange.jshop.category.Category;
-import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
-import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
-import org.mxchange.jshop.item.AddableBasketItem;
-import org.mxchange.jshop.product.Product;
-
-/**
- *
- * @author Roland Haeder
- */
-public interface PizzaApplication extends Application {
-       /**
-        * Some "getter" for a linked list of only available products
-        * 
-        * @return Only available products
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Deque<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Some "getter" for a linked list of all products
-        *
-        * @return All products
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Deque<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Some "getter" for a linked list of all categories
-        *
-        * @return All categories
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Deque<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Initializes this instance with given ServletContext
-        *
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.io.IOException If an IO error occurs
-        */
-       public void init () throws SQLException, IOException;
-
-       /**
-        * Some "getter" for a an array of only available products
-        * 
-        * @return Only available products
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Iterator<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Some "getter" for a an array of all products
-        *
-        * @return All products
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Iterator<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Some "getter" for a an array of all categories
-        *
-        * @return All categories
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public Iterator<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Generates a link for category's parent category. If none is given, the method will return only a small
-        * note.
-        *
-        * @param category Category instance
-        * @return HTML link for category's parent category
-        * @deprecated Old lost code
-        */
-       @Deprecated
-       public String generateLinkForParent (final Category category);
-
-       /**
-        * Checks if given Product instance is available and returns a printable
-        * (human-readable) string.
-        * 
-        * @param product Product instance to check
-        * @return Human-readable version of product availability
-        * @deprecated Old lost code
-        */
-       @Deprecated
-       public String getPrintableProductAvailability (final Product product);
-
-       /**
-        * Returns a printable (human-readable) string of product's category
-        * 
-        * @param product Product instance to check
-        * @return Human-readable version of product availability
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        * @deprecated Old lost code
-        */
-       @Deprecated
-       public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
-
-       /**
-        * Adds given category data from request to database
-        *
-        * @param category Category instance
-        * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        */
-       public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;
-
-       /**
-        * Adds given product data from request to database
-        *
-        * @param product Product instance
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used
-        */
-       public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
-
-       /**
-        * Handles admin product form requests
-        *
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used
-        * @deprecated Old lost code
-        */
-       @Deprecated
-       public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException;
-
-       /**
-        * Handles admin category form requests
-        * 
-        * @throws java.io.IOException If an IO error occurs
-        * @throws java.sql.SQLException If an SQL error occurs
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly
-        * @throws java.lang.reflect.InvocationTargetException If something else happens?
-        * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used
-        * @deprecated 
-        */
-       @Deprecated
-       public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException;
-}
diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java
deleted file mode 100644 (file)
index 5eda780..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.pizzaapplication.application;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.sql.SQLException;
-import java.text.MessageFormat;
-import java.util.Deque;
-import java.util.Iterator;
-import org.mxchange.jcore.BaseFrameworkSystem;
-import org.mxchange.jsfcore.BaseServletSystem;
-import org.mxchange.jshop.category.Category;
-import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
-import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
-import org.mxchange.jshop.product.Product;
-
-/**
- * Main application class
- *
- * @author Roland Haeder
- */
-public class PizzaServiceApplication extends BaseServletSystem implements PizzaApplication {
-       /**
-        * Default constructor
-        */
-       public PizzaServiceApplication () {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-       }
-
-       @Override
-       public Deque<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Deligate to frontend
-               return this.categoryFrontend.getAllCategories();
-       }
-
-       @Override
-       public Deque<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Deligate to frontend
-               return this.productFrontend.getAllProducts();
-       }
-
-       @Override
-       public Deque<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Deligate to frontend
-               return this.productFrontend.getAllAvailableProducts();
-       }
-
-       @Override
-       public void init () throws SQLException {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-
-               // Is the bundle initialized?
-               if (!BaseFrameworkSystem.isBundledInitialized()) {
-                       // Temporary initialize default bundle
-                       // TODO The enum Gender uses this
-                       this.initBundle();
-               }
-
-               // Trace message
-               this.getLogger().trace("EXIT!"); //NOI18N
-       }
-
-       @Override
-       public void doBootstrap () {
-               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
-       }
-
-       @Override
-       public void doMainLoop () {
-               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
-       }
-
-       @Override
-       public void doShutdown () {
-               throw new UnsupportedOperationException("Not supported yet."); //NOI18N
-       }
-
-       @Override
-       @Deprecated
-       public String getPrintableProductAvailability (final Product product) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
-
-               // Is it null?
-               if (null == product) {
-                       // Should not be null
-                       throw new NullPointerException("product is null"); //NOI18N
-               }
-
-               // Get availability
-               if (product.getAvailable() == true) {
-                       // Is available
-                       return "Ja";
-               } else {
-                       // Not, not for public
-                       return "Nein";
-               }
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public Iterator<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-
-               // Ask frontend for a list of products
-               return this.productFrontend.getAvailableProductsIterator();
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public Iterator<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-
-               // Ask frontend for a list of products
-               return this.productFrontend.getAllProductsIterator();
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public Iterator<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-
-               // Ask frontend for a list of categories
-               return this.categoryFrontend.getAllCategoriesIterator();
-       }
-
-       /**
-        * Checks whether given category title is already used
-        *
-        * @param title Title of category to check
-        * @return Whether it has been found
-        */
-       private boolean isCategoryTitleUsed(final String title) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace("title=" + title + " - CALLED!"); //NOI18N
-
-               // Delegate to frontend
-               return this.categoryFrontend.isCategoryTitleUsed(title);
-       }
-
-       @Override
-       public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
-
-               // category must not be null
-               if (null == category) {
-                       // Is null
-                       throw new NullPointerException("category is null"); //NOI18N
-               }
-
-               // Get all fields
-               String title = category.getTitle();
-               Long parentId = category.getParentId();
-
-               // Debug message
-               this.getLogger().debug(MessageFormat.format("title={0},parentId={1}", title, parentId)); //NOI18N
-
-               // Init variables for casting
-               Integer id = 0;
-
-               // Check all fields
-               if (null == title) {
-                       // "title" not set
-                       throw new IllegalArgumentException("title is not set."); //NOI18N
-               } else if (title.isEmpty()) {
-                       // Is left empty
-                       throw new IllegalArgumentException("title is empty."); //NOI18N
-               } else if ((parentId == null) || (parentId == 0)) {
-                       // Is left empty
-                       throw new IllegalArgumentException("parentId is empty."); //NOI18N
-               }
-
-               // Try to check if title is used already
-               if (this.isCategoryTitleUsed(title)) {
-                       // Title already used
-                       throw new CategoryTitleAlreadyUsedException(category);
-               }
-
-               // The category is not found, so add it to database
-               this.categoryFrontend.addCategory(title, id);
-
-               // Trace message
-               this.getLogger().trace("EXIT!"); //NOI18N
-       }
-
-       @Override
-       public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
-
-               // product must not be null
-               if (null == product) {
-                       // Is null
-                       throw new NullPointerException("product is null"); //NOI18N
-               }
-
-               // Get title, price and category id
-               String title = product.getTitle();
-               Float price = product.getPrice();
-               Long categoryId = product.getCategoryId();
-               Boolean available = product.getAvailable();
-
-               // Debug message
-               this.getLogger().debug(MessageFormat.format("title={0},price={1},categoryId={2},available={3}", title, price, categoryId, available)); //NOI18N
-
-               // Check all fields
-               if (null == title) {
-                       // "title" not set
-                       throw new IllegalArgumentException("product title is not set"); //NOI18N
-               } else if (title.isEmpty()) {
-                       // Is left empty
-                       throw new IllegalArgumentException("product title is empty"); //NOI18N
-               } else if (null == price) {
-                       // "price" not set
-                       throw new IllegalArgumentException("product price is not set."); //NOI18N
-               } else if (null == categoryId) {
-                       // "title" not set
-                       throw new IllegalArgumentException("product category id is not set."); //NOI18N
-               } else if (null == available) {
-                       // "title" not set
-                       throw new IllegalArgumentException("product availability not set."); //NOI18N
-               }
-
-               // Try to check if title is used already
-               if (this.isProductTitleUsed(product)) {
-                       // Title already used
-                       throw new ProductTitleAlreadyUsedException(product);
-               }
-
-               // The product is not found, so add it to database
-               this.productFrontend.addProduct(title, price, categoryId, available);
-
-               // Trace message
-               this.getLogger().trace("EXIT!"); //NOI18N
-       }
-
-       @Override
-       @Deprecated
-       public String generateLinkForParent (final Category category) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
-
-               // category must not be null
-               if (null == category) {
-                       // Is null
-                       throw new NullPointerException("category is null"); //NOI18N
-               }
-
-               // Get parent id
-               Long parentId = category.getParentId();
-
-               // Is the id set?
-               if (parentId > 0) {
-                       // Product HTML code for link
-                       throw new UnsupportedOperationException(MessageFormat.format("parentId={0} - Unfinished!", parentId)); //NOI18N
-               }
-
-               // No parent set
-               return "Keine";
-       }
-
-       @Override
-       @Deprecated
-       public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N
-
-               // product must not be null
-               if (null == product) {
-                       // Abort here
-                       throw new NullPointerException("product is null"); //NOI18N
-               }
-
-               // Declare category
-               Category category;
-
-               // Get Category instance from product over the frontend
-               category = this.categoryFrontend.getCategory(product);
-
-               // Debug message
-               this.getLogger().debug(MessageFormat.format("categoryId={0}", category)); //NOI18N
-
-               // Get decoded title
-               String title = category.getDecodedTitle();
-
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("title={0} - EXIT!", title)); //NOI18N
-
-               // Return it
-               return title;
-       }
-
-       /**
-        * Checks if product's title is already used.
-        * 
-        * @param product Product instance
-        * @return Whether the product title is already used
-        * @throws java.io.IOException If any IO error occurs
-        * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found in a file-based database backend's file ... ;-)
-        * @throws java.sql.SQLException If any SQL error occurs
-        * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed
-        * @throws java.lang.reflect.InvocationTargetException Any other problems?
-        */
-       private boolean isProductTitleUsed (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", product)); //NOI18N
-
-               // Init title
-               String title = product.getTitle();
-
-               // category must not be null and "title" must be found and non-empty
-               if (null == product) {
-                       // Abort here
-                       throw new NullPointerException("category is null"); //NOI18N
-               } else if (null == title) {
-                       // title is not set
-                       throw new IllegalArgumentException("product title is not set"); //NOI18N
-               } else if (title.isEmpty()) {
-                       // Is left empty
-                       throw new IllegalArgumentException("product title is empty"); //NOI18N
-               }
-
-               // Default is not used
-               // TODO Call backend
-               throw new UnsupportedOperationException("not finished yet.");
-
-               // Trace message
-               //this.getLogger().trace(MessageFormat.format("isUsed={0} - EXIT!", isUsed)); //NOI18N
-
-               // Return it
-               //return isUsed;
-       }
-
-       @Override
-       @Deprecated
-       public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException {
-               // Deprecated method called
-               throw new UnsupportedOperationException("Deprecated method called.");
-       }
-
-       @Override
-       @Deprecated
-       public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException {
-               // Deprecated method called
-               throw new UnsupportedOperationException("Deprecated method called.");
-       }
-
-       /**
-        * Checks if category's title is already used.
-        * 
-        * @param category Category instance
-        * @return Whether the product title is already used
-        * @throws java.io.IOException If any IO error occurs
-        * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found in a file-based database backend's file ... ;-)
-        * @throws java.sql.SQLException If any SQL error occurs
-        * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged
-        * @throws java.lang.NoSuchMethodException If a method was not found
-        * @throws java.lang.IllegalAccessException If the method cannot be accessed
-        * @throws java.lang.reflect.InvocationTargetException Any other problems?
-        */
-       private boolean isCategoryTitleUsed (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
-
-               // Init title
-               String title = category.getTitle();
-
-               // category must not be null and "title" must be found and non-empty
-               if (null == category) {
-                       // Abort here
-                       throw new NullPointerException("category is null"); //NOI18N
-               } else if (null == title) {
-                       // title is not set
-                       throw new IllegalArgumentException("category title is not set."); //NOI18N
-               } else if (title.isEmpty()) {
-                       // Is left empty
-                       throw new IllegalArgumentException("category title is empty."); //NOI18N
-               }
-
-               // Default is not used
-               boolean isUsed = this.isCategoryTitleUsed(title);
-
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("isUsed={0} - EXIT!", isUsed)); //NOI18N
-
-               // Return it
-               return isUsed;
-       }
-}
index f3885dfe839c7288facc4b51fc016af9e6b6ad46..6532d4020c871cdbc611ba22355381788ea1e653 100644 (file)
@@ -29,12 +29,9 @@ import javax.faces.FacesException;
 import javax.inject.Named;
 import org.mxchange.jshop.beans.BaseFrameworkBean;
 import org.mxchange.jshop.category.Category;
-import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
-import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
-import org.mxchange.jshop.item.AddableBasketItem;
 import org.mxchange.jshop.product.Product;
-import org.mxchange.pizzaapplication.application.PizzaApplication;
-import org.mxchange.pizzaapplication.application.PizzaServiceApplication;
+import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
+import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
 
 /**
  * Main application class
@@ -49,18 +46,12 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe
         */
        private static final long serialVersionUID = 58137539530279L;
 
-       /**
-        * Pizza application
-        */
-       private final PizzaApplication app;
-
        /**
         * Initializer block
         */
        {
                // Get new application instance
                this.getLogger().debug("INITIALIZER!"); //NOI18N
-               this.app = new PizzaServiceApplication();
        }
 
        /**
index 91deebe423f47a53cf2e01babdc46186502a6df5..e28a03d033a4807f0f07eaad55089705bd8de036 100644 (file)
@@ -22,8 +22,8 @@ import java.util.Iterator;
 import javax.faces.FacesException;
 import org.mxchange.jshop.beans.FrameworkBean;
 import org.mxchange.jshop.category.Category;
-import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
-import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
+import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
+import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
 import org.mxchange.jshop.product.Product;
 
 /**
@@ -124,7 +124,7 @@ public interface PizzaWebBean extends FrameworkBean {
         *
         * @param category Category instance
         * @throws java.rmi.RemoteException If something unexpected happened
-        * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException If the given title is already used
+        * @throws org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException If the given title is already used
         */
        public void doAdminAddCategory (final Category category) throws RemoteException, CategoryTitleAlreadyUsedException;
 
@@ -133,7 +133,7 @@ public interface PizzaWebBean extends FrameworkBean {
         *
         * @param product Product instance
         * @throws java.rmi.RemoteException If something unexpected happened
-        * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the given product title is already used
+        * @throws org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException If the given product title is already used
         */
        public void doAdminAddProduct (final Product product) throws RemoteException, ProductTitleAlreadyUsedException;