Package com.google.code.magja.model.product

Examples of com.google.code.magja.model.product.ProductAttributeSet


    if (attSetList == null)
      return resultList;

    for (Map<String, Object> att : attSetList) {
      ProductAttributeSet set = new ProductAttributeSet();
      for (Map.Entry<String, Object> attribute : att.entrySet())
        set.set(attribute.getKey(), attribute.getValue());
      resultList.add(set);
    }

    return resultList;
  }
View Full Code Here


   * @throws ServiceException
   */
  private ProductAttributeSet getAttributeSet(String id)
      throws ServiceException {

    ProductAttributeSet prdAttSet = new ProductAttributeSet();
    Integer set_id = Integer.parseInt(id);

    // if are the default attribute set, that not list on the api, so we
    // have to set manually
    if (set_id.equals(soapClient.getConfig().getDefaultAttributeSetId())) {

      prdAttSet.setId(set_id);
      prdAttSet.setName("Default");

    } else {
      List<Map<String, Object>> setList;
      try {
        setList = (List<Map<String, Object>>) soapClient.call(
            ResourcePath.ProductAttributeSetList, "");
      } catch (AxisFault e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }

      if (setList != null) {
        for (Map<String, Object> set : setList) {
          if (set.get("set_id").equals(set_id.toString())) {

            for (Map.Entry<String, Object> att : set.entrySet())
              prdAttSet.set(att.getKey(), att.getValue());

            break;
          }
        }
      }
View Full Code Here

   * this test use two configurable attributes for instance, size and color
   */
  @Test
  public void testSaveConfigurableProduct() throws ServiceException {
   
    ProductAttributeSet set = new ProductAttributeSet();
    set.setId(9);
    set.setName("Vestuario");
   
    Product product = new Product();
    product.setAttributeSet(set);
    product.setSku(MagjaStringUtils.randomString(3, 10).toUpperCase());
    product.setName(MagjaStringUtils.randomString(3, 5) + " Configurable Prod");
View Full Code Here

TOP

Related Classes of com.google.code.magja.model.product.ProductAttributeSet

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.