Package de.mhus.lib.cao

Examples of de.mhus.lib.cao.CaoException


  @Override
  public void setObject(String name, Object value) throws CaoException {
    CaoMetaDefinition def = master.getMetadata().getDefinition(name);
    if (def==null||def.getType()!=TYPE.OBJECT)
      throw new CaoException("Unknown attribute: " + name);
    data.put(name, value);
  }
View Full Code Here


  @Override
  public void setString(String name, String value) throws CaoException {
    CaoMetaDefinition def = master.getMetadata().getDefinition(name);
    if (def==null)
      throw new CaoException("Unknown attribute: " + name);
    data.put(name, value);
  }
View Full Code Here

    if (dql==null) return null;
    query.setDQL(dql);
    try {
      return query.execute(session, DfQuery.READ_QUERY);
    } catch (DfException e) {
      throw new CaoException(e);
    }
  }
View Full Code Here

    if (dql==null) return null;
    query.setDQL(dql);
    try {
      return query.execute(session, DfQuery.READ_QUERY);
    } catch (DfException e) {
      throw new CaoException(e);
    }
  }
View Full Code Here

          }
        }
      }
      node.getSession().save();
    } catch (Exception e) {
      throw new CaoException(getId(),e);
    }
   
  }
View Full Code Here

      }
      try {
        meta = new DctmMeta(con.getDriver(),res.enumAttrs());
        hasNext = res.next();
      } catch (DfException e) {
        throw new CaoException(e);
      }
    }
View Full Code Here

      // START TRANSACTION
      try {
        orgSession.getSessionManager().beginTransaction();
      } catch (DfException e) {
        monitor.log().debug(e);
        throw new CaoException(e);       
      }
    }

    try {
      session = orgSession.getSessionManager().getSession(orgSession.getDocbaseName());     
     
      monitor.beginTask("count", CaoMonitor.UNKNOWN);
      int cnt = 0;
      for (Object element : sources.getElements()) {
          cnt = count( (DctmElement)element, cnt );
      }
     
      monitor.beginTask("copy", cnt);
      cnt = 0;
      for (Object element : sources.getElements()) {
        cnt = copy( target, (DctmElement)element, cnt );
        // element.getConnection().fireElementCreated(target.getId()+"/"+element.getName());
      }
           
      session.getSessionManager().release(session);
      if (useTransaction) {
        monitor.log().debug("Commit transaction");
        orgSession.getSessionManager().commitTransaction();
      }
     
    } catch (Throwable t) {
      monitor.log().error(t);
      if (session!=null) session.getSessionManager().release(session);
      if (useTransaction) {
        monitor.log().debug("Abort transaction");
        try {
          orgSession.getSessionManager().abortTransaction();
        } catch (DfException e) {
          monitor.log().debug(e);
          throw new CaoException(e);
        }
      }
    }
   
    session = null;
View Full Code Here

    try {
      IDfSysObject src = (IDfSysObject) session.getObject(new DfId(element.getId()));
      IDfFolder trg = (IDfFolder) session.getObject(new DfId(target.getId()));
      cnt = copy(trg,src,cnt);
    } catch (Exception e) {
      throw new CaoException("Copy " + element.getId(),e);
    }
   
   
    return cnt;
  }
View Full Code Here

      IDfCollection res = new DfQuery(dql).execute(session, IDfQuery.READ_QUERY);
      if (res.next())
        cnt = cnt + res.getInt("cnt");
      cnt++; // cnt the node itself
    } catch (Exception e) {
      throw new CaoException("Count " + element.getId(),e);
    }
    return cnt;
  }
View Full Code Here

  @Override
  public CaoList getChildren(CaoAccess access) throws CaoException {
    try {
      return new QueryList();
    } catch (Exception e) {
      throw new CaoException(e);
    }
  }
View Full Code Here

TOP

Related Classes of de.mhus.lib.cao.CaoException

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.