Package es.ipsa.atril.exceptions

Examples of es.ipsa.atril.exceptions.ElementNotFoundException


    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("BaseModelObject.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    Class t = Class.forName("com.zesped.model."+d.type().name());
    BaseModelObject o = (BaseModelObject) t.newInstance();
    o.setDocument(d);
    o.delete(oSes, oDms);
  }
View Full Code Here


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

      }
      oSes.disconnect();
      oSes.close();
    }
    oSrvFlv = oServFlvrs.get(sCaptureServiceFlavorId);
    if (null==oSrvFlv) throw new ElementNotFoundException("No CaptureService Flavor was found with Id. "+sCaptureServiceFlavorId);
    return oSrvFlv;
  }
View Full Code Here

    if (sIdOrCode==null) throw new NullPointerException("AccountingAccount may not be null");
    if (sIdOrCode.length()==0) throw new NullPointerException("AccountingAccount may not be empty");
    for (AccountingAccount a : list(oSes))
      if (sIdOrCode.equals(a.getId()) || sIdOrCode.equals(a.getUuid()) || sIdOrCode.equals(a.getCode()))
        return a;
    throw new ElementNotFoundException("AccountingAccount "+sIdOrCode+" not found");
  }
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

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

  }

  public static Product seek(AtrilSession oSes, String sProductId)
    throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    Product p = new Product();
    if (sProductId==null) throw new ElementNotFoundException("Product may not be null");
    if (sProductId.length()==0) throw new ElementNotFoundException("Product may not be empty");
    for (Document d : top(oSes).getDocument().children()) {
      if (d.type().name().equals("Product")) {
        if (!d.attribute("product_id").isEmpty()) {
          if (sProductId.equals(d.attribute("product_id").toString())) {
            p.setDocument(d);
            return p;
          }
        }
        if (!d.attribute("product_name").isEmpty()) {
          if (sProductId.equalsIgnoreCase(d.attribute("product_name").toString())) {
            p.setDocument(d);
            return p;
          }
        }
      } // fi
    } // next
    throw new ElementNotFoundException("Product "+sProductId+"not found");
 
View Full Code Here

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

  }

  public TaxPayer seek(AtrilSession oSes, String sTaxPayer)
    throws ElementNotFoundException, NotEnoughRightsException, DmsException,
         InstantiationException, IllegalAccessException {
    if (sTaxPayer==null) throw new ElementNotFoundException("TaxPayer may not be null");
    if (sTaxPayer.length()==0) throw new ElementNotFoundException("TaxPayer may not be empty");
    final String sSanitizedBusinessName =  Gadgets.removeChars(sTaxPayer, "\"*?").trim().toUpperCase();;
    for (TaxPayer t : super.list(oSes)) {
      if (t.getBusinessName().equals(sSanitizedBusinessName) || t.getBusinessName().equalsIgnoreCase(sTaxPayer) || t.getId().equals(sTaxPayer) || t.getTaxId().equalsIgnoreCase(sTaxPayer))
        return t;
    }
    throw new ElementNotFoundException("TaxPayer "+sTaxPayer+"not found");
  }
View Full Code Here

  public Attr[] attributes() {
    return null;
  }

  public Client seek(AtrilSession oSes, String sClient) throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    if (sClient==null) throw new ElementNotFoundException("Client may not be null");
    if (sClient.length()==0) throw new ElementNotFoundException("Client may not be empty");
    final String sSanitizedBusinessName =  Gadgets.removeChars(sClient, "\"*?").trim().toUpperCase();;
    for (Client c : super.list(oSes)) {
      if (c.getBusinessName().equals(sSanitizedBusinessName) || c.getBusinessName().equalsIgnoreCase(sClient) || c.getId().equals(sClient) || c.getTaxId().equalsIgnoreCase(sClient))
        return c;
    }
    throw new ElementNotFoundException("Client "+sClient+"not found");
  }
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.