Package com.jada.xml.site

Examples of com.jada.xml.site.SiteParamBean


    Site site = new Site();
    if (!insertMode) {
          site = SiteDAO.load(form.getSiteId());
    }
    SiteParamBean siteParamBean = new SiteParamBean();
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
    }

    form.setMailSmtpPort(form.getMailSmtpPort().trim());
    ActionMessages errors = validate(form, siteParamBean);
    if (errors.size() != 0) {
      form.setMailSmtpPassword("");
      form.setCaptchaPrivateKey("");
      form.setCaptchaPublicKey("");
          initListInfo(form);
      saveMessages(request, errors);
      return mapping.findForward("error");
    }

    site.setSiteDesc(form.getSiteDesc());
    if (!insertMode) {
      site.setShareInventory(form.isShareInventory() ? Constants.VALUE_YES : Constants.VALUE_NO);
      site.setManageInventory(form.isManageInventory() ? Constants.VALUE_YES : Constants.VALUE_NO);
      site.setSingleCheckout(form.isSingleCheckout() ? Constants.VALUE_YES : Constants.VALUE_NO);
      site.setListingPageSize(Format.getInt(form.getListingPageSize()));
      site.setMailSmtpHost(form.getMailSmtpHost());
      site.setMailSmtpPort(form.getMailSmtpPort());
      site.setMailSmtpAccount(form.getMailSmtpAccount());
      if (!Format.isNullOrEmpty(form.getMailSmtpPassword())) {
        site.setMailSmtpPassword(AESEncoder.getInstance().encode(form.getMailSmtpPassword()));
      }
      if (form.getMailSmtpPassword().equals(" ")) {
        site.setMailSmtpPassword(AESEncoder.getInstance().encode(""));
      }
    }
    site.setActive(form.isActive() ? Constants.VALUE_YES : Constants.VALUE_NO);
    siteParamBean.setEnableCaptcha(form.isEnableCaptcha() ? String.valueOf(Constants.VALUE_YES) : String.valueOf(Constants.VALUE_NO));
    if (!Format.isNullOrEmpty(form.getCaptchaPrivateKey())) {
      siteParamBean.setCaptchaPrivateKey(AESEncoder.getInstance().encode(form.getCaptchaPrivateKey()));
    }
    if (!Format.isNullOrEmpty(form.getCaptchaPublicKey())) {
      siteParamBean.setCaptchaPublicKey(AESEncoder.getInstance().encode(form.getCaptchaPublicKey()));
    }
    if (!form.isEnableCaptcha()) {
      siteParamBean.setCaptchaPrivateKey("");
      siteParamBean.setCaptchaPublicKey("");
    }
    site.setSiteParam(Utility.joxMarshall("SiteParamBean", siteParamBean));
    site.setRecUpdateBy(adminBean.getUser().getUserId());
    site.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    if (insertMode) {
View Full Code Here


   
    form.setEnableCaptcha(false);
    form.setCaptchaPrivateKey("");
    form.setCaptchaPublicKey("");
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      SiteParamBean siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
      if (siteParamBean.getEnableCaptcha().equals(String.valueOf(Constants.VALUE_YES))) {
        form.setEnableCaptcha(true);
      }
    }
  }
View Full Code Here

    }
   
    public void setCaptcha(MyAccountForgotActionForm form, HttpServletRequest request) throws Throwable {   
    ContentBean contentBean = getContentBean(request);
    Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
    SiteParamBean siteParamBean = new SiteParamBean();
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
    }
    String enableCaptcha= siteParamBean.getEnableCaptcha();
    if (!Format.isNullOrEmpty(enableCaptcha)) {
      form.setEnableCaptcha(enableCaptcha);
      if (!Format.isNullOrEmpty(siteParamBean.getCaptchaPublicKey())) {
        form.setCaptchaPublicKey(AESEncoder.getInstance().decode(siteParamBean.getCaptchaPublicKey()));
      }
      if (!Format.isNullOrEmpty(siteParamBean.getCaptchaPrivateKey())) {   
        form.setCaptchaPrivateKey(AESEncoder.getInstance().decode(siteParamBean.getCaptchaPrivateKey()));
     
    }
    return;
  }
View Full Code Here

      if (Format.isNullOrEmpty(form.getCustEmail())) {
        errors.add("custEmail", new ActionMessage("content.error.string.required"));
      }
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      SiteParamBean siteParamBean = new SiteParamBean();
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
    }
    if (!Format.isNullOrEmpty(siteParamBean.getEnableCaptcha()) && "Y".equals(siteParamBean.getEnableCaptcha())) {
      String captchaPrivateKey = AESEncoder.getInstance().decode(siteParamBean.getCaptchaPrivateKey());    
            String remoteAddr = request.getRemoteAddr();
            String challenge = request.getParameter("recaptcha_challenge_field");
            String uresponse = request.getParameter("recaptcha_response_field");
        if (Format.isNullOrEmpty(uresponse)) {
          errors.add("recaptchaUserResponse", new ActionMessage("content.error.captcha.required"));
View Full Code Here

        return errors;
      }

      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      SiteParamBean siteParamBean = new SiteParamBean();
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
    }
    if (!Format.isNullOrEmpty(siteParamBean.getEnableCaptcha()) && "Y".equals(siteParamBean.getEnableCaptcha())) {
      String captchaPrivateKey = AESEncoder.getInstance().decode(siteParamBean.getCaptchaPrivateKey());    
            String remoteAddr = request.getRemoteAddr();
            String challenge = request.getParameter("recaptcha_challenge_field");
            String uresponse = request.getParameter("recaptcha_response_field");
        if (Format.isNullOrEmpty(uresponse)) {
          errors.add("recaptchaUserResponse", new ActionMessage("content.error.captcha.required"));
View Full Code Here

   
    public void setCaptcha(MyAccountRegisterActionForm form, HttpServletRequest request)
        throws Throwable {   
    ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      SiteParamBean siteParamBean = new SiteParamBean();
    if (!Format.isNullOrEmpty(site.getSiteParam())) {
      siteParamBean = (SiteParamBean) Utility.joxUnMarshall(SiteParamBean.class, site.getSiteParam());
    }
    String enableCaptcha= siteParamBean.getEnableCaptcha();
    if (!Format.isNullOrEmpty(enableCaptcha)) {
      form.setEnableCaptcha(enableCaptcha);
      if (!Format.isNullOrEmpty(siteParamBean.getCaptchaPublicKey())) {
        form.setCaptchaPublicKey(AESEncoder.getInstance().decode(siteParamBean.getCaptchaPublicKey()));
      }
      if (!Format.isNullOrEmpty(siteParamBean.getCaptchaPrivateKey())) {   
        form.setCaptchaPrivateKey(AESEncoder.getInstance().decode(siteParamBean.getCaptchaPrivateKey()));
     
    }
        return;
    }
View Full Code Here

TOP

Related Classes of com.jada.xml.site.SiteParamBean

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.