Resource bundle: how to manage in WNC 10+
Hi everybody,
I would like to make a summary of how to customize a resource bundle for Windchill versions starting from 10, and to be sure that what I am writing is right.
I am listing all the possible cases and trying to understand how to manage them:
- Resource bundle custom in previous Windchill version
- Resource bundle overriding an OOTC RB in previous Windchill version (IE: roleAccessResource.rbInfo)
- Resource bundle in a new custom in WNC 10+
- Resource bundle overriding an OOTB RB in WNC 10+ (IE: roleAccessResource.java)
1. Resource bundle custom in previous Windchill version (IE: companyRB.rbInfo)
Based on the migration steps all the RBs are moved to the file resourceCustomize.rbInfo and the user has to follow these steps to customize one of the labels in this file:
- Copy the file from <WTHOME>/src/wt/util/resource to <WTHOME>/wtCustom/wt/util/resource (once, before editing any label)
- Modify the label already present in this file
- From a Windchill shell launch the command: ant -f bin/tools.xml bundle_custom
- From a Windchill shell launch the command (only if the label is used in applets): ant -f codebase/MakeJar.xml custUpdate
At the end of the conversion, RBs should not be existing anymore and hence never use again file *.rbInfo => never create other custom rbInfo files
References:
How to generate file resourceCustsomize.rbInfo: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS75810
Steps to modify label in resourceCustomize.rbInfo: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS179861
How to generate java files from rbInfo: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS149158
2. Resource bundle overriding an OOTC rb in previous Windchill version (IE: roleAccessResource.rbInfo)
These RBs will be migrated "automatically" to the file resourceCustomize.rbInfo, so refer to point 1 if you need to modify them.
Reference: How to generate file resourceCustsomize.rbInfo: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS75810
3. Resource bundle custom in WNC 10+
Administrators/developers can use WTListResourceBundle class and annotations as shown in the example below
Example from the "Windchill customization guide"
"
Listing 24: exampleResource.java
01 package com.acme.example;
02
03 import wt.util.resource.*;
04
05 /** This example blatantly plagiarized from the JavaDoc. **/
06 @RBUUID("com.acme.example.exampleResource")
07 public class exampleResource extends WTListResourceBundle {
08 @RBEntry("This is the localized text with a single
substitution: \"{0}\".")
09 @RBComment("An example entry.")
10 @RBArgComment0("Any string...")
11 public static final String EXAMPLE_STRING = "0";
12 }
"
References:
Windchill customization guide: http://support.ptc.com/WCMS/files/135892/en/10_MR030_WindchillCustomizationGuide.pdf
Customize OOTB java files: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS219006
Question: the command in the referenced article is used to compile java file without the IDE (Eclipse, IntelliJ, ...) or is it mandatory to compile all the java files?
4. Resource bundle overriding an OOTB RB in WNC 10+ (IE: roleAccessResource.java)
Java file cannot be modified, but the user has to:
- Create/Modify entry in the file resourceCustomize.rbInfo
- Recompile the file using the commands
ant -f bin/tools.xml bundle_custom
ant -f codebase/MakeJar.xml custUpdate
References:
Customize OOTB java files: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS219006
How to add entries in resourceCustomize: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS179861
Scenario
I need to customize labels for the file roleAccessResource where some entries are coming from the previous version of Windchill and hence the file resourceCustomize.rbInfo has already some modified entries; I followed the steps in http://support.ptc.com/cs/help/windchill_hc/wc110_hc/WCCG_UICust_GenericUICust_CustomizeRoleBasedUIFunctions.html?queryI… but with no results.
Do I to use what I wrote in the 4th point?
And which method do I have to use to customize a state?
Conclusion
In Windchill 10+ I do not have to maintain any rbInfo file except the resourceCustomize.rbInfo to edit OOTB label or to add entries to OOTB files.
Custom rbInfo can be migrated to java files and removed the entries from resourceCustomize.rbInfo that is including all the found rbInfo.
Any custom resource bundle can be generated using the java style.
I hope everything is right, otherwise just let me know which errors I have done 🙂

