Teneo Developers

Resource Files

Resource File manager

Teneo Studio allows to add Resource Files to a solution; this is done in the backstage of Teneo Studio (Solution > Resources > File) where the user will find the Resource File manager.

Resource Files can, for example, be custom input processors, images, scripts, compiled .jar files, or even an Excel workbook containing additional information which can be retrieved and used in the answers of Output nodes.

Resource Files in a solution are not shared by other solutions; they only exist in the solution where they are added and when the solution is published the Resource Files are included.

Resource File manager

The Resource File manager provides a list of the available file resources in the center view, and selecting a file will provide the user with the following information in the right-side panel:

  • Name of the file
  • Description (if any available)
  • Published Location or the folder the file is stored to
  • Last Modified provides a date and timestamp
  • Last Edited by provides information about the last user who modified the file
  • File > Size gives information about the size of the uploaded file.

Furthermore, various buttons are available in the top of the center view and right-side panel, these are all described in the following sections.

File types

Teneo Studio allows to upload a variety of different file formats, such as Groovy scripts, compiled .jar files, as well as text-based formats such as .txt or .csv, .html, and even images files. Below please find a few examples of file types which can be added as a Resource File.

  • .jar files: .jar files can contain classes available through scripts in a solution, .jar files' Published Location should be set to /script_lib.
  • .groovy files: Groovy classes can be added by storing the class as a .groovy file with the name of the class; the file's Published Location must be /script_lib. When added and saved, the class can be called from anywhere in the solution. It is not needed to compile the class as it compiles when the solution is loaded in memory.
  • .jsp files: Java Server Pages can be used to format the Teneo Engine response and can be used by using the URL parameter viewtype with the name of the JSP without the extension in request to Engine; the JSP can make use of the Teneo Engine scripting API and the Published Location of a JSP is by defaults the /views folder.
  • Images: images files, such as .jpg, .png or .gif are stored in the Published Location /images by default; once the solution is published, the images can be retrieved by appending /images/[image_name].[extension] to the Engine URL.
  • Other file types, such as .csv, .txt, .xls, .zip, .json, .prop, etc., can also be added to a solution and for the mentioned file extensions all share the Published Location /script_lib.

Add Resource File

  • In the backstage of Teneo Studio (Solution > Resources), select File
  • Click Add to browse to the file
  • Select the file and click Open
  • In the right-side panel, optionally write a description of the file
  • Under Published Location write the folder location
  • When done, click Save in the top of the panel to upload the file to the solution.

View or Download Resource File

To either view or download an available Resource File, first

  • Select the file in the file list
  • In the right-side panel, click View or Download
    • View allows to open the file in an editor associated with the file's extension
    • Download allows to browse to a wanted folder and download the file to it.

Edit properties of a Resource File

  • Select the Resource File in the list
  • Click Edit in the right-side panel
  • Now, edit the wanted property: Name, Description or Published Location
  • Lastly, remember to click Save to preserve the changes.

Edit Resource File

  • Select the Resource File in the list
  • Click Edit in the right-side panel
  • Below the property fields of the resource, the File area displays the following options:
    • Edit:
      • Opens the editor associated with the File's extension
      • Now, perform the wanted modifications, save the changes, and close the editor
      • Back in Teneo Studio, click Save to apply the modifications to Teneo.
    • Upload:
      • Opens the file explorer
      • Browse to the new version of the file to upload it
      • Back in Teneo Studio remember to click Save to upload the new version of the file to Teneo.
    • Download:
      • Opens the file explorer
      • Select the folder where to download the Resource File locally and click Save.

Delete Resource File

  • To delete a Resource File from the solution, simply select the file in the list of available Resource Files
  • Click Delete in the top of the right-side panel
  • The Apply button becomes available, click it to perform the actual deletion of the selected Resource File, alternatively click Cancel to abort the deletion.

History

To view the History of a Resource File, follow the below steps:

  • First, select the file in the Resource File list
  • Next, click the History button available in the top of the right-side panel
  • The History window will open
  • In the view of available Revisions, selecting a Revision allows to Set/Unset the stable version of the file.

Set and Unset Stable

  • Select a file in the Resource File list
  • Click Set Stable to set the latest version of the file to stable, to set a previous version to stable, please open the History (see above)
  • Click Unset Stable to unset the currently stable version (this might not be the latest version of the file).

Learn more about Version Flags.

Filter File Resources

A text filter is available in the top of the Resource Files' list; to filter on the available files, simply write any text piece in the filter to have it filter on the list.

Text filter

Teneo Engine - Interfacing with API JSPs
Global Scripts
Custom Input Processor configuration