0

I am using DFS.NET Productivity layer v6.7.

I have variables dataObject and repoFolderPath. I want to save dataObject inside the folder specified by the path repoFolderPath.

I can do this in two ways:

  1. By setting i_folder_id:

    dataObject.Properties.Set<String[]>("i_folder_id", new String[] { repoFolderPath } );
    
  2. By using DFS .NET API:

    ObjectPath objectPath = new ObjectPath(repoFolderPath);
    ObjectIdentity linkFolderIdentity = new ObjectIdentity(objectPath, repositoryName);
    ReferenceRelationship linkFolderRelationship = new ReferenceRelationship();
    linkFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
    linkFolderRelationship.Target = linkFolderIdentity;
    linkFolderRelationship.TargetRole = Relationship.ROLE_PARENT;
    dataObject.Relationships.Add(linkFolderRelationship);
    

Q. What difference it will make if I choose one above other apart from the fact that in first approach I can use i_folder_id and in second approach I can use repoFolderPath? Will the second set of lines ultimately result in setting i_folder_id, or will do something more in addition to it?

Obviously for saving dataObject to the repository I am doing following in both the cases:

DataPackage dataPackage = new DataPackage(dataObject);
OperationOptions operationOptions = null;
DataPackage resultPackage = objectService.Create(dataPackage, operationOptions);
David Eisenstat
  • 64,237
  • 7
  • 60
  • 120
Mahesha999
  • 22,693
  • 29
  • 116
  • 189

1 Answers1

0

I am 99% sure that in this case when you create new object there is no difference between those two approaches, but for the sake of your vocation don't use first approach.

I did some research regarding relation types in my freshly installed repository. There is no relation type that would indicate some kind of connection between folder and objects linked to it. That just solidifies my assumption that there isn't anything else with linking object to folders aside from i_folder_id attribute.

As for the linking object to multiple folders - you just repeat lines you wrote for the first folder.

Miki
  • 2,493
  • 2
  • 27
  • 39
  • `vocation` means ?? Do you want to imply that its a bad practice? – Mahesha999 Aug 13 '14 at 13:44
  • but still want to know if it is setting any values of any cells in Documentums' SQL Server tables? I am always wary of document-objects to SQL-Server-tables mappings. Lots of stuff stored in there. Cant just keep track of everything. And if I should follow second approach, how can I link object to multiple folders ? In first approach I can do: `dataObject.Properties.Set("i_folder_id", new String[] { repoFolderPath1, repoFolderPath2 } );` – Mahesha999 Aug 13 '14 at 13:58
  • That is the main reason why you should do it like in second approach. I cannot guarantee you that there isn't anything else, maybe someone with deeper knowledge could give you a answer. – Miki Aug 13 '14 at 14:03