Package es.ipsa.atril.sec.authentication

Examples of es.ipsa.atril.sec.authentication.AtrilSession.disconnect()


    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"));     
View Full Code Here


    } 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

            aProds.add(p);           
          }
        }
      }
    }
    oSes.disconnect();
    oSes.close();   
    Collections.sort(aProds, oPrcCmp);
    return aProds;
  }
View Full Code Here

      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

      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

      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

  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;
  }

  @Override
View Full Code Here

    if (oCache==null) {
      AtrilSession oSes = DAO.getAdminSession("AccountingAccountsDefaults");
      oCache = new ArrayList<AccountingAccountDefault>();
      for (Document d : top(oSes).getDocument().children())
        oCache.add(new AccountingAccountDefault(d));
      oSes.disconnect();
      oSes.close();
    }
    return oCache;
  }
View Full Code Here

  public Collection<TaxPayer> getTaxPayers() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("EditEmployee");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<TaxPayer> taxpayers = oAcc.taxpayers(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return taxpayers;
  }
 
  @DefaultHandler
View Full Code Here

      CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
      clients = oAcc.clients(oSes).list(oSes);
      for (Client oCli : clients)
        if (oCli.getTaxId().length()>0)
          oCli.setBusinessName(oCli.getBusinessName()+" ("+oCli.getTaxId()+")");
      oSes.disconnect();
      oSes.close();
      try {
        Cache.putEntry(getSessionAttribute("customer_account_docid")+"clients", clients);
      } catch (Exception e) {
        Log.out.error("CaptureInvoice.getClients() Cache.putEntry("+getSessionAttribute("customer_account_docid")+"clients) "+e.getClass().getName()+" "+e.getMessage(), e);
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.