Portlet Factory, Version 6.1.2
Using resource bundle data
There are two techniques you can use to incorporate resource data as a Lookup Table. The technique you choose depends on your data formats and on the availability in the model of a Localized Resource builder. You can choose:
- No Localized Resource builder in model
- If you have a resource bundle (or any similarly-shaped data) in your model, you can use a Lookup Table builder, tell it to reference that variable, and select Resource Bundle Style.
- Localized Resource builder available
- In the Localized Resource builder there is a check box input, Create Lookup Table. If you enable this input, a Lookup Table builder with the name name of Localized Resource builderLookupTable is added to the model with all the correct settings to make a lookup table out of this data.
In essence, you use a resource bundle's keys and values as the "data" and "text" in a Lookup Table. For example, if the resource bundle contains the following:
P1=East P2=West P3=North P4=SouthThe Lookup table can use as data values P1, P2, P3 and P4, and the corresponding text Table values will be Ease, West, North, South.
The builder input, Value Set, is available if you choose a Variable type of Resource Bundle Style. This input provides an indirect picker, you can use eto specify a reference to an XML variable, a reference to a comma-delimited String, or a hard-coded comma delimited string. This input will contain a set of values only, and the Lookup Table will be built from your set of values. The resulting table will be in the order of the values you specified.
This has the added value that you can use only a single resource bundle and you can build several Lookup Tables from it.
For example, if you have a resource bundle with the following keys and text:
jan=January feb=February mar=March . . . nov=November dec=Decemberand
P1=East P2=West P3=North P4=SouthYou could have a variable with the following XML.Note: The order of the values is different from in the bundle.
<top> <option>P1</option> <option>P3</option> <option>P2</option> <option>P4</option> </top>First you would add a Localized Resource builder to the resource bundle.
Then you could add one Lookup Table builder using the localized resource and pointing at the XML above. This would create a lookup table with values P1, P3, P2, P4 and the corresponding text would be East, North, West, South.
Then you could add another Lookup Table builder using the same localized resource and, in the Value Set input, you specify the comma-delimited text entry: jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
This will create another table with those twelve values and the labels, again, taken from the bundle.
Note: You never put any labels in the model. You put only the values in the model, Labels come from the resource bundle.
Parent topic: Lookup Table builder
Library | Support |