Install From Web (For Developers)
From Joomla! Documentation
Revision as of 11:00, 9 November 2013 by NickSavov
- 1 1. Fill out the 2 new fields on JED
- 2 None
- 3 Free Direct Download Link
- 4 Free but Registration Required at Link
- 5 Commerical Purchase Required at Link
- 6 2. Setting your site and extensions up for -Free but Registration Required at Link- Extension
- 7 How web installation works
- 8 Web installation with joomlaapps-plugin
- 9 Setting your site and extensions up for a Commercial Extension
- 10 Source code for the feature
1. Fill out the 2 new fields on JED
If you edit your extension listing on JED you will see the following new fields. Select the type of your extension from the list - there are four options:
- Free Direct Download Link:
- Free but Registration Required at Link:
- Commerical Purchase Required at Link:
And, Download/registration/purchase URL field. URL can target:
- A zip URL E.g. http://www.example.com/updates/com_extension_v9.9.zip
- A update XML URL E.g. http://www.example.com/updates/extension_update.xml
Note, the caching on the server for the Install from Web feature is set for 2-6 hours and so you probably won't see your changes right away in the Joomla backend.
If your extension is a free direct download link then all your work is done and you can ignore the next steps :)
This the most common case today. Only JED mandatory fields are filled, and 'Install From Web' fields are empty. The entry is shown, 'Download' button is shown and there's no 'Install' button.
If your extension is just a free direct download link - then put in a link to the update XML you have or direct URL to the zip file.
Free Direct Download Link
If the URL field is filled with a zip or an update XML URL; 'Install' button appears, and the user can just click to install.
Free but Registration Required at Link
If your extension requires registration then you need to put a link to your site Registration Page; 'Install' button appears, and the user can just click to be redirected to your site.
Commerical Purchase Required at Link
If your extension requires a payment then you need to put a link to your site Purchase Page; 'Install' button appears, and the user can just click to be redirected to your site.
2. Setting your site and extensions up for -Free but Registration Required at Link- Extension
If you require a consumer to register then you have to set up your site to deal with the user registration.
If not, the user fills the registration, and the last step of the web installation is NOT completed.
How web installation works
When user clicks on the 'Install' button, Joomla submits these parameters:
- installat E.g. http://yourdomain.com/administrator/index.php?option=com_installer&view=install
- installapp E.g. 99999
installat is the return URL, and installapp is JED's extension ID.
To fill the web installation step, you backend has to receive these parameters, process the registration, and return to the installat URL.
While the registration is filled and processed, Joomla is expecting to receive the zip URL or an update XML URL. When it's received, Joomla finally completes the installation.
Web installation with joomlaapps-plugin
The joomlaapps-plugin is the reference implementation. A good starting point that was developed specifically for this purpose found here.
The plugin has two parameters:
- Files to download
- Entry URL
In the Files to Download parameter, the first parameter you have to set up is to point the plugin to your extensions update XML files or zip files (one per line).
About Entry URL: this plugin is specifically designed for the Joomla User Component (Defaul value index.php?option=com_users&view=login) however it will also integrate nicely with any registration page. E.g. in Community Builder case simply by changing the entry point URL in the plugins parameters - generally it is recommended (but my no means compulsory) to point this to your login page. Note an empty value of this parameter will default to pointing to the Joomla User Component Login page.
How to build joomlaapps-plugin
- Download the files from github
- Copy language files into the system plugin directory
- Zip all files, and install it in the Extension Manager
Setting your site and extensions up for a Commercial Extension
This will need more work than the previous step. It is advised that you download the same plugin - however you will have to integrate into the plugin an extra check to see if the user has purchased your extension. As different extensions implement this in many different ways it is left to extension developers to implement this functionality.
The plugin can be used to get installat and installapp parameters, but it must NOT return the zip URL or update XML URL onUserLogin. When the purchase is completed, the operation can return to fill the web installation.
Source code for the feature
You can contribute bug fixes and new features to the following repositories:
https://github.com/joomla/extensions/tree/installfromweb https://github.com/joomla-projects/joomla-cms/tree/feature-appstore-server https://github.com/joomla/joomla-cms https://github.com/joomla-projects/joomla-cms/tree/feature-appstore-client