Filtering Issues

This topic describes some peculiarities of domain template filtering.

Filtering is the way the request XML packet indicates the object (a domain template or several) to which the operation will be applied. The request XML packets filter domain templates using a special filter node and by specifying the owner of the template (if necessary).

When created, a domain template is given a unique ID and a unique name. The filter node that filters a domain template is presented by the DomainFilterType complex type (domain_input.xsd). This node is structured as follows:

The filter node allows you to specify a domain template either by ID, or by template name. In addition, it allows you to specify multiple domain templates within one filter. All of them should be specified either by ID, or by template names.

<packet version="1.4.2.0">
<domain-template>
<get>
   <filter>
      <name>base_template</name>
      <name>extra_template</name>
   </filter>
</get>
</domain-template>
</packet>

Or:

<packet version="1.4.2.0">
<domain-template>
<get>
   <filter>
      <id>12</id>
      <id>14</id>
   </filter>
</get>
</domain-template>
</packet>

Finally, the filter can be left empty, which means that all domain templates are selected:

<packet version="1.4.2.0">
<domain-template>
<get>
   <filter/>
</get>
</domain-template>
</packet>

Another important issue is the ownership of domain templates. When created by Plesk Administrator for own needs, a domain template gets to the administrator's template repository. When created for a certain Plesk client, a domain template is added to the template repository of this client.

Domain templates are searched in the template repository of the current user. Since all operations on domain templates are allowed to Plesk Administrator only, domain templates are searched in the administrator's repository by default. To filter some domain template that belongs to a certain client, you need to identify this client in the request packet. Use the client-id or client-login node for this purpose:

<packet version="1.4.2.0">
<domain-template>
<get>
   <filter>
      <name>base_template</name>
   </filter>
   <client-login>tecnhnolux</client-login>
</get>
</domain-template>
</packet>