Application Packaging PDF
Application Packaging PDF
Application Packaging PDF
1.2
Table of Contents
1. Introduction
2. Conventions
3. Document Structure
4. Basic Package Format
4.1. File Format
4.2. Files
4.3. Metadata File
4.4. Package contents listing
5. Metadata Descriptor
5.1. Common Application Properties
5.1.1. Application ID
5.1.2. Package Name
5.1.3. Package Version
5.1.4. Homepage
5.1.5. Master package reference
5.1.6. Software Vendor Information
5.1.7. Software Packager Information
5.1.8. Summary
5.1.9. Description
5.1.10. Icon
5.1.11. Screenshots
5.1.12. Changelog
5.1.13. Categories
5.1.14. Languages
5.1.15. Updates
5.1.16. Content Delivery Methods
5.1.17. Global Settings
5.2. Services
5.2.1. Service Summary
5.2.2. License Agreement
5.2.3. Information Links
5.2.4. Entry Points
5.2.5. Service Settings
5.2.6. Resources
5.2.7. Requirements
5.2.8. Service Provision
5.3. Service Provision Methods
5.3.1. URL Mapping
5.3.2. Configuration Script
5.3.3. Verification Script
5.3.4. Resource Script
5.3.5. Backup/Restore Script
6. Package Contents Listing
7. Points of Extensibility
7.1. Requirement Types
7.2. URL Handlers Types
7.3. Additional Files
7.4. Environment Variables
7.5. Additional Scripts
7.6. Script Language
7.7. Application Provision Method
7.8. Rules
8. Common Aspects
8.1. PHP Aspect
8.1.1. Requirement Types
8.1.2. URL Handlers
8.1.3. Configuration Script Language
8.2. ASP.NET Aspect
8.2.1. Requirement Types
8.2.2. URL Handler Type
8.2.3. Configuration Script Language
8.3. Database Aspect
8.3.1. Environment Variables
8.3.2. Database Server Types
8.3.3. Upgrade
8.3.4. MySQL Specific Settings
8.4. Apache Aspect
8.5. CGI Support
8.6. Hardware Resources
8.7. Operating Environment
8.8. Mail
8.8.1. Environment Variables
8.8.2. Upgrade
8.9. Perl Aspect
8.9.1. Requirement Types
8.9.2. URL Handlers
8.9.3. Configuration Script Language
8.10. DNS Zone
8.11. DLL Content Processing Method
8.12. IIS Aspect
References
1. Introduction
Application Packaging Standard defines the packages structure and rules of
processing packages. Package is a file that contains an application files and
metadata required to create and manage instances of the application.
The APP-META.xml file contains all the metadata required to manage the
application. This includes name, version, description and changelog of the
application, resources required for the application and its services to function
properly and description of user-supplied configuration settings. Typical
structure of metadata:
<application xmlns="http://apstandard.com/ns/1"
version="1.2" packaged="2008-11-02T09:30:10+06:00">
<name>Broombla</name>
<version>1.0.11</version>
<release>4</release>
<homepage>http://broombla.com/</homepage>
<vendor>
<name>Broombla Corporation</name>
<homepage>http://broombla.com/</homepage>
<icon path="icons/corp_logo.gif"/>
</vendor>
<packager>
<name>Broombla Packaging</name>
<homepage>http://broombla.com/packages</homepage>
<icon path="icons/corp_logo.gif"/>
</packager>
<presentation>
<summary>...</summary>
<description>
...
</description>
<icon path="icons/logo.gif"/>
<screenshot path="img/screenshot1.gif">
<description>...</description>
</screenshot>
<changelog>
<version version="1.0.11" release="4">
<entry>Fixed bug in ...</entry>
</version>
</changelog>
<categories/>
<languages/>
</presentation>
...
<service>
<license must-accept="true">
...
</license>
<requirements xmlns:php="http://apstandard.com/ns/1/php">
...
</requirements>
<provision>
<url-mapping>
<!-- Mapping URLs to the files and URL handlers -->
<mapping url="/" path="htdocs">
<php:handler/>
</mapping>
</url-mapping>
</provision>
</service>
</application>
2. Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in [RFC
2119]
3. Document Structure
This specification is divided into the following two parts:
The first part of the specification describes basic metadata required for
application to instantiate and operate, and points of extensibility.
4.2. Files
There MUST NOT be two files or directories in one directory which file names
differ only in case.
Special Windows device names (con, con.*, nul, nul.*, lpt etc) MUST NOT be
used in packages. It is recommended to check for such files during package
unpacking on Windows.
5. Metadata Descriptor
RELAX NG schema of metadata descriptor
The APP-META.xml file MUST be valid according to the schema above. XML
namespace of the metadata will be changed when incompatible changes are
introduced.
The version of APS format specified herein is 1.2 . The numbering scheme for
APS format versions is major.minor . The major and minor numbers MUST be
treated as separate integers and each number MAY be incremented higher
than a single digit. Thus, APS 1.2 would be a lower version than APS 1.10 .
Leading zeros (e.g., APS 1.01 ) MUST be ignored by APS controllers and
MUST NOT be specified.
Package SHOULD use the lowest possible version of APS specification that is
sufficient for describing the application's capabilities and requirements.
<application xmlns="http://apstandard.com/ns/1"
version="1.2" packaged="2008-11-02T09:30:10+06:00">
</application>
...
<description>Some description</description>
<description xml:lang='de-DE'>...</description>
<description xml:lang='ja-JA'>...</description>
...
5.1.1. Application ID
<id>http://www.phpbb.com/</id>
<version>2.0.22</version>
<release>6</release>
5.1.4. Homepage
<homepage>http://phpbb.com/</homepage>
<master-package>
<package id="http://www.phpbb.com" match="version = 1.1"/>
</master-package>
<vendor>
<name>Broombla Corporation</name>
<homepage>http://broombla.com</homepage>
<homepage xml:lang="ja-JA">http://broombla.com/ja</homepage>
<icon path="icons/broombla-corp-logo.gif"/>
</vendor>
<packager>
<name>Parallels</name>
<homepage>http://parallels.com</homepage>
<icon path="icons/parallels-package-logo.gif"/>
<uri>uuid:15d041e8-34c6-409a-b165-3290d2c9d599</uri>
</packager>
The uri element is an arbitrary URI unique for each packager (it is
RECOMMENDED to use uuid: URI scheme to minimize the possibility of
clash). This URI is needed to distinguish packages with the same name but
created by different packagers. Note that consequent versions of the same
package MUST have the same URI, as otherwise package Controllers MAY
refuse to update package from one version to another.
Controllers SHOULD allow to upgrade and patch package from the version
which does not specify uri to the one which specifies in order to support
smooth upgrade path for the packages which did not use uri from the
beginning.
5.1.8. Summary
<presentation>
<summary>
High powered, fully scalable, and highly customizable Open Source
bulletin
board package.
</summary>
<summary xml:lang="es-ES">...</summary>
...
</presentation>
5.1.9. Description
<description>
phpBB is a high powered, fully scalable, and highly customizable
Open Source bulletin board package. phpBB has a user-friendly
interface, simple and straightforward administration panel, and
helpful FAQ. phpBB is the ideal free community solution for all web
sites.
</description>
<description xml:lang="it-IT">...</description>
One-paragraph description of the package for end users.
5.1.10. Icon
5.1.11. Screenshots
<screenshot path="images/admin.png">
<description>Administrative interface</description>
<description xml:lang="he-IL">...</description>
</screenshot>
<screenshot path="images/main.png">
<description>Main page</description>
<description xml:lang="ja-JA">...</description>
</screenshot>
5.1.12. Changelog
<changelog>
<version version="2.1.22" release="1">
<entry>New upstream version</entry>
<entry xml:lang="de-DE">...</entry>
</version>
<version version="2.1.21" release="5">
...
</version>
...
</changelog>
5.1.13. Categories
<categories>
<category>Collaboration/Portals</category>
<category>Web/Content management</category>
</categories>
5.1.14. Languages
<languages>
<language>en</language>
<language>de</language>
<language>ru</language>
</languages>
Package may declare a set of languages for the presentation purposes. The
first language is the "default language" of the application. Languages are
identifiers from ISO 639.
5.1.15. Updates
Attribute mode defines how upgrade procedure will proceed. Following options
are possible:
Such specification means that package can patch the installed version 2.0.1
or 2.0.2 and upgrade version 1.0.1.
<content xmlns:dll="http://apstandard.com/ns/1/dll">
<dll:register path="win/some.dll"/>
</content>
<global-settings>
<setting id="host">
...
</setting>
</global-settings>
Package may have global settings that are visible and affect all instances of
application services. Global settings SHOULD be set prior to any service
provision. Such settings are declared by the global-settings element within
the application description. When a global setting is changed, all instances of
the application services need to be reconfigured immediately. Global settings
MUST NOT use the value-of-setting attribute.
5.2. Services
<service id="calendar">
...
</service>
</application>
Each service may feature its own settings, use its own resources and require
a special provisioning activity. Each service in the package MUST be uniquely
identified by id attribute within application package.
<application>
<name>Webmail</name>
...
<service id="email">
...
<service id="mailbox">
...
</service>
<service id="addressbook">
...
</service>
</service>
</application>
During updates package SHOULD NOT alter the services hierarchy in a way
that may introduce ambiguity in update of already provisioned services. In
particular, new version of package SHOULD NOT:
Singular service can be instantiated only once under unique parent. Such
service should be marked with singular equal to true. Controller will allow to
create several instances of non-singular services.
<service id="email">
<presentation>
<name>Email</name>
<name xml:lang="de"> ... </name>
<summary>Electronic mail address with mailbox</summary>
<icon path="images/email.gif"/>
...
</presentation>
...
</service>
5.2.2. License Agreement
<license must-accept="true">
<free/>
<text>
<name>GPLv2</name>
<file>licenses/gplv2.txt</file>
</text>
<text xml:lang="de-DE">
<name>GPLv2</name>
<file>licenses/gplv2-de_DE.txt</file>
</text>
<license>
or
<license>
<text>
<name>Revised BSD</name>
<url>http://opensource.org/licenses/bsd-license</url>
</text>
</license>
A license declaration MAY include name of the license, whether the license
must be accepted by a user, and either a full path to the license file in the
package or a URL of the full text of the license. The file element MUST be a
full path in the archive to the existing file. Application license may be
characterized as free or commercial by using
appropriate free orcommercial element.
If link points to a document from package, its href attribute must contain file
URL path from the package with empty host part, for
example file:///doc/deployment.pdf. Otherwisehref attribute must contain URL
of an external web resource.
The class attribute MAY be used to inform a control panel about the
destination web resource meaning. The following values of this attribute are
predefined:
Controller MAY use this information when grouping the links or optionally
displaying them. Controller SHOULD ignore unknown values of
the class attribute and treat it as unspecified.
Packager may declare entry points to be used for a given service. When a
Controller provisions a service with entry points, it MAY provide user with the
choice of what entry points to show in control panel interface and where.
<entry-points>
<entry dst="/info">
<label>Information service</label>
</entry>
<entry dst="/guest">
<label>Guest view</label>
<label xml:lang="de-DE">...</label>
<description>View the gallery as user not logged in</description>
<icon path="images/icon-guest.png"/>
</entry>
</entry-points>
The dst attribute of an entry point may contain absolute or relative URI of the
entry point. Templates conforming to [URI Templates] are allowed. For
relative URIs, absolute URL will be generated when entry point is being
displayed, pointing to the base URL of application + URI of entry point. GET or
POST HTTP request method MAY be declared to be used to access HTTP
entry point. GET is assumed by default.
When displaying an entry point, Controller SHOULD use the provided label,
description and icon. The icon/@path attribute MUST contain a full path in
archive to the icon file. The icon SHOULD be a 64x64 pixel image in PNG
format using alpha transparency. JPEG and GIF formats MAY be used as
well, but their use is discouraged.
The entry/@class attribute MAY be used to inform Controller about the entry
point designation. The following values of this attribute are predefined:
Controller MAY use this information for displaying the entry point. Controller
MUST ignore unknown entry/@class and treat such entry point as being
without explicit class specification. Application MAY declare several entry
points with the same class attribute.
Entry point MAY declare request variables to be specified when user clicks
entry point in control panel interface. Variables values may be taken from
actual service settings using thevalue-of-setting attribute or explicitly specified
as the variable element value. If the specified setting has empty value,
the variable element value MUST be used. These variables are also used for
URI Templates expansion. Variables with duplicate names are allowed and, if
present, MUST be used for arrays representation as defined in [URI
Templates] 'prefix' operator (4.4.4), 'suffix' operator (4.4.5) and 'list' operator.
Controller MAY provide arbitrary values for such variables basing on its own
considerations. Controller MUST ignore unknown variable/@class and treat
such variable as variable without explicit class specification. Application MAY
declare several variables with the same class attribute. Controller SHOULD
provide equal values for variables with the same class.
If a setting has the optional attribute and value of the setting is not specified,
Controller MUST NOT apply type validation rules for setting's value and
SHOULD use usual algorithm for calculating of default value if applicable. If it
is no optional attribute defined this setting is treated as mandatory and
Controller SHOULD NOT allow entering empty value for the setting unless it is
allowed by validation rules.
Regular settings are visible only to service that declares them. Settings with
the same name/id are allowed in different services.
Setting that should have a unique value within some scope should have
an uniq attribute. This attribute may have one of the following values:
global - The setting value should be unique for all application instances provisioned in all
global contexts.
application he setting value should be unique for all application instances provisioned in the
global context.
owner - The setting value should be unique for all application instances of the customer.
service - The setting value should be unique for all service instances provisioned in the
application instance.
Once setting defined as unique Controller MUST arrange setting value unicity
in requested scope. And refuse non-unique user input or auto-configuration.
All settings identified by the same uuid attribute and have uniq attribute
defined are validated for unicity between each other by Controller.
Setting may be protected from editing by both application owner and provider
by protected attribute with value true. If no this attribute specified setthing is
threaded as available for editing.
Settings may be grouped by the group element. Group MAY have a name
declared by the name element. Groups without specified name are
called anonymous . Group contains a list of settings and MAY contain
anonymous groups. Settings and groups are listed in the order suggested to
be used in interface.
Settings are typed, Controller SHOULD use the type information to validate
input. The following types are defined:
min
Minimum acceptable integer value (inclusive). The least
A 64-bit signed possible value is -9223372036854775808.
integer
integer number Maximum acceptable integer value (inclusive). The
max
greates possible value is 9223372036854775807.
A double-precision
64-bit floating point
number with values
from value space m × min Minimum acceptable real value (inclusive).
float 2^e, where m is an
max Maximum acceptable real value (inclusive).
integer whose
absolute value is less
than 2^53, and e is an
integer between -1075
Type Values Optional restrictions
and 970.
email address, as
email defined in [RFC
2822]
DNS domain name, as
defined in [RFC
1035] Setting
attributeclass to
domain-
value domain-
name
name will instruct
controller to substitue
here selector with
available domains.
Either DNS domain
host- name, as defined in
name [RFC 1035] or IP
address.
One of supplied
enum
identifiers
If attribute provided - order of items is significant.
Possible attribute values: id - order items by
order
id, name - order items by name, custom - let
customer order items himself.
min-
Minimal allowed number of items in list (inclusive).
items
List of values of some max- Maximal allowed number of items in list (inclusive).
list items
type
Type of elements. May
be string, integer, float, email, domain-
name, host-name, enum. Restrictions from
element-
appropriate types also allowed here. List of default
type
values MAY be provided in child default-
value elements. For enum element-
type Child choice elements MAY be provided.
Controller MUST ignore unknown class value and treat such element as being
without explicit semantics specification.
Settings group which declares class="authn" MAY use the following classes of
settings:
<group class="authn">
<setting id="user_account_name" type="string" class="login">
<name>User login</name>
</setting>
<setting id="user_pwd" type="password" class="password">
<name>Password</name>
</setting>
</group>
<group class="presentation">
<setting id="user_locale" type="enum" default-value="en-GB" class="locale">
<name>Default locale</name>
<choice id="en-GB">
<name>English</name>
</choice>
<choice id="fr-FR">
<name>French</name>
</choice>
<choice id="de-DE">
<name>German</name>
</choice>
</setting>
</group>
Settings group which uses class="web" MAY use the following classes for
settings:
<group class="web">
<setting id="site_title" type="string" class="title"
default-value="Homepage">
<name>Site Title</name>
</setting>
<group class="vcard">
<group class="fn n">
<setting id="user_first_name" class="given-name" ... />
<setting id="user_last_name" class="family-name" ... />
</group>
<group class="tel">
<name class="type">work</name>
<setting id="work_phone" class="value" .../>
</group>
<group class="tel">
<name class="type">cell</name>
<setting id="mobile_phone" class="value" .../>
</group>
</group>
The name element MUST NOT contain both the class and
the xml:lang attributes. Only one name element with declared class attribute is
allowed within one settings group.
5.2.6. Resources
The Resources section of metadata describes what usage values are reported
by application. This information may be used by controller for application
monitoring and resource accounting.
<resources>
<resource id="users" class="item" limiting-setting="users">
<name>Number of users created in application</name>
<description>Number of active users created within
application</description>
</resource>
<resource id="folders" class="item" limiting-setting="folders">
<name>Number of folders</name>
<description>Total number of active directory folders used by
application</description>
</resource>
<resource id="traffic.download" class="kb">
<name>Download Traffic</download>
<description>Total number of kbytes downloaded by
application</description>
</resource>
</resources>
Application may give a hint to controller what settings limit this resource usage
by limiting-setting attribute. So, control panel will be able to display both
current resource usage and its actual limit to user.
Reporting of resource usage happens for all resources together with resource-
script execution.
5.2.7. Requirements
<requirements
xmlns:php="http://apstandard.com/ns/1/php"
xmlns:db="http://apstandard.com/ns/1/db">
<php:version min="5.0.2"/>
<choice>
<requirements id="mysql">
<php:extension>mysql</php:extension>
<db:db>
<db:id>main</db:id>
<db:default-name>wiki</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.0</db:server-min-version>
</db:db>
</requirements>
<requirements id="postgresql">
<php:extension>postgresql</php:extension>
<db:db>
<db:id>main</db:id>
<db:default-name>wiki</db:default-name>
<db:can-use-tables-prefix>false</db:can-use-tables-prefix>
<db:server-type>postgresql</db:server-type>
<db:server-min-version>7.4</db:server-min-version>
</db:db>
</requirements>
</choice>
</requirements>
Every requirement type has associated rules (in natural language) of how to
satisfy the requirement during the instantiation as the part of the requirement
type definition in aspect.
<provision>
<when-chosen requirements-id="arch-x86_64">
<mapping url="/" path="cgi/x86_64"/>
</when-chosen>
</provision>
This division depends on provision methods being used for the service. If at
least one of used provision methods requires individual update, the update
procedure MUST be performed for all the service's provision methods. If no
provision methods require individual update, Controller MUST NOT perform
update procedures for the service.
<url-mapping>
<default-prefix>forum</default-prefix>
<installed-size>5242880</installed-size>
<mapping url="upload">
<php:handler><php:disabled/></php:handler> <!-- Disabling PHP -->
<php:permissions writable="true"/>
</mapping>
<mapping url="stat" virtual="virtual">
<php:handler><php:disabled/></php:handler>
<mod-python:handler>com.example.StatHandler</mod-python:handler>
</mapping>
</mapping>
</url-mapping>
The example mapping describes three contexts: URLs starting from the /,
URLs starting from the /upload and URLs starting from the /stat. The two first
are mapped to the file system, the third one is virtual (the mod_python aspect
is not defined in this specification, so this is placed here just for illustrative
purposes).
Mappings may be nested, and there MUST NOT be two mappings with such
URLs that the first URL is the prefix of the second URL. In other words, the
construction
<mapping url="/">
<mapping url="foo/bar"/>
<mapping url="foo/bar/baz"/>
</mapping>
<mapping url="/">
<mapping url="foo/bar">
<mapping url="baz"/>
</mapping>
</mapping>
All url s in mappings are relative to the parent URL mapping. Absolute URLs
are PROHIBITED in the url attributes except the root mapping
where url value MUST be '/'.
The path attribute of mapping is always path from the root of archive to the
directory inside the archive, it must not have the / character at the start.
If mapping has an explicit path attribute, then the mapping is associated with
the directory specified by this attribute. The association means that any URL
which is in the scope of the given mapping (URLs in scopes of inner mappings
are not in the scope of outer mapping) and is not handled by the handlers
declared in the mapping needs to be served as the file from the directory
specified.
If a mapping has neither an explicit path attribute nor a virtual attribute, then
the directory associated with the given mapping is calculated from the
directory associated with the parent mapping appending the relative URL that
the given mapping has. E.g., for the following declarations
If mapping has an explicit virtual attribute equal to virtual, then the mapping
is not associated with any directory, and requests to the URLs in the scope of
this mapping must return 'Not found' error, if not handled by handlers declared
in the given mapping.
If mapping has an explicit shared attribute equal to true, then the controller
SHOULD share contents of directory referred by this mapping between all
instances of the version of application.
If an outer mapping does not have an associated directory, then the inner
mappings without explicit path element do not have an associated directory
too.
If the whole application mapping is not virtual (meaning that there is at least
one mapping without the virtual attribute), the root mapping MUST have
the path attribute.
Aspects declare types of URL handlers, rules of how to process them. Rules
regulating propagation of specific URL handlers to inner mappings are also
declared in aspects.
The handler defined latter overrides the former. In the following example, all
*.php files will be processed by CGI handler.
<mapping url="users">
<php:handler>
<php:extension>php</php:extension>
</php:handler>
<cgi:handler>
<cgi:extension h:handler-type="php">php</cgi:extension>
</cgi:handler>
</mapping>
5.3.1.2. Update
Every file existing in both old and new packages gets replaced by new
version.
All files existing in old package, but not in new, are deleted.
All files existing in new package are installed, overwriting any files
present on file system.
No other file is touched - all files created by users are kept intact.
A service may be provisioned with the help of configuration script. This script
will be invoked during application service provisioning, cancelling, updating
and reconfiguration. Availability of the script is declared by the configuration-
script element. Different configuration scripts for different services are
allowed.
<configuration-script name="configure">
<script-language>php</script-language>
</configuration-script>
Configuration scripts MUST reside in the scripts directory in the package root
directory. Name of configuration script is specified with the name attribute.
If any script invocation fails (script returns a non-zero exit code), it MUST be
treated as fatal error and Controller MUST refuse to continue operation.
Stdout and stderr I/O streams of the script should be captured to log error or
treat output values, see configuration script output.
install
where <old version> is the old version, and <old release> is the old release of
the application being upgraded.
configure
remove
<configuration-script name="reseller">
<script-language>php</script-language>
<status-control/>
</configuration-script>
In this case, Controller MUST invoke the script with the following arguments:
enable
disable
SERVICE_ID=gallery
Services which utilize URL Mapping provision method demand the following
environment variables to be passed to configuration script.
Full URL specifying where the service is available, represented by the four
environment variables corresponding to the URL parts as defined in [RFC
1738]:
For example:
BASE_URL_SCHEME=http
BASE_URL_HOST=example.com
BASE_URL_PORT not defined
BASE_URL_PATH=phpBB/
Also, for each mapping, except for those which do not map to file system,
the WEB_<id>_DIR environment variable must be passed with the absolute path
to the directory to which the mapping maps, where id is the full URL path of
the mapping, with all '/' characters converted to '_'.
I.e., for the following URL mapping declaration:
WEB___DIR=/var/www/vhosts/domain.name/public_html/example/htdocs
WEB__foo_bar_DIR=/var/www/vhosts/domain.name/public_html/example/htdocs/foo/b
ar
WEB__foo_bar_baz_DIR=\
/var/www/vhosts/domain.name/public_html/example/htdocs/foo/bar/baz
WEB__foo_bar_quux_DIR=/var/www/vhosts/domain.name/public_html/example/somedir
5.3.2.2.2. SETTINGS
During the service provisioning, all the declared service settings and package
global settings MUST be passed to the configuration script. No old values
should be passed.
During the service reconfiguration, cancelation and service status change, all
the declared service settings and package global settings, except marked as
installation-only, MUST be passed to the configuration script.
During the service instance upgrade and patching, all settings of the new
version of service which exist in old version MUST be set to corresponding
values from the old instance. If a settings validator does not allow a value from
the old instance, such setting MUST be set to the default value. All settings
from new package which do not correspond to the settings from old package
MUST get the default values.
For the boolean, string, float, and integer property value data type elements,
the corresponding environment variables must contain values entered by
user.
For the enum setting, the environment variable must contain the identifier of
one of the values (defined by the id attribute of the enum/choice element)
selected by the user (e.g., if you have choice with
id interface_color containing options with IDs black and blue, then
variable SETTINGS_interface_color with value black or blue will be exported).
Configure script structured output MAY contain errors, errors bind to specific
settings and new setting values.
<output xmlns="http://apstandard.com/ns/1/configure-output">
<errors>
<error id="1093" setting-id="login">
<message>Login name 'jsmith' already exists.</message>
<system>login 'jsmith' is duplications with record
id=12384</system>
</error>
<error id="1123" setting-id="password">
<message>Password matches dictionary word</message>
<system>login 'jsmith' password strength too low
rate=0.02</system>
</error>
</errors>
</output>
Configuration script MAY return new values for some settings. In this case
Controller SHOULD store returned settings. Element value SHOULD be used
to pass returned value. Setting that are not returned in structured output
SHOULD NOT be altered.
If returned setting does not match setting type or/and restrictions controller
SHOULD raise fatal error.
<output xmlns="http://apstandard.com/ns/1/configure-output">
<settings>
<setting id="context-id">
<value>12365</value>
</setting>
<setting id="creation-date">
<value>2009-10-10</value>
</setting>
</settings>
</output>
Verification script can be defined and called in both global context and context
of service instance. In case of global context no resources allocated and no
environment variables related to service instance or resources provided. Call
of verification script in global context required for verification of global settings.
Also verification script MAY be called for settings verification before service
provisioning.
Controller MAY execute this script while user press special control for
verification (for example "Verify" button on settings edit screen). Or on just
usual install/configure/upgrade operation. It should be safe to call this script in
synchronous mode. To make results of execution visible for user just on
submit.
Application may give a hint to controller how often it should poll application for
resource usage value with poll-interval attribute. It MAY be specified either
as number of minutes, like 5m or as number of hours like 2h or as number of
days, like 1d. Controller MAY disregard poll-interval attribute and decide how
often call resource script.
If some resource was not reported in output controller MUST assume that
resource is not used.
<resources xmlns="http://apstandard.com/ns/1/resource-output">
<resource id="users" value="123"/>
<resource id="folders" value="1340"/>
<resource id="traffic.download" value="12388" period="300"/>
</resources>
Operations like backup, restoration or migration may be done with the help of
backup script. This script will be invoked during application backup and
restoration. Availability of the script is declared by the backup-script element.
Different configuration scripts for different services are allowed.
<backup-script name="backup.php">
<script-language>php</script-language>
</backup-script>
Backup/Restore script follows same calling conventions as configuration
script.
If any script invocation fails (script returns a non-zero exit code), it MUST be
treated as fatal error and Controller MUST refuse to continue operation.
Stdout and stderr I/O streams of the script should be captured to log error in
this case.
backup
On this operation script should backup all sensitive application data to file
specified in BACKUP_FILE variable. Controller should provide appropriate
location for backup file and ensure that there is enough diskspace for file
creation.
restore
On this operation application should restore all sensitive application data from
file specified in BACKUP_FILE variable.
Child services should be restored by this operation, both set of services and
content of services. Controller will arrange restore of service instances and
related resources. Restore script responsible for child service data restoring.
Same rules and set of variables are used for backup script as for configuration
script .
Full path to backup file location passed to script in BACKUP_FILE variable. This
file should be writable for backup operation and should be readable for restore
operation.
Backup script should operate with file using simple sequential read and write
operations.
The APP-LIST.xml file MUST be valid according to the schema above. XML
namespace of the package listing will be changed when incompatible changes
are introduced.
Usually packager should sign APS package with package certificate. As well
as APS certification authority SHOULD also sign package on successful
certification.
7. Points of Extensibility
Aspects are additional specifications that declare how to describe specific
needs of applications in packages, and how Controllers must process the
descriptions.
Every requirement type consists of XML element schema which describes the
structure of element representing requirement, and rules of how to process
the requirement.
Each aspect may declare several URL handlers types. Every URL handler
type declares how to desecribe rules on how to handle URLs which are
specific to the declaring aspect in the scope of a particular mapping.
Every URL handler type consists of XML element schema which describes the
structure of element representing URL handler, and rules of how to process
the URL handler. Especially, this should include the rules of inheriting URL
handlers from the outer mappings in inner mappings.
Aspect may declare that additional files need to be packaged. Aspect MUST
NOT declare additional files in the scripts directory, it is reserved for
processing configuration scripts.
Aspect may declare additional scripts to be run during the package lifetime.
Aspect must provide rules of when to run additional scripts, which arguments
and environment variables need to be passed to the scripts.
7.8. Rules
8. Common Aspects
This specification defines a number of "common aspects": a set of aspects
which are expected to be implemented in Controllers. However, if an aspect is
inapplicable to a particular Controller, it may be omitted.
<php:extension>curl</php:extension>
<php:extension>Zend Optimizer</php:extension>
<php:extension>ionCube Loader</php:extension>
<php:function>system</php:function>
<php:allow-url-fopen>true</php:allow-url-fopen>
<php:handler>
<php:extension>php</php:extension>
<php:extension>pinc</php:extension>
</php:handler>
<php:handler><php:disabled/></php:handler>
Handlers of this type require that files with the specified extensions (if no
extensions are specified, a single php extension is assumed) are handled by
the PHP interpreter.
Inner mappings inherit handlers from the outer mappings, so the presence
of php:disabled disables PHP in the given mapping.
<php:permissions writable="true">
<php:permissions readable="false">
The situation when a directory and files in the directory to which the given
mapping maps should be writable by PHP interpreter is specified by using
the writable attribute with the "true" value. The "false" value is default, so no
explicit attribute for this is required.
The situation when files in the directory should be protected from reading by
PHP interpreter is specified by the readable attribute with the "false" value. The
"true" value is default, so no explicit attribute for this is required.
Inner mappings do not inherit permission handlers from the outer mappings.
8.1.3. Configuration Script Language
This aspect defines the php identifier to be used by configuration scripts. When
a configuration script uses the php language, it MUST be run by stand-alone
PHP interpreter. All the requirements described in the application metadata
apply to the interpreter running configuration scripts.
This aspect should be used by web applications which use ASP.NET. This
aspect uses the http://apstandard.com/ns/1/aspnet XML namespace.
<aspnet:handler/>
<aspnet:handler>
<aspnet:disabled/>
</aspnet:handler>
Handler of this type requires that files with the specified extensions (if no
extensions are specified, the default set of ASP.NET extensions is assumed)
are handled by ASP.NET.
Inner mappings inherit handlers from the outer mappings, so the presence
of aspnet:disabled disables ASP.NET in the given mapping.
<aspnet:permissions writable="true">
The situation when files in the directory to which the given mapping maps
should be writable by the ASP.NET interpreter is specified by using
the writable attribute with the "true" value. The "false" value is default, so no
explicit attribute for this is required.
<requirements>
<db:db xmlns:db="http://apstandard.com/ns/1/db">
<db:id>storage</db:id>
<db:default-name>broombla</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.0</db:server-min-version>
<db:features xmlns:mysql="http://apstandard.com/ns/1/db/mysql">
<mysql:privilege>Create_tmp_table_priv</mysql:privilege>
</db:features>
</db:db>
</requirements>
id
Identifier of the database. This identifier will be used in environment variables
passed to configuration scripts.
default-name
Optional. Proposed name of a database. It is not guaranteed that the allocated
database will use this name.
can-use- This element must have the true value only if a service is able to cope with
tables-prefix sharing a database with another services by using prefixed tables. Otherwise, its
value should be false .
server-type This element must be one of the database server identifiers described below.
server-min- This element describes the minimum acceptable version of database server
version software.
features
This element describes peculiarities of required database and database user that
are specific for database management system.
Database requirements with the same id value are allowed only in different
branches of a single choice grouping. It is illegal to declare database
requirements with the same id in different choice s or in a choice and outside it
at the same time.
mysql - MySQL
postgresql - PostgreSQL
microsoft:sqlserver - Microsoft SQL Server
8.3.3. Upgrade
If both old and new version of package require a database with the same id ,
then this database and its content need to be preserved. Controller MUST
refuse to upgrade database to another database type.
All databases which are declared in old or new packages MUST be accessible
during upgrade script invocation. Thus, application MAY perform database
upgrades by issuing new database id in the package release which requires
cross-database upgrade.
<requirements>
<db:db xmlns:db="http://apstandard.com/ns/1/db">
<db:id>storage</db:id>
<db:default-name>broombla</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.0</db:server-min-version>
<db:features xmlns:mysql="http://apstandard.com/ns/1/db/mysql">
<mysql:privilege>Create_tmp_table_priv</mysql:privilege>
<mysql:privilege disabled="true">Lock_tables_priv</mysql:privilege>
</db:features>
</db:db>
</requirements>
This aspect declares two requirement types: Apache module requirement type
and Apache .htaccess requirement type. Those requirements should be used
only if a web application works exclusively with Apache due to some Apache-
specific features.
<requirements>
<apache:required-module xmlns:apache="http://apstandard.com/ns/1/apache">
mod_python
</apache:required-module>
</requirements>
Requirement of this type is satisfied when the specified Apache module is
enabled for the application.
<requirements>
<apache:htaccess xmlns:apache="http://apstandard.com/ns/1/apache"/>
</requirements>
This aspect allows declaring CGI scripts in a package. This aspect uses
the http://apstandard.com/ns/1/cgi XML namespace. Explicit handlers notation
uses thehttp://apstandard.com/ns/1/cgi/handlers namespace.
<cgi:handler
xmlns:cgi="http://apstandard.com/ns/1/cgi"
xmlns:h="http://apstandard.com/ns/1/cgi/handlers">
<cgi:extension h:handler-type="perl">pl</cgi:extension>
<cgi:extension h:handler-type="perl">cgi</cgi:extension>
</cgi:handler>
<cgi:handler xmlns:cgi="http://apstandard.com/ns/1/cgi">
<cgi:all-files/>
</cgi:handler>
A handler of this type requires that files with the specified extensions (if no
extensions are specified, a single cgi extension is assumed) are handled by
running them as CGI scripts. If the all-files option is declared, then all files
under the current mapping are to be handled as CGI scripts.
Inner mappings inherit handlers from the outer mappings, so the presence
of cgi:disabled disables handling of CGI in the given mapping.
Some web servers need additional information about programs to run CGIs.
This information is optionally supplied in the h:handler attribute. Possible
values of this attribute consist of several predefined strings, each denoting
CGI handler of a particular type, namely:
Web servers which do not need an additional information about CGI handlers
should ignore the h:handler attributes.
<cgi:permissions writable="true">
<cgi:permissions readable="false">
The situation when a directory and files in the directory to which the given
mapping maps should be writable by running CGI script is specified by using
the writable attribute with the "true" value. The "false" value is default, so no
explicit attribute for this is required.
The situation when files in the directory should be protected from reading by
running CGI script is specified by the readable attribute with the "false" value.
The "true" value is default, so no explicit attribute for this is required.
Inner mappings do not inherit permission handlers from the outer mappings.
<requirements>
<hw:hardware xmlns:hw="http://apstandard.com/ns/1/hardware">
<hw:minimal>
<hw:cpu>200</hw:cpu>
<hw:ram>50</hw:ram>
</hw:minimal>
<hw:recommended>
<hw:cpu>600</hw:cpu>
<hw:ram>100</hw:ram>
</hw:recommended>
</hw:hardware>
</requirements>
This aspect declares the following requirement types: the minimum and
recommended amount of CPU and RAM resources required for service to
work. Requirements of this type are satisfied if Controller is aware that
necessary amount of resources is available. Required CPU resources are
specified in megaherz, RAM resources are specified in megabytes.
<requirements>
<env:environment xmlns:env="http://apstandard.com/ns/1/environment">
<env:x86/>
<env:windows/>
</env:environment>
</requirements>
This aspect declares the following requirement types: operating system, and
operating system architecture. Requirements of this type are satisfied if the
appropriate operating system and OS architecture are used for services
instances. Requirements of this type are allowed only within top-level service.
8.8. Mail
RELAX NG schema of Mail aspect
<requirements xmlns:mail="http://apstandard.com/ns/1/mail">
<mail:mailbox>
<mail:access>
<mail:imap/>
<mail:imap-ssl/>
<mail:imap-tls/>
<mail:pop3/>
<mail:pop3-apop/>
</mail:access>
<mail:outgoing>
<mail:smtp/>
</mail:outgoing>
</mail:mailbox>
</requirements>
<requirements xmlns:mail="http://apstandard.com/ns/1/mail">
<mail:outgoing>
<mail:smtp/>
<mail:smtp-tls/>
</mail:outgoing>
</requirements>
id
Identifier of mailbox. This identifier will be used in environment variables passed to
configuration scripts
access A list of protocols that must be used for accessing mailbox
imap IMAP version 4 revision 1 protocol as defined by RFC 3501
imap-ssl IMAP version 4 revision 1 tunneled over SSL
imap-tls IMAP version 4 revision 1 with Transport Layer Security enabled
pop3 POP3 protocol as defined by RFC 1939
pop3-
apop POP3 protocol with APOP extension
pop3-tls POP3 protocol access with TLS enabled
outgoing Requirement for access to outgoing mail server
smtp
Requirement for access to outgoing mail server over SMTP protocol as defined by
RFC 5321
smtp-ssl Requirement for access to outgoing mail server over SMTP with SSL tunnelling
smtp-tls
Requirement for access to outgoing mail server over SMTP protocol with TLS
enabled
New mailbox is created accessible over the specified protocols or existing mailbox is configured
to be accessible over the specified protocols.
User authorized to accessing the mailbox is created or exists already.
If 'outgoing' element is used - the same user is authenticated by outgoing mail server.
Mail delivery for at least one email address is configured to the mailbox.
Outgoing mail server is accessible over the protocols specified within 'outgoing' element.
The 'outgoing' requirement type demands access to outgoing mail server over
SMTP protocol as defined by RFC 5321. Requirement of this type is satisfied
when:
8.8.2. Upgrade
If both old and new versions of application require mailbox then the mailbox,
its content and user access credentials MUST be preserved. If new version of
application requires different set of mailbox access protocols, then mailbox
MUST be accessible over new set of protocols during upgrade.
This aspect is to be used by web applications written in Perl. This aspect uses
the http://apstandard.com/ns/1/perl XML namespace.
Perl aspect declares the following requirement types: perl version and perl
module.
Defined here perl modules should be available with perl 'use' instruction.
<perl:handler>
<perl:extension>pl</perl:extension>
<perl:extension>perl</perl:extension>
</perl:handler>
<perl:handler><perl:disabled/></perl:handler>
Handlers of this type require that files with the specified extensions (if no
extensions are specified, a single pl extension is assumed) are handled by
the perl interpreter.
Inner mappings inherit handlers from the outer mappings, so the presence
of perl:disabled disables Perl in the given mapping.
8.9.3. Configuration Script Language
This aspect is to be used by services, that need a special DNS zone resource
records in order to work. This aspect uses
the http://apstandard.com/ns/1/dns XML namespace.
<requirements>
<dns:record xmlns:dns="http://apstandard.com/ns/1/dns">
<dns:mx>
<dns:src>
<dns:current/>
</dns:src>
<dns:dst>
<dns:external>mailserver.example.com.</dns:external>
</dns:dst>
<dns:priority>10</dns:priority>
</dns:mx>
</dns:record>
<dns:record xmlns:dns="http://apstandard.com/ns/1/dns">
<dns:id>MainMX</dns:id>
<dns:mx>
<dns:src>
<dns:current/>
</dns:src>
<dns:dst>
<dns:external>reserve.example.com.</dns:external>
</dns:dst>
<dns:priority>20</dns:priority>
<dns:substitute/>
</dns:mx>
</dns:record>
</requirements>
external , prefix and several elements specific for MX , A , TXT and SRV records
may take their values from actual service settings, using value-of-
setting attribute. If both @value-of-setting and element's text values are
specified - the latter is assumed to be a default value. If setting value is
changed - resource record MUST be reconfigured appropriately. If setting
value is incompatible with resource record type (for example ip element's
value is specified as not IP address) resulting resource record MUST NOT be
created.
Records MAY have a substitute keyword in definition. This means that DNS
record should replace existing DNS record with new value. When such
requirement is satisfied, the following environment variable must be passed to
configuration scripts for 'dns:record' requirement: DNS_<id>_SUBSTITUTE. It
should contain original value of DNS record been replaced. Keyword id refer
here to requirement identifier.
<requirements>
<dns:record xmlns:dns="http://apstandard.com/ns/1/dns">
<dns:cname>
<dns:source>
<dns:wildcard/>
</dns:source>
<dns:destination>
<dns:external value-of-
setting="park_to">parked.example.com.</dns:external>
</dns:destination>
</dns:cname>
</dns:record>
</requirements>
<content xmlns:dll="http://apstandard.com/ns/1/dll">
<dll:register path="win/some.dll"/>
</content>
This aspect declares two requirement types: IIS version requirement type and
IIS pool requirement type. Those requirements should be used only if a web
application works exclusively with IIS.
<requirements xmlns:iis="http://apstandard.com/ns/1/iis">
<iis:version match="version > 7"/>
<iis:pool mode="integrated"/>
</requirements>
Requirement of this type is satisfied when the IIS version above 7 and pool
mode on hosting set to integrated.
References
Satellite Specifications
XML Technologies
Other
[RFC 2872] Application and Sub Application Identity Policy Element for Use
with RSVP
[ISO 639] ISO 639: Codes for the Representation of Names of Languages