Templates are a capability for creating a new workspace. Essentially, instead of creating an empty workspace, workspaces can be derived from pre-defined template definitions. Any Finsemble user or administrator can create new templates. But default, only the “Blank Template” is defined.
To create a template definition:
There are two ways to use a saved workspace template.
Note: Although an exported template definition is exported as JSON, it should be treated as an internal Finsemble definition. This means templates can be exported (i.e., saved) from Finsemble and imported back into Finsemble, but should not be used or accessed for other purposes. The underlying motivation is that template definitions are big and complex, based on their internal representation.
The "User Preferences Menu" can be used to import. This "New Workspace" dialog utilizes the Input and Selection Dialog presentation component for creating a workspace.
"importConfig": [ "$applicationRoot/configs/application/services.json", "$applicationRoot/components/sampleComponents.json", "$applicationRoot/configs/application/systemComponents.json", "$applicationRoot/configs/other/workspaceConfig-Workspace 2-template.json" ]
It is important to understand saved templates include URLs from the workspace it is cloned from. This is correct as long as the template will be used on the same server (i.e., the server referenced by the URLs). However, if the template is created in a development environment or on a different server environment, then the URLs in the the template file must be manually replaced with the correct URL values. This can be done using a text editor’s global replacement function). The new URL values can be either a standard URL string or it can included a configuration-macro value—examples are shown below.
If the template was created when running Finsemble on server1, the URLs contained within might look like the following.
To use the template running Finsemble on server2, a global replacement in the file would leave the URL like the following:
Or if the template is run in different environments, the new URL might look like the following:
Note: When replacing URL with macros that overlap, to maintain macro consistency, first do a replacement with the most specific macro value. For example consider the following two common macros.
Because their paths overlap, first replace
“$moduleRoot”, then replace
Read the Workspace Client API documentation for more information about workspaces under the hood.
Read the Workspace tutorial for an overview of this topic.