Template Engine
Template engine is a processor which generates empty artifacts based on artifact templates. The functionality of the template engine is embedded into Jinni.
For Tribefire purposes the template engine is mostly used to create artifact templates, but you can create any file structure with it - it does not have to be a artifact.
On this page
General
Creating directory and file structures for different platform asset natures manually is an extremely error-prone process. Template engine reduces the risk of an error by using preexisting artifact templates. Using the template engine, you are sure that the artifact you want to use for your custom implementation has consistent naming, contains all the necessary dependencies, and follows structural best practices.
As mentioned above, the functionality of the template engine is exposed via Jinni, which means you must set up Jinni on your machine to be able to generate empty artifacts.
Jinni
Jinni is an application used to set up Tribefire by evaluating platform setup requests. You can pass service requests to Jinni with the command line or using a JSON file. Jinni is necessary to work with platform assets.
Note that Jinni uses Maven to resolve dependencies, so configuring your Maven settings correctly is necessary for Jinni to work.
To set up Jinni:
- Configure Apache Maven as described below.
- Navigate to https://maven.apache.org/download.cgi/, download, and install Maven 3.5.2 or later.
- Make sure that the
PATH
system environment variable is set to the root directory of your Maven installation (one containing thebin
folder). You can check it by opening a command prompt and running themvn --version
command. - Add the following system environment variables (we're using them later in the provided Maven settings file):
Name Value MYPROJECT_LOCAL_REPOSITORY
Path to your local Maven repository MYPROJECT_TRIBEFIRE_REPOSITORY_USER
Your user name on the remote Tribefire repository MYPROJECT_TRIBEFIRE_REPOSITORY_PASSWORD
Your password on the remote Tribefire repository MYPROJECT_TRIBEFIRE_REPOSITORY_NAME
The name of a repository you want to download dependencies from, typically core-stable
. For more information, see the section below.MYPROJECT_DISTRIBUTION_REPOSITORY_USER
Your user name on the remote distribution repository (one where you would save your Tribefire artifacts, for example your company's remote repository). If you don't have access to such repository, ignore this variable. MYPROJECT_DISTRIBUTION_REPOSITORY_PASSWORD
Password to the remote distribution repository MYPROJECT_DISTRIBUTION_REPOSITORY_NAME
Name of the remote distribution repository where you will save your Tribefire artifacts. If you don't have access to such repository, you'll need to modify the settings.xml template to point to a local folder instead (explained below). In any case, you need to add this repository in Control Center/CortexConfiguration
once Tribefire is installed, so that Tribefire knows where to save your artifacts.Note that the
MYPROJECT
part of the variable is a placeholder used to describe the project/company you work for, for example:ACME_LOCAL_REPOSITORY
orPROJECTX_TRIBEFIRE_REPOSITORY_USER
. Variable names do not matter as long as you are consistently using them insettings.xml
.-
Make sure you have the correct configuration in your
.m2/settings.xml
file:If you have no access to a distribution repository, you need to replace it in the
setting.xml
file with a local remote repository. You can use the snippet below:<repository> <id>localRemoteRepository</id> <layout>default</layout> <url>LOCAL_FOLDER_PATH</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> </repository>
You can download the
settings.xml
template here.Make sure to provide the correct values for
localRepository
,localRemoteRepository
,username
, andpassword
.
- Download the Jinni package. For information on where do download Tribefire components from, see below.
Follow the links below to download latest tribefire core components, selected cartridges and related tools.
Jinni
Jinni is a CLI tool provided by Braintribe, enabling you to install Tribefire on a local Tomcat host. You can download the Jinni Package here (authentication required).
The list below provides Maven setup dependencies for each asset. You can directly copy these into the
--setupDependency
part of your Jinni command, as in--setupDependency groupId:artifactId
.Available Assets
Asset Download Link Jinni --setupDependency
Tribefire client dependencies tribefire-client-default-deps Dependencies required to communicate with tribefire-services
through the Java API.tribefire Modeler tribefire-modeler tribefire.cortex.modeler:tribefire-modeler#2.0
Enablement Cartridges
Setupstribefire-demo-cartridge
tribefire-simple-cartridgetribefire.extension.demo:tribefire-demo-setup#2.0
tribefire.extension.simple:simple-cartridge-setup#2.0
Enablement Cartridges
Source codeEnablement Maven Artifacts Download the zip-file with the latest version Product Cartridges tribefire-ldap-cartridge
tribefire-shiro-cartridge
swagger-model-import-cartridgetribefire.extension.ldap:ldap-setup#2.0
tribefire.extension.shiro:shiro-setup#2.0
tribefire.extension.swagger:swagger-model-import-setup#2.0
Aggregators tribefire-standard-aggregator tribefire.cortex.assets:tribefire-standard-aggregator#2.0
Plugins jdbcplugins Check on individual plugins - Unzip the downloaded archive to a location of your choice (e.g.
/development/jinni
). - Add jinni's bin folder (e.g.
/development/jinni/bin
) to thePATH
variable of your operating system.
For information about using Jinni to set up Tribefire, see Quick Installation.
Using Template Engine
Generally, every artifact generation request adheres to the following syntax: jinni request-name --groupId someGroupID --artifactId someArtifactID --version someVersion --installationPath somePath
.
Normally, only --artifactId
is mandatory and other information is defaulted. Different requests may take different parameters, as some requests have mandatory parameters which you must append at the end of the Jinni call.
For more information, see Artifact Template Types and Creating Artifact Templates.