2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.pizzaapplication.beans.controller;
19 import java.rmi.RemoteException;
20 import java.util.Deque;
21 import java.util.Iterator;
22 import javax.faces.FacesException;
23 import org.mxchange.jshop.beans.FrameworkBean;
24 import org.mxchange.jshop.category.Category;
25 import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException;
26 import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException;
27 import org.mxchange.jshop.product.Product;
31 * @author Roland Haeder
33 public interface PizzaBean extends FrameworkBean {
35 * Initializes this instance
37 * @throws FacesException If something was wrong
39 public void init () throws FacesException;
42 * Some "getter" for an iterator of only available products
44 * @return Only available products
45 * @throws java.rmi.RemoteException If anything went wrong
47 public Iterator<Product> getAvailableProductsIterator () throws RemoteException;
50 * Some "getter" for an iterator of all products
52 * @return All products
53 * @throws java.rmi.RemoteException If anything went wrong
55 public Iterator<Product> getAllProductsIterator () throws RemoteException;
58 * Some "getter" for an iterator of all categories
60 * @return All categories
61 * @throws java.rmi.RemoteException If anything went wrong
63 public Iterator<Category> getAllCategoriesIterator () throws RemoteException;
66 * Some "getter" for a linked list of only available products
68 * @return Only available products
69 * @throws java.rmi.RemoteException If anything went wrong
71 public Deque<Product> getAvailableProducts () throws RemoteException;
74 * Some "getter" for a linked list of all products
76 * @return All products
77 * @throws java.rmi.RemoteException If anything went wrong
79 public Deque<Product> getAllProducts () throws RemoteException;
82 * Some "getter" for a linked list of all categories
84 * @return All categories
85 * @throws java.rmi.RemoteException If anything went wrong
87 public Deque<Category> getAllCategories () throws RemoteException;
90 * Generates a link for category's parent category. If none is given, the method will return only a small
93 * @param category Category instance
94 * @return HTML link for category's parent category
95 * @deprecated Old lost code
98 public String generateLinkForParent (final Category category);
101 * Checks if given Product instance is available and returns a printable
102 * (human-readable) string.
104 * @param product Product instance to check
105 * @return Human-readable version of product availability
106 * @deprecated Old lost code
109 public String getPrintableProductAvailability (final Product product);
112 * Returns a printable (human-readable) string of product's category
114 * @param product Product instance to check
115 * @return Human-readable version of product availability
116 * @throws java.rmi.RemoteException If something unexpected happened
117 * @deprecated Old lost code
120 public String getPrintableProduktCategory (final Product product) throws RemoteException;
123 * Adds given category data from request to database
125 * @param category Category instance
126 * @throws java.rmi.RemoteException If something unexpected happened
127 * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException If the given title is already used
129 public void doAdminAddCategory (final Category category) throws RemoteException, CategoryTitleAlreadyUsedException;
132 * Adds given product data from request to database
134 * @param product Product instance
135 * @throws java.rmi.RemoteException If something unexpected happened
136 * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the given product title is already used
138 public void doAdminAddProduct (final Product product) throws RemoteException, ProductTitleAlreadyUsedException;
141 * Handles admin product form requests
143 * @throws RemoteException If something unexpected happened
144 * @deprecated Old lost code
147 public void doAdminHandleProductForms () throws RemoteException;
150 * Handles admin category form requests
152 * @throws RemoteException If something unexpected happened
153 * @deprecated Old lost code
156 public void doAdminHandleCategoryForms () throws RemoteException;