Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I am trying to fetch token from specific Localization Table (i.e. only from the Localization Table named as "es") through the extension SDK in thingworx.
I am using "com.thingworx.localization.LocalizationTable.GetToken" api. But it always returns the token value from the "Default" Localization Table. I also tried "com.thingworx.localization.LocalizationTable.setName" api to set the name of the expected Localization Table but it didn't worked.
Can I get any code reference in java?
You can call against the table directly.
So within Thingworx it would be LocalizationTables["es"].GetToken{params}
sorry not sure how that would translate into the SDK
I don't think there is a service that allows you to do that by doing a call that specifies the actual localization table you want it from.
The Java code should look like this:
LocalizationTable esLocalizationTable = (LocalizationTable)EntityUtilities.findEntity("es", RelationshipTypes.ThingworxRelationshipTypes.LocalizationTable);
try {
String valueToken = esLocalizationTable.GetToken("yourtoken");
} catch (Exception e1) {
e1.printStackTrace();
}
Thanks a lot! It worked for me.