Follow-up encoding problem
Hello,
I'm writing follow-up that checks that wi has no blocking relationships. It works fine in my development environment but fails in client environment. My client has JTS with Russian translation. It looks like string that I check in my java code "Зависит от"(Depends On) is incorrectly encoded in the client environment. Any ideas? |
Accepted answer
Ralph Schoon (63.4k●3●36●46)
| answered Oct 04 '12, 8:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 04 '12, 8:47 a.m.
Timur,
that was what I meant, don't use the display names to identify anything in server extensions. There are ID's and constants available to use instead. This allows to code this up and it will work for any template. Again, see http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ and the earlier article on linking to understand how the code should be modified. E.g. use
WorkItemLinkTypes.BLOCKS_WORK_ITEM
Timur Markunin selected this answer as the correct answer
Comments
Timur Markunin
commented Oct 05 '12, 5:03 a.m.
Thanks a lot, Ralph!
|
2 other answers
Ralph Schoon (63.4k●3●36●46)
| answered Oct 04 '12, 8:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Timur,
I am not sure what you do here. Are you using a string to identify the link endpoints? If so, I would suggest to use the constants to access the link types. e.g. as described here: http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ If you do this you should be independent from the language you use in the templates. I would suggest to avoid using translated strings for extensions wherever possible. Use the ID's instead. This is sometimes not easy to do, especially if coding a client that gets data as strings, but try it if possible at all. If you do it and you still experience problems I would suggest to open a work item. |
Hi Ralph! Thanks for your response!
I'm using following code to check wi's relations: IWorkItemReferences iwr = ((ISaveParameter) data).getNewReferences(); List<IEndPointDescriptor> epdl = iwr.getTypes(); for(int i=0;i<epdl.size();i++) { ILinkType lt = epdl.get(i).getLinkType(); if(lt.getLinkTypeId().endsWith(BlockingItemLink)) { if(epdl.get(i).getDisplayName().equalsIgnoreCase(DependsOnLink)||epdl.get(i).getDisplayName().equalsIgnoreCase(DependsOnLinkRU)) { IReportInfo info = collector.createExceptionInfo("This wi is blocked by another wi", new Throwable("Error")); // tell the caller to post an error, and reject the action collector.addInfo(info); } } The problem is that if process template is translated than epdl.get(i).getDisplayName() returns translated string. |
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.
Comments
What encoding are you using for your Java source? (In Eclipse that is controlled in preferences General > Workspace > Text file encoding)
I use UTF-8