Package es.ipsa.atril.exceptions

Examples of es.ipsa.atril.exceptions.ElementNotFoundException


  public AccountingAccount account(AtrilSession oSes, String sAccountId) throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    for (AccountingAccount a : accounts(oSes).list(oSes)) {
      if (a.getUuid().equals(sAccountId) || a.getCode().equals(sAccountId))
        return a;
    }
    throw new ElementNotFoundException("No accounting account with id. or code "+sAccountId+" was found for tax payer "+getDocument().id());
  }
View Full Code Here


    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("TaxPayer.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    List <Document> oAlwed = oDms.query("AllowedTaxPayer$taxpayer='"+sDocId+"'");
    List <Document> oDnied = oDms.query("DeniedTaxPayer$taxpayer='"+sDocId+"'");
    for(Document a : oAlwed)
      BaseModelObject.delete(oSes, a.id());
    for(Document n : oDnied)
View Full Code Here

  }

  public AccountingAccount(AtrilSession oSes, String sUuid) throws ElementNotFoundException {
    super("AccountingAccount");
    List<Document> oLst = oSes.getDms().query("AccountingAccount$account_uuid='" + sUuid + "'");
    if (oLst.isEmpty()) throw new ElementNotFoundException("No accounting account was found with UUID "+sUuid);
    load(oSes, oLst.get(0).id());
  }
View Full Code Here

        if (d.type().name().equals(m.getTypeName())) {
          m.setDocument(oSes.getDms().getDocument(d.id()));
          break;
        }
    } // next
    if (m.getDocument()==null) throw new ElementNotFoundException(m.getTypeName()+" document not found");
    return m;
  }
View Full Code Here

      if (d.type().name().equals(t.getTypeName())) {
        t.setDocument(oSes.getDms().getDocument(d.id()));
        break;
      }
    } // next
    if (t.getDocument()==null) throw new ElementNotFoundException(t.getTypeName()+" document not found");
    return t;
  }
View Full Code Here

  public static CaptureType seek(AtrilSession oSes, String sName) throws ElementNotFoundException {
    Dms oDms = oSes.getDms();
    SortableList<Document> oLst = oDms.query("CaptureType$name='"+sName+"'");
    if (oLst.isEmpty())
      throw new ElementNotFoundException("CaptureType "+sName+" not found");
    return new CaptureType(oDms.getDocument(oLst.get(0).id()));
  }
View Full Code Here

      if (d.type().name().equals(c.getTypeName())) {
        c.setDocument(oSes.getDms().getDocument(d.id()));
        break;
      }
    } // next
    if (c.getDocument()==null) throw new ElementNotFoundException(c.getTypeName()+" document not found");
    return c;     
  }
View Full Code Here

    } catch (NumberFormatException nfe) {
      throw new NumberFormatException("Document Id must be a long value");
    }
    try {
      oDoc = oDms.getDocument(sDocId);
      if (oDoc==null) throw new ElementNotFoundException("Cannot find document "+sDocId);
    } catch (ElementNotFoundException enf) {
      throw new ElementNotFoundException("Element not found "+sDocId);
    }
    if (oDoc!=null) setDocument(oDoc);
  }
View Full Code Here

  } // setDocument

  public String parentId() throws IllegalStateException, ElementNotFoundException {
    if (oDoc==null) throw new IllegalStateException(getTypeName()+" document not set before calling parentId() method");
    NodeList<Document> oParents = oDoc.parents();
    if (oParents.isEmpty()) throw new ElementNotFoundException("Parent not found");
    return oParents.get(0).id();
  }
View Full Code Here

  }

  public void load(AtrilSession oSes, String sDocId) throws ElementNotFoundException, NotEnoughRightsException , DmsException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    setDocument(d);
  }
View Full Code Here

TOP

Related Classes of es.ipsa.atril.exceptions.ElementNotFoundException

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.