Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC API - Parent folder as a Versionable

I was just wondering how I could get a state for the parent-folder's handle as a versionable and pass that to scmService in order to retrieve the parent folder.

I'm currently doing:

IVersionable newparent = scmService.fetchState(versionableAfter.getParent(), new String[]{IVersionable.NAME_PROPERTY}, null);

but that's clearly wrong because I'm not specifying the state as a handle

0 votes



One answer

Permanent link
I used this code to understand how the API works: http://thescmlounge.blogspot.de/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html

In https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/ the method findOrCreateFolderWithParents() does this task.

The only way I found was to start with the root and look the children up until I had the one I wanted.

2 votes

Comments

Hi Ralph,

I've gone through both the links and I guess in summary, if I understood things right:

1) In order to be able to do something like this we have to use classes which are not meant to be a part of the API which means that the classes' interfaces can change with newer releases and support by the extension's author would have to be provided accordingly - this is from the first Link under 'Walking the file tree to fetch content'

2)The code in both links seems to be for client-side programming. But there probably are Server-Side equivalents to the APIs used in the code.

Now here's the question: why would the class IVersionable implement the getParent() method if it isn't meant to be used by extensions?

There are areas, where internal API can't be avoided. I would like to see users requesting this API to be officially supported. Although the API in some places is internal and could change at any time, I have not seen many changes in these areas since I do this API work. I think it is safe to use these methods, but to be fair to users I have to point it out.

The server side API is usually very similar to the client side API. The services on the server are usually named com.ibm...Service as opposed to the client where they are named com.ibm...Client. Some capabilities are only available on the client.

I did not say you can't use getParent() in my case I ended up doing something different to get my code to work, because I had to check in files and I had to find and set the parent.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Nov 26 '14, 6:39 p.m.

Question was seen: 4,098 times

Last updated: Dec 01 '14, 3:04 a.m.

Confirmation Cancel Confirm