Package com.jada.content

Examples of com.jada.content.ContentBean


    public ActionForward finalize(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
      ContentBean contentBean = getContentBean(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
      createEmptySecureTemplateInfo(request);
    try {
      this.finalizeOrder(form, site, shoppingCart, request, messages);
      }
    catch (AuthorizationException e) {
      logger.error(e);
      this.ignoreToken(request, true);
      return actionMapping.findForward("authorizationException");
    }
    catch (NotImplementedException e) {
      logger.error(e);
      this.ignoreToken(request, true);
      return actionMapping.findForward("authorizationException");
    }
    catch (PaymentException e) {
      logger.error(e);
      return actionMapping.findForward("paymentError");
    }

      request.setAttribute("shoppingCart.orderNum", shoppingCart.getOrderNum());
      ShoppingCart.remove(request);
      ActionForward forward = actionMapping.findForward("success");
        forward = new ActionForward(forward.getPath() +
                      "&prefix=" + contentBean.getSiteDomain().getSiteDomainPrefix() +
                      "&langName=" + contentBean.getContentSessionKey().getLangName() +
                      "&shoppingCart.orderNum=" + shoppingCart.getOrderNum(),
                      forward.getRedirect());
        return forward;
    }
View Full Code Here


            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ActionForward actionForward = actionMapping.findForward("success");
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
   
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    ActionMessages messages = new ActionMessages();
    this.initCartInfo(form, site, shoppingCart, request, messages);
    this.initCreditCardInfo(form, site, shoppingCart, request, messages);
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
     
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      createEmptySecureTemplateInfo(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;

      ActionMessages messages = this.validateCreditCard(form);
      if (messages.size() > 0) {
View Full Code Here

            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ActionForward actionForward = actionMapping.findForward("success");
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
   
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
    if (shoppingCart.isShippingQuoteLock()) {
          actionForward = actionMapping.findForward("quote");
            return actionForward;
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
     
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      createEmptySecureTemplateInfo(request);
      ShoppingCartActionForm form = (ShoppingCartActionForm) actionForm;
    ShoppingCart shoppingCart = ShoppingCart.getSessionInstance(request, true);
//    shoppingCart.setShippingPickUp(false);
    ActionForward actionForward = null;
View Full Code Here

    public ActionForward logout(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ContentBean contentBean = getContentBean(request);
    createEmptyTemplateInfo(request);
      this.removeSession(request);
        ActionForward actionForward = actionMapping.findForward("logoutSuccess");
        String path = actionForward.getPath();
        path += "&prefix=" + contentBean.getContentSessionBean().getSiteDomain().getSiteDomainPrefix();
        path += "&langName=" + contentBean.getContentSessionKey().getSiteProfileClassName();
        ActionForward forward = new ActionForward();
        forward.setPath(path);
        forward.setRedirect(true);
        return forward;
    }
View Full Code Here

      form.setCustPassword1("");
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
      }
     
      ContentBean contentBean = getContentBean(request);
      Site site = contentBean.getContentSessionBean().getSiteDomain().getSite();
      Long defaultSiteDomainId = contentBean.getSiteDomain().getSite().getSiteDomainDefault().getSiteDomainId();
      char singleCheckout = contentBean.getSiteDomain().getSite().getSingleCheckout();
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
     
      String sql = "from   Customer customer " +
             "where  customer.siteDomain.siteDomainId = :siteDomainId " +
             "and    custEmail = :custEmail";
        Query query = em.createQuery(sql);
        if (singleCheckout == Constants.VALUE_YES) {
            query.setParameter("siteDomainId", defaultSiteDomainId);
        }
        else {
          query.setParameter("siteDomainId", contentBean.getSiteDomain().getSiteDomainId());
        }
        query.setParameter("custEmail", form.getCustEmail1());
        if (query.getResultList().size() > 0) {
          messages.add("custEmail1", new ActionMessage("content.error.email.duplicate"));
        }
       
      sql = "from   Customer customer " +
          "where  customer.siteDomain.siteDomainId = :siteDomainId " +
          "and    custPublicName = :custPublicName";
        query = em.createQuery(sql);
        if (singleCheckout == Constants.VALUE_YES) {
            query.setParameter("siteDomainId", defaultSiteDomainId);
        }
        else {
          query.setParameter("siteDomainId", contentBean.getSiteDomain().getSiteDomainId());
        }
        query.setParameter("custPublicName", form.getCustPublicName());
        if (query.getResultList().size() > 0) {
          messages.add("custPublicName", new ActionMessage("content.error.publicName.duplicate"));
        }
      if (messages.size() > 0) {
      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
      form.setCustPassword("");
      form.setCustPassword1("");
            return actionForward;
      }
     
      sql = "from CustomerClass customerClass where siteId = :siteId and customerClass.systemRecord = 'Y'";
      query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
      CustomerClass customerClass = (CustomerClass) query.getSingleResult();

     
      Customer customer = new Customer();
      customer.setSite(site);
    if (singleCheckout == Constants.VALUE_YES) {
      SiteDomain siteDomain = (SiteDomain) em.find(SiteDomain.class, defaultSiteDomainId);
      customer.setSiteDomain(siteDomain);
    }
    else {
      customer.setSiteDomain(contentBean.getSiteDomain());
    }
      customer.setCustPublicName(form.getCustPublicName());
      customer.setCustEmail(form.getCustEmail1());
      customer.setCustPassword(AESEncoder.getInstance().encode(form.getCustPassword()));
      customer.setCustSource(Constants.CUSTOMER_SOURCE_REGISTER);
View Full Code Here

      if (!form.getCustPassword().equals(form.getCustPassword1())) {
        errors.add("custPasswordNoMatch", new ActionMessage("content.error.password.nomatch"));
        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())) {
View Full Code Here

        return map;
    }
   
    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();
View Full Code Here

       
        String target = request.getParameter("target");
        if (target != null) {
              ActionForward base = actionMapping.findForward(target);
              String path = base.getPath();
              ContentBean contentBean = getContentBean(request);
              path += "&prefix=" + contentBean.getSiteDomain().getSiteDomainPrefix() +
              "&langName=" + contentBean.getContentSessionKey().getLangName() +
              "&currencyCode=" + contentBean.getContentSessionKey().getSiteCurrencyClassName();
              actionForward = new ActionForward();
              actionForward.setPath(path);
              actionForward.setRedirect(base.getRedirect());
              return actionForward;
        }
View Full Code Here

TOP

Related Classes of com.jada.content.ContentBean

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.