Add-ons represent additional Oracle Commerce Platform products or features that are available separately from products, but which can be used to add functionality.
Product add-ons can be defined as groups for selection purposes. For instance, the Switching Datasource and Non-Switching Datasource add-ons are mutually exclusive. They are defined as belonging to a product-addon-group
that allows only one to be selected, using the max-occurs
attribute.
<product-addon-group id="datasource_group" min-occurs="1" max-occurs="1"> <title>Choose switching or non-switching datasource :</title> <product-id-required id="product_id"/> <requires-product-addon id="product_addon_id"/> <product-addon id="switchingdatasource" > <title resource-key="">Switching Datasource</title> <modify-server-instance-type id="management"> <add-named-datasource>switchingA</add-named-datasource> <add-named-datasource>switchingB</add-named-datasource> </modify-server-instance-type> <modify-server-instance-type id="production"> <add-named-datasource>switchingA</add-named-datasource> <add-named-datasource>switchingB</add-named-datasource> </modify-server-instance-type> </product-addon <product-addon id="nonswitchingdatasource" > <title resource-key="">Non-Switching Datasource</title> <modify-server-instance-type id="management"> <add-named-datasource>nonswitching</add-named-datasource> </modify-server-instance-type> <modify-server-instance-type id="production"> <add-named-datasource>nonswitching</add-named-datasource> </modify-server-instance-type> </product-addon> </product-addon-group
You can use the product-id-required
and requires-product-addon
elements in the product-addon-group
to specify other products or add-ons that must be present if the add-on group is selected. If you specify one or more product-id-required
products, the add-on-group is only displayed if the user selects all of those products. If you specify one or more add-ons in the requires-product-addon
element, the add-on group is only displayed if the required add-on group has been selected. In such a case, the order of the groups is important.
Add-On Combinations
In addition to individual products, you can define combinations as add-ons in the product.xml
, then define changes based on the selection of one or more add-ons.
Modifying Server Instance Types
An add-on might mean that additional modules are required in the EAR, that an additional data source is needed, or that an entirely different server type can be used; for example, if you add reporting to any Oracle Commerce Platform production combination, a data source is required for the data warehouse, and all potential server types require additional modules. Use the <modify-server-instance-type>
element to specify these changes:
<product-addon id="reporting <title resource-key="">Reporting</title <modify-server-instance-type id="management"> <prepend-module>ARF.Base</prepend-module <add-named-datasource>datawarehouse</add-named-datasource> </modify-server-instance-type> <modify-server-instance-type id="production"> <prepend-module>ARF.Base</prepend-module <add-named-datasource>datawarehouse</add-named-datasource> </modify-server-instance-type> </product-addon
The <modify-server-instance-type>
element has the following sub-elements:
<prepend-module>
<append-module>
<remove-module>
<add-named-datasource>
<remove-named-datasource>
<add-server-instance>
The module-related elements use the following syntax:
<prepend-module name="DAS"/>
The append-module
element can optionally include a before
attribute. For example, the following XML adds the DSS module before the DAS module, if DAS is found:
<append-module name="DSS" before="DAS"/>
The datasource elements have the following format:
<add-named-datasource id="production"/>
To add another server instance, use the syntax:
<add-server-instance id="reporting"/>
The server instance added must be defined just like any other instance.
To remove a server instance, use the syntax:
<remove-server-instance id="reporting"/>