]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 13:32:07 +0000 (15:32 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 13:32:07 +0000 (15:32 +0200)
- auto-reformatted many files
- some getter names have changed, fixed here
- parentId is no longer in Category objects, need to get parentCategory.categoryId
- updated jars
Signed-off-by:Roland Häder <roland@mxchange.org>

24 files changed:
lib/jcore-logger-lib.jar
lib/jcore.jar
lib/jcoreee.jar
lib/jshop-core.jar
lib/jshop-ee-lib.jar
src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebController.java
src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebBean.java
src/java/org/mxchange/pizzaapplication/beans/category/AdminCategoryWebController.java
src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java
src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebController.java
src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java
src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java
src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebController.java
src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebBean.java
src/java/org/mxchange/pizzaapplication/beans/shop/ShopWebController.java
src/java/org/mxchange/pizzaapplication/servlet/receipt/PdfReceiptServlet.java
web/WEB-INF/templates/admin/admin_category_selection_box.tpl
web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl
web/WEB-INF/templates/basket/total_sum.tpl
web/admin/category.xhtml
web/admin/product.xhtml
web/errorHandler.xhtml
web/index.xhtml

index ca19891b4bbe2d8a1ad1f9a199727023c9fd0812..ccc4dab72ddc6458cad72726cde8399e9067e11c 100644 (file)
Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ
index 57dc0a07e9ad739e6f82121851bb5ecdf7291de2..c0bdbee1e02a1d6bf6ef6af3c07a3bd7c43e06fe 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index 884b0d96ea6bf9165d0544762c053be8168aa340..d550fe018c1a514bef85d93ba1e622042048b6e6 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index 90365fe70f990fc5a9e3fae53e46f57c1d9163a5..3e77fa799e8b8ef8e53f83888d9832a67c5aa1b1 100644 (file)
Binary files a/lib/jshop-core.jar and b/lib/jshop-core.jar differ
index deaa0afb02ad1cf83efb7868e15b8f70c4236913..287302188b7c28bb7c37d5345bad592da56eb884 100644 (file)
Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ
index 5421d9a16745f1707b857c54541b61d8e5472d29..b7fce984529ce2574ecd36f81a2d02825e3db3eb 100644 (file)
@@ -29,41 +29,57 @@ import org.mxchange.jshopcore.model.product.Product;
 public interface BasketWebController extends Serializable {
 
        /**
-        * Clears this basket instance
+        * Adds given product instance to basket by adding amount from form data to
+        * it.
+        *
+        * @param product Product instance to add
+        * @return Redirect target or null
         */
-       public void clear ();
+       public String addItem (final Product product);
 
        /**
-        * Checks whether the basket is empty
+        * Gets for all added items
         *
-        * @return Whether the basket is empty
+        * @return A list of all added items
         */
-       public boolean isEmpty ();
+       public List<AddableBasketItem> allItems ();
 
        /**
-        * Checks whether the basket has items in it. This method is wrapper to
-        * isEmpty()
+        * Calculates total price (no tax added) of current item. If no current item
+        * is set and no amount, a NPE is thrown.
         *
-        * @return Whether the basket is empty
+        * @return Current item's total price
         */
-       public boolean hasItems ();
+       public Float calculateCurrentItemPrice ();
 
        /**
-        * Checks whether the currently set product is added in basked
+        * Calculates total price (no tax added) for given item.
         *
-        * @param product Product instance
-        * @return Whether the product is added
+        * @param item Item instance to calculate total price for
+        * @return Total price
         */
-       public boolean isProductAdded (final Product product);
+       public Float calculateItemPrice (final AddableBasketItem item);
 
        /**
-        * Adds given product instance to basket by adding amount from form data to
-        * it.
+        * Calculates total sum (no tax added) for all items
         *
-        * @param product Product instance to add
-        * @return Redirect target or null
+        * @return Total price of all items
         */
-       public String addItem (final Product product);
+       public Float calculateTotalPrice ();
+
+       /**
+        * Changes given item instance's amount in basket and redirects to proper
+        * page. If the item is not found, another "error" page is called.
+        *
+        * @param item Item instance to change
+        * @return Page redirection
+        */
+       public String changeItem (final AddableBasketItem item);
+
+       /**
+        * Clears this basket instance
+        */
+       public void clear ();
 
        /**
         * Getter for item amount property
@@ -94,27 +110,14 @@ public interface BasketWebController extends Serializable {
        public void setCurrentItem (final AddableBasketItem currentItem);
 
        /**
-        * Calculates total price (no tax added) of current item. If no current item
-        * is set and no amount, a NPE is thrown.
-        *
-        * @return Current item's total price
-        */
-       public Float calculateCurrentItemPrice ();
-
-       /**
-        * Calculates total price (no tax added) for given item.
-        *
-        * @param item Item instance to calculate total price for
-        * @return Total price
-        */
-       public Float calculateItemPrice (final AddableBasketItem item);
-
-       /**
-        * Calculates total sum (no tax added) for all items
+        * Some getter for item amount of given product. This method requires a full
+        * iteration over all items in the basket to look for proper product
+        * instance.
         *
-        * @return Total price of all items
+        * @param product Product instance
+        * @return Item amount of given product
         */
-       public Float calculateTotalPrice ();
+       public Long getItemAmount (final Product product);
 
        /**
         * Getter for last entry
@@ -131,35 +134,32 @@ public interface BasketWebController extends Serializable {
        public int getLastNumRows ();
 
        /**
-        * Gets for all added items
+        * Checks whether the basket has items in it. This method is wrapper to
+        * isEmpty()
         *
-        * @return A list of all added items
+        * @return Whether the basket is empty
         */
-       public List<AddableBasketItem> allItems ();
+       public boolean hasItems ();
 
        /**
-        * Some getter for item amount of given product. This method requires a full
-        * iteration over all items in the basket to look for proper product
-        * instance.
-        * 
-        * @param product Product instance
-        * @return Item amount of given product
+        * Checks whether the basket is empty
+        *
+        * @return Whether the basket is empty
         */
-       public Long getItemAmount (final Product product);
+       public boolean isEmpty ();
 
        /**
-        * Changes given item instance's amount in basket and redirects to proper
-        * page. If the item is not found, another "error" page is called.
+        * Checks whether the currently set product is added in basked
         *
-        * @param item Item instance to change
-        * @return Page redirection
+        * @param product Product instance
+        * @return Whether the product is added
         */
-       public String changeItem (final AddableBasketItem item);
+       public boolean isProductAdded (final Product product);
 
        /**
         * Outputs last added item in the basket.
-        * 
+        *
         * @return Last added item
         */
-       public String outputLastAddedItem();
+       public String outputLastAddedItem ();
 }
index 687ada65dad3cac465f652b6fc20774fe9d49fa2..2db3a58ea0de6ee277cf3b9b6458568182531277 100644 (file)
@@ -35,9 +35,10 @@ import org.mxchange.pizzaapplication.beans.shop.ShopWebController;
  *
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named("admin_category")
+@Named ("admin_category")
 @RequestScoped
 public class AdminCategoryWebBean implements AdminCategoryWebController {
+
        /**
         * Serial number
         */
@@ -62,9 +63,9 @@ public class AdminCategoryWebBean implements AdminCategoryWebController {
        private String title;
 
        /**
-        * Parent id
+        * Parent category
         */
-       private Long parentId;
+       private Category parentCategory;
 
        /**
         * Default constructor
@@ -88,7 +89,7 @@ public class AdminCategoryWebBean implements AdminCategoryWebController {
                try {
                        // Create category
                        Category category = new ProductCategory();
-                       category.setParentId(this.getParentId());
+                       category.setParentCategory(this.getParentCategory());
                        category.setTitle(this.getTitle());
 
                        // Deligate to remote bean
@@ -113,12 +114,12 @@ public class AdminCategoryWebBean implements AdminCategoryWebController {
        }
 
        @Override
-       public Long getParentId () {
-               return this.parentId;
+       public Category getParentCategory () {
+               return this.parentCategory;
        }
 
        @Override
-       public void setParentId (final Long parentId) {
-               this.parentId = parentId;
+       public void setParentCategory (final Category parentCategory) {
+               this.parentCategory = parentCategory;
        }
 }
index 545550ad2c1fcb2feb5143c5e9411f8fa1777c8d..8ea0703d1910067c384b7cb90b649bce7a9ebf1e 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.pizzaapplication.beans.category;
 
 import javax.faces.view.facelets.FaceletException;
+import org.mxchange.jshopcore.model.category.Category;
 
 /**
  * An interface for product controllers for "ADMIN" role
@@ -28,35 +29,36 @@ public interface AdminCategoryWebController {
        /**
         * Adds given category data from request to database
         *
-        * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
+        * @throws javax.faces.view.facelets.FaceletException If something
+        * unexpected happened
         */
        public void addCategory () throws FaceletException;
 
        /**
-        * Getter for title
+        * Getter for parent id
         *
-        * @return the title
+        * @return Parent id
         */
-       public String getTitle ();
+       public Category getParentCategory ();
 
        /**
-        * Setter for title
+        * Setter for parent category
         *
-        * @param title the title to set
+        * @param parentCategory Parent category to set
         */
-       public void setTitle (final String title);
+       public void setParentCategory (final Category parentCategory);
 
        /**
-        * Getter for parent id
+        * Getter for title
         *
-        * @return Parent id
+        * @return the title
         */
-       public Long getParentId ();
+       public String getTitle ();
 
        /**
-        * Setter for parent id
+        * Setter for title
         *
-        * @param parentId Parent id to set
+        * @param title the title to set
         */
-       public void setParentId (final Long parentId);
+       public void setTitle (final String title);
 }
index c85fdb0de378b66142eb260c004d3342202747d0..726fabedd100c2a57833285bf94f21b86dbbfd83 100644 (file)
@@ -69,7 +69,7 @@ public class CheckoutWebBean implements CheckoutWebController {
         * Queue instance
         */
        private Queue queue;
-       
+
        /**
         * Session instance
         */
index f314f02b354e29157ff9b2b9e3cd1b81298c10cf..a3250207d9cf7273a771ee94d74c9260cc407f17 100644 (file)
@@ -25,9 +25,10 @@ import org.mxchange.jshopcore.model.customer.Customer;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public interface CheckoutWebController extends Serializable {
+
        /**
         * Runs the actual checkout and returns a proper page redirection target.
-        * 
+        *
         * @return Page redirection target
         */
        public String doCheckout ();
index 32638065ab7de5e34a5b802839131573fecef2f2..b9ccd5cc34f29ecca2b2a0e76be371e96e87f787 100644 (file)
@@ -23,7 +23,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcore.model.contact.Contact;
-import org.mxchange.jcore.model.contact.CustomerContact;
+import org.mxchange.jcore.model.contact.UserContact;
 import org.mxchange.jcore.model.contact.gender.Gender;
 import org.mxchange.jshopcore.model.customer.Customer;
 import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote;
@@ -34,18 +34,15 @@ import org.mxchange.jshopcore.model.customer.ShopCustomer;
  *
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named("customerController")
+@Named ("customerController")
 @SessionScoped
 public class CustomerWebBean implements CustomerWebController {
+
        /**
         * Serial number
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Remote customer bean
-        */
-       private final CustomerSessionBeanRemote customerBean;
 
        /////////////////////// Properties /////////////////////
        /**
@@ -72,16 +69,15 @@ public class CustomerWebBean implements CustomerWebController {
         * Country code
         */
        private String countryCode;
-
        /**
-        * Email address
+        * Remote customer bean
         */
-       private String emailAddress;
+       private final CustomerSessionBeanRemote customerBean;
 
        /**
-        * Gender instance
+        * Email address
         */
-       private Gender gender;
+       private String emailAddress;
 
        /**
         * Family name
@@ -98,6 +94,11 @@ public class CustomerWebBean implements CustomerWebController {
         */
        private String firstName;
 
+       /**
+        * Gender instance
+        */
+       private Gender gender;
+
        /**
         * House number
         */
@@ -150,11 +151,7 @@ public class CustomerWebBean implements CustomerWebController {
                Customer customer = new ShopCustomer();
 
                // Create new contact
-               Contact contact = new CustomerContact();
-               contact.setGender(this.getGender());
-               contact.setFirstName(this.getFirstName());
-               contact.setFamilyName(this.getFamilyName());
-               contact.setCompanyName(this.getCompanyName());
+               Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName(), this.getCompanyName());
                contact.setStreet(this.getStreet());
                contact.setHouseNumber(this.getHouseNumber());
                contact.setZipCode(this.getZipCode());
@@ -174,103 +171,103 @@ public class CustomerWebBean implements CustomerWebController {
        }
 
        @Override
-       public Gender getGender () {
-               return this.gender;
+       public String getCellphoneNumber () {
+               return this.cellphoneNumber;
        }
 
        @Override
-       public void setGender (final Gender gender) {
-               this.gender = gender;
+       public void setCellphoneNumber (final String cellphoneNumber) {
+               this.cellphoneNumber = cellphoneNumber;
        }
 
        @Override
-       public String getCompanyName () {
-               return this.companyName;
+       public String getCity () {
+               return this.city;
        }
 
        @Override
-       public void setCompanyName (final String companyName) {
-               this.companyName = companyName;
+       public void setCity (final String city) {
+               this.city = city;
        }
 
        @Override
-       public String getFirstName () {
-               return this.firstName;
+       public String getCompanyName () {
+               return this.companyName;
        }
 
        @Override
-       public void setFirstName (final String firstName) {
-               this.firstName = firstName;
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
        }
 
        @Override
-       public String getFamilyName () {
-               return this.familyName;
+       public String getCountryCode () {
+               return this.countryCode;
        }
 
        @Override
-       public void setFamilyName (final String familyName) {
-               this.familyName = familyName;
+       public void setCountryCode (final String countryCode) {
+               this.countryCode = countryCode;
        }
 
        @Override
-       public String getStreet () {
-               return this.street;
+       public String getEmailAddress () {
+               return this.emailAddress;
        }
 
        @Override
-       public void setStreet (final String street) {
-               this.street = street;
+       public void setEmailAddress (final String emailAddress) {
+               this.emailAddress = emailAddress;
        }
 
        @Override
-       public Long getHouseNumber () {
-               return this.houseNumber;
+       public String getFamilyName () {
+               return this.familyName;
        }
 
        @Override
-       public void setHouseNumber (final Long houseNumber) {
-               this.houseNumber = houseNumber;
+       public void setFamilyName (final String familyName) {
+               this.familyName = familyName;
        }
 
        @Override
-       public Long getZipCode () {
-               return this.zipCode;
+       public String getFaxNumber () {
+               return this.faxNumber;
        }
 
        @Override
-       public void setZipCode (final Long zipCode) {
-               this.zipCode = zipCode;
+       public void setFaxNumber (final String faxNumber) {
+               this.faxNumber = faxNumber;
        }
 
        @Override
-       public String getCity () {
-               return this.city;
+       public String getFirstName () {
+               return this.firstName;
        }
 
        @Override
-       public void setCity (final String city) {
-               this.city = city;
+       public void setFirstName (final String firstName) {
+               this.firstName = firstName;
        }
 
        @Override
-       public String getCountryCode () {
-               return this.countryCode;
+       public Gender getGender () {
+               return this.gender;
        }
 
        @Override
-       public void setCountryCode (final String countryCode) {
-               this.countryCode = countryCode;
+       public void setGender (final Gender gender) {
+               this.gender = gender;
        }
 
        @Override
-       public String getEmailAddress () {
-               return this.emailAddress;
+       public Long getHouseNumber () {
+               return this.houseNumber;
        }
 
        @Override
-       public void setEmailAddress (final String emailAddress) {
-               this.emailAddress = emailAddress;
+       public void setHouseNumber (final Long houseNumber) {
+               this.houseNumber = houseNumber;
        }
 
        @Override
@@ -284,23 +281,23 @@ public class CustomerWebBean implements CustomerWebController {
        }
 
        @Override
-       public String getFaxNumber () {
-               return this.faxNumber;
+       public String getStreet () {
+               return this.street;
        }
 
        @Override
-       public void setFaxNumber (final String faxNumber) {
-               this.faxNumber = faxNumber;
+       public void setStreet (final String street) {
+               this.street = street;
        }
 
        @Override
-       public String getCellphoneNumber () {
-               return this.cellphoneNumber;
+       public Long getZipCode () {
+               return this.zipCode;
        }
 
        @Override
-       public void setCellphoneNumber (final String cellphoneNumber) {
-               this.cellphoneNumber = cellphoneNumber;
+       public void setZipCode (final Long zipCode) {
+               this.zipCode = zipCode;
        }
 
        @Override
index 554e9c1dd2f6df6f54bf503284c1c836fd7c1ab2..cc6c07eab110efa8cbc6a2560054d74795447401 100644 (file)
@@ -35,144 +35,144 @@ public interface CustomerWebController extends Serializable {
        public Customer createCustomerInstance ();
 
        /**
-        * Gender of the contact
+        * Cellphone number
         *
-        * @return the gender
+        * @return the cellphoneNumber
         */
-       public Gender getGender ();
+       public String getCellphoneNumber ();
 
        /**
-        * Gender of the contact
+        * Cellphone number
         *
-        * @param gender the gender to set
+        * @param cellphoneNumber the cellphoneNumber to set
         */
-       public void setGender (final Gender gender);
+       public void setCellphoneNumber (final String cellphoneNumber);
 
        /**
-        * Company name
+        * City
         *
-        * @return the companyName
+        * @return the city
         */
-       public String getCompanyName ();
+       public String getCity ();
 
        /**
-        * Company name
+        * City
         *
-        * @param companyName the companyName to set
+        * @param city the city to set
         */
-       public void setCompanyName (final String companyName);
+       public void setCity (final String city);
 
        /**
-        * First name
+        * Company name
         *
-        * @return the first name
+        * @return the companyName
         */
-       public String getFirstName ();
+       public String getCompanyName ();
 
        /**
-        * First name
+        * Company name
         *
-        * @param firstName the first name to set
+        * @param companyName the companyName to set
         */
-       public void setFirstName (final String firstName);
+       public void setCompanyName (final String companyName);
 
        /**
-        * Family name
+        * Country code
         *
-        * @return the familyName
+        * @return the countryCode
         */
-       public String getFamilyName ();
+       public String getCountryCode ();
 
        /**
-        * Family name
+        * Country code
         *
-        * @param familyName the familyName to set
+        * @param countryCode the countryCode to set
         */
-       public void setFamilyName (final String familyName);
+       public void setCountryCode (final String countryCode);
 
        /**
-        * Street
+        * Email address
         *
-        * @return the street
+        * @return the emailAddress
         */
-       public String getStreet ();
+       public String getEmailAddress ();
 
        /**
-        * Street
+        * Email address
         *
-        * @param street the street to set
+        * @param emailAddress the emailAddress to set
         */
-       public void setStreet (final String street);
+       public void setEmailAddress (final String emailAddress);
 
        /**
-        * House number
+        * Family name
         *
-        * @return the houseNumber
+        * @return the familyName
         */
-       public Long getHouseNumber ();
+       public String getFamilyName ();
 
        /**
-        * House number
+        * Family name
         *
-        * @param houseNumber the houseNumber to set
+        * @param familyName the familyName to set
         */
-       public void setHouseNumber (final Long houseNumber);
+       public void setFamilyName (final String familyName);
 
        /**
-        * ZIP code
+        * Fax number
         *
-        * @return the zipCode
+        * @return the faxNumber
         */
-       public Long getZipCode ();
+       public String getFaxNumber ();
 
        /**
-        * ZIP code
+        * Fax number
         *
-        * @param zipCode the zipCode to set
+        * @param faxNumber the faxNumber to set
         */
-       public void setZipCode (final Long zipCode);
+       public void setFaxNumber (final String faxNumber);
 
        /**
-        * City
+        * First name
         *
-        * @return the city
+        * @return the first name
         */
-       public String getCity ();
+       public String getFirstName ();
 
        /**
-        * City
+        * First name
         *
-        * @param city the city to set
+        * @param firstName the first name to set
         */
-       public void setCity (final String city);
+       public void setFirstName (final String firstName);
 
        /**
-        * Country code
+        * Gender of the contact
         *
-        * @return the countryCode
+        * @return the gender
         */
-       public String getCountryCode ();
+       public Gender getGender ();
 
        /**
-        * Country code
+        * Gender of the contact
         *
-        * @param countryCode the countryCode to set
+        * @param gender the gender to set
         */
-       public void setCountryCode (final String countryCode);
+       public void setGender (final Gender gender);
 
        /**
-        * Email address
+        * House number
         *
-        * @return the emailAddress
+        * @return the houseNumber
         */
-       public String getEmailAddress ();
+       public Long getHouseNumber ();
 
        /**
-        * Email address
+        * House number
         *
-        * @param emailAddress the emailAddress to set
+        * @param houseNumber the houseNumber to set
         */
-       public void setEmailAddress (final String emailAddress);
+       public void setHouseNumber (final Long houseNumber);
 
        /**
         * Phone number
@@ -189,32 +189,32 @@ public interface CustomerWebController extends Serializable {
        public void setPhoneNumber (final String phoneNumber);
 
        /**
-        * Fax number
+        * Street
         *
-        * @return the faxNumber
+        * @return the street
         */
-       public String getFaxNumber ();
+       public String getStreet ();
 
        /**
-        * Fax number
+        * Street
         *
-        * @param faxNumber the faxNumber to set
+        * @param street the street to set
         */
-       public void setFaxNumber (final String faxNumber);
+       public void setStreet (final String street);
 
        /**
-        * Cellphone number
+        * ZIP code
         *
-        * @return the cellphoneNumber
+        * @return the zipCode
         */
-       public String getCellphoneNumber ();
+       public Long getZipCode ();
 
        /**
-        * Cellphone number
+        * ZIP code
         *
-        * @param cellphoneNumber the cellphoneNumber to set
+        * @param zipCode the zipCode to set
         */
-       public void setCellphoneNumber (final String cellphoneNumber);
+       public void setZipCode (final Long zipCode);
 
        /**
         * Checks whether all required personal data is set
index 29b26d0f9cf1c17434936d352a0f37df462e2e28..90fa3dea432d93f51a3c0cd2e77833c8f752f8d2 100644 (file)
@@ -30,7 +30,8 @@ public interface AdminProductWebController {
        /**
         * Adds given product data from request to database
         *
-        * @throws javax.faces.view.facelets.FaceletException If something unexpected happened
+        * @throws javax.faces.view.facelets.FaceletException If something
+        * unexpected happened
         */
        public void addProduct () throws FaceletException;
 
@@ -43,58 +44,58 @@ public interface AdminProductWebController {
        public List<Product> getAllProducts () throws FaceletException;
 
        /**
-        * Getter for product's title property
+        * Getter for product's available property
         *
-        * @return Product's title
+        * @return Product's available property
         */
-       public String getTitle ();
+       public Boolean getAvailable ();
 
        /**
-        * Setter for product's title property
-        * 
-        * @param title Product's title
+        * Setter for product's available property
+        *
+        * @param available Product's available property
         */
-       public void setTitle (final String title);
+       public void setAvailable (final Boolean available);
 
        /**
-        * Getter for product's price property
+        * Getter for product's category id
         *
-        * @return Product's price property
+        * @return Product's category id
         */
-       public Float getPrice ();
+       public Long getId ();
 
        /**
-        * Setter for product's price property
-        * 
-        * @param price Product's price property
+        * Setter for product's category id
+        *
+        * @param id Product's category id
         */
-       public void setPrice (final Float price);
+       public void setId (final Long id);
 
        /**
-        * Setter for product's available property
-        * 
-        * @param available Product's available property
+        * Getter for product's price property
+        *
+        * @return Product's price property
         */
-       public void setAvailable (final Boolean available);
+       public Float getPrice ();
 
        /**
-        * Getter for product's available property
-        * 
-        * @return Product's available property
+        * Setter for product's price property
+        *
+        * @param price Product's price property
         */
-       public Boolean getAvailable ();
+       public void setPrice (final Float price);
 
        /**
-        * Getter for product's category id
+        * Getter for product's title property
         *
-        * @return Product's category id
+        * @return Product's title
         */
-       public Long getId ();
+       public String getTitle ();
 
        /**
-        * Setter for product's category id
+        * Setter for product's title property
         *
-        * @param id Product's category id
+        * @param title Product's title
         */
-       public void setId (final Long id);
+       public void setTitle (final String title);
 }
index 07f2bd661f49c805e730f41711a4dac4fd20298f..a06cda1e8bd271640bfee217d2b8a6c95b836edc 100644 (file)
@@ -25,6 +25,7 @@ import org.mxchange.jshopcore.model.customer.Customer;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public interface ReceiptWebController extends Serializable {
+
        /**
         * Fetches last access key for given customer instance
         *
@@ -33,16 +34,16 @@ public interface ReceiptWebController extends Serializable {
        public String fetchAccessKey ();
 
        /**
-        * Setter for customer instamce
+        * Getter for customer instamce
         *
-        * @param customer Customer instance
+        * @return Customer instance
         */
-       public void setCustomer (final Customer customer);
+       public Customer getCustomer ();
 
        /**
-        * Getter for customer instamce
+        * Setter for customer instamce
         *
-        * @return Customer instance
+        * @param customer Customer instance
         */
-       public Customer getCustomer ();
+       public void setCustomer (final Customer customer);
 }
index 172c4bc6b4e990217453bb5993510769c8827486..9b233a734b51cef3697e7e66bc545386ab4ab1f0 100644 (file)
@@ -39,7 +39,7 @@ import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
  *
  * @author Roland Haeder<roland@mxchange.org>
  */
-@Named("controller")
+@Named ("controller")
 @ApplicationScoped
 public class ShopWebBean extends BaseEeSystem implements ShopWebController {
 
@@ -73,29 +73,6 @@ public class ShopWebBean extends BaseEeSystem implements ShopWebController {
                }
        }
 
-       @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
@@ -109,7 +86,7 @@ public class ShopWebBean extends BaseEeSystem implements ShopWebController {
                List<Category> deque = new LinkedList<>();
 
                // Create fake entry
-               Category fake = new ProductCategory(0L, this.getMessageStringFromKey("ADMIN_CATEGORY_HAS_NO_PARENT"), 0L); //NOI18N
+               Category fake = new ProductCategory(0L, this.getMessageStringFromKey("ADMIN_CATEGORY_HAS_NO_PARENT"), null); //NOI18N
 
                // Add it
                deque.add(fake);
@@ -127,4 +104,27 @@ public class ShopWebBean extends BaseEeSystem implements ShopWebController {
                // TODO Find something better here to prevent warning
                return Collections.unmodifiableList(this.availableProducts);
        }
+       
+       @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);
+               }
+       }
 }
index efdadb289d7f3d3a79a7f5cc7bb3c6e29bc68663..4de37aa2f279d1d2921894ed1593b34bb8280c93 100644 (file)
@@ -43,14 +43,6 @@ public interface ShopWebController extends Serializable {
         */
        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
         *
@@ -67,4 +59,12 @@ public interface ShopWebController extends Serializable {
         * @throws javax.faces.view.facelets.FaceletException If anything went wrong
         */
        public List<Category> getAllCategoriesParent () throws FaceletException;
+
+       /**
+        * 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;
 }
index 944bfd0c4f21f492d9b330cd6fd57dae1cb3943a..9e2cf9dbe20e4900044d81416d11b23e5fa9a299 100644 (file)
@@ -62,6 +62,11 @@ public class PdfReceiptServlet extends HttpServlet {
                }
        }
 
+       @Override
+       public String getServletInfo () {
+               return "Produces an official recipit as PDF file for given access key.";
+       }
+
        @Override
        protected void doGet (final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
                // Is the key set?
@@ -83,9 +88,4 @@ public class PdfReceiptServlet extends HttpServlet {
                this.doGet(request, response);
        }
 
-       @Override
-       public String getServletInfo () {
-               return "Produces an official recipit as PDF file for given access key.";
-       }
-
 }
index 6841d02775bb612035c7ea03a075662bf3a25af2..3141b802cc0179508c30b7fc625872b6cc40581a 100644 (file)
@@ -5,7 +5,7 @@
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
        <h:selectOneMenu class="select" id="parentId" value="#{admin_product.id}" required="true" requiredMessage="#{msg.ADMIN_CATEGORY_MUST_BE_SELECTED}">
-               <f:selectItems value="#{controller.allCategories}" var="cat" itemValue="#{cat.id}" itemLabel="#{cat.title}" />
+               <f:selectItems value="#{controller.allCategories}" var="cat" itemValue="#{cat.categoryId}" itemLabel="#{cat.title}" />
                <f:validateLongRange for="parentId" minimum="0" maximum="1000" />
        </h:selectOneMenu>
 </ui:composition>
index 9d87117a67c4aa8616120bce9ab13c2dbe766e98..ef9e71004c8f9df70ec12c5e1a350c339a9507ba 100644 (file)
@@ -4,7 +4,7 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">
 
-       <h:selectOneMenu class="select" id="parentId" value="#{admin_category.parentId}" required="true" requiredMessage="#{msg.ADMIN_PARENT_CATEGORY_CANNOT_BE_NULL}">
-               <f:selectItems value="#{controller.allCategoriesParent}" var="parent_category" itemValue="#{parent_category.id}" itemLabel="#{parent_category.title}" />
+       <h:selectOneMenu class="select" id="parentId" value="#{admin_category.parentCategory}" required="true" requiredMessage="#{msg.ADMIN_PARENT_CATEGORY_CANNOT_BE_NULL}">
+               <f:selectItems value="#{controller.allCategoriesParent}" var="parent_category" itemValue="#{parent_category.categoryId}" itemLabel="#{parent_category.title}" />
        </h:selectOneMenu>
 </ui:composition>
index c350d77c282188f9b3105bf2aab17b8726bcf727..274f9a496608de75156fe7d3042eac1b90b3e85d 100644 (file)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <ui:composition
-         xmlns="http://www.w3.org/1999/xhtml"
-         xmlns:ui="http://java.sun.com/jsf/facelets"
-         xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://java.sun.com/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
 
        <ui:fragment rendered="#{basketController.hasItems()}">
                <div class="totals_container">
index 8db504cca9cd95e0aab2e9ede999b67979ea94cc..021b989a55e10e6d408234e48ba38d42cff91857 100644 (file)
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.ADMIN_ENTER_CATEGORY_TITLE}</f:facet>
-                                                       #{cat.title}
+                                                               #{cat.title}
                                                </h:column>
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.ADMIN_PARENT_CATEGORY}</f:facet>
-                                                       #{cat.parentId}
+                                                               #{cat.parentCategory.categoryId}
                                                </h:column>
                                        </h:dataTable>
 
 
                        <div class="para">
                                <h:form acceptcharset="utf-8" id="add_category">
-                               <div class="table">
-                                       <div class="table_header">
-                                               #{msg.ADMIN_ADD_CATEGORY_TITLE}
-                                       </div>
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       #{msg.ADMIN_ADD_CATEGORY_TITLE}
+                                               </div>
 
-                                       <fieldset id="product_data">
-                                               <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
+                                               <fieldset id="product_data">
+                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.ADMIN_ENTER_CATEGORY_TITLE}
-                                                               <div class="tiny">#{msg.ADMIN_ENTER_CATEGORY_TITLE_EXAMPLE}</div>
-                                                       </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_ENTER_CATEGORY_TITLE}
+                                                                       <div class="tiny">#{msg.ADMIN_ENTER_CATEGORY_TITLE_EXAMPLE}</div>
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <h:inputText class="input" id="title" value="#{admin_category.title}" size="10" maxlength="255" required="true" />
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="title" value="#{admin_category.title}" size="10" maxlength="255" required="true" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
                                                        </div>
 
-                                                       <div class="clear"></div>
-                                               </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_PARENT_CATEGORY}
+                                                               </div>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.ADMIN_PARENT_CATEGORY}
-                                                       </div>
+                                                               <div class="table_right">
+                                                                       <ui:include src="/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl" />
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <ui:include src="/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl" />
+                                                               <div class="clear"></div>
                                                        </div>
+                                               </fieldset>
 
-                                                       <div class="clear"></div>
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" action="#{admin_category.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
                                                </div>
-                                       </fieldset>
-
-                                       <div class="table_footer">
-                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton class="submit" type="submit" action="#{admin_category.addCategory()}" value="#{msg.ADMIN_BUTTON_ADD_CATEGORY}" />
                                        </div>
-                               </div>
                                </h:form>
                        </div>
                </ui:define>
index c1427f2f9d870ccf730a2df9644c61f6d2e88ee9..33b0a9d71e6bfff0af1331522078abab27d2c2b5 100644 (file)
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.ADMIN_ENTER_PRODUCT_TITLE}</f:facet>
-                                                       #{product.title}
+                                                               #{product.title}
                                                </h:column>
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.SINGLE_ITEM_PRICE}</f:facet>
-                                                       #{product.price}
+                                                               #{product.price}
                                                </h:column>
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.CATEGORY}</f:facet>
-                                                       #{product.categoryId}
+                                                               #{product.categoryId}
                                                </h:column>
 
                                                <h:column>
                                                        <f:facet name="header">#{msg.IS_AVAILABLE}</f:facet>
-                                                       #{product.available}
+                                                               #{product.available}
                                                </h:column>
                                        </h:dataTable>
 
 
                        <div class="para">
                                <h:form acceptcharset="utf-8" id="add_category">
-                               <div class="table">
-                                       <div class="table_header">
-                                               #{msg.ADMIN_ADD_PRODUCT_TITLE}
-                                       </div>
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       #{msg.ADMIN_ADD_PRODUCT_TITLE}
+                                               </div>
 
-                                       <fieldset id="product_data">
-                                               <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
+                                               <fieldset id="product_data">
+                                                       <legend>#{msg.PLEASE_FILL_ALL_FIELDS}</legend>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.ADMIN_ENTER_PRODUCT_TITLE}
-                                                               <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE}</div>
-                                                       </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.ADMIN_ENTER_PRODUCT_TITLE}
+                                                                       <div class="tiny">#{msg.ADMIN_ENTER_PRODUCT_TITLE_EXAMPLE}</div>
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <h:inputText class="input" id="title" size="10" maxlength="255" required="true" value="#{admin_product.title}" />
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="title" size="10" maxlength="255" required="true" value="#{admin_product.title}" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
                                                        </div>
 
-                                                       <div class="clear"></div>
-                                               </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.SINGLE_ITEM_PRICE}
+                                                                       <div class="tiny">(z.B. <em>50.0</em>)</div>
+                                                               </div>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.SINGLE_ITEM_PRICE}
-                                                               <div class="tiny">(z.B. <em>50.0</em>)</div>
-                                                       </div>
+                                                               <div class="table_right">
+                                                                       <h:inputText class="input" id="price" size="10" maxlength="255" required="true" value="#{admin_product.price}" />
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <h:inputText class="input" id="price" size="10" maxlength="255" required="true" value="#{admin_product.price}" />
+                                                               <div class="clear"></div>
                                                        </div>
 
-                                                       <div class="clear"></div>
-                                               </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.CATEGORY}
+                                                               </div>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.CATEGORY}
-                                                       </div>
+                                                               <div class="table_right">
+                                                                       <ui:include src="/WEB-INF/templates/admin/admin_category_selection_box.tpl" />
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <ui:include src="/WEB-INF/templates/admin/admin_category_selection_box.tpl" />
+                                                               <div class="clear"></div>
                                                        </div>
 
-                                                       <div class="clear"></div>
-                                               </div>
+                                                       <div class="table_row">
+                                                               <div class="table_left">
+                                                                       #{msg.IS_AVAILABLE}
+                                                               </div>
 
-                                               <div class="table_row">
-                                                       <div class="table_left">
-                                                               #{msg.IS_AVAILABLE}
-                                                       </div>
+                                                               <div class="table_right">
+                                                                       <h:selectOneListbox required="true" id="available" value="#{admin_product.available}" size="1" class="select">
+                                                                               <f:selectItem itemValue="true" itemLabel="#{msg.YES}" />
+                                                                               <f:selectItem itemValue="false" itemLabel="#{msg.NO}" />
+                                                                       </h:selectOneListbox>
+                                                               </div>
 
-                                                       <div class="table_right">
-                                                               <h:selectOneListbox required="true" id="available" value="#{admin_product.available}" size="1" class="select">
-                                                                       <f:selectItem itemValue="true" itemLabel="#{msg.YES}" />
-                                                                       <f:selectItem itemValue="false" itemLabel="#{msg.NO}" />
-                                                               </h:selectOneListbox>
+                                                               <div class="clear"></div>
                                                        </div>
+                                               </fieldset>
 
-                                                       <div class="clear"></div>
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" id="add" action="#{admin_product.addProduct()}" value="#{msg.ADMIN_BUTTON_ADD_PRODUCT}" />
                                                </div>
-                                       </fieldset>
-
-                                       <div class="table_footer">
-                                               <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                               <h:commandButton class="submit" type="submit" id="add" action="#{admin_product.addProduct()}" value="#{msg.ADMIN_BUTTON_ADD_PRODUCT}" />
                                        </div>
-                               </div>
                                </h:form>
                        </div>
 
index 8d19de414f0d547f0f7fd4488a3aa763cc96a29d..adb51696e2f4b1105ed30cd54c740805cedbdd61 100644 (file)
@@ -1,7 +1,7 @@
-<%-- 
-       Document   : errorHandler
-       Created on : 05.08.2015, 12:06:39
-       Author     : Roland Haeder
+<%--
+Document   : errorHandler
+Created on : 05.08.2015, 12:06:39
+Author     : Roland Haeder
 --%>
 
 <%@page import="java.io.PrintWriter"%>
index 225b9c29c07d8fba1a081384172527fc014cb3d2..5e10ffb603057da03138eaabd1a61eaba230cf39 100644 (file)
@@ -34,7 +34,7 @@
                                <h:column>
                                        <div id="main_item_container">
                                                <div class="item_title">
-                                                        #{product.title}
+                                                       #{product.title}
                                                </div>
 
                                                <div class="item_content">