kurtisane Absent Member.
Absent Member.
276 views

Starteam Java Checkout Label

Hello,

I'm facing the issue that I can't figure out how to checkout all files with a given Label.

I have the View, the Root Folder of that View, a CheckoutManager and the Label that I want to check out.

CheckoutManager doesn't allow a checkout by Label in certain Folder or View...

 

How is that done ?

I could iterate through the Items and check whether they have that Label or not, but that still doesn't check out that Item with the Label ....

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

RE: Starteam Java Checkout Label

Do you need to checkout the files attached to the label at their tips?
or do you need to check out the files attached to the label at the labeled revision?

if the former (that's my impression from the way you've phrased the question)
you'd need to run the following pseudo-code.

Server s = ...
Project p = s.findProject("name");
View v = p.findView("name");
Label l = v.findLabel("name");
ViewMemberCollection files = v.getViewMembers(s.getTypes().FILE);
files = l.getLabeledItems(files); // this is a reduced set of files attached to the label
CheckoutManager co = v.createCheckoutManager();
co.checkout(files);
co.commit();


If the latter (this returns all files at a configuration time associated with a view label, which is effectively a checkout from history)

Server s = ...
Project p = s.findProject("name");
View v = p.findView("name");
Label l = v.findLabel("name");
v = new View (v, ViewConfiguration.createFrom(l));
CheckoutManager co = v.createCheckoutManager();
co.checkout(v.getViewMembers(s.getTypes().FILE));
co.commit();


i hope this helps
take care
anil
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.