Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttributeGroup


      item.setRecCreateBy(adminBean.getUser().getUserId());
      item.setRecCreateDatetime(new Date(System.currentTimeMillis()));
     
      if (!Format.isNullOrEmpty(form.getCustomAttribGroupId())) {
        Long customAttribGroupId = Format.getLong(form.getCustomAttribGroupId());
        CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), customAttribGroupId);
        item.setCustomAttributeGroup(customAttributeGroup);
        form.setCustomAttribGroupName(customAttributeGroup.getCustomAttribGroupName());

        String sql = "select   customAttributeDetail " +
                   "from     CustomAttributeGroup customAttributeGroup " +
                   "join   customAttributeGroup.customAttributeDetails customAttributeDetail  " +
                   "where    customAttributeGroup.customAttribGroupId = :customAttribGroupId " +
View Full Code Here


      }
    }
   
    if (!Format.isNullOrEmpty(form.getCustomAttribGroupId())) {
      Long customAttribGroupId = Format.getLong(form.getCustomAttribGroupId());
      CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(adminBean.getSite().getSiteId(), customAttribGroupId);
      item.setCustomAttributeGroup(customAttributeGroup);
    }
   
    for (ItemAttributeDetail itemAttributeDetail : item.getItemAttributeDetails()) {
      for (ItemAttributeDetailLanguage itemAttributeDetailLanguage : itemAttributeDetail.getItemAttributeDetailLanguages()) {
View Full Code Here

    Site site = adminBean.getSite();
    initSiteProfiles(form, site);
   
    JSONEscapeObject jsonResult = new JSONEscapeObject();
    jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
    CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), Format.getLong(form.getCustomAttribGroupId()));
    Vector<JSONEscapeObject> customAttributeDetails = new Vector<JSONEscapeObject>();
    for (CustomAttributeDetail customAttributeDetail : customAttributeGroup.getCustomAttributeDetails()) {
      JSONEscapeObject result = new JSONEscapeObject();
      result.put("customAttribDetailId", customAttributeDetail.getCustomAttribDetailId());
      result.put("customAttribDesc", customAttributeDetail.getCustomAttribute().getCustomAttributeLanguage().getCustomAttribDesc());
      customAttributeDetails.add(result);
    }
View Full Code Here

    query.setParameter("siteId", adminBean.getSite().getSiteId());
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> customAttributesList = new Vector<LabelValueBean>();
    customAttributesList.add(new LabelValueBean("", ""));
    while (iterator.hasNext()) {
      CustomAttributeGroup customAttributeGroup = (CustomAttributeGroup) iterator.next();
      LabelValueBean bean = new LabelValueBean(customAttributeGroup.getCustomAttribGroupName(),
                           customAttributeGroup.getCustomAttribGroupId().toString());
      customAttributesList.add(bean);
    }
    LabelValueBean customAttributeGroups[] = new LabelValueBean[customAttributesList.size()];
    customAttributesList.copyInto(customAttributeGroups);
    form.setCustomAttributeGroups(customAttributeGroups);
View Full Code Here

      jsonResult.put("message", resources.getMessage("error.item.itemNum.duplicate"));
      streamWebService(response, jsonResult.toHtmlString());
      return null;
    }
   
    CustomAttributeGroup customAttributeGroup = item.getCustomAttributeGroup();
    if (customAttributeGroup != null) {
      Vector<AttributeDetailOption[]> attributeVector = new Vector<AttributeDetailOption[]>();
      for (CustomAttributeDetail customAttributeDetail : customAttributeGroup.getCustomAttributeDetails()) {
        CustomAttribute customAttribute = customAttributeDetail.getCustomAttribute();
        if (customAttribute.getCustomAttributeOptions().size() == 0) {
          continue;
        }
        if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
View Full Code Here

        throws Throwable {

        CustomAttributeGroupMaintActionForm form = (CustomAttributeGroupMaintActionForm) actionForm;
    Site site = getAdminBean(request).getSite();
    initSiteProfiles(form, site);
        CustomAttributeGroup customAttributeGroup = new CustomAttributeGroup();
        PropertyUtils.copyProperties(form, customAttributeGroup);
        form.setMode("C");
       
        FormUtils.setFormDisplayMode(request, form, FormUtils.CREATE_MODE);
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

      Site site = getAdminBean(request).getSite();
        CustomAttributeGroupMaintActionForm form = (CustomAttributeGroupMaintActionForm) actionForm;
    initSiteProfiles(form, site);
    String customAttribGroupId = request.getParameter("customAttribGroupId");
        CustomAttributeGroup customAttributeGroup = new CustomAttributeGroup();
        customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), Format.getLong(customAttribGroupId));
        form.setMode("U");
        copyProperties(form, customAttributeGroup);
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

   
      Site site = getAdminBean(request).getSite();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    CustomAttributeGroupMaintActionForm form = (CustomAttributeGroupMaintActionForm) actionForm;
    try {
      CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), Format.getLong(form.getCustomAttribGroupId()));
      em.remove(customAttributeGroup);
      em.getTransaction().commit();
    }
    catch (Exception e) {
      if (Utility.isConstraintViolation(e)) {
View Full Code Here

    }

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    initSiteProfiles(form, site);
    CustomAttributeGroup customAttributeGroup = new CustomAttributeGroup();
    if (!insertMode) {
      customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), Format.getLong(form.getCustomAttribGroupId()));
    }

    ActionMessages errors = validate(form, site.getSiteId());
    if (errors.size() != 0) {
      saveMessages(request, errors);
      return mapping.findForward("error");
    }

    if (insertMode) {
      customAttributeGroup.setRecCreateBy(adminBean.getUser().getUserId());
      customAttributeGroup.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    }
    customAttributeGroup.setCustomAttribGroupName(form.getCustomAttribGroupName());
    customAttributeGroup.setSite(site);
    customAttributeGroup.setRecUpdateBy(adminBean.getUser().getUserId());
    customAttributeGroup.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
   
    if (insertMode) {
      em.persist(customAttributeGroup);
    }
    else {
      // em.update(customAttributeGroup);
    }
        form.setMode("U");
        form.setCustomAttribGroupId(customAttributeGroup.getCustomAttribGroupId().toString());
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    return mapping.findForward("success");
  }
View Full Code Here

        HttpServletResponse response) throws Throwable {
    CustomAttributeGroupMaintActionForm form = (CustomAttributeGroupMaintActionForm) actionForm;
    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    Long customAttribGroupId = Format.getLong(form.getCustomAttribGroupId());
    CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), customAttribGroupId);
    streamWebService(response, getJSONCustomAttributeDetails(customAttributeGroup));
    return null;
  }
View Full Code Here

TOP

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

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.