Examples of IDfPersistentObject


Examples of com.documentum.fc.client.IDfPersistentObject

      monitor.log().debug("Move " + src.getObjectId() + " to " + trg.getObjectId());
     
      if (src instanceof IDfFolder) {
        do {
          String dql = "dm_folder WHERE FOLDER(ID('"+trg.getObjectId()+"')) and object_name='"+MSql.escape(src.getObjectName())+"'";
          IDfPersistentObject existing = session.getObjectByQualification(dql);
          if ( existing != null ) {
           
            // Target folder already exists - this is the short way, use the existing folder to continue
           
            monitor.log().debug("  Target folder already exists " + existing.getObjectId());
           
            int nextIndex = 1;
            String name = src.getObjectName();
            int pos = name.lastIndexOf('_');
            if (pos > 0 && MCast.toint(name.substring(pos+1),0) > 0) {
View Full Code Here

Examples of com.documentum.fc.client.IDfPersistentObject

      name = name.substring(0,name.lastIndexOf('.'));
    this.name = name;
    try {
      if (res.hasAttr("r_object_id")) {
        IDfId id = res.getId("r_object_id");
        IDfPersistentObject obj = ((DctmConnection)getConnection()).getSession().getObject(id);
        this.meta = new DctmMeta(getDriver(),obj.enumAttrs());
        loadData(obj);
      } else {
        loadData(res);
      }
    } catch (DfException e) {
View Full Code Here

Examples of com.documentum.fc.client.IDfPersistentObject

  @Override
  public void save() throws CaoException {
    if (!isValid()) throw new CaoInvalidException();
    try {
      IDfPersistentObject obj = (IDfPersistentObject) ((DctmConnection)getConnection()).getDctmObject(getId());
 
      for (String name : data.keySet()) {
        if (name.equals("r_folder_id")) {
          // ignore
        } else {
          CaoMetaDefinition def = master.getMetadata().getDefinition(name);
          String listItemName;
          switch (def.getType()) {
          case BOOLEAN:
            obj.setBoolean(name, getBoolean(name,false));
            break;
          case DATETIME:
            obj.setTime(name, new DfTime(getDate(name).toDate()));
            break;
          case DOUBLE:
            obj.setDouble(name, getDouble(name,0));
            break;
          case LONG:
            obj.setInt(name, (int)getDouble(name,0));
            break;
          case STRING:
            obj.setString(name, getString(name));
            break;
          case LIST:
            CaoList list = getList(name);
            obj.truncate(name, 0);
            listItemName = list.getMetadata().getDefinitionAt(0).getName();
            for (CaoElement item :list.getElements()) {
              obj.appendString(name, item.getString(listItemName ));
            }
          }
        }
      }
      obj.save();
      reload();
      master.reload();
     
      getConnection().fireElementUpdated(getId());
     
View Full Code Here

Examples of com.documentum.fc.client.IDfPersistentObject

   
    monitor.log().debug("Copy " + src.getObjectId() + " to " + trg.getObjectId());

    if (src instanceof IDfFolder) {
      String dql = "dm_folder WHERE FOLDER(ID('"+trg.getObjectId()+"')) and object_name='"+MSql.escape(src.getObjectName())+"'";
      IDfPersistentObject existing = session.getObjectByQualification(dql);
      if ( existing != null ) {
       
        // Target folder already exists - this is the short way, use the existing folder to continue
       
        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) {
View Full Code Here

Examples of com.documentum.fc.client.IDfPersistentObject

      throw new IllegalArgumentException();
    }
    DmId dctmId = (DmId) objectId;
    IDfId idfId = dctmId.getidfId();

    IDfPersistentObject idfPersistentObject;
    try {
      idfPersistentObject = idfSession.getObject(idfId);
      if (idfPersistentObject instanceof IDfSysObject) {
        return new DmSysObject((IDfSysObject) idfPersistentObject);
      } else if (idfPersistentObject instanceof IDfACL) {
View Full Code Here

Examples of com.documentum.fc.client.IDfPersistentObject

  /** @since 3.2.0 */
  @Override
  public IPersistentObject getObjectByQualification(String qualification)
      throws RepositoryDocumentException {
    IDfPersistentObject idfPersistentObject;
    try {
      idfPersistentObject = idfSession.getObjectByQualification(qualification);
      if (idfPersistentObject == null) {
        return null;
      } else if (idfPersistentObject instanceof IDfSysObject) {
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.