Getting files of a Baselin
Hi
I'm using the jazz API (SDK)
I need to get the files in a certain baseline. Currently I have a code that gets all the files in a component, but I only need to get the baseline's files. Thanks |
9 answers
Hi Lorena.
To answer your original question about getting the files in a particular baseline, here is some sample code based on the Jazz Java client API. Given a baseline handle, this code prints the files in the baseline, including file type, uuid, and path. Is this what you had in mind? -Matt ============================== /** * Print the specified baseline */ private static void printBaseline(IBaselineHandle handle, IProgressMonitor monitor) throws TeamRepositoryException { IBaselineConnection blConn = SCMPlatform.getWorkspaceManager(repo).getBaselineConnection(handle, monitor); IConfiguration config = blConn.changeHistory().configuration(); IFolderHandle rootFolder = config.rootFolderHandle(monitor); printFolder(blConn.getName(), rootFolder, config, monitor); } /** * Recursively print the specified repository folder and its file contents. * Print the path and UUID of each entry. */ @SuppressWarnings("unchecked") private static void printFolder(String path, IFolderHandle folder, IConfiguration config, IProgressMonitor monitor) throws TeamRepositoryException { printEntry(path, folder); Map<String,IVersionableHandle> kids = config.childEntries(folder, monitor); for (Entry<String, IVersionableHandle> folderEntry : kids.entrySet()) { path = path + "/" + folderEntry.getKey(); IVersionableHandle child = folderEntry.getValue(); if (child instanceof IFolderHandle) { printFolder(path, (IFolderHandle) child, config, monitor); } else { printEntry(path, child); } } } /** * Print a single repository file's type, UUID, and path. */ private static void printEntry(String path, IVersionableHandle vh) throws TeamRepositoryException { if (firstTimeThrough) { System.out.format("File Type,UUID,Path\n"); firstTimeThrough = false; } System.out.format("%s,%s,%s\n", vh.getItemType().getName(), vh.getStateId().getUuidValue(), path); } |
Hi, you can't take directly the files from a baseline. You need to compare the baseline to a workspace or a stream in order to get the change-sets (and then the files) you want find.
Best regards, Michele
|
Hi Michele (or) Lorena,
Is it possible to get such lists using Calculated value script to retrieve values into an enumeration attribute? Thanks. |
Ralph Schoon (63.7k●3●36●48)
| answered Jun 22 '12, 8:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Valli,
https://jazz.net/wiki/bin/view/Main/AttributeCustomization states what is possible and as far as i am aware what you want to do is not doable using JavaScript. |
Thanks Ralph. Can operation advisor provide an equivalent of what i am trying to do?
My req. is: Based on project area, i want a drop-down of streams available, based on selected stream,, i want a drop-down of baselines available Its kind of dependent enumeration concept - but i need to automate the values in the enumeration list. Is this possible using operation advisor plugin?
|
Ralph Schoon (63.7k●3●36●48)
| answered Jun 22 '12, 9:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,
i think you want to create an AttributeValueProvider (see https://jazz.net/wiki/bin/view/Main/AttributeValueProviders ) and possibly an attribute presentation (see https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentationsV2 ) to allows selecting the values. An operation advisor would be required to make sure some precondition is met. |
Ralph Schoon (63.7k●3●36●48)
| answered Jun 22 '12, 9:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Having said that and even if I have looked into extending the tools, I rather try to avoid complex extensions like the ones mentioned above if at all possible. Keep it simple.
If you make work item usage too complex all users will start to hate it and you loose time etc. We have seen excessive customizations in the past with other tools and the ill effect it has. There also seems a universal law that more stuff is added to work items, but it is almost never removed, even if it is not necessary anymore. 8-D |
Hi Ralph,
This is the calculated value script that i asked previously about...I am not sure of how to retrieve streams, baselines etc using dojo providers. I have not tried it relating to SCM at all.Please advise. Thanks.
|
Ralph Schoon (63.7k●3●36●48)
| answered Jun 22 '12, 10:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Valli,
please follow the links in https://jazz.net/forum/questions/79881/getting-files-of-a-baselin/79959 . Since I haven't implemented anything like that myself, I can't provide more. The only think that I am pretty sure of is that you can't access that kind of data in a JavaScript based attribute customization. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.