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
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
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 ();
}
*
* @author Roland Haeder<roland@mxchange.org>
*/
-@Named("admin_category")
+@Named ("admin_category")
@RequestScoped
public class AdminCategoryWebBean implements AdminCategoryWebController {
+
/**
* Serial number
*/
private String title;
/**
- * Parent id
+ * Parent category
*/
- private Long parentId;
+ private Category parentCategory;
/**
* Default constructor
try {
// Create category
Category category = new ProductCategory();
- category.setParentId(this.getParentId());
+ category.setParentCategory(this.getParentCategory());
category.setTitle(this.getTitle());
// Deligate to remote bean
}
@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;
}
}
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
/**
* 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);
}
* Queue instance
*/
private Queue queue;
-
+
/**
* Session instance
*/
* @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 ();
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;
*
* @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 /////////////////////
/**
* 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
*/
private String firstName;
+ /**
+ * Gender instance
+ */
+ private Gender gender;
+
/**
* House number
*/
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());
}
@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
}
@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
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
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
/**
* 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;
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);
}
* @author Roland Haeder<roland@mxchange.org>
*/
public interface ReceiptWebController extends Serializable {
+
/**
* Fetches last access key for given customer instance
*
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);
}
*
* @author Roland Haeder<roland@mxchange.org>
*/
-@Named("controller")
+@Named ("controller")
@ApplicationScoped
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
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);
// 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);
+ }
+ }
}
*/
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
*
* @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;
}
}
}
+ @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?
this.doGet(request, response);
}
- @Override
- public String getServletInfo () {
- return "Produces an official recipit as PDF file for given access key.";
- }
-
}
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>
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>
<?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">
<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>
<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>
-<%--
- 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"%>
<h:column>
<div id="main_item_container">
<div class="item_title">
- #{product.title}
+ #{product.title}
</div>
<div class="item_content">