How to create a business template


Business templates are a handy way of transferring results of your work between erp5 instances, and also of distributing them publicly. You can use them also for version control - since the bt5 format is (almost) human-readable, you can store daily builds of your bt5 in an svn and track differences.

Composition of a business template

A business template is made of ZODB objects of all possible types. The logic is that it should form a complete functional unit - either a complete application, or a set of objects that together serve a particular purpose. For example, an erp5_crm business template contains forms, templates, portal_types, modules, base categories and workflows which put together allow you to register phone calls and emails and follow sale opportunities and support requests. Another template may contain only a general accounting plan (GAP) for a country, or a message catalog for user interface translation.

Most of what you do in erp5 is creating forms, scripts and templates - it is advisable to create a separate skin folder for what you do, to keep things in order and to ease creation of a business template.

Putting a template together

Go to <your_erp5_site>/portal_templates, create a new template. Give it an id that reflects the scope of what the template is supposed to bring. Optionally, you can add version information, change log etc.

Now, type in ids of objects you want to export - skin folders, modules, workflows, base categories. If you need to add specific objects (contained in a module), add them to the 'paths' box.

If you added some portal_types or altered exising ones, go to the second tab and type them into the top box. Then, from the 'Action' box, select 'Get portal type properties' - all the remaining boxes will be filled automatically.

Each component will be detailed below.

Build and export

To build a template, select 'Build business template' from the 'Action' box. Once done, click the 'Import/Export' button. You will be given two options - if you choose 'save', the template will be saved locally on your server as a directory; if you chose 'export', it will be shipped straight to you as a .bt5 file, which is the same but tar-gzipped. The directory/file name will be composed of the template's id and its version numer.

Content of a Business Template



Most of fields in the General tab are obvious, but the following may require an extra explanation:

* Title

* Revision Number

* Dependencies

* Provision

* Modules

* Categories

* Skin Folders

* Registered Skin Selection

If not defined explicitly, the skin folder is added to all skin selections. If it uses a skin selection that does not exist when installing the business template, this skin selection will be added to portal_skins. The new skin selection will be initialized with all skin folders, except skin folders taht are explicitly listed as Registered Skin Selection in other business templates.

* Workflows

* Path

Portal Types

Portal types and their configuration are defined separately. In the Portal Types view of the business template UI, you have the following fields:

* Portal Types

* Workflow Chains

* Allowed Content Types

* Hidden Content Types

* Property Sheets

* Base Categories

* Actions

Catalog Methods

* Catalog Methods

* Catalog Result Tables



* Zope Roles

* Site Properties

* Document Classes

* Property Sheets

* Extensions

* Update Tools

* Update Business Template Workflow

* Zope Products

* Unit Test Classes

* Message Translations

wo | erp5_content
wo | erp5_ui

* Constraints Classes

* Portal Type Roles

* Local Roles

HowToCreateBusinessTemplates (last edited 2010-05-25 08:46:29 by ŁukaszNowak)