return (String) object;
}
- /**
- * Some "getter" for HTML code 'checked="checked"' if the product is choosen
- *
- * @param product Product instance
- * @param request Request instance
- * @param session Session instance
- * @return Whether the product is choosen
- */
@Override
public String getCheckedHtmlFromProduct (final Product product, final HttpServletRequest request, final HttpSession session) {
// Trace message
}
}
- /**
- * Some "getter" for HTML code 'disabled="disabled"' for e.g. submit buttons
- *
- * @param request Request instance
- * @param session Session instance
- * @return Whether the product is choosen
- */
@Override
public String getDisabledHtmlFromSession (final HttpServletRequest request, final HttpSession session) throws ServletException {
// Trace message
}
}
- /**
- * Checks if given Product instance is available and returns a printable
- * (human-readable) string.
- *
- * @param product Product instance to check
- * @return Human-readable version of product availability
- */
@Override
public String getPrintableProduktAvailability (final Product product) {
// Trace message
}
}
- /**
- * Some "getter" for a an array of only available products
- *
- * @return All products
- */
@Override
public Iterator<Product> getAvailableProducts () throws ServletException {
// categoryFrontend must be set
}
}
- /**
- * Some "getter" for a an array of all products
- *
- * @return All products
- */
@Override
public Iterator<Product> getAllProducts () throws ServletException {
// Trace message
}
}
- /**
- * Some "getter" for a an array of all categories
- *
- * @return All categories
- */
@Override
public Iterator<Category> getAllCategories () throws ServletException {
// Trace message
}
}
- /**
- * Checks whether the given product is choosen, request overules session.
- *
- * @param product Product instance
- * @param request Request instance
- * @param session Session instance
- * @return Whether the product is choosen
- */
@Override
@Deprecated
public boolean isProductChoosen (final Product product, final HttpServletRequest request, final HttpSession session) {
throw new UnsupportedOperationException("This method is deprecated and shall not be called");
}
- /**
- * Somewhat setter in session
- *
- * @param session Session instance
- * @param key Session key to set
- * @param value Value to set
- */
@Override
public void setValueInSession (final HttpSession session, final String key, final Object value) {
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Clears given parameter for product in session
- *
- * @param product Product instance
- * @param session Session instance
- * @param parameter Parameter to clear
- */
- private void clearSessionAttribute (final Product product, final HttpSession session, final String parameter) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("produce={0},parameter={1},session={2} - CALLED!", product, parameter, session)); //NOI18N
-
- // Clear in session
- this.getLogger().debug(MessageFormat.format("Clearing product={0},parameter={1} ...", product.getItemId(), parameter)); //NOI18N
- this.setValueInSession(product, session, parameter, null);
-
- // Trace message
- this.getLogger().trace("EXIT!"); //NOI18N
- }
-
/**
* Some getter for value from session
*
* @param session Session instance
* @param attribute Attribute to get value from
* @return Value from session
+ * @deprecated
*/
+ @Deprecated
private Object getValueFromSession (final Product product, final HttpSession session, final String attribute) {
// Trace message
this.getLogger().trace(MessageFormat.format("product={0},session={1},attribute={2} - CALLED!", product, session, attribute)); //NOI18N
return this.productFrontend.isProductTitleUsed(title);
}
- /**
- * Checks if the product ordered?
- *
- * @param product Product instance
- * @param session HttpSession instance
- * @return Whether the product has been ordered
- */
- private boolean isProductOrdered (final Product product, final HttpSession session) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("product={0},session={1} - CALLED!", product, session)); //NOI18N
-
- // Get session
- Object isOrdered = this.getValueFromSession(product, session, SESSION_ORDERED);
- this.getLogger().debug(MessageFormat.format("product={0},isOrdered={1}", product.getItemId(), isOrdered)); //NOI18N
-
- // Return result
- return ("true".equals(isOrdered)); //NOI18N
- }
-
- /**
- * Somewhat setter in session
- *
- * @param product Product instance
- * @param session Session instance
- * @param keyPart Key part to include in final key
- * @param value Value to set
- */
- private void setValueInSession (final Product product, final HttpSession session, final String keyPart, final Object value) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("product={0},session={1},keyPart={2},value={3} - CALLED!", product, session, keyPart, value)); //NOI18N
-
- // Set it synced
- this.getLogger().debug(MessageFormat.format("Setting value={0} for product={1},keyPart={2}", value, product.getItemId(), keyPart)); //NOI18N
- this.setValueInSession(session, String.format(HTTP_PARAM_MASK, keyPart, product.getItemId()), value);
-
- // Trace message
- this.getLogger().trace("EXIT!"); //NOI18N
- }
-
- /**
- * Adds given category data from request to database
- *
- * @param request Request instance
- */
@Override
public void doAdminAddCategory (final HttpServletRequest request) throws ServletException, CategoryTitleAlreadyUsedException {
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Adds given product data from request to database
- *
- * @param request Request instance
- */
@Override
public void doAdminAddProduct (final HttpServletRequest request) throws ServletException, ProductTitleAlreadyUsedException {
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Generates link HTML code for given category's parent id, if set. This
- * link then points to products.jsp?category_id=x
- *
- * @param category Category instance
- * @return HTML code
- */
@Override
public String generateLinkForParent (final Category category) {
// Trace message
return isUsed;
}
- /**
- * Handles admin form requests
- * @param request Request instance
- * @param response Response instance
- * @throws ServletException If something unexpected happened
- */
@Override
public void doAdminHandleProductForms (final HttpServletRequest request, final HttpServletResponse response) throws ServletException {
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Handles admin form requests
- * @param request Request instance
- * @param response Response instance
- * @throws ServletException If something unexpected happened
- */
@Override
public void doAdminHandleCategoryForms (final HttpServletRequest request, final HttpServletResponse response) throws ServletException {
// Trace message