Package com.documentum.fc.client

Examples of com.documentum.fc.client.DfQuery


      if (obj instanceof IDfFolder) {
        IDfFolder folder = (IDfFolder) obj;
        String dql = "SELECT r_object_id FROM dm_sysobject (all) WHERE ANY i_folder_id='"
            + folder.getObjectId() + "'";

        IDfCollection list = new DfQuery(dql).execute(session, IDfQuery.READ_QUERY);
        // folder.getContents( "r_object_id" );
        Vector<IDfSysObject> ids = new Vector<IDfSysObject>();
        while (list.next())
          ids.add((IDfSysObject) session.getObject(new DfId(list.getString("r_object_id"))));
        list.close();
View Full Code Here


//    applications.put(CaoDriver.APP_CONTENT, new DctmApplication(this) );
//    CapGuiDriver.createApplicationFor(config,applications);
  }

  public IDfCollection getQueryResult(String name, String[] attributes) throws CaoException {
    DfQuery query = new DfQuery();
    String dql = resources.getProperty(name);
    if (dql != null && attributes != null ) {
      for (int i=0; i < attributes.length;i++)
        dql = dql.replaceAll("\\["+i+"\\]", MSql.escape(attributes[i]));
    }
    log.trace("DQL: " + name + " -> "+ dql);
    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

      throw new CaoException(e);
    }
  }
 
  public IDfCollection getQueryResult(String dql) throws CaoException {
    DfQuery query = new DfQuery();
    log.trace("DQL: " + dql);
    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

        monitor.log().debug("  Target folder already exists " + existing.getObjectId());
        cnt++;
        monitor.worked(cnt);
       
        dql = "select r_object_id from dm_sysobject where FOLDER(ID('"+src.getObjectId()+"'))";
        IDfCollection res = new DfQuery(dql).execute(session, IDfQuery.READ_QUERY);
        LinkedList<String> children = new LinkedList<String>();
        while (res.next())
          children.add(res.getString("r_object_id"));
        res.close();
       
        for(String id : children) {
          IDfSysObject newSrc = (IDfSysObject) session.getObject(new DfId(id));
          cnt = copy((IDfFolder)existing,newSrc,cnt);
        }

        return cnt;
       
      }
    }
    LinkedList<String> tmp = new LinkedList<String>();
    for ( int i = 0; i < src.getFolderIdCount(); i++)
      tmp.add(src.getFolderId(i).getId());
   
    src.link(trg.getObjectId().getId());
   
    for (String id : tmp )
      src.unlink(id);
   
    IDfId newId = src.saveAsNew(true);
    monitor.log().debug("  Created: " + newId);
    src.revert();
    IDfPersistentObject newItem = session.getObject(newId);
    cnt++;
    monitor.worked(cnt);
   
    // fire events
    if (useTransaction) {
      events.add(new String[] {newId.getId(),trg.getObjectId().getId()});
    } else {
      target.getConnection().fireElementCreated( newId.getId() );
      target.getConnection().fireElementLink(trg.getObjectId().getId(), newId.getId());
    }
   
    if (src instanceof IDfFolder) {
      IDfFolder srcFolder = (IDfFolder)src;
      IDfFolder trgFolder = (IDfFolder)newItem;
      String dql = "select r_object_id from dm_sysobject where FOLDER(ID('"+srcFolder.getObjectId()+"'))";
      IDfCollection res = new DfQuery(dql).execute(session, IDfQuery.READ_QUERY);
      LinkedList<String> children = new LinkedList<String>();
      while (res.next())
        children.add(res.getString("r_object_id"));
      res.close();
     
View Full Code Here

  private int count(DctmElement element, int cnt) throws CaoException {
    if (monitor.isCanceled()) return cnt;
    try {
      String dql = "select count(*) as cnt from dm_sysobject where FOLDER(ID('"+element.getId()+"'),descend)";
      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);
View Full Code Here

    this.idfClient = idfClient;
  }

  @Override
  public IQuery getQuery() {
    return new DmQuery(new DfQuery());
  }
View Full Code Here

    return new DmLoginInfo(idfClientX.getLoginInfo());
  }

  @Override
  public IQuery getQuery() {
    return new DmQuery(new DfQuery());
  }
View Full Code Here

  public DmQuery(IDfQuery idfQuery) {
    this.idfQuery = idfQuery;
  }

  public DmQuery() {
    this.idfQuery = new DfQuery();
  }
View Full Code Here

TOP

Related Classes of com.documentum.fc.client.DfQuery

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.