Examples of CustomAttribute


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

Examples of com.jada.jpa.entity.CustomAttribute

        }
       
        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

Examples of com.jada.jpa.entity.CustomAttribute

        }
        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

Examples of com.jada.jpa.entity.CustomAttribute

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

Examples of com.jada.jpa.entity.CustomAttribute

      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

Examples of com.jada.jpa.entity.CustomAttribute

      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

Examples of org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribute

        try {
            ClassReader cr = new ClassReader(bytecode);
            ClassWriter cw = AsmHelper.newClassWriter(true);
            ClassInfoClassAdapter visitor = new ClassInfoClassAdapter(cw);
            cr.accept(visitor, new Attribute[] {
                new CustomAttribute()
            }, false);
        } catch (Throwable t) {
            t.printStackTrace();
        }
View Full Code Here

Examples of org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribute

        public void visitAttribute(final Attribute attrs) {
            Attribute attributes = attrs;
            while (attributes != null) {
                if (attributes instanceof CustomAttribute) {
                    CustomAttribute customAttribute = (CustomAttribute) attributes;
                    byte[] bytes = customAttribute.getBytes();
                    try {
                        m_annotations.add(new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject());
                    } catch (Exception e) {
                        System.err.println("WARNING: could not deserialize annotation due to: " + e.toString());
                    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribute

     */
    private void addAnnotations(final Attribute attrs) {
        Attribute attributes = attrs;
        while (attributes != null) {
            if (attributes instanceof CustomAttribute) {
                CustomAttribute customAttribute = (CustomAttribute) attributes;
                byte[] bytes = customAttribute.getBytes();
                try {
                    m_annotations.add(new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject());
                } catch (Exception e) {
                    System.err.println("WARNING: could not deserialize annotation due to: " + e.toString());
                }
View Full Code Here

Examples of org.codehaus.aspectwerkz.attribdef.definition.attribute.CustomAttribute

                continue;
            }
            String name = tag.getName();
            String value = tag.getValue();
//                String[] parameters = tag.getParameters();
            enhancer.insertClassAttribute(new CustomAttribute(name, value, null));
            log("class [" + javaClass.getFullyQualifiedName() + "]");
            log("\tattribute [" + name + " " + value + "]");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.