I get DFS to import a file pretty easily. The portion that does not work is telling the document where to be inserted. Currently I can only put it in the "home" directory for the user. Does anyone know how to get it into a specific directory?
Jon
String objectId = null;
//IObjectService objectService = getObjectService(context);
//dm_document
Emc.Documentum.FS.DataModel.Core.DataObject dataObject =
new Emc.Documentum.FS.DataModel.Core.DataObject(new ObjectIdentity(repositoryName), "dm_document");
Emc.Documentum.FS.DataModel.Core.Properties.PropertySet properties = dataObject.Properties;
properties.Set("object_name", Path.GetFileName(file) + DateTime.Now.ToString("HHmm"));
//text = Unix text
//crtext = Windows Text
properties.Set("a_content_type", "crtext");
ObjectPath objectPath = new ObjectPath("testing/folder1/");
ObjectIdentity folderID = new ObjectIdentity(objectPath, repositoryName);
Relationship fold = new Relationship();
fold.Name = Relationship.RELATIONSHIP_FOLDER;
fold.IntentModifier = RelationshipIntentModifier.ADD;
ReferenceRelationship folderRelation = new ReferenceRelationship();
folderRelation.Name = Relationship.RELATIONSHIP_FOLDER;
folderRelation.TargetRole = Relationship.ROLE_PARENT;
dataObject.Relationships.Add(folderRelation);
// FileContent is for UCF, use BinaryContent
//dataObject.Contents.Add(new BinaryContent(File.ReadAllBytes(file), "jpg"));
dataObject.Contents.Add(new FileContent(Path.GetFullPath(file), "crtext"));
OperationOptions operationOptions = null;
DataPackage resultPackage = objService.Create(new DataPackage(dataObject), operationOptions);
objectId = resultPackage.DataObjects[0].Identity.GetValueAsString();