Creating Site
This section describes how to create a site in Plesk Sitebuilder using the integration API.
There are two types of sites in Plesk Sitebuilder: trial and regular sites. For details on site types, refer to the Serving Your Customers>Managing Sites section of Sitebuilder 4.5 Administrator's Guide.
To publish a site, you should specify publishing settings for the site. For details on the settings, refer to the Serving Your Customers>Managing Sites>Registering Site in System section of Sitebuilder 4.5 Administrator's Guide.
There are several publishing scenarios. They are as follows:
- Standard. This scenario uses the following schema: first, the host where a specific site will be published is created. Then the host is added to a plan. Then the plan is assigned to the user which site is going to be published. It is highly recommended to use this scenario.
- FreeParallelsHosting. In this scenario a user can publish sites to one of Parallels FTP servers. This scenario will be deprecated in next versions of Plesk Sitebuilder.
- AnyFtp. In this scenario a user can publish sites to the FTP server he defined in his publishing settings. This scenario will be deprecated in next versions of Plesk Sitebuilder.
The sites are created by methods of web service SiteWebService. The methods can be invoked by all users.
Use the following methods to create a Plesk Sitebuilder account:
- CreateAnonymousSite. Creates a trial site and adds it to list of sites of a specific reseller. If the reseller's ID is not specified, the site is owned by administrator. You can specify a site ID if needed, or the system will generate it automatically. Publishing settings are not specified in this method. For details on input and output parameters of the method, refer to the Web services>SiteWebService>CreateAcnonymousSite section of Plesk Sitebuilder 4.5 Integration API Reference.
- CreateSite. Creates a site. Publishing settings are not specified in this method. The site can be trial or regular. If the site is regular, you should specify the site owner's ID. It can be retrieved by method GetAccountByName of service AccountWebService. For details on input and output parameters of the method, refer to the Web services>SiteWebService>CreateSite section of Plesk Sitebuilder 4.5 Integration API Reference.
- CreateSite2. Creates a site with specific publishing settings and owner. In this method you should also specify the ID of the host to which the site is published, if a user chose the Publishing to location specified by provider mode of publishing. The ID can be retrieved by method GetHostByAddress of service HostWebService. For details on input and output parameters of the method, refer to the Web services>SiteWebService>CreateSite2 section of Plesk Sitebuilder 4.5 Integration API Reference.
- CreateSiteWithHost. First, the method creates the host with a specific ID add host to a user plan. Then it creates a site with standard FTP publishing scenario on the host. For details on input and output parameters of the method, refer to the Web services>SiteWebService>CreateSiteWithHost section of Plesk Sitebuilder 4.5 Integration API Reference.
The section is illustrated with code samples written in PHP and ASP. To integrate Plesk Sitebuilder with your applications using PHP, refer to the PHP section. Otherwise, refer to the ASP section.