Installing an AddOn for a Specific Storefront
The addoninstall tool allows you to configure an AddOn for a storefront. It also adds the AddOn to the extensioninfo.xml file of the storefront, and generates the relevant project.properties file for the AddOn.
The addoninstall Tool
The following table lists the parameters of the addoninstall tool:
| Parameter | Notes |
|---|---|
|
addonnames |
This parameter is mandatory. If more than one AddOn name is specified, the names must be separated by commas. If you do not include the addonnames parameter when you run the addoninstall command, you are asked to provide it. |
|
addonStorefront.<storefrontTemplateName> |
This parameter is used to indicate which storefronts you are installing the AddOn for. If more than one storefront is specified, the storefront names must be separated by commas. The <storefrontTemplateName> variable indicates the storefront template you wish to use for storefront generation. By default, the value is yacceleratorstorefront. |
The ant addoninstall command has the following format:
ant addoninstall -Daddonnames="AddOnName1,AddOnName2" -DaddonStorefront.<storefrontTemplateName>="Storefront1,Storefront2"
The following is an example of the ant addoninstall command, where two AddOns (NewAddOn1 and NewAddOn2) are installed for B2CStorefront1 and B2CStorefront2, as well as for B2BStorefront1 and B2BStorefront2:
ant addoninstall -Daddonnames="NewAddOn1,NewAddOn2" -DaddonStorefront.yacceleratorstorefront="B2CStorefront1,B2CStorefront2,B2BStorefront1,B2BStorefront2"
The project.properties.template File
When you run the ant addoninstall command, the project.properties file for the AddOn is generated automatically. This is done using the project.properties.template file. Note that when you run the ant addoninstall command, the project.properties.template file overwrites the contents of the project.properties file of the AddOn.
-
Deletes the old project.properties file.
-
Generates the new project.properties file from the project.properties.template file.
-
Adds a relative import file reference in the yacceleratorstorefront/web/webroot/WEB-INF/_ui-src/responsive/lib/ybase-x.x.x/less/addons.less file if such reference does not already exist and the AddOn’s _ui-src/reponsive/less folder contains an <AddOn Name>.less file. For more information on LESS support for AddOns, see Responsive Website Build Process
-
Replaces the storefront name with the following line in the project.properties file:
<storefrontTemplateName>.additionalWebSpringConfigs.<AddOnName>=classpath:/<AddOnName>/web/spring/<AddOnName>-web-spring.xml
Configuring the AddOn Storefront Properties
When generating a new project.properties file, you can replace the addonStorefront.<storefrontTemplateName> property, or you can delete it, as described in the following sections.
Replacing the AddOn Storefront Properties
You can replace the default storefront properties by using the following parameter when you run the ant addoninstall command: addonStorefront.<storefrontTemplateName>=Storefront1,Storefront2.
For example, the default storefront properties for the B2C Accelerator appear in the project.properties file as follows:
yacceleratorstorefront.additionalWebSpringConfigs.<AddOnName>=classpath:/<AddOnName>/web/spring/<AddOnName>-web-spring.xml
If you specify the storefront parameters as addonStorefront.yacceleratorstorefront=B2CStorefront1,B2CStorefront2, the default line above is replaced in the project.properties file with the following:
B2CStorefront1.additionalWebSpringConfigs.<AddOnName>=classpath:/<AddOnName>/web/spring/<AddOnName>-web-spring.xml B2CStorefront2.additionalWebSpringConfigs.<AddOnName>=classpath:/<AddOnName>/web/spring/<AddOnName>-web-spring.xml
Deleting the AddOn Storefront Properties
If you set the storefront parameter addonStorefront.yacceleratorstorefront=blank, the following property is deleted from the project.properties file:
yacceleratorstorefront.additionalWebSpringConfigs.<AddOnName>=classpath:/<AddOnName>/web/spring/<AddOnName>-web-spring.xml
Running the ant addoninstall Command
-
Before you run the ant addoninstall command:
-
Ensure that the addonsupport extension is listed in localextensions.xml file, as follows:
... <extension name="addonsupport"/> ...
-
Also, ensure that the AddOn and storefront extension that you want to install are listed in localextensions.xml file.
-
If you have all your AddOns prepared as a single ZIP file, perform the following steps:
-
Unzip all the AddOns that you wish to install into a subfolder of the <HYBRIS_BIN_DIR> folder. In the following example, the subfolder is called addoninstalldir.
-
Add the following line to your localextensions.xml file:
... <path autoload="true" dir="$\{HYBRIS_BIN_DIR\}/addoninstalldir"/> ...
-
-
Finally, make sure you have properly defined the project.properties.template file for each AddOn that you wish to install.
-
-
Open the command prompt and navigate to the hybris/bin/platform directory.
-
Run the addoninstall command. The command has the following format:
ant addoninstall -Daddonnames="AddOnName1,AddOnName2" -DaddonStorefront.<storefrontTemplateName>="Storefront1,Storefront2"
-
When addoninstall has finished running successfully, rebuild the SAP system by running ant clean all from the hybris/bin/platform directory.