how to update the extracted metadata to the repository???

task
edited April 30, 2012 in Documentum #1

hi all,

i extracted documents from repository and metadata of corresponding objects in xml format to my local m/c.Now i need to update this metadata and upload it to other repository.. i am able to upload by setting some attributes as show in code....but how do i read each xml properties and update the values????pls give ur valuable suggestions!!!!!!!!!!

  IDfClientX clientx = new DfClientX();
  IDfImportOperation operation = clientx.getImportOperation();
  operation.setSession( session );
  IDfFolder folder = null;
  folder = session.getFolderByPath( destFolderPath ); if( folder == null ) {
  System.out.println("Folder or cabinet " + destFolderPath + " does not exist in the Docbase!");
  return;
}
     operation.setDestinationFolderId(folder.getObjectId()); IDfFile myFile = clientx.getFile( srcFileOrDir );

if( myFile.exists() == false ) {
  System.out.println("File or directory " + srcFileOrDir + " does not exist in the file system!");
  return;
}

  IDfImportNode node = (IDfImportNode) operation.add( srcFileOrDir );
  node.setNewObjectName("Import Folder");
  operation.execute();
 
  IDfList myNodes = operation.getNodes();
  int iCount = myNodes.getCount();
  System.out.println("Number of nodes after operation: " + iCount );
 
  for( int i = 0; i < iCount; ++i ) {
  IDfImportNode aNode = (IDfImportNode) myNodes.get(i);
  IDfSysObject object=aNode.getNewObject();
  object.setObjectName("Import_"+object.getObjectName()+"");
  object.setTitle("testing");
  object.setSubject("doImport");
  object.setApplicationType("importing");
  object.save();
  System.out.print("Object ID " + i + ": " + aNode.getNewObjectId().toString() + " " );
  System.out.println("Object name: file "+i+":"+object.getObjectName()+"");
}
}

Comments

  • VadimYakovlev
    edited April 30, 2012 #2
    task wrote:Now i need to update this metadata and upload it to other repository.

    Did you consider using a plain dump and load feature, load your objects into other repository and then update metadata in the target repository using DQL/DFC/whatever...? This way you'd eliminate the unnecessary hop of exporting the data locally.

  • yamangoyal
    edited April 30, 2012 #3

    you can use Buldoser tool to export and import the Data along with the Meta-data.

    In your case you need to use XML parser to read the XML file and then set the properties of the objects.