coreBOS (5.5 forward) is prepared to make installing and distributing your modules easy.
There are basically two approaches for this:
The first step is to create the new module in an existing system, so install a coreBOS system on your development machine and let's get started.
You can find full details on how to create a coreBOS module or extension here.
A coreBOS module package consists of a set of files that implement the functionality of the module and a manifest.xml file which details the necessary meta data and database changes that it needs. You can read more about this in other sections of the wiki.
Once your module is working as you like and you want to package it, follow these steps:
You must have these files in place:
The complete composer.json format supported is:
{
"name": "Package",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Package name, including 'vendor-name/' prefix."
},
"description": {
"type": "string",
"description": "Short package description."
},
"keywords": {
"type": "array",
"items": {
"type": "string",
"description": "A tag/keyword that this package relates to."
}
},
"homepage": {
"type": "string",
"description": "Homepage URL for the project.",
"format": "uri"
},
"version": {
"type": "string",
"description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes."
},
"time": {
"type": "string",
"description": "Package release date, in 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DDTHH:MM:SSZ' format."
},
"license": {
"type": ["string", "array"],
"description": "License name. Or an array of license names."
},
"extra": {
"price": [number],
"buyemail": [email],
"buyurl": [uri],
"distribution": ["Sale","Free","Subscription","Donationware"]
},
"authors": {
"type": "array",
"description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [ "name"],
"properties": {
"name": {
"type": "string",
"description": "Full name of the author."
},
"email": {
"type": "string",
"description": "Email address of the author.",
"format": "email"
},
"homepage": {
"type": "string",
"description": "Homepage URL for the author.",
"format": "uri"
},
"role": {
"type": "string",
"description": "Author's role in the project."
}
}
}
},
"support": {
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Email address for support.",
"format": "email"
},
"issues": {
"type": "string",
"description": "URL to the issue tracker.",
"format": "uri"
},
"forum": {
"type": "string",
"description": "URL to the forum.",
"format": "uri"
},
"wiki": {
"type": "string",
"description": "URL to the wiki.",
"format": "uri"
},
"irc": {
"type": "string",
"description": "IRC channel for support, as irc://server/channel.",
"format": "uri"
},
"source": {
"type": "string",
"description": "URL to browse or download the sources.",
"format": "uri"
},
"docs": {
"type": "string",
"description": "URL to the documentation.",
"format": "uri"
}
}
}
}
}
where only the first name and type are mandatory.
There are different ways to achieve this.
If you have linux shell access you can easily obtain the zip package entering the build dirtectory and executing the pack script:
You can add the next script to the root of your coreBOS install and execute it from the command line or the browser to get the package.
These scripts are already prepared in the build directory, you simply have to copy to the root the one you want to use.
File in build/export_package_database.php
<?php
// Turn on debugging level
$Vtiger_Utils_Log = false;
include_once('vtlib/Vtiger/Module.php');
$modulename = vtlib_purify($_REQUEST['modulename']);
$module = Vtiger_Module::getInstance($modulename);
$pkg = new Vtiger_Package();
$pkg->export($module,'',$modulename.'.zip',true);
?>
File in build/export_package_filesystem.php
<?php
// Turn on debugging level
$Vtiger_Utils_Log = false;
include_once('vtlib/Vtiger/Module.php');
$modulename = vtlib_purify($_REQUEST['modulename']);
Vtiger_Package::packageFromFilesystem($modulename,false,true);
?>
File in build/export_language_filesystem.php
<?php
// Turn on debugging level
$Vtiger_Utils_Log = false;
include_once('vtlib/Vtiger/Module.php');
$languagecode = vtlib_purify($_REQUEST['languagecode']);
$languagename = vtlib_purify($_REQUEST['languagename']);
Vtiger_Package::languageFromFilesystem($languagecode,$languagename,true);
?>
*To have your new module installed by default when installing coreBOS, copy the package file to the **packages/mandatory** directory.
*To have your new module appear in the list of optional modules during the install of coreBOS, copy the package file to the **packages/optional** directory.
*To install the module in an already installed application load the package file through the **Module Manager** interface.
A bundle package is a file which contains 2 or more normal packages to be installed together in a certain order.
In order to construct these packages what we usually do is take all the steps above for each individual package and then manually create the manifest file and zip them all together.
In the build directory you can see how we have set this up for the Project bundle. Since we use links we can call the pack.sh script to get the bundle packaged.