Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Item


    form.setShipHeaders(shipHeaders);
  }
 
    public Vector<OrderItemAttributeBean> getOrderItemAttributes(OrderItemDetail orderItemDetail) throws NumberFormatException, SecurityException, Exception {
    Vector<OrderItemAttributeBean> orderItemAttributes = new Vector<OrderItemAttributeBean>();
    Item item = orderItemDetail.getItem();
    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;
        }
          OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
View Full Code Here


      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
      java.util.Iterator<Item> iterator = coupon.getItems().iterator();
      Vector<JSONEscapeObject> items = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        Item item = (Item) iterator.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("itemId", item.getItemId());
        object.put("itemNum", item.getItemNum());
        object.put("itemShortDesc", item.getItemLanguage().getItemShortDesc());
        object.put("itemDesc", item.getItemLanguage().getItemDesc());
        items.add(object);
      }
      jsonResult.put("items", items);
      result = jsonResult.toHtmlString();
      return result;
View Full Code Here

        }
      }
    }
    Iterator<?> iterator = removeList.iterator();
    while (iterator.hasNext()) {
      Item item = (Item) iterator.next();
      coupon.getItems().remove(item);
    }
    String result = getJSONItemList(coupon, form);
    streamWebService(response, result);
    return null;
View Full Code Here

    MessageResources resources = this.getResources(request);
    Coupon coupon = CouponDAO.load(siteId, Format.getLong(form.getCouponId()));
    boolean found = false;
    java.util.Iterator<Item> iterator = coupon.getItems().iterator();
    while (iterator.hasNext()) {
      Item item = (Item) iterator.next();
      if (item.getItemId().equals(Format.getLong(form.getItemId()))) {
        found = true;
        break;
      }
    }
    if (found) {
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
      jsonResult.put("message", resources.getMessage("error.item.exist"));
      streamWebService(response, jsonResult.toHtmlString());
    }
    Item item = ItemDAO.load(siteId, Format.getLong(form.getItemId()));
    if (item == null) {
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
      jsonResult.put("message", resources.getMessage("error.item.notexist"));
      streamWebService(response, jsonResult.toHtmlString());
View Full Code Here

          Content content = menu.getContent();
          form.setContentId(content.getContentId().toString());
          form.setContentTitle(content.getContentLanguage().getContentTitle());
        }
        else if (menu.getMenuType().equals(Constants.MENU_ITEM) && menu.getItem() != null) {
          Item item = menu.getItem();
          form.setItemId(item.getItemId().toString());
          form.setItemNum(item.getItemNum());
          form.setItemShortDesc(item.getItemLanguage().getItemShortDesc());
        }
        else if (menu.getMenuType().equals(Constants.MENU_SECTION) && menu.getCategory() != null) {
          Category category = menu.getCategory();
          form.setCatId(category.getCatId().toString());
          form.setCatShortTitle(category.getCategoryLanguage().getCatShortTitle());
View Full Code Here

            menu.setContent(content);
          }
        }
        if (form.getMenuType().equals(Constants.MENU_ITEM)) {
          if (!Format.isNullOrEmpty(form.getItemId())) {
            Item item = ItemDAO.load(site.getSiteId(), Format.getLong(form.getItemId()));
            menu.setItem(item);
          }
        }
        if (form.getMenuType().equals(Constants.MENU_SECTION)) {
          if (!Format.isNullOrEmpty(form.getCatId())) {
View Full Code Here

      initSiteProfiles(form, site);
     
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        JSONEscapeObject json = new JSONEscapeObject();
        Iterator<?> iterator = null;
    Item item = (Item) em.find(Item.class, Format.getLong(form.getItemId()));
    ItemLanguage itemLanguage = null;
    for (ItemLanguage language : item.getItemLanguages()) {
      if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
        itemLanguage = language;
      }
    }
    iterator = item.getComments().iterator();
    json.put("itemNum", item.getItemNum());
    json.put("itemUpcCd", item.getItemUpcCd());
    json.put("itemShortDesc", itemLanguage.getItemShortDesc());
    json.put("itemDesc", itemLanguage.getItemDesc());
     
         Vector<JSONEscapeObject> comments = new Vector<JSONEscapeObject>();
         while (iterator.hasNext()) {
View Full Code Here

            display.setCommentSourceTitle(content.getContentLanguage().getContentTitle());
            display.setCommentSourceId(Format.getLong(content.getContentId()));
          }
          else {
            display.setCommentSource("I");
            Item item = comment.getItem();
            display.setCommentSourceTitle(item.getItemLanguage().getItemShortDesc());
            display.setCommentSourceId(Format.getLong(comment.getItem().getItemId()));
          }
          if (comment.getModeration() != null && comment.getModeration() == Constants.VALUE_YES) {
            display.setCommentModeration("Yes");
          }
View Full Code Here

    Vector<JSONEscapeObject> vector = new Vector<JSONEscapeObject>();
    for (HomePageDetail homePageDetail : homePage.getHomePageDetails()) {
      JSONEscapeObject jsonDetail = new JSONEscapeObject();
      jsonDetail.put("homePageDetailId", homePageDetail.getHomePageDetailId());
      jsonDetail.put("seqNum", homePageDetail.getSeqNum());
      Item item = homePageDetail.getItem();
      Content content = homePageDetail.getContent();
      if (item != null) {
        ItemLanguage itemLanguage = null;
        for (ItemLanguage language : item.getItemLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
            itemLanguage = language;
          }
        }
        jsonDetail.put("type", "Item");
        jsonDetail.put("homePageDesc", itemLanguage.getItemShortDesc() + " - " + item.getItemSkuCd());
      }
      if (content != null) {
        ContentLanguage contentLanguage = null;
        for (ContentLanguage language : content.getContentLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
View Full Code Here

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    initSiteProfiles(form, site);
    HomePage homePage = HomePageDAO.load(Format.getLong(form.getHomePageId()));
   
    Item item = ItemDAO.load(site.getSiteId(), Format.getLong(form.getItemId()));
    int seqNum = -1;
    boolean exist = false;
    boolean hasFeature = false;
    for (HomePageDetail homePageDetail : homePage.getHomePageDetails()) {
      if (homePageDetail.getSeqNum() > seqNum) {
        seqNum = homePageDetail.getSeqNum();
      }
      if (homePageDetail.getFeatureData() == Constants.VALUE_YES) {
        hasFeature = true;
      }
      Item currentItem = homePageDetail.getItem();
      if (currentItem == null) {
        continue;
      }
      if (currentItem.getItemId().equals(item.getItemId())) {
        exist = true;
        break;
      }
    }
    if (!exist) {
View Full Code Here

TOP

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

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.