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 belongs to the "Programming" element category.

The "VTL Include" element can be found in the "Applications" module in the "Elements" area. A new element can be created by positioning it on the workspace from here using drag & drop.

Further 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

Refer to 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, in which an existing Velocity file from the application package can be referenced or a new one created .

Edit velocity file

Opens the velocity editor.

Refer to a 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 package

Opens the Velocity file manager, in which 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 are only executed if they are stored under certain subdirectories of the portal 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. Therefore, rights checks may need to be carried out in the code of VM files in order to prevent unauthorized access to sensitive information.

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. It is also possible 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, numbers, 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 may not be called directly from the web should have the file extension .vmi. 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 for editing the currently selected script file.

All elements can be moved to the desired position in the Velocity file manager using drag & drop. Subdirectories can be created for existing directories if a directory is selected.

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 safety instructions.