It's all about the answers!

Ask a question

RTC API - Parent folder as a Versionable


Zaid Al-Khishman (35615) | asked Nov 26 '14, 6:39 p.m.
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

One answer



permanent link
Ralph Schoon (55.2k23642) | answered Nov 27 '14, 2:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Comments
Zaid Al-Khishman commented Nov 28 '14, 5:07 p.m.

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?


Ralph Schoon commented Dec 01 '14, 3:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 to post your answer.