Actions

Difference between revisions of "Package"

From Joomla! Documentation

m (Added category)
(Added library and system plugin examples. Fix bad ids that cause issues uninstalling package. Also added author and creation date that will be shown in extension manager)
Line 5: Line 5:
 
== How do I create a package? ==
 
== How do I create a package? ==
  
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. If you have a helloworld component and module you make the following tree in your zipfile:
+
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:
 +
 
 +
* '''component''' helloworld
 +
* '''module''' helloworld
 +
* '''library''' helloworld
 +
* '''system plugin''' helloworld
 +
 
 +
The package should have the following tree in your zipfile:
  
 
   -- pkg_helloworld.xml
 
   -- pkg_helloworld.xml
Line 11: Line 18:
 
       |-- com_helloworld.zip
 
       |-- com_helloworld.zip
 
       |-- mod_helloworld.zip
 
       |-- mod_helloworld.zip
 +
      |-- lib_helloworld.zip
 +
      |-- plg_sys_helloworld.zip
  
 
The pkg_helloworld.xml could have the following contents:
 
The pkg_helloworld.xml could have the following contents:
Line 18: Line 27:
 
  <extension type="package" version="1.6">
 
  <extension type="package" version="1.6">
 
  <name>Hello World Package</name>
 
  <name>Hello World Package</name>
 +
<author>Hello World Package Team</author>
 +
<creationDate>May 2012</creationDate>
 
  <packagename>helloworld</packagename>
 
  <packagename>helloworld</packagename>
 
  <version>1.0.0</version>
 
  <version>1.0.0</version>
Line 26: Line 37:
 
  <update>http://www.updateurl.com/update</update>
 
  <update>http://www.updateurl.com/update</update>
 
  <files folder="packages">
 
  <files folder="packages">
<file type="component" id="com_helloworld" >com_helloworld.zip</file>
+
  <file type="component" id="helloworld" >com_helloworld.zip</file>
<file type="module" id="mod_helloworld" client="site">mod_helloworld.zip</file>
+
  <file type="module" id="helloworld" client="site">mod_helloworld.zip</file>
 +
  <file type="library" id="helloworld">lib_helloworld.zip</file>
 +
  <file type="plugin" id="helloworld" group="system">plg_sys_helloworld.zip</file>
 
  </files>
 
  </files>
 
  </extension>
 
  </extension>
 
</source>
 
</source>
  
When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.
+
When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.
 +
 
 +
Remember to use the package uninstaller instead of individual subpackage uninstallers to avoid orphan extension entries in the extension manager.
  
 
[[Category:Extensions| Package]]
 
[[Category:Extensions| Package]]

Revision as of 18:09, 28 May 2012

What is a package?

A package is a extension that is used to install multiple extensions in one go. This is used if you have for example a component and a module that are depending on each other. Combining them in a package will let the user install and uninstall both extensions in one go. Package extensions can be used with Joomla Compat icon 1 6.png and higher.

How do I create a package?

A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:

  • component helloworld
  • module helloworld
  • library helloworld
  • system plugin helloworld

The package should have the following tree in your zipfile:

 -- pkg_helloworld.xml
 -- packages <dir>
     |-- com_helloworld.zip
     |-- mod_helloworld.zip
     |-- lib_helloworld.zip
     |-- plg_sys_helloworld.zip

The pkg_helloworld.xml could have the following contents:

 <?xml version="1.0" encoding="UTF-8" ?>
 <extension type="package" version="1.6">
 <name>Hello World Package</name>
 <author>Hello World Package Team</author>
 <creationDate>May 2012</creationDate>
 <packagename>helloworld</packagename>
 <version>1.0.0</version>
 <url>http://www.yoururl.com/</url>
 <packager>Hello World Package Team</packager>
 <packagerurl>http://www.yoururl.com/</packagerurl>
 <description>Example package to combine multiple extensions</description>
 <update>http://www.updateurl.com/update</update>
 <files folder="packages">
   <file type="component" id="helloworld" >com_helloworld.zip</file>
   <file type="module" id="helloworld" client="site">mod_helloworld.zip</file>
   <file type="library" id="helloworld">lib_helloworld.zip</file>
   <file type="plugin" id="helloworld" group="system">plg_sys_helloworld.zip</file>
 </files>
 </extension>

When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.

Remember to use the package uninstaller instead of individual subpackage uninstallers to avoid orphan extension entries in the extension manager.