Examples of DmsException


Examples of es.ipsa.atril.doc.user.exceptions.DmsException

    super.save(oSes);

    if (getVolume(oSes)==null) {
      Log.out.debug("Getting default volume");
      Volume oVol = DAO.defaultVolume(oSes.getDms().getVolumeManager());
      if (oVol==null) throw new DmsException("No default volume is set");
      oVol.addDocument(getDocument());
      oVol.save();
      Log.out.debug("Added Ticket "+getDocument().id()+" to Volume "+oVol.name());
    }
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

                for (Document d : oLst) {
                  String q = d.parents().get(0).id();
                  if (p.equals(q) && !d.id().equals(getId()) &&
                    d.attribute(aAttrs[a].name).toString().equals(get(aAttrs[a].name))) {
                    Log.out.debug(getTypeName()+" attribute "+aAttrs[a].name+" unique constraint violation for value "+get(aAttrs[a].name)+" parent document id. is "+p+" previous document id. is "+d.id()+" current document id. is "+getId());
                      throw new DmsException(getTypeName()+" attribute "+aAttrs[a].name+" unique constraint violation for value "+get(aAttrs[a].name));
                    } // fi             
                }
              } // fi             
            }
          } // fi (unique)
          if (aAttrs[a].fk!=null && !isNull(aAttrs[a].name)) {
            try {
              BaseModelObject oObj = aAttrs[a].fk.doctype.newInstance();
              if (null==oObj.exists(oAdm, aAttrs[a].fk.attrib, get(aAttrs[a].name).toString())) {
                  throw new DmsException(getTypeName()+" attribute "+aAttrs[a].name+" foreign key violation "+get(aAttrs[a].name).toString()+" referencing "+oObj.getTypeName()+"."+aAttrs[a].fk.attrib);
              }
            } catch (InstantiationException e) {
              Log.out.error("BaseModelObject.save() InstantiationException "+e.getMessage());
            } catch (IllegalAccessException e) {
              Log.out.error("BaseModelObject.save() IllegalAccessException "+e.getMessage());
            }
          } // fi (foreign key)
          if (aAttrs[a].cc!=null) {
            if (!aAttrs[a].cc.check(oAdm, oIdx, this))
              throw new DmsException(getTypeName()+" attribute "+aAttrs[a].name+" constraint violation "+aAttrs[a].cc.getClass().getName());
          }
        } // next
      } finally {
        if (oAdm!=null) {
          if (oAdm.isConnected()) oAdm.disconnect();
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

      if (oCon!=null) {
        try {
          if (!oCon.isClosed()) oCon.close();
        } catch (SQLException e) { }
      }
      throw new DmsException(sqle.getMessage(), sqle);
    }
    return nDeletedAttributes;
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

    Volume oVol = getVolume(oSes);
   
    if (oVol==null) {
      Log.out.debug("Getting default volume");
      oVol = DAO.defaultVolume(oSes.getDms().getVolumeManager());
      if (oVol==null) throw new DmsException("No default volume is set");
      oVol.addDocument(getDocument());
      oVol.save();
      Log.out.debug("Added Invoice "+getDocument().id()+" to Volume "+oVol.name());
    } else {
      Log.out.debug("Got volume "+oVol.name());     
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

    Document oBil = exists(oSes, new NameValuePair("concept", getString("concept")), new NameValuePair("employee_uuid", getString("employee_uuid")));
   
    if (oBil!=null)
      if (oBil.id().equals(id()))
        throw new DmsException("A previous bill note with the same concept for the same employee already exists");

    super.save(oSes);
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

  @Override
  protected void delete(AtrilSession oSes, Dms oDms)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException,
    ClassCastException, IllegalStateException, DmsException {
    if (invoicesCount(oDms)>0)
      throw new DmsException ("Foreign key constraint violation. Client is referenced by Invoices.");
    else if (ticketsCount(oDms)>0)
      throw new DmsException ("Foreign key constraint violation. Client is referenced by Tickets.");
    else
      super.delete(oSes, oDms);
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

      oCon.close();
      oCon=null;

    } catch (SQLException sqle) {
      Log.out.debug("SQLException "+sqle.getMessage());
      throw new DmsException(sqle.getMessage(), sqle);
    } finally {
      try {
        if (oCon!=null) {
          if (!oCon.isClosed()) {
            if (oStm!=null) oStm.close();
View Full Code Here

Examples of es.ipsa.atril.doc.user.exceptions.DmsException

        oCon.close();
        oCon=null;
       
      } catch (SQLException sqle) {
        Log.out.debug("SQLException "+sqle.getMessage());
        throw new DmsException(sqle.getMessage(), sqle);
      } finally {
        try {
          if (oCon!=null) {
            if (!oCon.isClosed()) {
              if (oStm!=null) oStm.close();
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.