For the purpose of illustrating what environment variables the Controller must to create and pass to configuration script on its invocation, we present the file with metadata of the SugarCRM application. This application provides 'root' service named instance that in its turn provides child service named account. For each of services declared a separate configuration scripts are specified: configure for 'root' service and usermanager for child one. Depending on what script is invoked the Controller must prepare the following sets of environment variables:
'Root' service variables:
|
Child service variables:
|
|
|
The following is the full content of the SugarCRM APP-META.xml file where each variable-producing place is provided with a comment saying what environment must be created there and why.
<application xmlns="http://apstandard.com/ns/1" version="1.2">
<!-- Full URL specifying where the application is to be installed
-->
<!--
BASE_URL_SCHEME
BASE_URL_HOST
BASE_URL_PORT
BASE_URL_PATH
-->
<id>http://www.sugarcrm.com/crm/</id>
<name>SugarCRM</name>
<version>5.2.0a</version>
<release>1</release>
<homepage>http://www.sugarcrm.com/crm/</homepage>
<vendor>
<name>SugarCRM Inc.</name>
<homepage>
http://www.sugarcrm.com/crm/about/about-sugarcrm.html
</homepage>
<icon path="images/icon.png"/>
</vendor>
<packager>
<name>Parallels</name>
<homepage>http://parallels.com</homepage>
<uri>uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103</uri>
</packager>
<presentation>
<summary>Sugar CRM Community Edition</summary>
<description>
Sugar CRM Community Edition enables organizations to
efficiently organize, populate, and maintain
information on all aspects of their customer
relationships. It provides integrated management of
corporate information on customer accounts and contacts,
sales leads and opportunities, plus activities such as
calls, meetings, and assigned tasks. The system
seamlessly blends all of the functionality required to
manage information on many aspects of your business
into an intuitive and user-friendly graphical interface.
</description>
<icon path="images/icon.png"/>
<screenshot path="images/screen_home.png">
<description>Home Screen</description></screenshot>
<screenshot path="images/screen_admin.png">
<description>Admin Screen</description></screenshot>
<screenshot path="images/screen_dashboard.png">
<description>Dashboard View</description></screenshot>
<screenshot path="images/screen_accounts.png">
<description>Account Details</description></screenshot>
<screenshot path="images/screen_campaigns.png">
<description>Marketing Campaigns</description></screenshot>
<screenshot path="images/screen_bug_tracker.png">
<description>Bug Tracker</description></screenshot>
<screenshot path="images/screen_calendar.png">
<description>Calendar</description></screenshot>
<screenshot path="images/screen_documents.png">
<description>Documents</description></screenshot>
<changelog>
<version version="5.2.0a" release="1">
<entry>Packaged as APS 1.1</entry>
</version>
</changelog>
<categories>
<category>
Back office/Customer Relationship Management
</category>
</categories>
<languages>
<language>en</language>
</languages>
</presentation>
<patch match="/application/version = '5.0.0'
or /application/version = '5.1.0a'"/>
<service id="instance">
<license must-accept="true">
<free/>
<text>
<name>GPLv3</name>
<file>htdocs/LICENSE.txt</file>
</text>
</license>
<presentation>
<name>SugarCRM Instance</name>
<summary>Basic services</summary>
<entry-points>
<entry class="control-panel" dst="/index.php"
method="POST">
<label>Application entry point</label>
<variable name="module">Users</variable>
<variable name="action">Authenticate
</variable>
<variable name="return_module">Users
</variable>
<variable name="return_action">Login
</variable>
<variable name="cant_login"/>
<variable name="login_module"/>
<variable name="login_action"/>
<variable name="login_record"/>
<variable name="user_name" class="login"
value-of-setting="admin_name"/>
<variable name="user_password"
class="password"
value-of-setting="admin_password"/>
<variable name="login_theme">Sugar
</variable>
<variable name="login_language">en_us
</variable>
<variable name="Login">++Login++
</variable>
</entry>
</entry-points>
</presentation>
<!-- For each service setting declared in package, the corresponding
environment variable SETTINGS_[id] MUST be passed on to
the configuration script -->
<settings>
<group class="authn">
<name>Administrator's Account</name>
<!--
SETTINGS_admin_name
-->
<setting id="admin_name" type="string"
default-value="admin" min-length="1"
max-length="32"
regex="^[a-zA-Z][0-9a-zA-Z_\-]*"
class="login">
<name>Administrator's Login</name>
<error-message>Please make sure the text
you entered starts with a letter and
continues with either numbers, letters,
underscores or hyphens.
</error-message>
</setting>
<!--
SETTINGS_admin_password
-->
<setting id="admin_password" type="password"
class="password">
<name>Administrator's Password</name>
</setting>
</group>
<group class="web">
<!--
SETTINGS_title
-->
<setting id="title" type="string"
default-value="SugarCRM" class="title">
<name>System Name</name>
<description>This name will be displayed
in the browser title bar when users visit
the Sugar application.</description>
</setting>
<!--
SETTINGS_send_usage_statistics
-->
<setting id="send_usage_statistics"
type="enum" default-value="true"
installation-only="true">
<name>Send Anonymous Usage Statistics
</name>
<description>If selected 'Yes', Sugar
will send anonymous statistics about
your installation to SugarCRM Inc.
every time your system checks for
new versions.
</description>
<choice id="true">
<name>Yes</name>
</choice>
<choice id="false">
<name>No</name>
</choice>
</setting>
<!--
SETTINGS_check_for_updates
-->
<setting id="check_for_updates" type="enum"
default-value="automatic">
<name>Check For Updates</name>
<description>How the system will check
for updated versions of the application.
</description>
<choice id="automatic">
<name>Automatic</name>
</choice>
<choice id="manual">
<name>Manual</name>
</choice>
</setting>
</group>
</settings>
<requirements xmlns:php="http://apstandard.com/ns/1/php"
xmlns:db="http://apstandard.com/ns/1/db"
xmlns:apache="http://apstandard.com/ns/1/apache">
<!--
PHP_VERSION
-->
<php:version min="5.1.0"/>
<php:extension>mysql</php:extension>
<php:extension>mbstring</php:extension>
<!--
DB_main_TYPE
DB_main_NAME
DB_main_LOGIN
DB_main_PASSWORD
DB_main_HOST
DB_main_PORT
DB_main_VERSION
DB_main_PREFIX
-->
<db:db>
<db:id>main</db:id>
<db:default-name>sugarce</db:default-name>
<db:can-use-tables-prefix>true
</db:can-use-tables-prefix>
<db:server-type>mysql</db:server-type>
<db:server-min-version>4.1.2
</db:server-min-version>
</db:db>
</requirements>
<provision>
<!-- For each mapping, except ones which do not map to the
file system, WEB_<id>_DIR must be passed with the absolute
path to the directory to which mapping maps, where id is
the full URL path of the mapping, with all '/' characters
converted to '_'.
-->
<url-mapping>
<default-prefix>sugarcrm</default-prefix>
<installed-size>53547008</installed-size>
<!--
WEB___DIR
-->
<mapping url="/" path="htdocs"
xmlns:php="http://apstandard.com/ns/1/php">
<php:handler>
<php:extension>php</php:extension>
</php:handler>
<!--
WEB__cache_DIR
-->
<mapping url="cache">
<php:permissions writable="true"/>
</mapping>
<!--
WEB__custom_DIR
-->
<mapping url="custom">
<php:permissions writable="true"/>
</mapping>
<!--
WEB__data_DIR
-->
<mapping url="data">
<php:permissions writable="true"/>
</mapping>
<!--
WEB__modules_DIR
-->
<mapping url="modules">
<php:permissions writable="true"/>
</mapping>
<!--
WEB__tmp_DIR
-->
<mapping url="tmp">
<php:permissions writable="true"/>
</mapping>
<!--
WEB__config.php_DIR
-->
<mapping url="config.php"
virtual="virtual">
<php:permissions writable="true"/>
</mapping>
</mapping>
</url-mapping>
<configuration-script name="configure">
<script-language>php
</script-language>
</configuration-script>
</provision>
<service id="account">
<presentation>
<name>SugarCRM Account</name>
<entry-points>
<entry class="control-panel"
dst="/index.php"
method="POST">
<label>Account entry point</label>
<variable name="module">
Users
</variable>
<variable name="action">
Authenticate
</variable>
<variable name="return_module">
Users
</variable>
<variable name="return_action">
Login
</variable>
<variable name="cant_login"/>
<variable name="login_module"/>
<variable name="login_action"/>
<variable name="login_record"/>
<variable name="user_name"
class="login"
value-of-setting="user_login"/>
<variable name="user_password"
class="password"
value-of-setting="user_password"/>
<variable name="login_theme">Sugar
</variable>
<variable name="login_language">
en_us
</variable>
<variable name="Login">++Login++
</variable>
</entry>
</entry-points>
</presentation>
<!-- For each service setting declared in package,
the corresponding environment variable SETTINGS_[id]
MUST be passed on to the configuration script -->
<settings>
<group class="authn">
<name>Account Preferences</name>
<!--
SETTINGS_user_login
OLDSETTINGS_user_login
-->
<setting id="user_login" class="login"
track-old-value="true"
type="string" min-length="3"
max-length="60"
regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
<name>Account's Login</name>
</setting>
<!--
SETTINGS_user_password
-->
<setting id="user_password"
class="password" type="password"
min-length="4">
<name>Account's Password</name>
</setting>
</group>
<group class="vcard">
<group class="fn n">
<!--
SETTINGS_first_name
-->
<setting id="first_name"
class="given-name" type="string"
max-length="30">
<name>First Name</name>
</setting>
<!--
SETTINGS_last_name
-->
<setting id="last_name"
class="family-name" type="string"
max-length="30">
<name>Last Name</name>
</setting>
</group>
<group class="email">
<!--
SETTINGS_user_email
-->
<setting id="user_email"
class="value"
type="email">
<name>Email</name>
</setting>
</group>
<!--
SETTINGS_title
-->
<setting id="title" class="title"
type="string">
<name>Title</name>
</setting>
<!--
SETTINGS_department
-->
<setting id="department"
class="organization-unit"
type="string">
<name>Department</name>
</setting>
<group class="tel">
<name class="type">work</name>
<!--
SETTINGS_phone_work
-->
<setting id="phone_work"
class="value"
type="string">
<name>Work Phone Number
</name>
</setting>
</group>
<group class="tel">
<name class="type">cell</name>
<!--
SETTINGS_phone_mobile
-->
<setting id="phone_mobile"
class="value"
type="string">
<name>Mobile Phone Number
</name>
</setting>
</group>
<group class="tel">
<name class="type">fax</name>
<!--
SETTINGS_phone_fax
-->
<setting id="phone_fax"
class="value"
type="string">
<name>Fax Number</name>
</setting>
</group>
<group class="tel">
<name class="type">home</name>
<!--
SETTINGS_phone_home
-->
<setting id="phone_home"
class="value"
type="string">
<name>Home Phone Number
</name>
</setting>
</group>
<!--
SETTINGS_address_street
-->
<setting id="address_street"
class="street-address" type="string">
<name>Street</name>
</setting>
<!--
SETTINGS_address_city
-->
<setting id="address_city"
class="locality"
type="string">
<name>City</name>
</setting>
<!--
SETTINGS_address_state
-->
<setting id="address_state"
class="region"
type="string">
<name>Region</name>
</setting>
<!--
SETTINGS_address_country
-->
<setting id="address_country"
class="country-name" type="string">
<name>Country</name>
</setting>
<!--
SETTINGS_postalcode
-->
<setting id="address_postalcode"
class="postal-code" type="string">
<name>Postal Code</name>
</setting>
<!--
SETTINGS_description
-->
<setting id="description" class="note"
type="string">
<name>Description</name>
</setting>
</group>
</settings>
<provision>
<configuration-script name="usermanager">
<script-language>php
</script-language>
<status-control/>
</configuration-script>
</provision>
</service>
</service>
</application>