Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ContactUs


      ContactUsListingActionForm form = (ContactUsListingActionForm) actionForm;

        ContactUsDisplayForm contactUsForms[] = form.getContactUsForms();
        for (int i = 0; i < contactUsForms.length; i++) {
          int seqNum = Format.getInt(contactUsForms[i].getSeqNum());
        ContactUs contactUs = ContactUsDAO.load(site.getSiteId(), Format.getLong(contactUsForms[i].getContactUsId()));
        contactUs.setSeqNum(seqNum);
        // em.update(contactUs);
        }
        return list(actionMapping, actionForm, request, response);
    }
View Full Code Here


        calcPage(adminBean, form, list, pageNo);
        Vector<ContactUsDisplayForm> vector = new Vector<ContactUsDisplayForm>();
        int startRecord = (form.getPageNo() - 1) * adminBean.getListingPageSize();
        int endRecord = startRecord + adminBean.getListingPageSize();
        for (int i = startRecord; i < list.size() && i < endRecord; i++) {
          ContactUs contactUs = (ContactUs) list.get(i);
          ContactUsDisplayForm contactUsDisplay = new ContactUsDisplayForm();
          contactUsDisplay.setContactUsId(Format.getLong(contactUs.getContactUsId()));
          contactUsDisplay.setContactUsName(contactUs.getContactUsLanguage().getContactUsName());
          contactUsDisplay.setContactUsEmail(contactUs.getContactUsEmail());
          contactUsDisplay.setContactUsPhone(contactUs.getContactUsPhone());
          contactUsDisplay.setActive(String.valueOf(contactUs.getActive()));
          contactUsDisplay.setSeqNum(Format.getInt(contactUs.getSeqNum()));
            vector.add(contactUsDisplay);
        }
        ContactUsDisplayForm contactUsDisplayForm[] = new ContactUsDisplayForm[vector.size()];
        vector.copyInto(contactUsDisplayForm);
        form.setContactUsForms(contactUsDisplayForm);
View Full Code Here

       
        for (int i = 0; i < contactUsForms.length; i++) {
          if (!contactUsForms[i].isRemove()) {
            continue;
          }
            ContactUs contactUs = new ContactUs();
            contactUs = ContactUsDAO.load(site.getSiteId(), Format.getLong(contactUsForms[i].getContactUsId()));
            em.remove(contactUs);
        }

        ActionForward forward = new ActionForward();
View Full Code Here

      query.setParameter("siteId", siteDomain.getSite().getSiteId());
      query.setParameter("active", String.valueOf(Constants.VALUE_YES));
      Iterator<?> iterator = query.getResultList().iterator();
      Vector<ContactUsInfo> vector = new Vector<ContactUsInfo>();
      while (iterator.hasNext()) {
        ContactUs contactUs = (ContactUs) iterator.next();
        ContactUsInfo info = new ContactUsInfo();
        info.setContactUsName(contactUs.getContactUsLanguage().getContactUsName());
        info.setContactUsAddressLine1(contactUs.getContactUsAddressLine1());
        info.setContactUsAddressLine2(contactUs.getContactUsAddressLine2());
        info.setContactUsCityName(contactUs.getContactUsCityName());
        info.setContactUsStateCode(contactUs.getContactUsStateCode());
        info.setContactUsStateName(contactUs.getContactUsStateName());
        info.setContactUsCountryCode(contactUs.getContactUsCountryCode());
        info.setContactUsCountryName(contactUs.getContactUsCountryName());
        info.setContactUsDesc(contactUs.getContactUsLanguage().getContactUsDesc());
        info.setSeqNum(Format.getInt(contactUs.getSeqNum()));
        info.setContactUsZipCode(contactUs.getContactUsZipCode());
        info.setContactUsEmail(contactUs.getContactUsEmail());
        info.setContactUsPhone(contactUs.getContactUsPhone());
            if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
              SiteProfile siteProfile = contentBean.getContentSessionBean().getSiteProfile();
              Iterator<?> iterator1 = contactUs.getContactUsLanguages().iterator();
              while (iterator1.hasNext()) {
                ContactUsLanguage contactUsLanguage = (ContactUsLanguage) iterator1.next();
            if (contactUsLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfile.getSiteProfileClass().getSiteProfileClassId())) {
                  if (contactUsLanguage.getContactUsName() != null) {
                    info.setContactUsName(contactUsLanguage.getContactUsName());
View Full Code Here

        AdminBean adminBean = getAdminBean(request);
        Site site = adminBean.getSite();
        ContactUsMaintActionForm form = (ContactUsMaintActionForm) actionForm;
    initSiteProfiles(form, site);
        ContactUs contactUs = new ContactUs();
        PropertyUtils.copyProperties(form, contactUs);
        form.setMode("C");
        form.setActive(String.valueOf(Constants.ACTIVE_YES));
        initSearchInfo(form, site.getSiteId());
       
View Full Code Here

    }
   
    Site site = getAdminBean(request).getSite();
    initSiteProfiles(form, site);
   
    ContactUs contactUs = em.find(ContactUs.class, Format.getLong(form.getContactUsId()));
 
      GoogleTranslate translator = new GoogleTranslate(form.getFromLocale(), form.getToLocale());
    form.setContactUsNameLangFlag(true);
    form.setContactUsDescLangFlag(true);
    form.setContactUsNameLang(translator.translate(contactUs.getContactUsLanguage().getContactUsName()));
    form.setContactUsDescLang(translator.translate(contactUs.getContactUsLanguage().getContactUsDesc()));
   
        initSearchInfo(form, site.getSiteId());
    FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    ActionForward actionForward = actionMapping.findForward("success");
    return actionForward;
View Full Code Here

    }
   
    Site site = getAdminBean(request).getSite();
    initSiteProfiles(form, site);
   
    ContactUs contactUs = em.find(ContactUs.class, Format.getLong(form.getContactUsId()));
   
    form.setContactUsNameLangFlag(false);
    form.setContactUsDescLangFlag(false);
    form.setContactUsNameLang(contactUs.getContactUsLanguage().getContactUsName());
    form.setContactUsDescLang(contactUs.getContactUsLanguage().getContactUsDesc());
    if (!form.isSiteProfileClassDefault()) {
        Iterator<?> iterator = contactUs.getContactUsLanguages().iterator();
        Long siteProfileClassId = form.getSiteProfileClassId();
        while (iterator.hasNext()) {
          ContactUsLanguage contactUsLanguage = (ContactUsLanguage) iterator.next();
          if (contactUsLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
            if (contactUsLanguage.getContactUsName() != null) {
View Full Code Here

    initSiteProfiles(form, site);
        if (form == null) {
            form = new ContactUsMaintActionForm();
        }
    String contactUsId = request.getParameter("contactUsId");
        ContactUs contactUs = new ContactUs();
        contactUs = ContactUsDAO.load(site.getSiteId(), Format.getLong(contactUsId));
       
        form.setMode("U");
        copyProperties(form, contactUs);
        initSearchInfo(form, site.getSiteId());
View Full Code Here

    throws Throwable {
   
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Site site = getAdminBean(request).getSite();
    ContactUsMaintActionForm form = (ContactUsMaintActionForm) actionForm;
    ContactUs contactUs = ContactUsDAO.load(site.getSiteId(), Format.getLong(form.getContactUsId()));
    em.remove(contactUs);
    ActionForward actionForward = actionMapping.findForward("removeSuccess");
    return actionForward;
  }
View Full Code Here

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    initSiteProfiles(form, site);

    ContactUs contactUs = new ContactUs();
    if (!insertMode) {
      contactUs = ContactUsDAO.load(site.getSiteId(), Format.getLong(form.getContactUsId()));
    }

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

    if (insertMode) {
      contactUs.setSite(site);
      contactUs.setRecCreateBy(adminBean.getUser().getUserId());
      contactUs.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    }
    contactUs.setActive(new Character(Constants.ACTIVE_NO));
    if (form.getActive() != null && form.getActive().equals(String.valueOf(Constants.ACTIVE_YES))) {
      contactUs.setActive(new Character(Constants.ACTIVE_YES));
    }
    contactUs.setContactUsEmail(form.getContactUsEmail());
    contactUs.setContactUsPhone(form.getContactUsPhone());
    contactUs.setContactUsAddressLine1(form.getContactUsAddressLine1());
    contactUs.setContactUsAddressLine2(form.getContactUsAddressLine2());
    contactUs.setContactUsCityName(form.getContactUsCityName());
    contactUs.setContactUsStateCode(form.getContactUsStateCode());
    String stateName = Utility.getStateName(site.getSiteId(), form.getContactUsStateCode());
    if (stateName == null) {
      stateName = "";
    }
    contactUs.setContactUsStateName(stateName);
    contactUs.setContactUsCountryCode(form.getContactUsCountryCode());
    contactUs.setContactUsCountryName(Utility.getCountryName(site.getSiteId(), form.getContactUsCountryCode()));
    contactUs.setContactUsZipCode(form.getContactUsZipCode());
    if (!Format.isNullOrEmpty(form.getSeqNum()))  {
      contactUs.setSeqNum(Format.getIntObj(form.getSeqNum()));
    }
    else {
      contactUs.setSeqNum(new Integer(0));
    }
    contactUs.setRecUpdateBy(adminBean.getUser().getUserId());
    contactUs.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
   
    if (form.isSiteProfileClassDefault()) {
      saveDefault(contactUs, form, adminBean);
    }
    else {
      saveLanguage(contactUs, form, adminBean);
    }
   
    if (insertMode) {
      em.persist(contactUs);
    }
    else {
      // em.update(contactUs);
    }
    form.setContactUsId(Format.getLong(contactUs.getContactUsId()));
    form.setMode("U");
        initSearchInfo(form, site.getSiteId());
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    return mapping.findForward("success");
  }
View Full Code Here

TOP

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

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.