Page tree
Skip to end of metadata
Go to start of metadata

Teamstudio Export can generate a static HTML site from an archive. By default, the HTML site displays all of the non-hidden views in the original application, and all of the fields found on the exported documents.  Some Notes applications contain a significant number of views and fields that are used by application logic.  Often, these views and fields do not provide useful information to the end user and impede the end user's ability to locate relevant information.

Teamstudio Export supports configuration settings within the exported HTML site that can be used to:

  • control which views are displayed
  • control which fields are displayed, including the order of display, and optionally provide field labels

 

The config.js file

Configuration settings for an HTML site are located inside the site's HTML folder (the .tse folder), at config/config.js. Documentation for configuring view and field display, along with examples can be found in the default config.js file generated when a site is created

The configuration file

The configuration file (config.js) is essentially a JavaScript / JSON configuration file, similar to properties files used by many modern web technologies.  To allow an HTML site to be self-contained and browsed locally without the use of a web server, the JavaScript object that represents the configuration properties is registered with the application by passing it to a function ('tmsData') that is called when config.js is loaded by the browser.  The default config.js file contains comments documenting this function, along with example settings that can be uncommented and modified as appropriate.

A basic understanding of JavaScript syntax and JSON is helpful when editing this file.

Note that the web application must be reloaded in the browser for changes to the config.js file to take effect.

Filtering views

The configuration allows control of which views are displayed by:

  • explicitly listing the views to display
  • providing a JavaScript function that accepts an array of available view names and returns an array of views to show
  • disabling the default hiding of views that start with '('  

Note: Views that start with '(' are filtered by default in Export 2.0 and later.


A simple config.js filtering views
window.tmsData('config.js', { 
   views: { filter: [ 'all', 'by date', 'by author'] }
});


See the default config.js file for detailed examples of view filters.

Filtering fields

The configuration allows control of which fields are displayed for a particular form by:

  • explicitly listing the fields to display, in display order
  • explicitly listing fields to display along with the labels to display for the fields
  • providing a JavaScript function that accepts an array of field names and returns an array of fields to show in one of the above formats

 

A simple config.js filtering fields
window.tmsData('config.js', { 
   	forms: 	
		{
		'Main Topic':
  			{
    			'fields': [
      				{name: 'Created', label: 'Date of publication'},
      				{name: 'Subject', label: 'Topic'}
    			]
  			}
		}
});

 

See the default config.js file for detailed examples of field filters.

Temporarily disabling filtering in the UI

To aid in developing view and field filters, the filters on both the main list of views and on a document can be toggled off and on by Shift-Double-Clicking the main Export header bar.  This feature can be helpful to see the full list of fields available when modifying filters, without needing to save the config.js and reload the application.

 

 

 

 

 

  • No labels