It's all about the answers!

Ask a question

API to determine local (not checked in) changes?


Srimanth Gunturi (206125) | asked Oct 24 '10, 12:56 a.m.
JAZZ DEVELOPER
retagged Dec 16 '13, 12:18 p.m. by David Lafreniere (4.8k7)
Hello,
Was wondering if there is any public API to determine the presence of
and/or details about files not checked in? We need to do our operation
only when no changes have been made to the workspace. All the API I have
seen are to do with ChangeSets, and when the user does not check-in,
there is no changeset.
Regards,
Srimanth.

8 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Oct 24 '10, 9:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that the RTC repository has no notion of a "checked out file" (in
RTC, that is a client-side only concept). So you'll be looking for an
Eclipse client API call, not a server API call.

Cheers,
Geoff

On 10/24/2010 12:56 AM, Srimanth Gunturi wrote:
Hello,
Was wondering if there is any public API to determine the presence of
and/or details about files not checked in? We need to do our operation
only when no changes have been made to the workspace. All the API I have
seen are to do with ChangeSets, and when the user does not check-in,
there is no changeset.
Regards,
Srimanth.

permanent link
Michael Valenta (3.7k3) | answered Oct 25 '10, 8:54 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Srimanth

The API you want is the ILocalChangeManager which can be obtain using
FileSystemCore.getSharingManager().getLocalChanegManager().

Michael

Srimanth Gunturi wrote:
Hello,
Was wondering if there is any public API to determine the presence of
and/or details about files not checked in? We need to do our operation
only when no changes have been made to the workspace. All the API I have
seen are to do with ChangeSets, and when the user does not check-in,
there is no changeset.
Regards,
Srimanth.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 01 '11, 8:14 a.m.
Hi,
I'm facing the same problem. When I try to use FileSystemCore I've always get some null object.
For example if I use FileSystemCore.getSharingManager.allShares I got an empty IShare array, and every try I made for findShareable returns null.

How do I have to use FileSystemCore in order to have these objects? I've seen there is a startUp method, how it has to be used?

Thanks,
Michele.

Srimanth

The API you want is the ILocalChangeManager which can be obtain using
FileSystemCore.getSharingManager().getLocalChanegManager().

Michael

Srimanth Gunturi wrote:
Hello,
Was wondering if there is any public API to determine the presence of
and/or details about files not checked in? We need to do our operation
only when no changes have been made to the workspace. All the API I have
seen are to do with ChangeSets, and when the user does not check-in,
there is no changeset.
Regards,
Srimanth.

permanent link
Michael Valenta (3.7k3) | answered Apr 01 '11, 2:47 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Are you using the plain java client? Have you loaded content from the repository? You won't get any shares until something is either loaded from the repository or shared.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 02 '11, 2:25 p.m.
Yes I'm using plain java client. I've a workspace repository and I've load on a local eclipse workspace using RTC eclipse client. Do I have do load repository using java plain api in order to use these methods?

Thanks,
Michele.

Are you using the plain java client? Have you loaded content from the repository? You won't get any shares until something is either loaded from the repository or shared.

permanent link
Michael Valenta (3.7k3) | answered Apr 04 '11, 8:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Technically you don't but it would be less error prone if you did. I would suggest trying to do the load using the plain java client and see if you can access the info after that.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 08 '11, 7:31 a.m.
It seems that FileSystemCore does not work properly with me. I've obtained ISharable object but only using ISandbox.findSharable and not using ISharingManager.findSharable/s. And also I can't get any ILocalChange using ILocalChangeManager.getPendingChanges.

Here is my code:

IWorkspaceConnection iwc = wm.getWorkspaceConnection(wsHandles.get(0), null);

FileSystemCore.startUp();
ISharingManager sm = FileSystemCore.getSharingManager();
ISandbox sbox = sm.getSandbox(pathObj, false);

ILocalChangeManager lcm = sm.getLocalChangeManager();
IShareable shareable = sbox.findShareable(ola, false);
ILocalChange[] localChanges = lcm.getPendingChanges(iwc.getContextHandle(), compHandles.get(0), sbox);

I've obtained IWorkspaceHandle and IComponentHandle using queries.

Can you see something I'm doing wrong using ISharingManager?

Thanks
Michele.

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 14 '11, 3:17 a.m.
I think I've found the problem: if I use ISandbox.allShares (although I don't use the IShare[] returned object) then getPendingChanges works.

I really don't understand which link exists between the two methods...

I also remove FileSystemCore.startUp() method. It seems to do nothing for me...

Your answer


Register or 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.