Setup Axelor Template

Axelor template is an enterprise module, that can be installed and used from Axelor’s nexus repository.

Nexus Configuration

settings.gradle

In settings.gradle file, inside dependencyResolutionManagement, declare a new repository to let gradle install axelor-template module from the dedicated Nexus repository.

dependencyResolutionManagement {
  repositories {
    // keep the declaration of your other repositories there
    maven {
      name 'maven-enterprise'
      url 'https://repository.axelor.com/nexus/repository/maven-enterprise/'
      credentials {
        username axelorMavenUsername
        password axelorMavenPassword
      }
    }
  }
}

gradle.properties

Create the file ~/.gradle/gradle.properties (if it doesn’t exist yet). Copy the following lines and use your own nexus credentials:

axelorMavenUsername=MyNexusUsername
axelorMavenPassword=MyNexusPassword

Notice: Nexus credentials should be provided by Axelor.

build.gradle

In the file build.gradle of your custom module, add axelor-template dependency:

dependencies {
  // keep your other dependencies there
  implementation 'com.axelor.addons:axelor-template:2.1.0'
}

Application configuration

Using axelor-template requires adding a set of parameters as the template module communicates with two other tools:

  • Axelor Template API (mandatory)

  • Axelor Library (not mandatory)

The configuration of Axelor Library and Axelor Template API can be done in three locations, with the following precedence rules:

  1. AppTemplate

  2. Config file

  3. License

For each configuration property, the system will first read it from AppTemplate, if it is empty it will look for it in config file and finally it will look for it in the license.

It is possible to read different properties from different location.
The easiest configuration is the use of the license.

AppTemplate

A configuration page is provided to set up Axelor Template API and Axelor Library properties. It overrides the properties defined in axelor-config.properties and license metadata.

Config file

When template module configuration is set locally, it requires adding the following parameters to the axelor-config.properties file:

  • template.library.url: URL of template library server

  • template.library.user: Username of the technical user

  • template.library.password: Password of the technical user

  • template.api.auth: Authentication mode (none or jwt)

  • template.api.baseUrl: Base URL of Template API server

  • template.api.user: Username of the API technical user

  • template.api.password: Password of the API technical user

  • template.api.tenantUuid: UUID of the API tenant

If template.api.auth is none, only the tenant UUID matters.

If template.api.auth is jwt, only the base URL, the user and the password matter.

Here’s a sample of the configuration:

# Template library
template.library.url = https://aos-library.axelor.com
template.library.user = templateUser
template.library.password = password

# Template API
template.api.auth = jwt
#template.api.tenantUuid = test
template.api.baseUrl = https://template-api.saas.axelor.com/v2
template.api.user = test-customer
template.api.password = 123

Notice: Library and API credentials should be provided by Axelor.

License

In that case, no configuration is required. Instead, your license integrator will set up all the properties in order to use template module properly.

Installation

To install axelor template:

  • Go to the menu Apps management

  • Search for Axelor template

  • In Template app card, click Install

Apps Management

You should have the following result on cards view:

Axelor Template install

The template module is now available on the sidebar menu with the following menus:

Template menu
  • Template print models: List all the templates available for printing.

  • Template settings: List all the template settings used in printing. It allows the definition of the datasets which will be used in template print models.

  • Print history: List all the prints.

  • Library templates: The library of templates provided by Axelor. In one click you can create a template and its settings from a template made by Axelor. A configuration is required (see Application configuration).

API and Library Configuration

After the template application is installed, you can override properties (if needed).

  • Go to the configuration of Template app

Template configuration Page
  • Click on Configure

  • You should have this result:

Template configuration

Here is the list of the available properties:

Library

  • Library URL: URL of Axelor Library server

  • Library user: Username of the Library technical user

  • Library password: Password of the Library technical user

Template API

  • API authentication type: The type of authentication which will be used for HTTP calls.

  • API base URL: The URL of the Axelor Template API server. you can use https://template-api.saas.axelor.com/v2

  • API user: Username of the API technical user

  • API password: Password of the API technical user

  • API tenant UUID: The UUID of the API tenant

  • Download timeout (in seconds): The time limit for downloading a document. If the time of generation of your document is less than the limit then your document is directly downloaded. Otherwise, a notification informs you as soon as your document is ready and available for download.

  • Download timeout can be overridden only there. The default value is 0.

  • The visibility of fields depend on Authentication type selected

    • if type is none or null and template.api.auth is in (null, none) then the tenant UUID is visible and API username and password are hidden.

    • if type is jwt or null and template.api.auth is in (null, jwt) then the tenant UUID is hidden and API username and password are visible.