===== Writing Customizations =====
==== Introduction ====
Customizations can replace or change pages of AWP to modify them according to a customer's needs. A customization can either be just a folder in the customizations directory or a zip-archive of such a folder in the same place or uploaded via the [[customizations|customizations panel]] in ACC.
==== Structure ====
The content of the customization's directory are applied on startup and whenever AWP is reloading settings or when a customization is changed in the file-system. Normal files are just copied to the same place in the live webapp, xslt files are applied on the existing files in the same place of the live webapp. For example, if your customization ''customer-name'' would contain the following files:
webapps/awp/customizations/customer-name/login/usersession-form.jspx
webapps/awp/customizations/customer-name/login/welcome.jspx.xslt
The file ''usersession-form.jspx'' would be copied to the ''webapps/awp/login'' directory, overwriting the existing file completely. The ''welcome.jspx.xslt'' instead would not be copied but applied as XSL transformation on the ''webapps/awp/login/welcome.jspx'' file.
==== Manifest ====
When applying customizations, AWP also scans the customization directory for unknown customizations. Newly found customizations are then added to the list of customizations with the metadata found in the ''manifest.json'' file in the root directory of the customization.
The customization should therefore ship a ''manifest.json'' file which provides the following information:
{
"id": "unique-id-of-the-customization",
"class-id": "Utility",
"name": "Display Name of the Customization",
"description": "Description about the customization's feature set",
"configuration": "Default configuration of the customization. Could be a json block for example."
}
The id should follow a structure which is collision free with other customizations, for example by using a specific namespace prefix, like ''com.partner-name.awp.customization-1''. \\
The ''class-id'' is a shown in the [[customizations|customizations panel]] to group all customizations. It's recommended to choose one of the existing class-ids.