Parallels Presence Builder - 12.0 Standalone Installation Manual

Parallels Presence Builder 12.0 Standalone
Installation and Administration Guide
Last updated: 22 May 2014
Contents
About This Guide 4
Feedback ....................................................................................................................................... 4
About Parallels Presence Builder Standalone 5
Preparing for Installation 6
Requirements for the Core Server ................................................................................................ 7
Requirements for Publishing Servers ............................................................................................ 8
Supported Web Browsers ............................................................................................................. 8
Installing Parallels Presence Builder Standalone 9
Installing on CentOS.................................................................................................................... 10
Installing on Debian ..................................................................................................................... 11
Troubleshooting Installation Issues ............................................................................................. 12
Setting the Administrator’s Password and Installing a License Key ........................................... 13
Upgrading to Parallels Presence Builder 12 Standalone from Previous Versions 15
Upgrading on CentOS ................................................................................................................. 16
Upgrading on Debian .................................................................................................................. 17
Troubleshooting Upgrade Issues ................................................................................................ 17
Integrating Parallels Presence Builder Standalone with Your Hosting Software 18
Checking if Your Hosting Platform Is Compatible with Presence Builder ................................... 20
Providing Site Owners with Access to the Editor ........................................................................ 20
Initializing the API Library .................................................................................................. 21
Adding the Create Site Button........................................................................................... 21
Adding the Edit Site Button ............................................................................................... 24
Deleting Sites from Presence Builder.......................................................................................... 26
Upselling Hosting Services 27
Upselling Hosting Services with Restricted Functionality Techniques ........................................ 28
Restricting Resources by Means of the API ..................................................................... 31
Configuring the Buy and Publish Dialog Window .............................................................. 35
Upselling Hosting Services with Automated Site Creation .......................................................... 38
Configuring the Promotional Footer ............................................................................................ 41
Retrieving the Current Content of the Promotional Footer ............................................... 43
Changing the Default Content of the Promotional Footer ................................................. 45
Showing the Promotional Footer on Websites .................................................................. 47
Removing the Promotional Footer from Websites ............................................................ 49
Configuring the Trial Mode 51
Placeholders Used in Trial Mode Messages ............................................................................... 54
Locale Strings Shown in Trial Mode ............................................................................................ 56
Customizing the Information Box ................................................................................................ 57
Customizing Text in E-mail Notices ............................................................................................. 61
Customizing the Pop-Up Message .............................................................................................. 63
Rebranding Presence Builder 66
Changing the Editor’s Name ....................................................................................................... 69
Changing the Product and Company Logos, Hyperlinks, and Copyright Notice ........................ 70
Changing the Link to the User’s Guide ....................................................................................... 71
Changing the Links to the Getting Started Video ........................................................................ 72
Customizing the Functionality of Presence Builder 73
Redirecting Users to the Login Page........................................................................................... 74
Prohibiting Users from Removing Their Sites ............................................................................. 75
Making Modules Unavailable in the Editor .................................................................................. 75
Making the Site Import Functionality Unavailable ....................................................................... 76
Adding Custom Banner Images .................................................................................................. 77
Adding Custom Design Templates .............................................................................................. 79
Adding the Support Button .......................................................................................................... 80
Adding the Link for Sending Feedback ....................................................................................... 81
Adding the Button to Return Users to Control Panel ................................................................... 82
Removing the Option to Add a Site Copy to Facebook............................................................... 83
Disabling Access to the Google Services from Presence Builder ............................................... 84
Removing Sites from Hosting Accounts ...................................................................................... 85
Viewing Service Logs 86
Removing Parallels Presence Builder Standalone 88
Appendix A. API Reference: Methods, Operations, and Resources 89
Request Format ........................................................................................................................... 90
Response Format ........................................................................................................................ 95
Operations on Resources ............................................................................................................ 96
Retrieving the Software Version........................................................................................ 97
Creating a Site................................................................................................................... 98
Generating a Security Token for Accessing a Site ......................................................... 102
Creating a Site Based on a Website Topic ..................................................................... 106
Retrieving Information About a Specific Site ................................................................... 112
Retrieving Information About All Sites ............................................................................ 115
Changing Site Properties and Settings ........................................................................... 118
Publishing a Website ....................................................................................................... 122
Deleting a Site ................................................................................................................. 123
Retrieving the Current Content of the Promotional Footer ............................................. 125
Setting Trial Mode Messages .......................................................................................... 127
Changing the Default Content of the Promotional Footer ............................................... 137
Showing the Promotional Footer on Websites ................................................................ 139
Removing the Promotional Footer from Websites .......................................................... 141
This guide is intended for hosting service providers who want to deploy Parallels
In this chapter:
Feedback .......................................................................................................... 4
Presence Builder Standalone on servers managed by control panel software other than Parallels Operations Automation and Parallels Plesk.
Feedback
If you have found an error in this guide, or if you have suggestions or ideas on how to improve this guide, please send your feedback using the online form at
http://www.parallels.com/en/support/usersdoc/. Please include in your report the
guides title, chapter and section titles, and the fragment of text in which you have found an error.
Parallels Presence Builder Standalone is a software suite for hosting providers. It
includes the following components:
Presence Builder - website design and promotion tool. API for integration into a hosting companys infrastructure.
This solution is ideal for hosting service providers who have their own shared hosting control panel and a billing system, and who want to offer Presence Builder to their customers.
Presence Builder can operate in the trial mode. When the trial mode is properly configured, prospective customers can access the editor, create websites, and publish them after they sign up to hosting services. To learn more about the trial mode, see the chapter Configuring the Trial Mode (on page 51).
You can install the core components of the system on the same server on which you
In this chapter:
Requirements for the Core Server ..................................................................... 7
Requirements for Publishing Servers ................................................................ 8
Supported Web Browsers.................................................................................. 8
plan to host websites, or have one dedicated server for running the system (lets call it the core server) and publish websites on separate hosting servers. The following figure illustrates a typical deployment scheme and the interaction of the components.
Before installing, make sure that the following requirements for the core server (on page 7) and publishing servers (on page 8) are met.
Requirements for the Core Server
Minimum Hardware Requirements
Intel or AMD CPU, 800 MHz. 500 megabytes of free disk space for installation of the core components, plus at
least 300 kilobytes for each hosted site.
8 gigabytes of RAM.
Software Requirements and Prerequisites
Parallels Presence Builder Standalone can be installed on the following operating systems:
CentOS 5.10, 6.5 (32-bit and 64-bit). Debian 6.0, 7.0 (32-bit and 64-bit).
The following software components, which are not included in the distribution package, must be additionally installed:
Apache web server (apache2 package).
After installing Apache on CentOS systems, make sure that the following directive is not present in the Apache configuration file /etc/httpd/conf/httpd.conf:
Alias /error/ /var/www/error/”. If it is present, comment it out and restart the web server.
MySQL Server version 5.0 or later.
Important: Make sure that the old_passwords value in the MySQL configuration file is set to 0 (off). You can also check the current value of this parameter in the database by issuing the following SQL query:
~# mysql -u<MYSQL_USER> -p<MYSQL_PASSWORD> -eshow variables
like old_passwords’”
mod_fcgid.
This is available from the Debian 6 repositories (called libapache2-mod-fcgid), but if you want to install on CentOS, you will need to obtain it from other third-party repositories.
Important: On CentOS systems, SELinux must be disabled.
You can check whether SELinux is disabled by issuing the command /usr/sbin/getenforce. If it is enabled, then do the following to switch it off:
1. Open the file /etc/selinux/config in a text editor and locate the line SELINUX=<value>.
2. Change it to SELINUX=disabled.
3. If you cannot find this file, open the file /boot/grub/grub.conf in a text editor and add the parameter selinux=0 to the Grub Boot Loader:
title SE-Linux Test System root (hd0,0)
kernel /boot/vmlinuz-2.4.20-selinux-XXXXXXXXXX ro
root=/dev/hda1 nousb selinux=0 #initrd /boot/initrd-2.4.20-selinux-XXXXXXXXXX.img
4. Restart the server to apply the changes.
5. If you do not want to restart, issue the command setenforce 0.
Note: The default values of the PHP settings memory_limit and
max_execution_time allow comfortable working with sites that have fewer than 500 pages. For this reason, the maximum number of pages that a site can have is set to 500 by default. If you want to support sites with a greater number of pages, configure the PHP settings memory_limit and max_execution_time accordingly, and set a greater value in the file /usr/local/sb/config, in the line maxPagesNumber =
500.
Requirements for Publishing Servers
Regardless of whether you plan to host customers sites on the same core server or separate servers, ensure that the following additional requirements are met:
The servers are resolvable on the Internet: DNS settings are properly configured. PHP version 5.2 or later is installed. PHP supports multibyte string functions (mbstring extension). In php.ini, the following directive is set: default_charset = UTF-8
Supported Web Browsers
Parallels Presence Builder Standalone supports the following browsers:
Internet Explorer 10 and 11. Mozilla Firefox 19 or later. Safari 6 for Mac. Google Chrome 25 or later.
This chapter describes how to deploy Parallels Presence Builder Standalone.
In this chapter:
Installing on CentOS ......................................................................................... 10
Installing on Debian ........................................................................................... 11
Troubleshooting Installation Issues ................................................................... 11
Setting the Administrators Password and Installing a License Key ................... 13
Installing on CentOS
The following instructions describe how to install Parallels Presence Builder Standalone by using the yum software management tool on CentOS 5.x-6.x.
To install Parallels Presence Builder Standalone on CentOS, do the
following:
1. In /etc/yum.repos.d/, create a file with the name wpb.repo.
2. Add the following text to the file.
[wpb-dist] name=wpb baseurl=http://download1.parallels.com/WPB/Standalone/12.0/di st-rpm-CentOS-$releasever-$basearch/ gpgcheck=0 priority=10 enabled=1
[wpb-third] name=wpb-third baseurl=http://download1.parallels.com/WPB/Standalone/12.0/th irdparty-rpm-CentOS-$releasever-$basearch/ gpgcheck=0 priority=10 enabled=1
3. Issue the following command:
# yum install wpb
After installation is finished, set the administrators password and install a license key as described in Setting the Administrators Password and Installing a License Key (on page 13).
If you want to make sure that the installation completed successfully, visit the editor in the trial mode and create a trial site by accessing a URL very similar to this: http://sitebuilder.<host name>/Try. You can find out the exact host name and IP address by issuing the command apachectl -S.
Additionally, to ensure that the Presence Builder Standalone installation is accessible by the domain name sitebuilder.<host name>, check and correct the DNS zone settings.
Important: If you plan to host websites on separate servers, make sure that these servers are properly resolved from the core server and are accessible over HTTP and FTP. You might need to manually configure DNS zones to ensure that the publishing servers are resolved.
Installing on Debian
The following instructions describe how to install Parallels Presence Builder Standalone by using the APT tools on Debian.
To install Parallels Presence Builder Standalone on Debian 6.0:
1. Add the following lines to the file /etc/apt/sources.list:
On 32-bit operating systems:
deb http://download1.parallels.com/WPB/Standalone/12.0/dist­deb-Debian-6.0-i386 / deb http://download1.parallels.com/WPB/Standalone/12.0/thirdparty
-deb-Debian-6.0-i386 /
On 64-bit operating systems:
deb http://download1.parallels.com/WPB/Standalone/12.0/dist­deb-Debian-6.0-x86_64 / deb http://download1.parallels.com/WPB/Standalone/12.0/thirdparty
-deb-Debian-6.0-x86_64 /
2. Issue the following command:
# apt-get update
3. Issue the following command:
# apt-get install wpb
After installation is finished, set the administrators password and install a license key as described in Setting the Administrators Password and Installing a License Key (on page 13).
If you want to make sure that the installation completed successfully, visit the editor in the trial mode and create a trial site by accessing a URL very similar to this: http://sitebuilder.<host name>/Try. You can find out the exact host name and IP address by issuing the command apachectl -S.
Additionally, to ensure that the Presence Builder Standalone installation is accessible by the domain name sitebuilder.<host name>, check and correct the DNS zone settings.
Important: If you plan to host websites on separate servers, make sure that these servers are properly resolved from the core server and are accessible over HTTP and FTP. You might need to manually configure DNS zones to ensure that the publishing servers are resolved.
Troubleshooting Installation Issues
Issue
Installation has finished successfully, but Parallels Presence Builder Standalone does not start. The following error message can be seen in /var/log/httpd/error.log:
Failed loading /usr/lib/php/modules/sw­engine/ioncube_loader_lin_5.3.so: /usr/lib/php/modules/sw­engine/ioncube_loader_lin_5.3.so: cannot restore segment prot
after reloc: Permission denied DEBUGGER DETECTED... Bye!
Resolution
This error may occur when SELinux is switched on. To check whether SELinux is switched on, issue the command
/usr/sbin/getenforce. If it is switched on (enabled), then do the following to switch it off:
1. Open the file /etc/selinux/config in a text editor and locate the line SELINUX=<value>.
2. Change it to SELINUX=disabled.
3. If you cannot find this file, open the file /boot/grub/grub.conf in a
text editor and add the parameter selinux=0 to the Grub Boot Loader: title SE-Linux Test System root (hd0,0)
kernel /boot/vmlinuz-2.4.20-selinux-XXXXXXXXXX ro
root=/dev/hda1 nousb selinux=0 #initrd /boot/initrd-2.4.20-selinux-XXXXXXXXXX.img
4. Restart the server to apply the changes.
5. If you do not want to restart, issue the command setenforce 0.
Issue
During installation, the following error message is shown in the console:
[ERROR] Unable to connect to database. System message: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD(your_existing_password). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might
need to remove the old-passwords flag from your my.cnf file
Resolution
Before installing Presence Builder, verify that the old_passwords option is switched off in the MySQL configuration file. You can use the following command to verify the value set for this option:
~# mysql -u<MYSQL_USER> -p<MYSQL_PASSWORD> -eshow variables
like old_passwords’”
To switch off this option, add the line old_passwords=0 into the file /etc/my.cnf, section [mysqld].
Restart mysqld to apply the new settings: ~# /etc/init.d/mysqld restart
If, after restarting MySQL, you cannot access the editor in the trial mode (at http://sitebuilder.<Presence Builder host name>/Try), and an error message is shown in the browser, then you need to run the post-install configuration:
~# sw-engine /usr/local/sb/utils/post_configure.php
Setting the Administrators Password and Installing a License Key
Before you can start using Presence Builder, you need to do the following: Set the administrators password. There is only one administrator account. The
username is admin, and it cannot be changed.
Install a license key. To obtain a license key for the product, contact your vendor or
Parallels sales representatives. For contact information, refer to
www.parallels.com/contact.
To install a license key:
1. Set the administrators password by issuing the following command:
# sb_configsb_passwd <new_password_here>
2. In a web browser, visit
https://sitebuilder.<host_name>/License/.
3. Click through the SSL warnings.
4. When prompted for a username and a password, provide the username
admin and the password that you specified in step 1.
5. Click Upload Key.
6. Browse to the license key file and click OK.
After the license key is uploaded, you can integrate Presence Builder with your control panel or billing software by means of the API. For information about using the API, refer to the chapters Integrating Parallels Presence Builder Standalone with Your Hosting Software (on page 18) and Appendix A. API Reference: Methods, Operations, and Resources (on page 89).
You can also set Presence Builder to notify you when the number of published websites allowed by your license has reached 90 percent. To do this:
1. On the Presence Builder server, open the configuration file /usr/local/sb/config.
2. Add the following line after the line [general]:
admin_email = <your e-mail address>
3. Save the file.
Notices will be sent once a week. To verify that the installation has been successfully completed, you can log in to the
editor in the trial mode by visiting http://sitebuilder.<host_name>/Try.
This chapter describes how to upgrade to Parallels Presence Builder 11 Standalone
In this chapter:
Upgrading on CentOS ....................................................................................... 16
Upgrading on Debian ........................................................................................ 17
Troubleshooting Upgrade Issues ....................................................................... 17
from the previous versions, 10.3, 10.4, 11.0, and 11.5. What happens during an upgrade:
The product packages that are installed in the system are upgraded by using the
native means of package managers (apt or yum).
The product’s database and websites are upgraded to match the new product
version; however, all website content remains intact.
The contents of the configuration file /usr/local/sb/config are overwritten.
This means that all customizations made by editing the configuration file are discarded.
Upgrading on CentOS
The following instructions describe how to upgrade Parallels Presence Builder Standalone by using the yum software management tool on CentOS 5.x-6.x or later.
To upgrade Parallels Presence Builder Standalone on CentOS, do the
following:
1. In /etc/yum.repos.d/, open the pa4wp.repo file for editing.
2. In the baseurl values specified under the sections titled
[sitebuilder-dist] and [sitebuilder-third], replace the old addresses of the product repository with the following new addresses.
[wpb-dist] baseurl=http://download1.parallels.com/WPB/Standalone/12.0/di st-rpm-CentOS-$releasever-$basearch/ [wpb-third] baseurl=http://download1.parallels.com/WPB/Standalone/12.0/th irdparty-rpm-CentOS-$releasever-$basearch/
3. Issue the following command:
# yum install wpb
If you want to make sure that the upgrade has completed successfully, visit http://sitebuilder.<host_name>/Try.
Upgrading on Debian
The following instructions describe how to upgrade Parallels Presence Builder Standalone by using the APT tools on Debian.
To upgrade Parallels Presence Builder Standalone on Debian 6.0:
1. Edit the file /etc/apt/sources.list to point the package manager to the new repositories:
On 32-bit operating systems:
deb http://download1.parallels.com/WPB/Standalone/12.0/dist­deb-Debian-6.0-i386 / deb http://download1.parallels.com/WPB/Standalone/12.0/thirdparty
-deb-Debian-6.0-i386 /
On 64-bit operating systems:
deb http://download1.parallels.com/WPB/Standalone/12.0/dist­deb-Debian-6.0-x86_64 / deb http://download1.parallels.com/WPB/Standalone/12.0/thirdparty
-deb-Debian-6.0-x86_64 /
2. Issue the following command:
# apt-get update
3. Issue the following command:
# apt-get install wpb
If you want to make sure that the upgrade has completed successfully, visit http://sitebuilder.<host_name>/Try.
Troubleshooting Upgrade Issues
Issue
On Debian Linux, upgrade of Presence Builder may fail with a fatal error message. This could happen if some services required by Presence Builder, such as MySQL, were not running when the upgrade was attempted.
Resolution
Start the MySQL database server and run the upgrade process again. Alternatively, you can resume the upgrade by issuing the command dpkgconfigure wpb-core.
This chapter provides general information about how you can integrate Parallels
Presence Builder Standalone with your existing hosting software. If your hosting software uses service plans, and the customers control panel
functionality is governed by plan options, you can customize the plans to include access to the editor as an option. For information about adding custom plan options to your hosting software, please consult the relevant documentation.
If your hosting software does not use service plans, or if you want to provide all hosting customers with access to the editor regardless of the plans, then you need to do the following:
1. Prepare scripts that will perform the necessary operations in the editor over the API. The scripts will create sites in Presence Builder and redirect the users browser to the editor.
2. Add a button leading to Presence Builder to the customers control panel area. The button could be labeled, for example, Launch Presence Builder, or its caption could be changed from Create Site to Edit Site, depending on whether a site for a given user account or domain name is already present in Presence Builder.
When a user clicks Create Site, a new site should be created in Presence Builder
and the user’s browser should be redirected to the site creation wizard.
When a user clicks Edit Site, the control panel or a custom integration script must
redirect the user’s browser to the editor window containing the user’s site, ready for editing.
After successful integration, your hosting customers will be able to access the Presence Builder editor, create and edit sites, and publish them to their webspaces over FTP.
Contents of this chapter: Checking If Your Hosting Platform Is Compatible with Presence Builder. This section
describes how to check whether your hosting platform meets the hosting requirements for publishing sites created with Presence Builder.
Providing Site Owners with Access to the Editor. This section describes how to
implement scripts for the Create Site and Edit Site buttons.
Deleting Sites from Presence Builder. This section describes how to implement
removal of sites from Presence Builder by means of the API.
In this chapter:
Checking if Your Hosting Platform Is Compatible with Presence Builder ........... 20
Providing Site Owners with Access to the Editor ............................................... 20
Deleting Sites from Presence Builder ................................................................ 26
Checking if Your Hosting Platform Is
Next in this section:
Initializing the API Library .................................................................................. 21
Adding the Create Site Button ........................................................................... 21
Adding the Edit Site Button ................................................................................ 24
Compatible with Presence Builder
Before you start preparing for the integration of Presence Builder with your hosting platform, make sure that the latter meets Presence Builders hosting requirements. You can do this by using a special script called check.php, which is shipped with Presence Builder installations.
To check whether your hosting platform meets the hosting requirements
of Presence Builder:
1. Set up a web hosting account on your hosting platform. For example, lets assume that the hosting account will be associated with the domain name example.com.
2. On the server where Presence Builder is installed, go to the directory /usr/local/sb/resources/publish/.
3. Copy the script check.php from that directory to the hosting accounts document root to make that script accessible by HTTP.
4. Using a web browser, visit http://example.com/check.php.
The script will show a report on the availability of the necessary hosting features.
Providing Site Owners with Access to the Editor
To provide domain administrators (or site owners) with access to the Presence Builder editor and enable them to create and edit websites, you need to add custom buttons or hyperlinks labeled Create Site and Edit Site to the appropriate locations of your hosting
control panel. These locations might be a user’s home page, account profile, or
account dashboard page - whatever is present in your system. To learn how to add custom buttons, consult the documentation for your hosting software.
Initializing the API Library
For integration purposes, we suggest that you use a library of PHP scripts that interact with Presence Builders API. The library is shipped with Presence Builder. It is located in the directory /usr/local/sb/utils/api-php/src.
To use the API library in your scripts, you need to do the following:
1. Ensure that PHP 5.2.x or later and the cURL PHP extension are installed on the server where you will run scripts.
2. Take the scripts from the server where Presence Builder is installed - from /usr/local/sb/utils/api-php/src, and copy them to the server where your hosting platform is running.
3. In your PHP script (let’s call it create_site.php for illustration purposes) insert the following lines:
<?php require_once /<path to the API library>/src/WpbApi.php; $config = array(
applicationApiUrl => https://<your Presence Builder host name>:443/api/5.3’, user => admin’, ‘password => <Presence Builder password>’
);
$wpbApi = new WpbApi($config); Where:
<path to the API library> is the directory to which you have copied the library in step
1.
<your Presence Builder host name> - the server where Presence Builder is
installed.
<Presence Builder password> - the password to your Presence Builder installation
that you specified after installing Presence Builder. This is described in the section Setting the Administrators Password and Installing a License Key (on page 13).
For a complete list of operations that you can perform by means of the API, see
Appendix A. API Reference: Methods, Operations, and Resources (on page 89).
Adding the Create Site Button
The Create Site button must invoke a script written in PHP for example, which will create a site in Presence Builder by means of the RestAPI HTTP requests. For details on methods and parameters that can be used in an HTTP request, refer to the chapter API
Reference: Methods, Operations, and Resources, section Creating a Site (see page 98).
To create a site, you need to do the following: Step 1. Connect the API library as described in the section Initializing the API Library (on
page 21). Step 2. Prepare data that should be passed to Presence Builder for creating a new site.
The data must be presented in an array, as in the following example.
$siteData = array(
state => regular’,
publicationSettings => array( targetUrl => ftp://user:password@ftp.example.com/httpdocs, webSiteUrl => http://example.com ), ownerInfo => array( personalName => John Doe, companyName => My Company LTD, email => admin@example.com, phone => +1-000-000-0000, address => Chambers St 138, city => New York, state => New York, zip => 10292, country => United States ) );
Where: state - is the parameter that specifies whether the site is in trial mode, suspended or
active (regular value). Sites in trial mode can be edited, but cannot be published to a hosting account. This parameter is mandatory.
publicationSettings - is the set of parameters that specify where to publish
the site over FTP and what account credentials to use: targetUrl - is the FTP account username, password, and address for
uploading the site.
webSiteUrl - is the address at which the published site must be available.
ownerInfo - is the set of parameters that specify information about the site owner.
To learn more about the parameters used in this array, refer to the section Creating a Site (on page 98).
Step 3. Create a site by using the API library.
// Create a new site with the $siteData structure
$siteUuid = $wpbApi->requestToApi(/sites/, WpbApi::POST,
array($siteData));
// Here you need to add a code that will save $siteUuid somewhere in your hosting platform. This site ID is needed for further access to the website editor
// Generate an authorization token for the website
$params = array(
localeCode => en_US’, ‘sessionLifeTime => 1800
);
$token = $wpbApi->requestToApi(sites/.$siteUuid . /token,
WpbApi::POST, array($params));
$wpbUrl = <your Presence Builder host name>’;
// Redirect to the Presence Builder editor by using the authorization token
header(Location: . $wpbUrl . /Start?token=. $token);
Where:
siteUuid - is a unique site ID.  localeCode - is the parameter that specifies the language that should be set for
the user interface when the user (site owner) logs in to the editor. The following languages are supported:
en_US - American English en_GB - British English de_DE - German es_ES - Spanish fr_FR - French it_IT - Italian ja_JP - Japanese nl_NL - Dutch pl_PL - Polish pt_BR - Brazilian Portuguese ru_RU - Russian zh_CN - simplified Chinese zh_TW - traditional Chinese
sessionLifeTime - is the parameter that specifies (in seconds) the period of
inactivity for a users session in the editor. When this period elapses, the security token expires and the user needs to log in again.
token - is the security token for redirecting a user’s browser to the editor. wpbUrl - is the host name of the server where Presence Builder is installed.
To learn more about these parameters, refer to the section Generating a Security Token for Accessing a Site (on page 102).
This script sample creates a website and returns a unique site identifier (UUID) for the newly created site. It is important that you save this site ID for future reference because you will need to specify that ID when retrieving information about a site, selecting a site for editing, changing site properties, or deleting a site. Therefore, you need to write a script that will save the received site ID to a file or a database.
Based on the site ID, the script must generate a security token for access to the editor, and then redirect the users browser to the editor. A new security token must be generated each time a site is opened for editing.
Adding the Edit Site Button
To add the Edit Site button, read the documentation for your hosting software. The Edit Site button must contain a reference to a script written in PHP for example, which will
do the following:
1. Connect the API library as described in the section Initializing the API Library (on page
21).
2. Check in the database whether there is a site ID for a given domain name or a user account.
3. Retrieve a site ID for a selected domain name or user account.
4. Generate a security token for that site ID through the API library. Note that the
security token is required to properly redirect the browser to the editor. A new security token must be generated each time a site is opened for editing.
5. Redirect the user’s browser to the editor window.
The following sample script creates a security token for the retrieved site ID. $siteUuid; //This variable contains the retrieved site ID
// Generate an authorization token for the website $params = array(
localeCode => en_US, sessionLifeTime => 1800 );
$token = $wpbApi->requestToApi(sites/ . $siteUuid . /token, WpbApi::POST, array($params));
$wpbUrl = <your Presence Builder host name>; // Redirect to the Presence Builder editor by using the authorization token
header(Location: . $wpbUrl . /Start?token= . $token);
Where: siteUuid - is a unique site ID.
localeCode - is the parameter that specifies the language that should be set for
the user interface when the user (site owner) logs in to the editor. The following languages are supported:
en_US - American English en_GB - British English de_DE - German es_ES - Spanish fr_FR - French it_IT - Italian ja_JP - Japanese nl_NL - Dutch pl_PL - Polish pt_BR - Brazilian Portuguese ru_RU - Russian zh_CN - simplified Chinese zh_TW - traditional Chinese
sessionLifeTime - is the parameter that specifies (in seconds) the period of
inactivity for a users session in the editor. When this period elapses, the security token expires and the user needs to log in again.
token - the security token for redirecting a user’s browser to the editor. wpbUrl - the host name of the server where Presence Builder is installed.
To learn more about these parameters, refer to the section Generating a Security Token for Accessing a Site (on page 102).
The URL for redirecting the user’s browser to the editor looks like the following:
http://<your Presence Builder host name>/Start?token=$token.
Deleting Sites from Presence Builder
Your customers will be able to remove their sites from the Presence Builder editor (unless you prohibit them from doing so (on page 75)), so there is no need to add a special button for deleting sites to your hosting software. However, you might want to automate deletion of sites from Presence Builder in cases when the corresponding user accounts and domains are removed from your hosting platform.
To delete sites, your script must do the following:
1. Connect the API library as described in the section Initializing the API Library (on page
21).
2. Retrieve site IDs for the domain names or user accounts that must be removed.
3. Call the following REST API method through the API library:
$siteUuid; //This is the ID of the site to be deleted $wpbApi->requestToApi(/sites/ . $siteUuid, WpbApi::DELETE);
This chapter describes how to use the following techniques for upselling hosting
In this chapter:
Upselling Hosting Services with Restricted Functionality Techniques ................28
Upselling Hosting Services with Automated Site Creation ..................................38
Configuring the Promotional Footer ...................................................................40
services: Differentiation of hosting plans based on the editors functionality available to
customers.
Automatic creation of websites for customers who purchase only domain name
registration services.
Showing an advertisement block on websites of the users who are subscribed to
free or low-cost service plans.
Upselling Hosting Services with Restricted Functionality Techniques
One of the methods that may help to upsell is differentiation of hosting plans based on the editor functionality available to customers. For example, you can set up hosting plans that allow users to create limited numbers of website pages, and you can charge extra money for the use of the Image Slider, Image Gallery, Map, and other modules.
The following overview describes how the restriction method can be configured and used:
1. You configure how many editor modules or website pages can be used per website. This can be done by means of the API for both newly created and already existing sites. This is described in the section Restricting Resources by Means of the API (on page 31).
2. A user logs in to the editor and starts creating a website. When the specified limit for the number of website pages or site modules is reached, a special icon with a dollar sign appears.
The icon in the toolbar.
The icon in the context menu.
The icon in the page creation wizard.
3. If the user adds one more module or a website page that exceeds the specified limits, he is prompted to pay for additional resources. Otherwise, he will not be able to publish the website. The text on the Publish button is changed to Buy and Publish.
Loading...
+ 113 hidden pages