Package org.apache.beehive.samples.petstore.model

Examples of org.apache.beehive.samples.petstore.model.Item


        {
            cart.incrementQuantityByItemId(form.getWorkingItemId());
        }
        else
        {
            Item toAddItem = _catalogControl.getItem(form.getWorkingItemId());
            if (toAddItem != null)
            {
                //toAddItem.setProduct(_currentProduct);
                cart.addItem(toAddItem);
            }
View Full Code Here


        public String getColumnName(int col) {
            return columnNames[col];
        }

        public Object getValueAt(int row, int col) {
            Item curItem = items[row];
            if (col == 0)
                return curItem.getItemId();
            else if (col == 1)
                return curItem.getProductId();
            else if (col == 2)
                return curItem.getAttr1();
            else if (col == 3)
                return curItem.getAttr2();
            else if (col == 4)
                return curItem.getAttr3();
            else if (col == 5)
                return curItem.getAttr4();
            else if (col == 6)
                return curItem.getAttr5();
            else if (col == 7)
                return curItem.getListPrice();
            else if (col == 8)
                return "" + curItem.getQty();
            else if (col == 9)
                return "" + curItem.getSupplier();
            else if (col == 10)
                return curItem.getUnitCost();
            else if (col == 11)
                return curItem.getStatus();
            else if (col == 12)
                return "";
            else
                return "Unknown Column";
        }
View Full Code Here

        (@WebParam(name = "itemId") String itemId,
         @WebParam(name = "listPrice") BigDecimal listPrice)
        throws InvalidIdentifierException, DataStoreException
    {
    
        Item i = getCatalogBean().getItem(itemId);
        if (i != null) {
            i.setListPrice(listPrice);
        }
        else {
            throw new InvalidIdentifierException
                ("A price cannot be set for a null Item");
        }
View Full Code Here

        Cart cart = lookupCart();
        if (cart.containsItemId(workingItemId))
            cart.incrementQuantityByItemId(workingItemId);
        else {
            Item toAddItem = _catalogControl.getItem(workingItemId);
            if (toAddItem != null)
                cart.addItem(toAddItem);
        }

        _cartForm = new CartForm();
View Full Code Here

    return cat;
    }

    public Item getItem(String key) throws InvalidIdentifierException
    {
    Item item = new Item();
    item = _catalogDao.getItem(key);
    if (item == null)
      throw new InvalidIdentifierException("Item: " + key + " not found!");
    return item;
    }
View Full Code Here

              _logger.error( "Unexpected DAO exception");
        throw new DataStoreException("unexpected database exception");
      }
     
          // Add the cart items and update the quantities in the DB
      Item item = null;
          Iterator i = cart.getLineItems().iterator();
          while (i.hasNext())
          {
              LineItem lineItem = (LineItem) i.next();
              _catalogControl.updateItemQuantity(lineItem.getItem().getItemId(), lineItem.getQuantity());
View Full Code Here

    return cat;
    }

    public Item getItem(String key)
    {
    Item item = new Item();
    try {
      item = _dbControl.getItem(key);
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
View Full Code Here

TOP

Related Classes of org.apache.beehive.samples.petstore.model.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.