Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.SiteProfileClass


  }
 
  public void saveLanguage(Item item, ItemMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteProfileClassId = form.getSiteProfileClassId();
    SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
      User user = adminBean.getUser();
      Iterator<?> iterator = item.getItemLanguages().iterator();
      boolean found = false;
      ItemLanguage itemLanguage = null;
      while (iterator.hasNext()) {
View Full Code Here


  public void saveDefault(Item item, ItemMaintActionForm form, AdminBean adminBean, boolean insertMode) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      User user = adminBean.getUser();
      Site site = adminBean.getSite();
      Long siteProfileClassId = form.getSiteProfileClassId();
    SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(siteProfileClassId);
      ItemLanguage itemLanguage = item.getItemLanguage();
     
      boolean exist = true;
      if (itemLanguage == null) {
        itemLanguage = new ItemLanguage();
View Full Code Here

      if (itemLanguage == null) {
        itemLanguage = new ItemLanguage();
        itemLanguage.setItem(item);
        itemLanguage.setRecCreateBy(adminBean.getUser().getUserId());
        itemLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
        itemLanguage.setSiteProfileClass(siteProfileClass);
      }
      ItemImage itemImage = new ItemImage();
      itemImage.setImageName(file.getFileName());
      itemImage.setContentType("image/jpeg");
View Full Code Here

        found = true;
        break;
      }
    }
    if (!found) {
      SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, form.getSiteProfileClassId());
      itemLanguage = new ItemLanguage();
      itemLanguage.setItem(item);
      itemLanguage.setRecCreateBy(adminBean.getUser().getUserId());
      itemLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      itemLanguage.setSiteProfileClass(siteProfileClass);
View Full Code Here

     
      CustomAttributeLanguage customAttribLanguage = new CustomAttributeLanguage();
      customAttribute.setSystemRecord(Constants.VALUE_NO);
      customAttribLanguage.setRecCreateBy(adminBean.getUser().getUserId());
      customAttribLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, form.getSiteProfileClassDefaultId());
        customAttribLanguage.setSiteProfileClass(siteProfileClass);
        customAttribLanguage.setCustomAttribute(customAttribute);
        customAttribute.setCustomAttributeLanguage(customAttribLanguage);
        customAttribute.getCustomAttributeLanguages().add(customAttribLanguage);
    }
View Full Code Here

      }
      else {
        exist = true;
        CustomAttributeOptionLanguage customAttribOptionLanguage = customAttributeOption.getCustomAttributeOptionLanguage();
        if (customAttribOptionLanguage == null) {
          SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
          customAttribOptionLanguage = new CustomAttributeOptionLanguage();
          exist = false;
          customAttribOptionLanguage.setCustomAttributeOption(customAttributeOption);
          customAttribOptionLanguage.setSiteProfileClass(siteProfileClass);
          customAttribOptionLanguage.setRecCreateBy(adminBean.getUser().getUserId());
View Full Code Here

    }
    if (!found) {
      customAttribLanguage = new CustomAttributeLanguage();
      customAttribLanguage.setRecCreateBy(user.getUserId());
      customAttribLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        customAttribLanguage.setSiteProfileClass(siteProfileClass);
        customAttribLanguage.setCustomAttribute(customAttribute);
        customAttribute.getCustomAttributeLanguages().add(customAttribLanguage);
    }
    if (form.isCustomAttribDescLangFlag()) {
      customAttribLanguage.setCustomAttribDesc(form.getCustomAttribDescLang());
    }
    else {
      customAttribLanguage.setCustomAttribDesc(null);
    }
    customAttribLanguage.setRecUpdateBy(user.getUserId());
    customAttribLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.persist(customAttribLanguage);
   
    for (int i = 0; i < form.getCustomAttribOptions().length; i++) {
      CustomAttributeOptionDisplayForm optionForm = form.getCustomAttribOptions()[i];
      CustomAttributeOption customAttributeOption = null;
      Long customAttribOptionId = Format.getLong(optionForm.getCustomAttribOptionId());
      customAttributeOption = CustomAttributeOptionDAO.load(adminBean.getSite().getSiteId(), customAttribOptionId);
      boolean exist = true;
      CustomAttributeOptionLanguage customAttributeOptionLanguage = null;
      for (CustomAttributeOptionLanguage optionLang : customAttributeOption.getCustomAttributeOptionLanguages()) {
        if (optionLang.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          customAttributeOptionLanguage = optionLang;
        }
      }
      if (customAttributeOptionLanguage == null) {
        customAttributeOptionLanguage = new CustomAttributeOptionLanguage();
        exist = false;
        customAttributeOptionLanguage.setRecCreateBy(user.getUserId());
        customAttributeOptionLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
          customAttributeOptionLanguage.setSiteProfileClass(siteProfileClass);
          customAttributeOptionLanguage.setCustomAttributeOption(customAttributeOption);
          customAttributeOption.getCustomAttributeOptionLanguages().add(customAttributeOptionLanguage);
      }
     
View Full Code Here

      }
        }
        if (siteDomainLanguage == null) {
          User user = getAdminBean(request).getUser();
        siteDomainLanguage = new SiteDomainLanguage();
        SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
        SiteDomainParamBean siteDomainParamBean = new SiteDomainParamBean();
        siteDomainLanguage.setSiteDomainParam(Utility.joxMarshall("SiteDomainParamBean", siteDomainParamBean));
        siteDomainLanguage.setSiteProfileClass(siteProfileClass);
        siteDomain.getSiteDomainLanguages().add(siteDomainLanguage);
        siteDomainLanguage.setRecUpdateBy(user.getUserId());
View Full Code Here

      siteDomainLanguage.setRecCreateBy(user.getUserId());
      siteDomainLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      siteDomain.setSiteDomainLanguage(siteDomainLanguage);
      siteDomain.getSiteDomainLanguages().add(siteDomainLanguage);
      siteDomain.setBaseCurrency(site.getSiteCurrencyClassDefault());
      SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
      siteDomainLanguage.setSiteProfileClass(siteProfileClass);
    }
    else {
          Template template = TemplateDAO.load(site.getSiteId(), Format.getLong(form.getTemplateId()));
          siteDomain.setTemplate(template);
          if (!Format.isNullOrEmpty(siteDomainLanguage.getSiteDomainParam())) {
            siteDomainParamBean = (SiteDomainParamBean) Utility.joxUnMarshall(SiteDomainParamBean.class, siteDomainLanguage.getSiteDomainParam());
          }
          siteDomainParamBean.setMailFromContactUs(form.getMailFromContactUs());
          siteDomainParamBean.setMailFromPwdReset(form.getMailFromPwdReset());
          siteDomainParamBean.setSubjectNotification(form.getSubjectNotification());
          siteDomainParamBean.setMailFromNotification(form.getMailFromNotification());
          siteDomainParamBean.setSubjectPwdReset(form.getSubjectPwdReset());
          siteDomainParamBean.setMailFromCustSales(form.getMailFromCustSales());
          siteDomainParamBean.setSubjectCustSales(form.getSubjectCustSales());
          siteDomainParamBean.setMailFromShippingQuote(form.getMailFromShippingQuote());
          siteDomainParamBean.setSubjectShippingQuote(form.getSubjectShippingQuote());
          siteDomainParamBean.setTemplateFooter(form.getTemplateFooter());
          siteDomainParamBean.setCheckoutNotificationEmail(form.getCheckoutNotificationEmail());
          siteDomainParamBean.setCheckoutShoppingCartMessage(form.getCheckoutShoppingCartMessage());
          siteDomainParamBean.setCategoryPageSize(form.getCategoryPageSize());
          siteDomainParamBean.setPaymentProcessType(form.getPaymentProcessType());
          siteDomainParamBean.setBusinessContactName(form.getBusinessContactName());
          siteDomainParamBean.setBusinessCompany(form.getBusinessCompany());
          siteDomainParamBean.setBusinessAddress1(form.getBusinessAddress1());
          siteDomainParamBean.setBusinessAddress2(form.getBusinessAddress2());
          siteDomainParamBean.setBusinessCity(form.getBusinessCity());
          siteDomainParamBean.setBusinessStateCode(form.getBusinessStateCode());
          siteDomainParamBean.setBusinessCountryCode(form.getBusinessCountryCode());
          siteDomainParamBean.setBusinessPostalCode(form.getBusinessPostalCode());
          siteDomainParamBean.setBusinessPhone(form.getBusinessPhone());
          siteDomainParamBean.setBusinessFax(form.getBusinessFax());
          siteDomainParamBean.setBusinessEmail(form.getBusinessEmail());
          siteDomainParamBean.setModuleDisplaySize(form.getModuleDisplaySize());
          siteDomainParamBean.setCheckoutIncludeShippingPickup(String.valueOf(Constants.VALUE_NO));
          siteDomainParamBean.setCheckoutAllowsShippingQuote(String.valueOf(Constants.VALUE_NO));
          if (form.isCheckoutIncludePickup()) {
            siteDomainParamBean.setCheckoutIncludeShippingPickup(String.valueOf(Constants.VALUE_YES));
          }
          if (form.isCheckoutAllowsShippingQuote()) {
            siteDomainParamBean.setCheckoutAllowsShippingQuote(String.valueOf(Constants.VALUE_YES));
          }
    }
        siteDomainLanguage.setSiteName(form.getSiteName());
    siteDomainLanguage.setRecUpdateBy(user.getUserId());
    siteDomainLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));

    siteDomain.setSiteDomainName(form.getSiteDomainName());
    siteDomain.setSiteDomainPrefix(form.getSiteDomainPrefix());
        siteDomain.setSitePublicPortNum(form.getSitePublicPortNum());
        siteDomain.setSiteSslEnabled(form.isSiteSecureConnectionEnabled() ? Constants.VALUE_YES : Constants.VALUE_NO);
        siteDomain.setSiteSecurePortNum(form.getSiteSecurePortNum());
        if (form.getBaseSiteCurrencyClassId() != null) {
          SiteCurrencyClass siteCurrencyClass = (SiteCurrencyClass) em.find(SiteCurrencyClass.class, Format.getLong(form.getBaseSiteCurrencyClassId()));
        siteDomain.setBaseCurrency(siteCurrencyClass);
        }
        else {
          siteDomain.setBaseCurrency(null);

        }
    siteDomain.setActive(form.isActive() ? Constants.ACTIVE_YES : Constants.ACTIVE_NO);
    siteDomain.setRecUpdateBy(user.getUserId());
    siteDomain.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      siteDomainLanguage.setSiteDomainParam(Utility.joxMarshall("SiteDomainParamBean", siteDomainParamBean));

        if (insertMode) {
          em.persist(siteDomainLanguage);
          em.persist(siteDomain);
          form.setSiteDomainId(siteDomain.getSiteDomainId().toString());
          form.setSiteDomainLangId(siteDomainLanguage.getSiteDomainLangId().toString());
          form.setDefaultSiteDomainLangId(siteDomainLanguage.getSiteDomainLangId().toString());
        }
        SiteProfileForm siteProfileForms[] = form.getSiteProfiles();
        for (int i = 0; i < siteProfileForms.length; i++) {
          SiteProfileForm siteProfileForm = siteProfileForms[i];
          SiteProfile siteProfile = null;
          if (!Format.isNullOrEmpty(siteProfileForm.getSiteProfileId())) {
            siteProfile = (SiteProfile) em.find(SiteProfile.class, Format.getLong(siteProfileForm.getSiteProfileId()));
          }
          else {
            siteProfile = new SiteProfile();
                siteProfile.setRecCreateBy(user.getUserId());
                siteProfile.setRecCreateDatetime(new Date(System.currentTimeMillis()));
            siteDomain.getSiteProfiles().add(siteProfile);
          }
          SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(Format.getLong(siteProfileForm.getSiteProfileClassId()));
        siteProfile.setSiteProfileClass(siteProfileClass);
        siteProfile.setSeqNum(Format.getInt(siteProfileForm.getSeqNum()));
        siteProfile.setActive(Constants.VALUE_YES);
        if (!siteProfileForm.isActive()) {
          siteProfile.setActive(Constants.VALUE_NO);
View Full Code Here

      if (siteDomainLanguage == null) {
        siteDomainLanguage = new SiteDomainLanguage();
        siteDomainLanguage.setRecCreateBy(user.getUserId());
        siteDomainLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        siteDomain.getSiteDomainLanguages().add(siteDomainLanguage);
      SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, form.getSiteProfileClassId());
      siteDomainLanguage.setSiteProfileClass(siteProfileClass);
      siteDomainParamBean = new SiteDomainParamBean();
      }
      siteDomainLanguage.setSiteName(null);
      if (form.isSiteNameLangFlag()) {
View Full Code Here

TOP

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

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.