Feature Configuration Basics
By ACShorten on Dec 29, 2011
One of the features of the Oracle Utilities Application Framework is the Feature Configuration object. This object allows implementation to set global defaults and specific features within each product. They can also be used by partners and implementation team to store configuration entries for their extensions. This saves hardcoding or extensive configuration settings which would otherwise complicate the configurability.
I will illustrate with an example. For example, say that I am building an integration with another product, in this case SOA Suite and I need the ability for the site to override the URL for the integration (the term is Dynamic Endpoints). I can create a Feature Configuration to house the URL override so that my custom code later can read the Feature and substitute the URL in my extensions later on.
To do this I need to create a custom Feature Configuration entry to house the URL. To do this I do the following:
- I create a Lookup using Admin --> L --> Lookup menu item where FIELD_NAME is set to EXT_SYS_TYP_FLG. I give the Field Value as an appropriate value (use the prefix CM to avoid conflicts with base features). Add an appropriate Description and javaname for the Lookup (the latter is used by the SDK if you choose to write java code for your extension). The Field Value is very important. Ensure the Lookup is active.
- Now you need to specify all the settings for the Feature Configuration. This step can be repeated if you want to create more than one setting for the Feature. Create another Lookup to house the settings with the name <Field Value>_OPT_TYP_FLG where <Field Value> is the name of the Field Value of the lookup you created in the previous step (Step 1). Specify a Field Value, Description and javaname for the setting. Ensure the Lookup is active.
- Now flush the online cache using the flushAll.jsp command (or use the JMX class to do this). This will reload the new Feature and its settings into the cache.
You can now create a new Feature Configuration with the appropriate setting from the Admin --> F --> Feature Configuration menu.
The figure below illustrates the steps above for my example:
Now that it is configured you can use the Feature Configuration in your extension by calling the Feature Configurartion with the appropriate values.
For my example I am going to write a Service Script I can use in my Plugin Scripts to retrieve the value. The idea is to call the Service script and it would return the value (otherwise it will be blank if the value is not set or the Feature Configuration is not present).
The figure below illustrates the script which hardcodes the values to return the Feature Configuration. This is not the only way of getting the information but the easiest to illustrate (you can write java code to do the same). The script reuses the base F1-GetFeatureConfiguration script to do most of the work.
This is just an example of some of the abilities of the Feature Configuration object. As an implementor you can create one custom Feature Configuration to house all your custom settings or individual ones (or any combination). Of course the next steps are to write the code to extend the product to use the Feature Configuration. That is another blog entry for another time.