Teneo Developers

File Resources

Introduction

The File manager allows to add files to the solution, these files can be programmatically accessed and used by the solution.

It is possible to upload a variety of file formats; only files added to /script_lib can be programmatically accessed by the solution while files stored in the root path / are accessible publicly for anyone who knows the engine URL, so be careful when placing files here, especially if they contain sensitive data! Learn more about the file types and publish locations further below.

Files in a solution are not shared by other solutions; they only exist in the solution they were added to. When the solution is published, the published solution includes all the uploaded files.

View of File Resources

The File Resource manager is available in the backstage of Teneo Studio: Solution tab > Resources > File

View of File Resources

In this view the user will find:

  • Left side:

    • Text filter and Add button
    • List of existing File Resources
  • Right side:

    • Ribbon options allowing to Edit, Delete, view History, set/unset Stable version
    • Details of the selected File Resource providing a read-only summary

The File Resources are available on the Solution dashboard in the File Resources tile; clicking the tile header or the right-pointing arrow takes the user to the list of File Resources. Clicking the name of an existing File Resource opens the Edit File Resource box.

In the list view the user will find:

  • The list of existing File Resources (if any)
  • Option to order the list per column header
  • Create button allowing to add a new File Resource
  • Text filter available in the top ribbon.

Basics

Open - view or download

To either view or download an already existing file resource, first:

  • Select the file in the 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.

To either view or download an already existing file resource, first:

  • Either in the File Resources tile on the Solution dashboard, or in the File Resources list (Solution dashboard > File Resources tile > right-pointing arrow), click the file to review

  • In the Edit File Resource view below the description now either

    • click the magnifying glass icon to view the file Note that not all file extensions are supported
    • click the download icon to download and view the file locally.

Create

In the backstage of Teneo Studio (Solution tab > Resources > File) follow the below steps to add a resource 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 Publish Location write the folder location; see File type and Publish locations for details
  • When done, click Save in the top of the panel to upload the file to the solution.

To create a new file resource, follow the below steps:

  • First, either:
    • Click the Create button directly in the File Resources tile (upper, right corner) on the Solution dashboard, or
    • In the File Resources list, click on Create New File Resource

Create New File Resource

  • The Create New File Resource opens, now either drag and drop a file to the window or click to browse to and select the file
  • Next, optionally add a Description
  • Under Published location write the folder location; note that some often used file extensions automatically get the folder location selected. Also refer to File type and Publish locations further below
  • Now, click Create to add the File Resource to the solution
  • Teneo Studio will prompt the user to confirm the creation, optionally add a Comment and lastly click Save to upload the file resource to the solution.

Edit properties

To edit the properties of an existing resource file, follow the below steps:

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

The below table provide an overview of further options available in the ribbon when working with file resources, also refer to the below section for details on how to edit a file resource.

ButtonCommentMore information
EditAllows to open the file in edit modeEdit file resource
DeleteProvides the option to delete a file
HistoryOpens the History of the selected file; previous versions and revisions of the file are listed, comments added at save are also displayed here. Select any of the revisions to view its content. Set a previous version as stable by selecting it in the list and clicking Set Stable, restore a previous version by selecting it and clicking Restore.Version History
Set/Unset StableSet the current version of the selected file as stable or unset itVersion Flag

To edit the properties of a file resource, follow the below steps:

  • Either in the File Resources tile on the Solution dashboard, or in the File Resources list (Solution dashboard > File Resources tile > right-pointing arrow), click the file to review
  • In the Edit File Resource update the properties
  • Click Change file to upload a new version of the file
  • Remember to Save to preserve the changes.

Edit file resource

To edit the content of a file resource, follow the below steps:

  • In the backstage of Teneo Studio (Solution tab > Resources > File), select the file resource 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
      • Perform the wanted modifications, save the changes and close the editor
      • Back in Teneo Studio, click Save to apply the modification 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 file resource locally and click Save.

To edit an already existing file resource, first:

  • Either in the File Resources tile on the Solution dashboard, or in the File Resources list (Solution dashboard > File Resources tile > right-pointing arrow), click the file to review

  • In the Edit File Resource view below the description field, the user can now perform the following actions:

    • Click Change file to upload a new version of the resource file
    • Click the magnifier glass icon to view the file
    • Click the download icon to download the file and modify it locally before uploading the new version by clicking Change file
  • Remember to Save to preserve any changes performed.

Save

To save a Resource File in edit mode with a comment, follow the below steps:

  • Click Save in the top ribbon
  • In the dialogue box (optionally) write a comment
  • Click Continue

To save directly and bypass the comment, press the Alt key while clicking the Save button.

To save a File Resource in edit mode, follow the below steps:

  • Click Save at the bottom of the Edit File Resource view
  • Optionally add a comment for the Version History
  • Click Save again to confirm.

The Save button only becomes clickable in the Edit File Resource view when changes are performed to an already existing File Resource or if the File Resource has not been saved earlier

Successful save is confirmed with a "Document saved successfully!" message; by clicking elsewhere in the browser window the message is closed.

Close

To close a Resource File in edit mode, the user needs to either click Cancel and discard any possible changes or click Save to preserve any performed changes.

To close the Edit File Resource view, simply click the X in the top right corner of the view.

If changes have been performed, click Save to preserve these before closing the view.

Delete

To delete a file resource from the solution, follow the below steps:

  • Select the file in the list in the backstage of Teneo Studio (Solution tab > Resources > File)
  • Click Delete in the right-side ribbon
  • The Apply button becomes available, click it to perform the actual deletion; alternatively click Cancel to abort the deletion.

If a file is deleted by mistake, it can be restored from the Recycle Bin.

To delete a file resource from the solution, follow the below steps:

  • Go to the File Resources list (Solution dashboard > File Resources > right-pointing arrow)
  • In the list, hover over the file to delete
  • In the right end side of the file, click the recycle bin
  • Teneo Studio will prompt the user to confirm the deletion, click Delete to confirm the deletion.

Note that deletion of a file currently cannot be undone in Teneo Studio Web, for this action please refer to the Recycle Bin available in Teneo Studio Desktop.

Filter

A text filter is available at the top of the list of Files; to filter on the available file resources, simply write the wanted letter combination to start filtering on the list.

A text filter is available in the top ribbon of Teneo Studio Web which allows to filter on the displayed list of documents; simply write the wanted letter combination to start filtering on the list.

The filter works on the following columns: Name, Description, Author.

Clicking the column headers allows to sort the list of documents alphabetically when clicking the Name, Description or Author header; when clicking Updated it is possible to sort by the date/time the documents were updated or created while Size and Publish Location allows to order the files by these properties.

Details

File types and publish locations

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.

Custom Input Processor configuration

The splitting of user input text into sentences and words, spelling correction and other language-depending processing are within the Teneo Platform done in separate modules: the Input Processors and the Simplifier. These are pluggable into the Teneo Engine via the Input Processors API.

The Input Processors and the Simplifier are configurable within the Platform allowing users to customize the Input Processors (IPs) of the Teneo Engine and the configuration for any solution by providing custom Input Processor configurations as a resource file in Teneo Studio with a fixed name and content structure.

The process of how to create a custom Input Processor configuration is described further here.