It's all about the answers!

Ask a question

RTC SCM API IFileItem.getUserProperties() problem


Bruce Eifler (3912) | asked May 22 '13, 1:49 p.m.
 I am trying to read the user properties of a file.
The file I am using has a known set key/value pair that has been checked into the workspace.
However when I the run the IFileItem.getUserProperties() method it returns a map with no entries.
The elementCount is 0.  What am I doing wrong?

Here is my usage=>

 IItem fileWorkingCopy = fileItem.getWorkingCopy();
Map<String, String> props = ((IFileItem)fileWorkingCopy).getUserProperties( );

Comments
Tim Mok commented May 22 '13, 3:45 p.m. | edited unknown
JAZZ DEVELOPER

Can you show the part where you fetch the file item? Where does that file item handle come from?


Tim Mok commented May 22 '13, 3:50 p.m.
JAZZ DEVELOPER

Can you show the part where you fetch the file item? Where does that file item handle come from?


Bruce Eifler commented May 22 '13, 5:02 p.m.

I had to attach an image.  There is something about complex code that greys out the "Post comment" button.  It did the same thing when I pasted a java stack trace.  If there is a trick to doing this please let me know.  Thanks 

IFileItem.getProperty.Problem.jpg


Bruce Eifler commented May 23 '13, 11:28 a.m.

The image attach didn't work.  lets try using a link =>
RTCSCMIFileItemGetPropertiesProb.rtf


Tim Mok commented May 23 '13, 4:05 p.m.
JAZZ DEVELOPER

You likely can't paste the code because some rich formatting on the code is using up the character limit.

It's not clear from your code which configuration you're using to fetch the file item. If the configuration was retrieved before the properties were added, it is fetching the file item as it was in that configuration where it doesn't have the properties.


Ralph Schoon commented May 24 '13, 2:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you want to paste code, use [pre] [/pre] (replace the brackets with < and > ) in the HTML Source view (top right button).


Surya Tripathi commented Jul 18 '13, 6:11 p.m.

Could you try calling getUserProperties() immediately after you call setUserProperties() and see if you are able to read those properties? If yes, then there may be something different when you read the properties at a later time. May you are using a different configuration?

showing 5 of 7 show 2 more comments

Be the first one to answer this question!


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.