APS 1.2 application of External System type designed for PA.
Application is linked with domain (or domains) that belong to customer's account. DNS records are automatically added or replaced in domain zone.
To enable domain integration in APS application of External System type, use the setting with class ="domain-name" (refer to Application Integration Guide for more details).
There may be 2 different use cases.
Use case #1. Application is installed on one domain.
Examples - mobile site (GoMobi application), eShop (ePages application).
To achive installation on customer's domain, add domain name setting with type="domain-name", e.g.:
<setting id="shop_domain" class="domain-name" visibility="hidden" protected="true" type="domain-name"> <name>Shop domain</name> </setting>
In addition to the domain-name value of setting, it is necessary to enable the 'Provision application on account's domain' activation parameter in the corresponding 'Application' resource type in POA.
Refer to the Knowledgebase article How to install an APS application on a customer's domain automatically for more details how to configure automatic installation of APS application on domain.
Currently POA does not allow to change domain an application is installed on.
It is recommended to use domain-name setting in the entry point.
Use case #2. Application can receive several domains.
Example - Spam Filter.
If several domains can be added to the APS application, use the domain-name setting with type="list", e.g.:
<setting id="domains" class="domain-name" type="list" element-type="string" track-old-value="true"> <name>List of domains</name> </setting>
When such setting is defined in APS application APP-META.xml, the 'Domains' tab will appear at application screen in POA Customer Control Panel. Customer can add several domains from the list of domains that are registered in their customer account.
To have domains added to application automatically, enable the 'Bind domains to application instance' activation parameter in the corresponding 'Application' resource type in POA.
Note: if application is installed automatically, empty domains list can be received on installation step. Then, when domains registration is completed in PA, application script will be called with the 'configure' parameter and domain list will be passed to application.
Configuration script receives domain list as usual list setting.
For example, domain1.com and domain2.com are added to application on installation step. Application has domain list setting as in the example above. On application installation step configuration script receives domains in the following environment variables:
Later, when customer adds one more domain in Customer CP, for example the domain domain3.com, configuration script is being called with the 'configure' parameter, and domains are being sent as follows:
SETTINGS_domains_1=domain1.com SETTINGS_domains_2=domain2.com SETTINGS_domains_3=domain3.com
If the domains setting has attribute track-old-value, the old list of domains will be sent as well:
Replacing DNS record
To replace a DNS record in domain zone, use the substitute option.
The example of scenario when application needs to replace DNS record: Spam Filter application changes existing MX records in domain in order to receive email, filter it and send to original mail server.
Application configuration script receives original DNS records as
DNS_<id>_SUBSTITUTE environment variable. In addition to this, in case when 'list' domain-name setting is used, the following environment variables are sent:
DNS_<id>_SUBSTITUTE_<domain_name> DNS_<id>_SUBSTITUTE_<domain_name>_<seq number>
For example, DNS requirement id is 'MX1', and the domain1.com originally had 2 MX records: mx1.provider.com and mx2.provider.com, and domain2.com - mx3.provider.com and mx4.provider.com. In such case, the variables related to MX records substituting will be as follows:
DNS_MX1_SUBSTITUTE=mx1.provider.com DNS_MX1_SUBSTITUTE_domain1.com=mx1.provider.com DNS_MX1_SUBSTITUTE_domain1.com_1=mx1.provider.com DNS_MX1_SUBSTITUTE_domain1.com_2=mx2.provider.com DNS_MX1_SUBSTITUTE_domain2.com=mx3.provider.com DNS_MX1_SUBSTITUTE_domain2.com_1=mx3.provider.com DNS_MX1_SUBSTITUTE_domain2.com_2=mx4.provider.com