Package es.ipsa.atril.doc.user

Examples of es.ipsa.atril.doc.user.Dms


  }

  public static String forUuid(String sUuid) throws NullPointerException,ElementNotFoundException {
    if (sUuid==null) throw new NullPointerException("UUID may not be null");
    AtrilSession oSes = DAO.getAdminSession("User.forUuid");   
    Dms oDms = oSes.getDms();
    SortableList<Document> oLst = oDms.query("User$user_uuid='"+sUuid+"'");
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException("No user found with UUID "+sUuid);
    } else {
View Full Code Here


    if (!oLst.isEmpty()) {
      Log.out.error("E-mail address "+getEmail()+" already belongs to another user");
      throw new IllegalArgumentException("E-mail address "+getEmail()+" already belongs to another user");
    }
   
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType("User"), oDms.getDocument(sUsrs));
    oDoc.save("");
    setDocument(oDoc);
   
    AttributeMultiValue oUid = oDoc.attribute("user_id");
    oUid.set(oDoc.id());
View Full Code Here

    while (oIter.hasNext()) {
      oTxPr = oIter.next();
      if (oTxPr.id().equals(sTaxPayerId)) return;
    }
    oTxPr = null;
    Dms oDms = oSes.getDms();
    boolean bSubFolderFound = false;
    for (Document c : getDocument().children())
      if (bSubFolderFound = c.type().name().equals(sType+"s")) break;
    if (!bSubFolderFound)
      oDms.newDocument(oDms.getDocumentType(sType+"s"), getDocument()).save("");
    for (Document c : getDocument().children()) {
      if (c.type().name().equals(sType+"s")) {
        oTxPr = new TaxPayer(oDms, sTaxPayerId);
        BaseCompanyObject oObj;
        if (sType.equals("AllowedTaxPayer"))
          oObj = new AllowedTaxPayer();
        else if (sType.equals("DeniedTaxPayer"))
          oObj = new DeniedTaxPayer();
        else
          throw new IllegalArgumentException("Unrecognized type "+sType);       
        oObj.newDocument(oSes, oDms.getDocument(c.id()));
        oObj.put("taxpayer", sTaxPayerId);
        oObj.put("creation_date", new Date());
        oObj.put("customer_acount", oTxPr.getString("customer_acount"));
        oObj.put("business_name", oTxPr.getString("business_name"));
        oObj.put("tax_id", oTxPr.getStringNull("tax_id",""));
View Full Code Here

    }
  }

  public void allowAll(AtrilSession oSes)
    throws ElementNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, ClassCastException, IllegalStateException {
      Dms oDms = oSes.getDms();
    for (Document c : getDocument().children())
      if (c.type().equals("AllowedTaxPayers"))
        new AllowedTaxPayers(oDms.getDocument(c.id())).clear(oSes);
      else if (c.type().equals("DeniedTaxPayers"))
        new DeniedTaxPayers(oDms.getDocument(c.id())).clear(oSes);
  }
View Full Code Here

  }
 
  private void loadTaxPayerPermissions(AtrilSession oSes)
    throws ElementNotFoundException, NotEnoughRightsException , DmsException,
    InstantiationException, IllegalStateException, IllegalAccessException {
    Dms oDms = oSes.getDms();
    for (Document c : getDocument().children()) {
      if (c.type().name().equals("AllowedTaxPayers"))
        for (AllowedTaxPayer oAlTp : new AllowedTaxPayers(oDms.getDocument(c.id())).list(oSes))
          oAllwed.add(new TaxPayer(oDms, oAlTp.getString("taxpayer")));
      else if (c.type().name().equals("DeniedTaxPayers"))
        for (DeniedTaxPayer oDnTp : new DeniedTaxPayers(oDms.getDocument(c.id())).list(oSes))
          oDenied.add(new TaxPayer(oDms, oDnTp.getString("taxpayer")));
    }
  }
View Full Code Here

    if (sDocs!=null) {
      if (sDocs.length()>0) {
        String[] aDocs = sDocs.split(",");
        try {
          connect();
          Dms oDms = getSession().getDms();
          for (int d=0; d<aDocs.length; d++) {
            Invoice i = new Invoice(oDms, aDocs[d]);
            aInvoices.add(i);
            sIds += (sIds.length()==0 ? "" : ",")+i.id();
          }
View Full Code Here

    return taxPayer(oDms).customerAccount(oDms);
  }

  public ArrayList<Ticket> tickets(AtrilSession oSes) {
    ArrayList<Ticket> aTcks = new ArrayList<Ticket>();
    Dms oDms = oSes.getDms();
    for (Document t : getDocument().children()) {
      if (t.type().name().equals("Ticket")) {
        aTcks.add(new Ticket(oDms.getDocument(t.id())));
      }
    }
    return aTcks;
  }
View Full Code Here

  }
 
  public Ticket createTicket(AtrilSession oSes, AccountingAccount oAac)
    throws ClassCastException, RuntimeException, IllegalStateException,
    NullPointerException, NotYetConnectedException, DmsException {
    Dms oDms = oSes.getDms();
    Ticket oTck = new Ticket(oSes, this);
    oTck.put("taxpayer", taxPayer(oDms).id());
    oTck.put("employee_uuid", getEmployeeUuid());
    oTck.put("accounting_uuid", oAac.getUuid());
    oTck.put("accounting_code", oAac.getCode());
View Full Code Here

  }

  public static void delete(AtrilSession oSes, String sDocId)
    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    new BillNote(oDms, sDocId).delete(oSes, oDms);
 
View Full Code Here

    final String id = getParam("id","");

    try {
          connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
          Dms oDms = getSession().getDms();
          AccountingAccount oAacc = new AccountingAccount(oDms, id);
          SortableList<Document> oTcks = oDms.query("Ticket$accounting_uuid='"+oAacc.getUuid()+"'");
      if (!oTcks.isEmpty()) {
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteAccountingAccount.hasTickets"));       
      }
      disconnect();
      } catch (Exception xcpt) {
View Full Code Here

TOP

Related Classes of es.ipsa.atril.doc.user.Dms

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.