Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttribute


            while (itemAttributeInfoIterator.hasNext()) {
              ItemAttributeInfo itemAttributeInfo = (ItemAttributeInfo) itemAttributeInfoIterator.next();
              ShoppingCartItemAttributeBean attributeBean = new ShoppingCartItemAttributeBean();
             
              ItemAttributeDetail itemAttributeDetail = (ItemAttributeDetail) em.find(ItemAttributeDetail.class, itemAttributeInfo.getItemAttribDetailId());
              CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_INPUT) {
                continue;
              }
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN) {
                continue;
              }
             
              attributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
              if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
                for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                    if (language.getCustomAttribDesc() != null) {
                      attributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
                    }
                      break;
                  }
                }
              }
             
              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());
View Full Code Here


        }
       
        Vector<ShoppingCartItemAttributeBean> shoppingCartItemAttributes = new Vector<ShoppingCartItemAttributeBean>();
        if (item != null && item.getItemTypeCd().equals(Constants.ITEM_TYPE_SKU)) {
          for (ItemAttributeDetail itemAttributeDetail : item.getItemAttributeDetails()) {
            CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
            if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
              continue;
            }
            ShoppingCartItemAttributeBean shoppingCartItemAttributeBean = new ShoppingCartItemAttributeBean();
           
            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;
                  }
                }
              }

              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());
View Full Code Here

        }
        itemAttributeInfos.add(itemAttributeInfo);
      }
      if (item.getItemTypeCd().equals(Constants.ITEM_TYPE_SKU)) {
        for (ItemAttributeDetail itemAttributeDetail : item.getItemAttributeDetails()) {
            CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
            if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
              continue;
            }
            ItemAttributeInfo itemAttributeInfo = new ItemAttributeInfo();
            itemAttributeInfo.setCustomAttribTypeCode(String.valueOf(customAttribute.getCustomAttribTypeCode()));
            itemAttributeInfo.setCustomAttribOptionId(itemAttributeDetail.getCustomAttributeOption().getCustomAttribOptionId());
            itemAttributeInfo.setItemAttribDetailId(itemAttributeDetail.getItemAttribDetailId());
            itemAttributeInfos.add(itemAttributeInfo);
        }
      }
View Full Code Here

public class CustomAttributeDAO extends CustomAttribute {
  private static final long serialVersionUID = 7996701119693466192L;

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

      itemXml.setCustomAttributeGroupId(customAttributeGroup.getCustomAttribGroupId());
      itemXml.setCustomAttributeGroupName(customAttributeGroup.getCustomAttribGroupName());
     
      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());
View Full Code Here

      shippingType.setRecCreateBy(userId);
      shippingType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      shippingType.setSite(site);
      em.persist(shippingType);
     
      CustomAttribute customAttribute = new CustomAttribute();
      customAttribute.setCustomAttribDataTypeCode(Constants.CUSTOM_ATTRIBUTE_DATA_TYPE_CURRENCY);
      customAttribute.setCustomAttribTypeCode(Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN);
      customAttribute.setCustomAttribName("Price");
      customAttribute.setItemCompare(Constants.VALUE_NO);
      customAttribute.setSystemRecord(Constants.VALUE_YES);
      customAttribute.setRecUpdateBy(userId);
      customAttribute.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customAttribute.setRecCreateBy(userId);
      customAttribute.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customAttribute.setSite(site);
     
      CustomAttributeLanguage customAttributeLanguage = new CustomAttributeLanguage();
      customAttributeLanguage.setCustomAttribDesc("Price");
      customAttributeLanguage.setRecUpdateBy(userId);
      customAttributeLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customAttributeLanguage.setRecCreateBy(userId);
      customAttributeLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customAttributeLanguage.setCustomAttribute(customAttribute);
      customAttributeLanguage.setSiteProfileClass(siteProfileClass);
      customAttribute.setCustomAttributeLanguage(customAttributeLanguage);
      em.persist(customAttributeLanguage);
      em.persist(customAttribute);

    String prefix = getNextPrefix();
    SiteDomain siteDomain = new SiteDomain();
View Full Code Here

TOP

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

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.