Resources
This section lists various file types (images, templates, schemas) which can be used in IntegrationManager. For example, email template, logo in a template, JSON schema of the payload. These resources are sent directly to a GIT repository, they are not saved in PlatformManager.
Previously, the content of a resource stored in the "Resources" tab was compressed into base64 format and encapsulated into JSON along with metadata. These JSON files were then stored in Git. However, moving forward, we are updating this process. Instead of compressing and encapsulating the content into JSON, the files will now be stored directly in Git without any alteration. This change is effective from IM version 5.3.0. You can now upload files in raw format directly into a Git repository or upload them via the PlatformManager UI. We also recommend migrating resources in the old format because we plan to remove support for it in the near future.
Available actions are:
Upload a new resource.
Download a resource.
Request deletion of a resource.
Supported file formats are: JPEG, JPG, PNG, FM, JSON , XML, FTL. (Administrators can allow more formats – in IntegrationManager using the property integration.resources.extensions.allowed
.)
To use this section, you need the Integration - Edit permission.
Usage
Since version 4.10.0 all resources are automatically synced between Git repository and provisioned IM instances file system. All resources are stored under /home/im/repository/resources. This change simplifies usage of resources.
We recommend to encrypt your resources using the switch button. The resource will be saved in an encrypted format with the ENC extension.
The Encrypted switch button is not available in versions older than 5.8.0.
Example
The following code illustrates how to utilize an IM route with a freeMarker template defined as a resource on a provisioned IM instance. In this scenario, the code demonstrates fetching and rendering the freeMarker template to generate dynamic content within the IM route.
Route
<routes>
<route id="test-route">
<from uri="direct:generateBody"/>
<setBody>
<simple>IM instance</simple>
</setBody>
<to uri="freemarker:file:/home/im/repository/resources/example.fm?contentCache=false"/>
<log message="${body}"/>
</route>
</routes>
Resource example.fm
Hello from ${body}
Output
The route and the template definition will print out this message into the log file:
Hello from IM instance
PlatformManager version 1.75.0