Package de.mhus.lib.cao

Examples of de.mhus.lib.cao.CaoException


      // 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 (CaoElement element : sources.getElements()) {
          cnt++;
      }
     
      monitor.beginTask("copy", cnt);
      cnt = 0;
      for (CaoElement element : sources.getElements()) {
        cnt = move( 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


   
      cnt++;
      monitor.worked(cnt);
     
    } catch (Exception e) {
      throw new CaoException("Count " + element.getId(),e);
    }
   
   
    return cnt;
  }
View Full Code Here

     
      getConnection().fireElementUpdated(getId());
     
     
    } catch (DfException e) {
      throw new CaoException(getId(),e);
    }   
  }
View Full Code Here

  public CaoList getChildren(CaoAccess access) throws CaoException {
       
    try {
      return new JackQueryList();
    } catch (RepositoryException e) {
      throw new CaoException(e);
    }
  }
View Full Code Here

    @Override
    public void reset() throws CaoException {
      try {
        rows = list.result.getRows();
      } catch (RepositoryException e) {
        throw new CaoException(e);
      }
    }
View Full Code Here

        File tmpFile;
        try {
          tmpFile = File.createTempFile("hair", ".txt");
        } catch (IOException e1) {
          e1.printStackTrace();
          throw new CaoException(e1);
        }
        final JackEditorInput editorInput = new JackEditorInput(jack.getNode(),new Path(tmpFile.getAbsolutePath()));
       
//        IEditorReference[] editorRefs = page.findEditors(editorInput,null,IWorkbenchPage.MATCH_INPUT);
        IEditorDescriptor desc = window.getWorkbench().getEditorRegistry().getDefaultEditor(editorInput.getName());
View Full Code Here

      if (a==null) a = MSingleton.instance().getActivator();
      String appClass = config.getExtracted("application_class");
      CaoApplication app = (CaoApplication) a.createObject(appClass,new Class[] {CaoConnection.class,IConfig.class}, new Object[] {con,config2});
      return app;
    } catch(Throwable t) {
      throw new CaoException(t);
    }
  }
View Full Code Here

        loadData(obj);
      } else {
        loadData(res);
      }
    } catch (DfException e) {
      throw new CaoException(e);
    }
    parentId = getId();
  }
View Full Code Here

    return new DctmWritable(this);
  }

  @Override
  public boolean isLocked(boolean owner) throws CaoException {
    if (getId()==null) throw new CaoException("Not a canonical object");
    try {
      //TODO performance ....
      IDfTypedObject obj = ((DctmConnection)getConnection()).getDctmObject(getId());
      if (obj instanceof IDfSysObject) {
        if (owner)
          return ((IDfSysObject)obj).isCheckedOutBy( ((DctmConnection)getConnection()).getUser() );
        else
          return ((IDfSysObject)obj).isCheckedOut();
      } else
        throw new CaoException("Not a sysobject");
    } catch (DfException e) {
      throw new CaoException(getId(),e);
    }
  }
View Full Code Here

  }

  @Override
  public boolean lock(int timeout) throws CaoException {
    try {
      if (timeout<0) throw new CaoException("timeout is less than zero");
      //TODO performance ....
      IDfTypedObject obj = ((DctmConnection)getConnection()).getDctmObject(getId());
      if (obj instanceof IDfSysObject) {
        if (timeout==0) {
          try {
            ((IDfSysObject)obj).lock();
            return true;
          } catch (DfException e) {
            return false;
          }
        } else {
          for (int t=0;t<timeout*2;t++) {
            try {
              ((IDfSysObject)obj).lock();
              return true;
            } catch (DfException e) {
             
            }
            MThread.sleep(500);
          }
          throw new CaoTimeoutException();
        }
      } else
        throw new CaoException("Not a sysobject");
    } catch (DfException e) {
      throw new CaoException(getId(),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.