VTL Include
VTL stands for Velocity Template Language. Velocity is an open-source software from the Jakarta Apache Project. It allows the direct addressing of Java objects based on an easily learned script language. The place where the VTL Include element is positioned on the workspace is where your VTL file will be executed later. The entire process is comparable to the inclusion of an ASP file with Visual Basic script.
To use this element, you need to have experience with scripting languages and ideally also in Java development. INTREXX GmbH Does not provide support for the use of VTL in Intrexx.
The "VTL Include" application element is part of the "Programming" element category.
The "VTL Include" element can be found in the "Elements" section of the "Applications" module. A new element can be created by dragging and dropping it from here and positioning it in the workspace.
More information on creating elements can be found here.
The Element Properties dialog opens automatically when a new element is created. The Properties dialog of an existing element can be opened by double-clicking on the element on the workspace, via the "Properties" context menu or via the "Edit / Properties" main menu if the "VTL Include" element is selected on the workspace.
Settings
Reference a Velocity file in the application
The path and name of the referenced Velocity file are shown. All Velocity files from the application package are stored in the portal directory internal/application/store/<AppGuid>/resources.
Select Velocity file
Opens the Velocity file manager. An existing Velocity file from the application package can be referenced or a new file can be created.
Edit Velocity file
Opens the Velocity Editor.
Reference an existing Velocity file on the server
An existing Velocity file available on the server can be referenced here.
Copy Velocity file from the server to the application
Opens the Velocity file manager where a Velocity file can be selected.
Security notice
Please note:
Files with the extensions .vm and .vmi that contain Velocity scripting code are Velocity files. Velocity files can only be executed if they are stored within certain subdirectories of the portal's directory. These subdirectories are:
-
internal/system/vm/
-
internal/layout/vm/
-
internal/application/vm/
-
internal/application/resource/
-
internal/workflow/<GUID>/velocity/
Velocity files that end in .vm can be called up directly from the web using URL parameters. If necessary, permission verification must therefore be performed in the code of the VM files, so that unauthorized access to sensitive information is prevented.
Examples:
Check for read permissions on a data group:
$AccessController.hasDatagroupPermissionFromPage($ProcessingContext, $appGuid, $dataGroupGuid, "read")
Check for access permissions for a page:
$AccessController.hasPagePermission($appGuid, $pageGuid, "access")
The file extension .vmi stands for Velocity files. As opposed to Velocity files with the extension .vm, VMI files cannot be called up directly from the web. For this reason, security checks, which have already been performed in the calling Velocity files, do not have to be performed again in VMI files.
Velocity file manager
Add
Displays a menu with which directories or Velocity script files can be created. There is also the possibility to import externally created velocity script files.
Directory
Clicking on the "Directory" menu item opens a dialog in which a directory can be created.
Enter the directory name here.
File name
Clicking on the "File" menu item opens a dialog in which a file can be created.
Enter the file name here.
Please follow these rules for valid names:
Allowed characters: Letters, digits, underscore (_). The name may not begin with a number. When adding files, please note: Velocity includes that are only used on the server side and must not be called directly from the web should be given the .vmi file extension. Otherwise, they should be given the extension .vm.
Import file
Opens a dialog in which the file can be selected.
Click "OK" to save changes and close the dialog again.
Edit
Opens the script editor where the currently selected script file can be edited.
All elements can be moved to the desired position in the Velocity file manager by drag and drop. If you select an existing directory, you can then create subdirectories.
Delete
Deletes the currently selected element.
Description
At the bottom of the dialog, the text, which is defined as a comment at the beginning of the Velocity file, is automatically shown.
Security notice
Please observe our security notice.