]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
renamed package to proper name
authorRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 09:19:48 +0000 (11:19 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 09:19:48 +0000 (11:19 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java
src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java [deleted file]
src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java [deleted file]
src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java
src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebController.java [new file with mode: 0644]

index 5531c0c78a215448b3156653402181abf470a5e0..687ada65dad3cac465f652b6fc20774fe9d49fa2 100644 (file)
@@ -28,7 +28,7 @@ import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
 import org.mxchange.jshopcore.model.category.AdminCategorySessionBeanRemote;
 import org.mxchange.jshopcore.model.category.Category;
 import org.mxchange.jshopcore.model.category.ProductCategory;
-import org.mxchange.pizzaapplication.beans.controller.ShopWebController;
+import org.mxchange.pizzaapplication.beans.shop.ShopWebController;
 
 /**
  * Main application class
diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java
deleted file mode 100644 (file)
index c151a60..0000000
+++ /dev/null
@@ -1,130 +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.beans.controller;
-
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.faces.FacesException;
-import javax.faces.view.facelets.FaceletException;
-import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcoreee.BaseEeSystem;
-import org.mxchange.jshopcore.model.category.Category;
-import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
-import org.mxchange.jshopcore.model.category.ProductCategory;
-import org.mxchange.jshopcore.model.product.Product;
-import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
-
-/**
- * General shop controller
- *
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Named("controller")
-@ApplicationScoped
-public class ShopWebBean extends BaseEeSystem implements ShopWebController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 58_137_539_530_279L;
-
-       /**
-        * "Cache" for all available products
-        */
-       private List<Product> availableProducts;
-
-       /**
-        * All categories
-        */
-       private List<Category> categories;
-
-       @Override
-       public void addCategory (final Category category) {
-               // Add the category
-               this.categories.add(category);
-       }
-
-       @Override
-       public void addProduct (final Product product) {
-               // Is the product available?
-               if (product.getAvailable()) {
-                       // Add it
-                       this.availableProducts.add(product);
-               }
-       }
-
-       @PostConstruct
-       public void init () {
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the bean
-                       CategorySessionBeanRemote categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N
-
-                       // Get all categories
-                       this.categories = categoryBean.getAllCategories();
-
-                       // Try to lookup the bean
-                       ProductSessionBeanRemote productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N
-
-                       // Get available products list
-                       this.availableProducts = productBean.getAvailableProducts();
-               } catch (final NamingException e) {
-                       // Continued to throw
-                       throw new FacesException(e);
-               }
-       }
-
-       @Override
-       public List<Category> getAllCategories () throws FacesException {
-               // Return it
-               // TODO Find something better here to prevent warning
-               return Collections.unmodifiableList(this.categories);
-       }
-
-       @Override
-       public List<Category> getAllCategoriesParent () throws FaceletException {
-               // Get regular list
-               List<Category> deque = new LinkedList<>();
-
-               // Create fake entry
-               Category fake = new ProductCategory(0L, this.getMessageStringFromKey("ADMIN_CATEGORY_HAS_NO_PARENT"), 0L); //NOI18N
-
-               // Add it
-               deque.add(fake);
-
-               // Add all
-               deque.addAll(this.getAllCategories());
-
-               // Return it
-               return deque;
-       }
-
-       @Override
-       public List<Product> getAvailableProducts () throws FacesException {
-               // Return it
-               // TODO Find something better here to prevent warning
-               return Collections.unmodifiableList(this.availableProducts);
-       }
-}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java
deleted file mode 100644 (file)
index 61bd49b..0000000
+++ /dev/null
@@ -1,70 +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.beans.controller;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.faces.view.facelets.FaceletException;
-import org.mxchange.jshopcore.model.category.Category;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * An interface for the shop
- *
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface ShopWebController extends Serializable {
-
-       /**
-        * Adds given category to the "cached" instance
-        *
-        * @param category Category instance
-        */
-       public void addCategory (final Category category);
-
-       /**
-        * Adds given product to the "cached" instance
-        *
-        * @param product Product instance
-        */
-       public void addProduct (final Product product);
-
-       /**
-        * Some "getter" for a linked list of only available products
-        * 
-        * @return Only available products
-        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
-        */
-       public List<Product> getAvailableProducts () throws FaceletException;
-
-       /**
-        * Some "getter" for a linked list of all categories
-        *
-        * @return All categories
-        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
-        */
-       public List<Category> getAllCategories () throws FaceletException;
-
-       /**
-        * Some "getter" for a linked list of all categories including "Has no
-        * parent" fake category.
-        *
-        * @return All categories
-        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
-        */
-       public List<Category> getAllCategoriesParent () throws FaceletException;
-}
index fcd1a53127f21344f18c4f4908bea103c98c0284..0b0645a824325a9d009d05c9528db73f9219f450 100644 (file)
@@ -29,7 +29,7 @@ import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
 import org.mxchange.jshopcore.model.product.AdminProductSessionBeanRemote;
 import org.mxchange.jshopcore.model.product.GenericProduct;
 import org.mxchange.jshopcore.model.product.Product;
-import org.mxchange.pizzaapplication.beans.controller.ShopWebController;
+import org.mxchange.pizzaapplication.beans.shop.ShopWebController;
 
 /**
  * Main application class
diff --git a/src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebBean.java
new file mode 100644 (file)
index 0000000..172c4bc
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * 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.shop;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.faces.FacesException;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcoreee.BaseEeSystem;
+import org.mxchange.jshopcore.model.category.Category;
+import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
+import org.mxchange.jshopcore.model.category.ProductCategory;
+import org.mxchange.jshopcore.model.product.Product;
+import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
+
+/**
+ * General shop controller
+ *
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named("controller")
+@ApplicationScoped
+public class ShopWebBean extends BaseEeSystem implements ShopWebController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 58_137_539_530_279L;
+
+       /**
+        * "Cache" for all available products
+        */
+       private List<Product> availableProducts;
+
+       /**
+        * All categories
+        */
+       private List<Category> categories;
+
+       @Override
+       public void addCategory (final Category category) {
+               // Add the category
+               this.categories.add(category);
+       }
+
+       @Override
+       public void addProduct (final Product product) {
+               // Is the product available?
+               if (product.getAvailable()) {
+                       // Add it
+                       this.availableProducts.add(product);
+               }
+       }
+
+       @PostConstruct
+       public void init () {
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup the bean
+                       CategorySessionBeanRemote categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N
+
+                       // Get all categories
+                       this.categories = categoryBean.getAllCategories();
+
+                       // Try to lookup the bean
+                       ProductSessionBeanRemote productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N
+
+                       // Get available products list
+                       this.availableProducts = productBean.getAvailableProducts();
+               } catch (final NamingException e) {
+                       // Continued to throw
+                       throw new FacesException(e);
+               }
+       }
+
+       @Override
+       public List<Category> getAllCategories () throws FacesException {
+               // Return it
+               // TODO Find something better here to prevent warning
+               return Collections.unmodifiableList(this.categories);
+       }
+
+       @Override
+       public List<Category> getAllCategoriesParent () throws FaceletException {
+               // Get regular list
+               List<Category> deque = new LinkedList<>();
+
+               // Create fake entry
+               Category fake = new ProductCategory(0L, this.getMessageStringFromKey("ADMIN_CATEGORY_HAS_NO_PARENT"), 0L); //NOI18N
+
+               // Add it
+               deque.add(fake);
+
+               // Add all
+               deque.addAll(this.getAllCategories());
+
+               // Return it
+               return deque;
+       }
+
+       @Override
+       public List<Product> getAvailableProducts () throws FacesException {
+               // Return it
+               // TODO Find something better here to prevent warning
+               return Collections.unmodifiableList(this.availableProducts);
+       }
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebController.java b/src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebController.java
new file mode 100644 (file)
index 0000000..efdadb2
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * 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.shop;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.faces.view.facelets.FaceletException;
+import org.mxchange.jshopcore.model.category.Category;
+import org.mxchange.jshopcore.model.product.Product;
+
+/**
+ * An interface for the shop
+ *
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface ShopWebController extends Serializable {
+
+       /**
+        * Adds given category to the "cached" instance
+        *
+        * @param category Category instance
+        */
+       public void addCategory (final Category category);
+
+       /**
+        * Adds given product to the "cached" instance
+        *
+        * @param product Product instance
+        */
+       public void addProduct (final Product product);
+
+       /**
+        * Some "getter" for a linked list of only available products
+        * 
+        * @return Only available products
+        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
+        */
+       public List<Product> getAvailableProducts () throws FaceletException;
+
+       /**
+        * Some "getter" for a linked list of all categories
+        *
+        * @return All categories
+        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
+        */
+       public List<Category> getAllCategories () throws FaceletException;
+
+       /**
+        * Some "getter" for a linked list of all categories including "Has no
+        * parent" fake category.
+        *
+        * @return All categories
+        * @throws javax.faces.view.facelets.FaceletException If anything went wrong
+        */
+       public List<Category> getAllCategoriesParent () throws FaceletException;
+}