The Aukyla Application Package FormatIntroAukyla Application Packages (AAPs) are primarily used for installing or updating applications in the Aukyla Platform, but can in fact install any kind of content, like plugins, translations, and updates to the Aukyla Platform itself. AAPs are basically Zip files, containing a special file called package.xml describing the package contents, and the files making up the contents itself. To create your own application package, just create the file package.xml and put in some meta-data, so that the file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<package>
<shortName>my_package</shortName>
</package>
You can then, from that same directory, run the following command: # create_package.php Created package my_package.aap. This will have resulted in a totally useless, but installable package. Meta-dataIn the package we created, we have only defined one bit of meta-data, namely the short name of the package. Here is an overview of all the meta-data that can be defined:
DependenciesIt is not uncommon for a package to rely on functionality provided by other packages. Therefore, you can specify which other packages, and which versions of these packages, should be installed before a package itself is allowed to be installed. This is done by creating an element dependencies, in which you can create a dependency element for every dependency the package has. Within the dependency element, you can specify the package on which your package depends, and the version of the package that should be installed. Use the following elements for this:
For example, a package which depends on at least version 2.1 of the Aukyla Platform, can specify its dependency as follows:
<dependencies>
<dependency>
<package>platform</package>
<minVersion>2.1</minVersion>
</dependency>
</dependencies>
FilesThe main part of the package will logically be its contents. The file package.xml should register all the files which are in the package, and any file that's not in the file package.xml will not be installed (and won't even be included in the package by the create_package.php utility). To specify which files are in the package, use the files element. Within this element, use a file element for every file in the package. The value of the element should be the relative path to the file. For example, a package which contains a single file called MyFrontend.php in the subdirectory plugins/Frontends, can specify this file as follows:
<files>
<file>plugins/Frontends/MyFrontend.php</file>
</files>
In addition, two attributes can be specified on the file element. These are the executable and update attributes. The executable attribute can take the following values:
The update attribute specifies how the file should be handled when doing an update rather than a clean installation. It can take the following values:
ResourcesResources are just plain files that will be made available publicly from the webserver. Examples are CSS and JavaScript files and images. Resources are placed inside the package in the subdirectory htdocs/resources and will be installed in the resources directory in the document root of the webserver. Resources are specified in the same way as files are specified, except that the files and file elements are replaced by the elements resources and resource, respectively. The specified path should be relative to the htdocs/resources directory, rather than the root of the package. No attributes are supported on the resource element. For example, a package which has a resource file called layout.css in the subdirectory htdocs/resources/plugins/Frontends/MyFrontend, can specify this file as follows:
<resources>
<resource>plugins/Frontends/MyFrontend/layout.css</resource>
</resources>
ModulesIf the package contains add-on modules (which are stored in the plugins/Modules subdirectory), you should specify some additional meta-data about them, so they can be activated. To specify the modules in your package, use the modules element and for each module use a module element. Within the module element, you can specify the following elements:
For example, a package that wishes to install a Logger module that's enabled by default and which should be able to log signals comming from the Login class, could specify this module as follows:
<files>
<file>plugins/Modules/Logger.php</file>
</files>
<modules>
<module>
<shortName>Logger</shortName>
<name>Logger Module</shortName>
<description>A module logging various signals</description>
<enabledByDefault>true</enabledByDefault>
<defaultPriority>000</defaultPriority>
</module>
</modules>
Final notesThe tutorial How to write your own Aukyla Frontend also walks through the creation of an Aukyla Application Package, and you can download and unzip the package created in the tutorial to examine the contents of a real package. If you want some more real-life examples, you can also inspect the AAPs of the Aukyla Platform itself and those of ADMS. If you have any remaining questions, please do not hesitate to contact us. |