Package com.google.code.magja.model.category

Examples of com.google.code.magja.model.category.CategoryAttribute


    if (attributes == null)
      return results;

    for (Map<String, Object> att : attributes) {

      CategoryAttribute attribute = new CategoryAttribute();

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

      // verify options
      if (att.get("type") != null) {
        String type = (String) att.get("type");
        if (type.equals("select") || type.equals("multiselect")) {

          List<Object> optParamList = new LinkedList<Object>();
          optParamList.add(att.get("attribute_id"));
          optParamList.add(storeView);

          List<Map<String, Object>> optList = null;
          try {
            optList = (List<Map<String, Object>>) soapClient.call(
                ResourcePath.CategoryAttributeOptions,
                optParamList);
          } catch (AxisFault e) {
            if(debug) e.printStackTrace();
            throw new ServiceException(e.getMessage());
          }

          if (optList != null) {
            for (Map<String, Object> optAtt : optList) {

              CategoryAttributeOption option = new CategoryAttributeOption();
              option.setLabel((String) optAtt.get("label"));
              option.setValue(optAtt.get("value"));

              attribute.getOptions().add(option);
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.google.code.magja.model.category.CategoryAttribute

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.