Package com.jada.util

Examples of com.jada.util.JSONEscapeObject


        ActionForm actionForm,
        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
       JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxRegionId = Format.getLong(form.getTaxRegionId());
        TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
       
        boolean modified = false;
View Full Code Here


        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
        AdminBean adminBean = getAdminBean(request);
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxRegionId = Format.getLong(form.getTaxRegionId());
        TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
       
        TaxRegionZip taxRegionZip = new TaxRegionZip();
View Full Code Here

        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
        AdminBean adminBean = getAdminBean(request);
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxRegionId = Format.getLong(form.getTaxRegionId());
        TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
        Long taxRegionZipId = Format.getLong(form.getTaxRegionZipId());
        TaxRegionZip taxRegionZip = (TaxRegionZip) em.find(TaxRegionZip.class, taxRegionZipId);
View Full Code Here

        ActionForm actionForm,
        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
       JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxRegionId = Format.getLong(form.getTaxRegionId());
        String taxRegionZipIds[] = form.getTaxRegionZipIds();
        TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
        if (taxRegionZipIds != null) {
View Full Code Here

    LabelValueBean productClassList[] = new LabelValueBean[vector.size()];
    vector.copyInto(productClassList);
    form.setProductClassList(productClassList);
   
    if (taxRegion != null) {
      JSONEscapeObject jsonProductClasses = new JSONEscapeObject();
        sql = "select    trProductClasses " +
            "from      TaxRegion tr " +
            "inner join tr.productClasses trProductClasses " +
            "left      join trProductClasses.productClass productClass " +
            "where     tr.taxRegionId = :taxRegionId " +
            "order     by productClass.productClassName";
        query = em.createQuery(sql);
        query.setParameter("taxRegionId", taxRegion.getTaxRegionId());
      iterator = query.getResultList().iterator();
      Vector<JSONEscapeObject> jsonVector = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        TaxRegionProduct trProduct = (TaxRegionProduct) iterator.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("taxRegionProductId", trProduct.getTaxRegionProductId());
        object.put("productClassId", trProduct.getProductClass().getProductClassId());
        object.put("productClassName", trProduct.getProductClass().getProductClassName());
        jsonVector.add(object);
      }
      jsonProductClasses.put("taxRegionProductClasses", jsonVector);
      // This string is to be converted into javascript variable via jstl
      form.setJsonProductClasses(URLEncoder.encode(jsonProductClasses.toHtmlString(), "UTF-8"));
View Full Code Here

    Site site = adminBean.getSite();
    initSiteProfiles(form, site);
   
    HomePage homePage = HomePageDAO.load(Format.getLong(form.getHomePageId()));
    HomePageDetail feature = homePage.getFeatureData();
    JSONEscapeObject JSONEscapeObject = new JSONEscapeObject();
    JSONEscapeObject.put("homePageId", homePage.getHomePageId());
    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())) {
            contentLanguage = language;
          }
        }
        jsonDetail.put("type", "Content");
        jsonDetail.put("homePageDesc", contentLanguage.getContentTitle());
      }
      if (feature != null) {
        if (feature.getHomePageDetailId().equals(homePageDetail.getHomePageDetailId())) {
          jsonDetail.put("feature", true);
        }
      }
      else {
        jsonDetail.put("feature", false);
      }
      vector.add(jsonDetail);
    }
    JSONEscapeObject.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
    JSONEscapeObject.put("homePageDetails", vector);
View Full Code Here

      return errors;
    }
   
    private String getJSONItemList(Coupon coupon, CouponMaintActionForm form) throws Exception {
      String result = null;
      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

      return result;
    }
 
    private String getJSONCategoryList(Coupon coupon) throws Exception {
      String result = null;
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
      java.util.Iterator<Category> iterator = coupon.getCategories().iterator();
      Vector<JSONEscapeObject> categories = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        Category category = (Category) iterator.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("catId", category.getCatId());
        object.put("catShortTitle", category.getCategoryLanguage().getCatShortTitle());
        categories.add(object);
      }
      jsonResult.put("categories", categories);
      result = jsonResult.toHtmlString();
      return result;
View Full Code Here

        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());
    }
    coupon.getItems().add(item);
    em.persist(coupon);
    String result = getJSONItemList(coupon, form);
    streamWebService(response, result);
View Full Code Here

      homePageDetail.setFeatureData(hasFeature ? Constants.ACTIVE_NO : Constants.VALUE_YES);
      homePage.getHomePageDetails().add(homePageDetail);
      em.persist(homePageDetail);
    }
   
    JSONEscapeObject JSONEscapeObject = new JSONEscapeObject();
    JSONEscapeObject.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
    form.setStream(true);
    form.setStreamData(JSONEscapeObject.toHtmlString());
    return null;
  }
View Full Code Here

TOP

Related Classes of com.jada.util.JSONEscapeObject

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.