Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttributeOption


                    break;
                  }
                }
              }

              CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
              orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
              if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
                for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                    if (language.getCustomAttribValue() != null) {
                      orderItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
                    }
                    break;
                  }
                }
              }
              orderItemAttributes.add(orderItemAttributeBean);
          }
        }
       
        for (OrderAttributeDetail orderAttributeDetail : detail.getOrderAttributeDetails()) {
          OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
          CustomAttribute customAttribute = orderAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
          orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
            if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
              for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
                if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                  if (language.getCustomAttribDesc() != null) {
                    orderItemAttributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
                  }
                  break;
                }
              }
            }
           
            if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
              orderItemAttributeBean.setCustomAttribValue(orderAttributeDetail.getOrderAttribValue());
            }
            else {
              CustomAttributeOption customAttributeOption = orderAttributeDetail.getCustomAttributeOption();
              orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
              if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
                for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                    if (language.getCustomAttribValue() != null) {
                      orderItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
                    }
                    break;
View Full Code Here


            if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
              continue;
            }
            OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
            orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
              CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
              orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
              orderItemAttributes.add(orderItemAttributeBean);
          }
      }
        for (OrderAttributeDetail orderAttributeDetail : orderItemDetail.getOrderAttributeDetails()) {
          OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
          CustomAttribute customAttribute = orderAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
          orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
           
            if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
              orderItemAttributeBean.setCustomAttribValue(orderAttributeDetail.getOrderAttribValue());
            }
            else {
              CustomAttributeOption customAttributeOption = orderAttributeDetail.getCustomAttributeOption();
              orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
            }
            orderItemAttributes.add(orderItemAttributeBean);
        }
      itemDisplay.setOrderItemAttributes(orderItemAttributes);
     
View Full Code Here

        if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
          continue;
        }
          OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
          orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
            CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
            orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
            orderItemAttributes.add(orderItemAttributeBean);
      }
    }
    for (OrderAttributeDetail orderAttributeDetail : orderItemDetail.getOrderAttributeDetails()) {
      OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
      CustomAttribute customAttribute = orderAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
      orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
       
        if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
          orderItemAttributeBean.setCustomAttribValue(orderAttributeDetail.getOrderAttribValue());
        }
        else {
            CustomAttributeOption customAttributeOption = orderAttributeDetail.getCustomAttributeOption();
            orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
        }
        orderItemAttributes.add(orderItemAttributeBean);
    }
      return orderItemAttributes;
    }
View Full Code Here

  }
 
  public void test1() {
    AttributeDetailOption[] attributes[] = new AttributeDetailOption[2][];
   
    CustomAttributeOption customAttributeOption = null;
   
    AttributeDetailOption options[] = new AttributeDetailOption[2];
    options[0] = new AttributeDetailOption();
    customAttributeOption = new CustomAttributeOption();
    customAttributeOption.setCustomAttribSkuCode("RED");
    options[0].setCustomAttributeOption(customAttributeOption);
    options[1] = new AttributeDetailOption();
    customAttributeOption = new CustomAttributeOption();
    customAttributeOption.setCustomAttribSkuCode("BLU");
    options[1].setCustomAttributeOption(customAttributeOption);
    attributes[0] = options;
   
    options = new AttributeDetailOption[3];
    options[0] = new AttributeDetailOption();
    customAttributeOption = new CustomAttributeOption();
    customAttributeOption.setCustomAttribSkuCode("L");
    options[0].setCustomAttributeOption(customAttributeOption);
    options[1] = new AttributeDetailOption();
    customAttributeOption = new CustomAttributeOption();
    customAttributeOption.setCustomAttribSkuCode("M");
    options[1].setCustomAttributeOption(customAttributeOption);
    options[2] = new AttributeDetailOption();
    customAttributeOption = new CustomAttributeOption();
    customAttributeOption.setCustomAttribSkuCode("S");
    options[2].setCustomAttributeOption(customAttributeOption);
    attributes[1] = options;

    Vector<Item> items = new Vector<Item>();
    combine(items, attributes, "X01", 0, new Vector<Object>());
View Full Code Here

             
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
                attributeBean.setCustomAttribValue(itemAttributeInfo.getItemAttribDetailValue());
              }
              else {
                CustomAttributeOption customAttribOption = CustomAttributeOptionDAO.load(site.getSiteId(), itemAttributeInfo.getCustomAttribOptionId());
                attributeBean.setCustomAttribValue(customAttribOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
                if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
                  for (CustomAttributeOptionLanguage language : customAttribOption.getCustomAttributeOptionLanguages()) {
                    if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                      if (language.getCustomAttribValue() != null) {
                        attributeBean.setCustomAttribValue(language.getCustomAttribValue());
                      }
                      break;
View Full Code Here

                    break;
                  }
                }
              }

              CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
              shoppingCartItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
              if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
                for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                    if (language.getCustomAttribValue() != null) {
                      shoppingCartItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
                    }
                    break;
                  }
                }
              }
              shoppingCartItemAttributes.add(shoppingCartItemAttributeBean);
          }
        }
       
        for (OrderAttributeDetail orderAttributeDetail : orderItemDetail.getOrderAttributeDetails()) {
          ShoppingCartItemAttributeBean shoppingCartItemAttributeBean = new ShoppingCartItemAttributeBean();
          CustomAttribute customAttribute = orderAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
          shoppingCartItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
            if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
              for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
                if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                  if (language.getCustomAttribDesc() != null) {
                    shoppingCartItemAttributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
                  }
                  break;
                }
              }
            }
           
            if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
              shoppingCartItemAttributeBean.setCustomAttribValue(orderAttributeDetail.getOrderAttribValue());
            }
            else {
              CustomAttributeOption customAttributeOption = orderAttributeDetail.getCustomAttributeOption();
              shoppingCartItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
              if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
                for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                    if (language.getCustomAttribValue() != null) {
                      shoppingCartItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
                    }
                    break;
View Full Code Here

        }
        OrderAttributeDetail orderAttributeDetail = new OrderAttributeDetail();
        orderAttributeDetail.setOrderItemDetail(orderItemDetail);
        orderAttributeDetail.setCustomAttributeDetail(itemAttributeDetail.getCustomAttributeDetail());
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_SELECT_DROPDOWN) {
          CustomAttributeOption customAttributeOption = (CustomAttributeOption) em.find(CustomAttributeOption.class, itemAttributeInfo.getCustomAttribOptionId());
          orderAttributeDetail.setCustomAttributeOption(customAttributeOption);
        }
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
          orderAttributeDetail.setOrderAttribValue(itemAttributeInfo.getItemAttribDetailValue());
        }
View Full Code Here

public class CustomAttributeOptionDAO extends CustomAttribute {
  private static final long serialVersionUID = -7150120378919592817L;

  public static CustomAttributeOption load(String siteId, Long customAttribOptionId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      CustomAttributeOption customAttributeOption = (CustomAttributeOption) em.find(CustomAttributeOption.class, customAttribOptionId);
    if (!customAttributeOption.getCustomAttribute().getSite().getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return customAttributeOption;
  }
View Full Code Here

      for (ItemAttributeDetail itemAttributeDetail : item.getItemAttributeDetails()) {
        com.jada.xml.ie.ItemAttributeDetail itemAttributeDetailXml = new com.jada.xml.ie.ItemAttributeDetail();
        CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
        itemAttributeDetailXml.setCustomAttribId(customAttribute.getCustomAttribId());
        itemAttributeDetailXml.setCustomAttribName(customAttribute.getCustomAttribName());
        CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
        if (customAttributeOption != null) {
          itemAttributeDetailXml.setCustomAttribOptionId(customAttributeOption.getCustomAttribOptionId());
          if (customAttributeOption.getCustomAttributeOptionLanguage() != null) {
            itemAttributeDetailXml.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
          }
          else {
            itemAttributeDetailXml.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionCurrency().getCustomAttribValue());
          }
          itemAttributeDetailXml.setRecUpdateBy(customAttributeOption.getRecCreateBy());
          itemAttributeDetailXml.setRecUpdateDatetime(customAttributeOption.getRecCreateDatetime());
          itemAttributeDetailXml.setRecCreateBy(customAttributeOption.getRecCreateBy());
          itemAttributeDetailXml.setRecCreateDatetime(customAttributeOption.getRecCreateDatetime());
        }
        for (ItemAttributeDetailLanguage itemAttributeDetailLanguage : itemAttributeDetail.getItemAttributeDetailLanguages()) {
          com.jada.xml.ie.ItemAttributeDetailLanguage itemAttributeDetailLanguageXml = new com.jada.xml.ie.ItemAttributeDetailLanguage();
          itemAttributeDetailLanguageXml.setItemAttribDetailValue(itemAttributeDetailLanguage.getItemAttribDetailValue());
          itemAttributeDetailLanguageXml.setRecUpdateBy(itemAttributeDetailLanguage.getRecCreateBy());
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.CustomAttributeOption

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.