Skip to main content
14-Alexandrite
February 7, 2017
Question

Resource bundle: how to manage in WNC 10+

  • February 7, 2017
  • 1 reply
  • 4902 views

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:

  1. Resource bundle custom in previous Windchill version
  2. Resource bundle overriding an OOTC RB in previous Windchill version (IE: roleAccessResource.rbInfo)
  3. Resource bundle in a new custom in WNC 10+
  4. 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:

  1. Copy the file from <WTHOME>/src/wt/util/resource to <WTHOME>/wtCustom/wt/util/resource (once, before editing any label)
  2. Modify the label already present in this file
  3. From a Windchill shell launch the command: ant -f bin/tools.xml bundle_custom
  4. 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:

  1. Create/Modify entry in the file resourceCustomize.rbInfo
  2. 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 🙂

1 reply

16-Pearl
February 7, 2017

Hi Riccardo,


StringResourceInfo, previously represented as RBINFO, are now (10.+) using as annotated Java files (WTListResourceBundle).

I confirm that the customization of out-of-the-box WTListResourceBundle must be done via the resourceCustomize.rbInfo file.

I would say that the reference article is How to customize out of the box Java Resource Bundles (WTListResourceBundle) in Windchill 10.0 and later

See also the WTListResourceBundle javadoc .

Other localized resources such as EnumResourceInfo and MetadataResourceInfo are still using RBINFO files in 10.+.

14-Alexandrite
February 8, 2017

Thank you very much Stephane.

The question wanted to be a confirmation and a general description of how RBs/java files are working in the new version.

If I am finding still other problems I will write here 🙂

Thank you again,

Riccardo