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.item.AddableBasketItem;
28 import org.mxchange.jshop.product.Product;
32 * @author Roland Haeder
34 public interface PizzaBean extends FrameworkBean {
36 * Initializes this instance
38 * @throws FacesException If something was wrong
40 public void init () throws FacesException;
43 * Some "getter" for an iterator of only available products
45 * @return Only available products
46 * @throws java.rmi.RemoteException If anything went wrong
48 public Iterator<Product> getAvailableProductsIterator () throws RemoteException;
51 * Some "getter" for an iterator of all products
53 * @return All products
54 * @throws java.rmi.RemoteException If anything went wrong
56 public Iterator<Product> getAllProductsIterator () throws RemoteException;
59 * Some "getter" for an iterator of all categories
61 * @return All categories
62 * @throws java.rmi.RemoteException If anything went wrong
64 public Iterator<Category> getAllCategoriesIterator () throws RemoteException;
67 * Some "getter" for a linked list of only available products
69 * @return Only available products
70 * @throws java.rmi.RemoteException If anything went wrong
72 public Deque<Product> getAvailableProducts () throws RemoteException;
75 * Some "getter" for a linked list of all products
77 * @return All products
78 * @throws java.rmi.RemoteException If anything went wrong
80 public Deque<Product> getAllProducts () throws RemoteException;
83 * Some "getter" for a linked list of all categories
85 * @return All categories
86 * @throws java.rmi.RemoteException If anything went wrong
88 public Deque<Category> getAllCategories () throws RemoteException;
91 * Generates a link for category's parent category. If none is given, the method will return only a small
94 * @param category Category instance
95 * @return HTML link for category's parent category
96 * @deprecated Old lost code
99 public String generateLinkForParent (final Category category);
102 * Checks if given Product instance is available and returns a printable
103 * (human-readable) string.
105 * @param product Product instance to check
106 * @return Human-readable version of product availability
107 * @deprecated Old lost code
110 public String getPrintableProduktAvailability (final Product product);
113 * Returns a printable (human-readable) string of product's category
115 * @param product Product instance to check
116 * @return Human-readable version of product availability
117 * @throws java.rmi.RemoteException If something unexpected happened
118 * @deprecated Old lost code
121 public String getPrintableProduktCategory (final Product product) throws RemoteException;
124 * Adds given category data from request to database
126 * @param category Category instance
127 * @throws java.rmi.RemoteException If something unexpected happened
128 * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException If the given title is already used
130 public void doAdminAddCategory (final Category category) throws RemoteException, CategoryTitleAlreadyUsedException;
133 * Adds given product data from request to database
135 * @param product Product instance
136 * @throws java.rmi.RemoteException If something unexpected happened
137 * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the given product title is already used
139 public void doAdminAddProduct (final Product product) throws RemoteException, ProductTitleAlreadyUsedException;
142 * Handles admin product form requests
144 * @throws RemoteException If something unexpected happened
145 * @deprecated Old lost code
148 public void doAdminHandleProductForms () throws RemoteException;
151 * Handles admin category form requests
153 * @throws RemoteException If something unexpected happened
154 * @deprecated Old lost code
157 public void doAdminHandleCategoryForms () throws RemoteException;
160 * Some "getter" for a product from given item
161 * @param item Item instance
162 * @return A Product instance
163 * @throws java.rmi.RemoteException If something bad happens
165 public Product getProduct (final AddableBasketItem item) throws RemoteException;