shannon wrote: you shouldn't be accessing the children of the root through the VaultFolderDelta object, you should use the VaultClientFolder that was created using that delta.
> You are 100% correct. This was my misunderstanding and after I changed that it works. I was reading too much into what the contents of the VaultFolderDelta were. Apologies.
shannon wrote:Note that get_FullPath() may only give you a relative path, beginning at whatever root folder you chose.
> I noticed this, and should have a workaround for what I need.
shannon wrote:You're going to have to explain to me what exactly you're trying to do with deleted objects before I can help. We don't ever use this in conjunction with deleted objects....not to mean that I won't help, just that it's uncharted territory basically.
> I think the best way is with an example.
I wrote a recursive method which will display all the members as they exist in a repository with the version number beside them as it exists "now". If you look at my
2nd post I gave a code snippet of how this was built.
Once I print the data out I get:
Code: Select all
-> vaulttest (11)
- fraction_decimal.html (1)
- index.html (2)
- welcome.html (3)
- menu.html (2)
-> stock (2)
- stock.html (1)
-> js (1)
- stock.js (1)
I would like to be able to do the same "As Of" any revision.
What I have now is
Code: Select all
private static List<Folder> buildTreeVer(String root, long version) {
List<Folder> allFolders = new ArrayList<Folder>();
VaultClientFolder vcfolder = ServerOperations.ProcessCommandListFolder(root, false);
VaultFolderDelta vfd = ServerOperations.ProcessCommandGetBranchStructure(ServerOperations.GetRepositoryId("Initial Repository"), root, vcfolder.get_ID(), version, true);
VaultClientFolder vcf = new VaultClientFolder(vfd, null);
VaultClientFolderColl coll = vcf.get_Folders();
int count = coll.get_Count();
for(int i =0; i< count;i++)
{
VaultClientFolder curVCF = (VaultClientFolder)coll.get_Item(i);
Folder temp = new Folder(curVCF.get_Name(), curVCF.get_FullPath(), curVCF.get_Version());
// This is the recursive call to get the children folders
temp.setChildren(buildTreeVer(curVCF.get_FullPath(), curVCF.get_Version()));
// This sets The members.
temp.setMembers(getMembers(temp.getPath()));
allFolders.add(temp);
}
return allFolders;
}
Basically the exact same method except that I know what to get the path "As Of" a certain version.
So in my example above. I have a child folder of $/vaulttest called $/images which I deleted at version 7, so it doesn't appear (notice the only child folder is $/vaultest/stock appears) since the top version is now 11.
If I now call the above method like this buildTreeVer("$/vaulttest", 5);
I would like to see:
Code: Select all
-> vaulttest (5)
- fraction_decimal.html (1)
- index.html (1)
- welcome.html (2)
- menu.html (1)
-> images(2)
- myimage.gif(1)
-> stock (2)
- stock.html (1)
-> js (1)
- stock.js (1)
Since at version 5 of $/vaulttest the child folder $/vaulttest/images existed at version 2 with one child file myimage.gif at version 1.
This actually works exactly as expected for all folders that still exist at head version. (ie. for stock which exists in both version 5 and 11), but for /images which only exists at version 7 and below, I get the Exception I mentioned in my previous post.
The exception occurs on this line: "ServerOperations.ProcessCommandListFolder(root, false);" which I only have in there because I need the ObjID for the constructor you gave me, and I haven't yet found another way of finding an ObjID without that call.
What I
think it boils down to is: How do I get the ObjID for a member that is deleted at head version, but has previously existed?
Apologies for the novel, but I think this explains my intent in full.