*/
public void init (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException;
- /**
- * Somewhat setter in session
- *
- * @param session Session instance
- * @param key Session key to set
- * @param value Value to set
- */
- public void setValueInSession (final HttpSession session, final String key, final Object value);
-
/**
* Some "getter" for a an array of only available products
*
*/
public void doAdminAddProduct (final ServletRequest request) throws ServletException, ProductTitleAlreadyUsedException;
- /**
- * 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
- */
- public String generateLinkForParent (final Category category);
-
/**
* Handles admin product form requests
*
}
}
- @Deprecated
- private boolean isProductChoosen (final Product product, final ServletRequest request, final HttpSession session) {
- throw new UnsupportedOperationException("This method is deprecated and shall not be called"); //NOI18N
- }
-
- @Override
- public void setValueInSession (final HttpSession session, final String key, final Object value) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("session={0},key={1},value={2} - CALLED!", session, key, value)); //NOI18N
-
- synchronized(session) {
- // Set it synced
- session.setAttribute(key, value);
- }
-
- // Trace message
- this.getLogger().trace("EXIT!"); //NOI18N
- }
-
- /**
- * Some getter for value from session
- *
- * @param product Product instance
- * @param session Session instance
- * @param attribute Attribute to get value from
- * @return Value from session
- * @deprecated Old lost code
- */
- @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
-
- // Init variable
- Object value = this.getValueFromSession(session, String.format(HTTP_PARAM_MASK, attribute, product.getItemId()));
-
- this.getLogger().debug(MessageFormat.format("product={0},attribute={1},value={2}", product.getItemId(), attribute, value)); //NOI18N
-
- // Trace message
- this.getLogger().trace(MessageFormat.format("value={0} - EXIT!", value)); //NOI18N
-
- // Return it
- return value;
- }
-
- /**
- * Some getter for value from session
- *
- * @param session Session instance
- * @param key Key to get value from
- * @return Value from session
- */
- private Object getValueFromSession (final HttpSession session, final String key) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("session={0},key={1} - CALLED!", session, key)); //NOI18N
-
- // Init value
- Object value;
-
- // Get it synchronized from session
- synchronized (session) {
- value = session.getAttribute(key);
- }
-
- // Trace message
- this.getLogger().trace(MessageFormat.format("value={0} - EXIT!", value)); //NOI18N
-
- // Return it
- return value;
- }
-
/**
* Initializes database frontends.
*/
this.getLogger().trace("EXIT!"); //NOI18N
}
- @Override
- public String generateLinkForParent (final Category category) {
- // Trace message
- this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
-
- // category must not be null
- if (null == category) {
- // Is null
- throw new NullPointerException("category is null"); //NOI18N
- }
-
- // Get parent id
- Long parentId = category.getParentId();
-
- // Is the id set?
- if (parentId > 0) {
- // Product HTML code for link
- throw new UnsupportedOperationException(MessageFormat.format("parentId={0} - Unfinished!", parentId)); //NOI18N
- }
-
- // No parent set
- return "Keine";
- }
-
@Override
public String getPrintableProduktCategory (final Product product) throws ServletException {
// Trace message
*/
public void init () throws FacesException;
- /**
- * Somewhat setter in session
- *
- * @param session Session instance
- * @param key Session key to set
- * @param value Value to set
- */
- public void setValueInSession (final HttpSession session, final String key, final Object value);
-
/**
* Some "getter" for an iterator of only available products
*
*/
public void doAdminAddProduct (final ServletRequest request) throws ServletException, ProductTitleAlreadyUsedException;
- /**
- * 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
- */
- public String generateLinkForParent (final Category category);
-
/**
* Handles admin product form requests
*
return this.app.getAllCategories();
}
- @Override
- public void setValueInSession (final HttpSession session, final String key, final Object value) {
- this.app.setValueInSession(session, key, value);
- }
-
@Override
public void doAdminAddCategory (final ServletRequest request) throws ServletException, CategoryTitleAlreadyUsedException {
this.app.doAdminAddCategory(request);
this.app.doAdminAddProduct(request);
}
- @Override
- public String generateLinkForParent (final Category category) {
- return this.app.generateLinkForParent(category);
- }
-
@Override
public String getPrintableProduktCategory (final Product product) throws ServletException {
return this.app.getPrintableProduktCategory(product);