Examples of AtrilSession


Examples of es.ipsa.atril.sec.authentication.AtrilSession

  @Override
  public AccountingAccount convert(String sUuid, Class<? extends AccountingAccount> accountClass,
               Collection<ValidationError> conversionErrors) {
    try {
      AccountingAccount oAacc = null;
      AtrilSession oSes = DAO.getAdminSession("AccountingAccounts");
      List<Document> oLst = oSes.getDms().query("AccountingAccount$account_uuid='"+sUuid+"'");
      if (!oLst.isEmpty()) {
        oAacc = new AccountingAccount(oSes.getDms(), oLst.get(0).id());
      }
      oSes.disconnect();
      oSes.close();
      oSes = null;
      if (null==oAacc) {
        Log.out.error("No accounting account with uuid "+sUuid+" was found");
        conversionErrors.add(new SimpleError("No accounting account with uuid "+sUuid+" was found"));
      }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

  @Override
  public Product convert(String sProductId, Class<? extends Product> productClass,
               Collection<ValidationError> conversionErrors) {
    Product oProd = null;
    AtrilSession oSes = null;
    try {
      oSes = DAO.getAdminSession("Products");
      oProd = Products.seek(oSes, sProductId);
      oSes.disconnect();
      oSes.close();
      oSes = null;
    } catch (ElementNotFoundException enf) {
      Log.out.error("No product with id "+sProductId+" was found");
      conversionErrors.add(new SimpleError("No product with id "+sProductId+" was found"));     
    } catch (Exception exc) {
      Log.out.error(exc.getClass().getName()+" Products.convert("+sProductId+") "+exc.getMessage());
      conversionErrors.add(new SimpleError(exc.getMessage()));
    } finally {
      if (oSes!=null) {
        if (oSes.isConnected()) oSes.disconnect();
        if (oSes.isOpen()) oSes.close();
      }
    }
    return oProd;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

      return p;
   

  public static Collection<Product> list() {
    ArrayList<Product> aProds = new ArrayList<Product>();
    AtrilSession oSes = DAO.getAdminSession("Products");
    for (Document d : top(oSes).getDocument().children()) {
      if (d.type().name().equals("Product")) {
        if (!d.attribute("is_active").isEmpty()) {
          if (d.attribute("is_active").toString().equalsIgnoreCase("1")) {
            Product p = new Product();
            p.setDocument(d);
            aProds.add(p);           
          }
        }
      }
    }
    oSes.disconnect();
    oSes.close();   
    Collections.sort(aProds, oPrcCmp);
    return aProds;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

  private static VatComparator oVatCmp = new VatPercents().new VatComparator();
 
  public static Collection<VatPercent> listAll() {
    if (oAllPercents==null) {
      AtrilSession oSes = DAO.getAdminSession("VatPercents");
      Dms oDms = oSes.getDms();
      Document p = VatPercents.top(oSes).getDocument();
      oAllPercents = new ArrayList<VatPercent>();
      for (Document d : p.children()) {
        oAllPercents.add(new VatPercent(oDms.getDocument(d.id())));
      }
      oSes.disconnect();
      oSes.close();
      Collections.sort(oAllPercents, oVatCmp);
    }
    return oAllPercents;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

    return oAllPercents;
  }

  public static Collection<VatPercent> listActive() {
    if (oActivePercents==null) {
      AtrilSession oSes = DAO.getAdminSession("VatPercents");
      Dms oDms = oSes.getDms();
      Document p = VatPercents.top(oSes).getDocument();
      oActivePercents = new ArrayList<VatPercent>();
      for (Document d : p.children()) {
        VatPercent v = new VatPercent(oDms.getDocument(d.id()));
        if (v.isActive()) oActivePercents.add(v);
      }
      oSes.disconnect();
      oSes.close();
      Collections.sort(oActivePercents, oVatCmp);
    }
    return oActivePercents;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

  }

  @Override
  public TicketThumbnail convert(String sId, Class<? extends TicketThumbnail> invThumbClass, Collection<ValidationError> conversionErrors) {
    Log.out.debug("BillNoteThumbnail convert("+sId+")");
    AtrilSession oSes = null;
    TicketThumbnail oBln = null;
    try {
      oSes = DAO.getAdminSession("BillNoteThumbnailTypeConverter");
      oBln = new TicketThumbnail(oSes.getDms(), sId);
    } catch (ElementNotFoundException enfe) {
      Log.out.error("Thumbnail "+sId+" not found "+enfe.getMessage(), enfe);
    } catch (Exception xcpt) {
      Log.out.error(xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
      if (oSes!=null) {
        if (oSes.isConnected()) oSes.disconnect();
        if (oSes.isOpen()) oSes.close();
      }
    }
    return oBln;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

  public ArrayList<AccountingAccount> getAccountingAccounts() {
    return accaccounts;
  }

  public Collection<Client> getClients() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("BaseEditBean");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<Client> clients = oAcc.clients(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return clients;
  }
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

    public Resolution form() {
        String order_id = getParam("order_id","");
        if(order_id.length()>0){
            try {
                connect();
                AtrilSession oSes = getSession();
                Dms oDms = oSes.getDms();
                order = new Order(oDms,order_id);
                disconnect();
                return new ForwardResolution("/WEB-INF/jsp/engagecreditok.jsp");
            } catch (StorageException ex) {
                Log.out.error("EngageCredit.form() "+ex.getClass().getName()+" "+ex.getMessage(), ex);
            }
        }else{          
            try {
                connect();
                AtrilSession oSes = getSession();
                Dms oDms = oSes.getDms();
                CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
                setName(cacc.getString("name_billing"));
                setCif(cacc.getString("cif_billing"));
                setPhone(cacc.getString("phone_billing"));
                setMail(cacc.getString("mail_billing"));
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

    public Resolution updatePendigState(){
        try {
            String order_id = getContext().getRequest().getParameter("order_id");
           
            connect();
            AtrilSession oSes = getSession();
            Dms oDms = oSes.getDms();
            order = new Order(oDms,order_id);
            order.put("status_number",Tpv.PENDIENTE_CONFIRMACION);
            Date dtNow = new Date();
            order.put("pay_date", dtNow);
      order.newTransaction();
      order.put("cardnumber", cardnumber);
      order.put("cardholder", cardholder);
      order.put("expiration_month_card", expiration_month_card);
      order.put("expiration_year_card", expiration_year_card);
      order.put("cvv2", cvv2);
            order.save(oSes);
            oSes.commit();
      HttpServletRequest request = getContext().getRequest();
      String peticion = "<tpv><oppago>"
          + "<modelopago>"+Tpv.getModelopago()+"</modelopago>"         
                   + "<idterminal>"+Tpv.getIdterminal()+"</idterminal>"
                   + "<idcomercio>"+Tpv.getIdcomercio()+"</idcomercio>"
View Full Code Here

Examples of es.ipsa.atril.sec.authentication.AtrilSession

   
    public Resolution guardar(String path) {
        try {

            connect();
            AtrilSession oSes = getSession();
            Dms oDms = oSes.getDms();
            CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
      oSes.commit();
     
            cacc.put("name_billing",getName());
            cacc.put("cif_billing",getCif());
            cacc.put("phone_billing",getPhone());
            cacc.put("mail_billing",getMail());
            cacc.put("address_billing",getAddress());
            cacc.put("postcode_billing",getPostcode());
            cacc.put("city_billing",getCity());
            cacc.put("state_billing",getState());
            cacc.put("country_billing",getCountry());
            cacc.save(oSes);
            oSes.commit();
     
            order = cacc.createOrder(oSes);
            order.put("user_id", getSessionAttribute("user_docid"));
            order.put("credits_bought", selectedProduct.getCredits());
            //order.save(oSes);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.