Retrieving full child label list

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Retrieving full child label list

Post by Aestros » Mon Jul 14, 2008 9:21 am

Need your help again with label.

I'm able to get the current label of an object from "GetLabelQueryItems_Main" and "GetLabelQueryItems_Recursive". It's working great to know the label of the current object.

But, is there a way to get all the child label of that object ?

Here's an example of what I'm looking for :
$/ObjectToGetLabel ( 3 label on it )
$/ObjectToGetLabel/FileWithLabel.txt ( 1 label on it)
$/ObjectToGetLabel/Folder1/Folder2WithLabel ( 2 label on it)

When I use your function on "$/ObjectToGetLabel", it will always return only the 3 ones of "$/ObjectToGetLabel". But I'm looking for 6 labels ( 3 + 1 + 2 ). So can I get all the child label from one of your functions ?

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Mon Jul 14, 2008 10:09 am

Are you making sure to pass true into the bGetRecursive arguemnt of your label query?
Subscribe to the Fortress/Vault blog

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Post by Aestros » Mon Jul 14, 2008 11:23 am

Yes, I'm passing "true" to all the parameters.

Here's my code for main label

Code: Select all

VaultLib.VaultLabelItemX[] labelList;

int rowFromInherit;
int rowFromRecursive;
string strQueryToken;

Client.BeginLabelQuery(itemPath, itemID, true, true, true, true, 0, out rowFromInherit, out rowFromRecursive,out strQueryToken);
Client.GetlabelQueryItems_Main(strQueryToken,0,rowFromInherit,out LabelList);
Client.EndLabelQuery(strQueryToken);
Here's my code for recursive label

Code: Select all

VaultLib.VaultLabelItemX[] labelList;

int rowFromInherit;
int rowFromRecursive;
string strQueryToken;

Client.BeginLabelQuery(itemPath, itemID, true, true, true, true, 0, out rowFromInherit, out rowFromRecursive,out strQueryToken);
Client.GetlabelQueryItems_Recursive(strQueryToken, 0, rowFromRecursive, out LabelList);
Client.EndLabelQuery(strQueryToken);

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Mon Jul 14, 2008 12:59 pm

Comments:

1. You should be able to do both queries at once. Just call both Client.GetlabelQueryItems_Main and GetlabelQueryItems_Recursive one after the other.

2. The set you want is actually the ones returned fromGetlabelQueryItems_Recursive. You've now seen enough of our label query workings to understand how all of the parameters map to the controls in the Show Labels dialog. If you can get the Show Labels dialog to show you what you want, then you should be able to get those same results from the API.

Keep asking questions, as I'm pretty sure we can get you what you want.
Subscribe to the Fortress/Vault blog

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Post by Aestros » Mon Jul 14, 2008 1:30 pm

Thanks for #1, I'll do the same operation in the same token.

For #2, it's the problem, your "Show Labels dialog" in your client program doesn't show child label too.

If I use the same example as before.
$/ObjectToGetLabel ( 3 label on it )
$/ObjectToGetLabel/FileWithLabel.txt ( 1 label on it)
$/ObjectToGetLabel/Folder1/Folder2WithLabel ( 2 label on it)
When I click on "Show labels..." and go for "Recursive Labels" tab, it shows only the 3 Label of "$/ObjectToGetLabel" and not the child one.
Even if I change the filter to "Files only", it will not show the label on "FileWithLabel.txt" even if the file is directly into the current folder I'm looking at. Checking / unchecking "Act recursively" is not changing the result too.

I'm working with Vault Client (4.1.1).
So if you say I can get what your client is showing to me, is this mean I can't get child label from API ?

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Mon Jul 14, 2008 1:45 pm

If it's not showing up, how was the child label applied?
Subscribe to the Fortress/Vault blog

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Post by Aestros » Mon Jul 14, 2008 1:55 pm

An easy question :)
$/ObjectToGetLabel ( 3 label on it )
$/ObjectToGetLabel/FileWithLabel.txt ( 1 label on it)
$/ObjectToGetLabel/Folder1/Folder2WithLabel ( 2 label on it)
Right-click on "$/ObjectToGetLabel/FileWithLabel.txt", click on "Label..." and a label name and comment, click "OK". That's it.
If I go after that into the "Show labels" of "$/ObjectToGetLabel", it doesn't show the new label on "$/ObjectToGetLabel/FileWithLabel.txt" anywhere.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Mon Jul 14, 2008 4:06 pm

I just did that test with 4.1.2, and it works fine for me (see screenshot)
Attachments
labels.JPG
labels.JPG (27.73 KiB) Viewed 24114 times
Subscribe to the Fortress/Vault blog

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Post by Aestros » Tue Jul 15, 2008 6:33 am

Ok. I'll try with 4.1.2 and I'll give you a feedback

Aestros
Posts: 17
Joined: Mon Jun 16, 2008 7:54 am

Re: Retrieving full child label list

Post by Aestros » Thu Aug 14, 2008 7:06 am

Problem solved !

My company installed Vault 4.1.2 ( was at 4.1.1 ) and the "Show Labels" Dialog is now showing the recursive labels correctly.

humphry
Posts: 25
Joined: Thu Aug 20, 2009 5:32 am

Re: Retrieving full child label list

Post by humphry » Fri Jun 10, 2011 4:16 am

Has this been changed in the meanwhile?
I am not able to see labels of children in the show labels dialog.
The screenshot above shows labels of children when the checkbox is enabled.
The checkbox does not have any effect on the result.
If I use show labels on one of the child folders I do see labels (at that sublevel).

Information about server and client:
Version Check: This Vault client is version 5.0.4.18845
Version Check: Your Vault server is version 5.0.4.18845

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Retrieving full child label list

Post by lbauer » Fri Jun 10, 2011 7:55 am

You should be able to see child or recursive labels.

I'd suggest we schedule a remote assist session where I can take a closer look. Contact support at sourcegear.com, Attn: Linda. We'll set something up. Please include a link to this forum post.
Linda Bauer
SourceGear
Technical Support Manager

humphry
Posts: 25
Joined: Thu Aug 20, 2009 5:32 am

Re: Retrieving full child label list

Post by humphry » Fri Jun 10, 2011 8:10 am

Here are two screenshots. Level0.png shows the dialog on the childlevel.
Level1.png shows the parent level. As you can see Level1.png does not show the label of the sublevel.
I can confirm that the same happens at other developer's machines.

Server problem?
Attachments
level1.png
level1.png (24.94 KiB) Viewed 23158 times
level0.png
level0.png (26.02 KiB) Viewed 23158 times

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Retrieving full child label list

Post by lbauer » Fri Jun 10, 2011 11:17 am

I installed a copy of Vault 5.0.4 and was not able to reproduce this in that version, either. It may be something related to your database or environment.

Has the recursive label view ever worked properly?

Can you reproduce this with any new label, or labels on just certain parts of the tree?

Is your database an import from VSS?
Linda Bauer
SourceGear
Technical Support Manager

humphry
Posts: 25
Joined: Thu Aug 20, 2009 5:32 am

Re: Retrieving full child label list

Post by humphry » Tue Jun 14, 2011 12:09 pm

I've never seen it working before.
It's not related to a part of the tree. Tried several places.
We did not migrate to Vault from VSS (or something else).

Any ideas?

Post Reply