Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.User


            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    getMissingFormInformation(form, adminBean.getSiteId());

      String invoiceHeaderId = form.getInvoiceHeaderId();
View Full Code Here


            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
    MessageResources resources = this.getResources(request);
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
     
      InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
      InvoiceEngine invoiceEngine = new InvoiceEngine(invoiceHeader, user);
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    getMissingFormInformation(form, adminBean.getSiteId());

      String invoiceHeaderId = form.getInvoiceHeaderId();
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
      AdminBean adminBean = getAdminBean(request);
      User user = adminBean.getUser();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
    getMissingFormInformation(form, adminBean.getSiteId());
View Full Code Here

    InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
    getMissingFormInformation(form, getAdminBean(request).getSiteId());
      String orderTrackingMessage = form.getOrderTrackingMessage();
      if (!Format.isNullOrEmpty(orderTrackingMessage)) {
        AdminBean adminBean = getAdminBean(request);
        User user = adminBean.getUser();
        OrderTracking orderTracking = new OrderTracking();
        orderTracking.setOrderTrackingCode("");
        orderTracking.setOrderTrackingMessage(orderTrackingMessage);
        if (form.isOrderTrackingInternal()) {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_YES));
        }
        else {
          orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_NO));
        }
        orderTracking.setRecUpdateBy(user.getUserId());
        orderTracking.setRecUpdateDatetime(new Date());
        orderTracking.setRecCreateBy(user.getUserId());
        orderTracking.setRecCreateDatetime(new Date());
        orderTracking.setOrderHeader(orderHeader);
        orderTracking.setInvoiceHeader(invoiceHeader);
        em.persist(orderTracking);
       
View Full Code Here

            HttpServletRequest request,
            HttpServletResponse response) throws Throwable {
      InvoiceMaintActionForm form = (InvoiceMaintActionForm) actionForm;
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    AdminBean adminBean = getAdminBean(request);
    User user = adminBean.getUser();
      OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
    InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
      OrderTrackingDisplayForm trackingForms[] = form.getOrderTrackings();
      for (int i = 0 ; i < trackingForms.length; i++) {
        OrderTracking orderTracking = (OrderTracking) em.find(OrderTracking.class, Format.getLong(trackingForms[i].getOrderTrackingId()));
        String value = String.valueOf(Constants.VALUE_NO);
        if (trackingForms[i].isOrderTrackingInternal()) {
          value = String.valueOf(Constants.VALUE_YES);
        }
        if (!orderTracking.getOrderTrackingInternal().equals(value)) {
          orderTracking.setOrderTrackingInternal(value);
            orderTracking.setRecUpdateBy(user.getUserId());
            orderTracking.setRecUpdateDatetime(new Date());
            em.persist(orderTracking);
        }
      }
     
View Full Code Here

  }
 
  public void saveLanguage(ShippingMethod shippingMethod, ShippingMethodMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteProfileClassId = form.getSiteProfileClassId();
      User user = adminBean.getUser();
      Iterator<?> iterator = shippingMethod.getShippingMethodLanguages().iterator();
      boolean found = false;
      ShippingMethodLanguage shippingMethodLanguage = null;
      while (iterator.hasNext()) {
        shippingMethodLanguage = (ShippingMethodLanguage) iterator.next();
        if (shippingMethodLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          found = true;
          break;
        }
      }
      if (!found) {
        shippingMethodLanguage = new ShippingMethodLanguage();
        shippingMethodLanguage.setRecCreateBy(user.getUserId());
        shippingMethodLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        shippingMethodLanguage.setSiteProfileClass(siteProfileClass);
        shippingMethodLanguage.setShippingMethod(shippingMethod);
      }
      if (form.isShippingMethodNameLangFlag()) {
        shippingMethodLanguage.setShippingMethodName(form.getShippingMethodNameLang());
      }
      else {
        shippingMethodLanguage.setShippingMethodName(null);
      }

      shippingMethodLanguage.setRecUpdateBy(user.getUserId());
      shippingMethodLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      em.persist(shippingMethodLanguage);
  }
View Full Code Here

        throws Throwable {
     
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        SiteListingActionForm form = (SiteListingActionForm) actionForm;
        String siteIds[] = form.getSiteIds();
        User user = getAdminBean(request).getUser();
       
        try {
          if (siteIds != null) {
            for (int i = 0; i < siteIds.length; i++) {
              Site site = SiteDAO.load(siteIds[i], user);
              SiteDAO.remove(site, user);
            }
            em.getTransaction().commit();
            em = JpaConnection.getInstance().getCurrentEntityManager();
            em.getTransaction().begin();
          }
        }
    catch (Exception e) {
      if (Utility.isConstraintViolation(e)) {
        ActionMessages errors = new ActionMessages();
        errors.add("error", new ActionMessage("error.remove.sites.constraint"));
        saveMessages(request, errors);
            ActionForward forward = actionMapping.findForward("removeError");
            em.getTransaction().rollback();
            return forward;
      }
      throw e;
        }
       
        AdminBean adminBean = getAdminBean(request);
        if (adminBean.getSite() == null) {
          Iterator<?> iterator = null;
          if (user.getUserType().equals(Constants.USERTYPE_SUPER) || user.getUserType().equals(Constants.USERTYPE_ADMIN)) {
             String sql = "from Site where siteId not like '\\_%' order by siteId";
             Query query = em.createQuery(sql);
             iterator = query.getResultList().iterator();
          }
          else {
            iterator = user.getSites().iterator();
          }
          Site site = (Site) iterator.next();
          adminBean.setSiteId(site.getSiteId());
          user.setUserLastVisitSiteId(site.getSiteId());
          // em.update(user);
        }

        ActionForward forward = new ActionForward();
        forward = new ActionForward(request.getServletPath() + "?process=list", true);
View Full Code Here

    }
   
    public void saveLanguage(Category category, CategoryMaintActionForm form, AdminBean adminBean) throws Exception {
         EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteProfileClassId = form.getSiteProfileClassId();
      User user = adminBean.getUser();
      Iterator<?> iterator = category.getCategoryLanguages().iterator();
      boolean found = false;
      CategoryLanguage categoryLanguage = null;
      while (iterator.hasNext()) {
        categoryLanguage = (CategoryLanguage) iterator.next();
        if (categoryLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          found = true;
          break;
        }
      }
      if (!found) {
        categoryLanguage = new CategoryLanguage();
        categoryLanguage.setRecCreateBy(user.getUserId());
        categoryLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = em.find(SiteProfileClass.class, siteProfileClassId);
        categoryLanguage.setSiteProfileClass(siteProfileClass);
        categoryLanguage.setCategory(category);
      }
      if (form.isCatTitleLangFlag()) {
        categoryLanguage.setCatTitle(form.getCatTitleLang());
      }
      else {
        categoryLanguage.setCatTitle(null);
      }
      if (form.isCatShortTitleLangFlag()) {
        categoryLanguage.setCatShortTitle(form.getCatShortTitleLang());
      }
      else {
        categoryLanguage.setCatShortTitle(null);
      }
      if (form.isCatDescLangFlag()) {
        categoryLanguage.setCatDesc(form.getCatDescLang());
      }
      else {
        categoryLanguage.setCatDesc(null);
      }
      if (form.isMetaKeywordsLangFlag()) {
        categoryLanguage.setMetaKeywords(form.getMetaKeywordsLang());
      }
      else {
        categoryLanguage.setMetaKeywords(null);
      }
      if (form.isMetaDescriptionLangFlag()) {
        categoryLanguage.setMetaDescription(form.getMetaDescriptionLang());
      }
      else {
        categoryLanguage.setMetaDescription(null);
      }
      categoryLanguage.setRecUpdateBy(user.getUserId());
      categoryLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      em.persist(categoryLanguage);
    }
View Full Code Here

   
    if (form.isSiteProfileClassDefault()) {
      saveDefault(content, form, adminBean);
      form.setRecUpdateBy(content.getRecUpdateBy());
      form.setRecUpdateDatetime(Format.getFullDatetime(content.getRecUpdateDatetime()));
      User user = adminBean.getUser();
      content.setUser(user);
      if (insertMode) {
        em.persist(content);
        form.setContentId(Format.getLong(content.getContentId()));
      }
View Full Code Here

TOP

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

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.