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?
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
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
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
2 other answers
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.
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.
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.
Comments
Alex Fitzpatrick
JAZZ DEVELOPER Oct 03 '12, 3:56 p.m.What encoding are you using for your Java source? (In Eclipse that is controlled in preferences General > Workspace > Text file encoding)
Timur Markunin
Oct 03 '12, 4:29 p.m.I use UTF-8