package.xml format

This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation!

This section describes important XML tags that are used by the packages system. These tags are used in a "package.xml" file that is located in a package directory.

Items to be installed

The package installation process is determined by the list of items to install. This list is always specified between the <install> and </install> XML tags. (Please note that using two <install> tags inside one "package.xml" file is not allowed.)

An item to install is specified using the <item> XML tag. The following table reveals the list of the tag's attributes.

Attribute

Value

type

The type of the item ("ezcontentclass", "ezcontentobject", "ezextension", "ezinstallscript", etc.)

filename

The name of the ".xml" file that contains information about the item (without the file extension).

sub-directory

The name of the subdirectory which contains the item's ".xml" file.

Example

Let's say that a content class package contains three content classes called "myarticle", "myfolder" and "myproduct". These classes are described in the files called "class-myarticle.xml", "class-myfolder.xml" and "class-myproduct.xml" that are located in the "myclassdir" subdirectory under the package directory. In this case, the "package.xml" file located in the package directory may contain the following lines:

<install>
<item type="ezcontentclass"
            filename="class-myarticle"
            sub-directory="myclassdir" />
<item type="ezcontentclass"
            filename="class-myfolder"
            sub-directory="myclassdir" />
<item type="ezcontentclass"
            filename="class-myproduct"
            sub-directory="myclassdir" />
</install>

This will instruct the system to install three items of the "ezcontentclass" type in the following order:

Items to be uninstalled

The package uninstallation process is determined by the list of items to uninstall. This list is always specified between the <uninstall> and </uninstall> XML tags. (Please note that using two <uninstall> tags inside one "package.xml" file is not allowed.)

An item to uninstall is specified using the <item> XML tag (as described above).

Dependent packages that are required

A site package usually contains dependencies to other packages. Choosing a site package in the setup wizard will result in downloading, importing and installing its dependent packages. The list of dependent packages that the site package requires is always specified between the <requires> and </requires> XML tags located within the <dependencies> and </dependencies> pair.

Dependent packages are specified using the <require> XML tag. The following table reveals the list of the tag's attributes.

Attribute

Value

type

The type of the package (usually "ezpackage").

name

The internal name of the package.

min-version

The minimal version of the package that can be used.

Example

The "package.xml" file of the "News" site package may contain the following lines:

<dependencies>
    <provides />
    <requires>
      <require type="ezpackage"
               name="news"
               min-version="1.0" />
      <require type="ezpackage"
               name="media"
               min-version="1.0-3" />
      <require type="ezpackage"
               name="t01"
               min-version="1.0" />
    </requires>
    <obsoletes />
    <conflicts />
  </dependencies>

This means that the "News" site package requires the following three dependent packages:

Choosing the "News" site package in the setup wizard will result in downloading the site package itself and all its dependent packages. All dependent packages except from the site style package will be automatically installed.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.