Many applications require some DNS records for proper functioning, for example:
In this document:
Benefits of the integration with DNS:
To meet the requirements, the applications must be integrated with the platform built-in Domain Manager:
The platform built-in Domain Manager exposes the following placeholders for view-plugins of APS applications:
PLACE-HOLDER | View Type | Purpose |
---|---|---|
http://www.parallels.com/ccp-domains#domainListInfo |
View-plugin | Service information in the list of domains |
http://www.parallels.com/ccp-domains#domainInfo |
View-plugin | Service management in a domain profile |
The following steps help you integrate an APS application with the Domain Manager.
Make the service implement the DomainService type:
implements("http://www.parallels.com/pa/pa-core-services/domain-management/
DomainService/1.0")
This adds the following to resources created by the service:
domain
- a strong relation with a hosted domain resource.records
- a collection of optional relations with resources derived from the DNS Record type.name
and status
- string properties.To integrate application UI with the Domain Manager dashboard, declare two view-plugins in the application metadata, for example:
<navigation id="plugins">
<view-plugin id="VpsPluginForDomainListScreen"
src="ui/plugins/DomainListPlugin.js">
<plugs-to id="http://www.parallels.com/ccp-domains#domainListInfo"/>
</view-plugin>
<view-plugin id="VpsPluginForDomainInfoScreen"
src="ui/plugins/DomainInfoPlugin.js">
<plugs-to id="http://www.parallels.com/ccp-domains#domainInfo"/>
</view-plugin>
</navigation>
View-plugin for the list of domains - presents the service in the Enabled for Services column of the domain list.
Plug it into http://www.parallels.com/ccp-domains#domainListInfo.
View-plugin for a single domain - presents the service in the detailed view of a domain (domain profile).
Plug it into http://www.parallels.com/ccp-domains#domainInfo.
When creating a resource from a UI view, specify the needed domain properties:
Domain Manager is able to show a list of all customer domains. In the Enabled for Services column,
it presents application services the domains are assigned to.
To represent its service in the domain list, an application must embed
a view-plugin into the Domain Manager placeholder http://www.parallels.com/ccp-domains#domainListInfo
.
The Domain Manager calls the following methods that must be defined in the view-plugin:
init(mediator)
- contains definition of an internal method of the mediator
object as mentioned below.mediator.updateState(domain,state)
- is the main method of the mediator
object that
must modify the state
object to indicate if the specified domain
is assigned to at least one application resource.Domain Manager passes the following objects when calling methods defined in the view-plugin:
init(mediator)
method gets the mediator
object used for exchanging data between the Domain Manager and view-plugins.mediator.updateState(domain,state)
method gets the domain
object and the state
object.domain
object represents the selected domain in accordance with the Hosted Domain type.
It also contains all assigned services in the domain.services
array.state
object is initially empty.As mentioned earlier, the init(mediator)
method must contain definition of the mediator.updateState (domain,state)
method.
The latter must define the state
object for the specified domain
as follows:
state.title
presents the service name in the Enabled for Services
column. Assign any string to it.state.status
defines if the service.title
will appear in the Enabled for Services
column. It may get
one of the values:state.title
in the Enabled for Services
column.
Set this value if the specified domain
is assigned to at least one application resource.Generally, the view-plugin can process the input data as presented in this skeleton:
mediator.updateState = function(domain, state) {
/* Assign a service name to the state.title property */
/* Define the state.status property */
};
The mediator.updateState(domain,state)
method does not return any value. I defines the state
object
it receives as an input argument. Possible values are explained in the previous section.
Refer to the demo process of developing such a view.
In an open domain profile, an application can provide some service data and tools for managing the application service for the selected domain.
For this purpose, the application must plug its view-plugin
into the Domain Manager placeholder http://www.parallels.com/ccp-domains#domainInfo
.
The Domain Manager calls the following methods that must be defined in the view-plugin:
init(mediator)
- contains definition of the setServiceData
method inside the mediator
object as mentioned below.mediator.setServiceData(data)
- is the main method. It must return the UI tile containing the elements
for presenting the service data and tools in the domain profile.init(mediator)
method gets the mediator
object used for exchanging data between the Domain Manager and view-plugins.mediator.setServiceData(data)
method receives the data
object that represents the selected domain in accordance
with the APS core domain schema. It also contains all assigned services in the data.services
array.The mediator.setServiceData(data)
method processes service data available in the data object.
Then it defines and returns a UI tile that presents the service data and provides tools
for managing the service related with the selected domain.
The mediator.setServiceData(data)
method returns the UI aps/Tile widget container
that the Domain Manager uses to present service data and tools in the profile of the selected domain.
Refer to the demo process of developing such a view-plugin.
Refer to the DNS Management that contains step-by-step development process
of creating and testing an application similar to one in the
sample package
.