Configure "Create New" Dialog
Use the Configure Create New dialog to maintain user-defined items in the Studio's Create New dialog for the current workspace.
The dialog is divided into two panels: the left panel contains a tree view, and the right panel displays information relating to the currently selected item in the tree.
Click the Add button to add a new template or wizard to the currently selected category. To delete a template, click the Delete button (note that the physical template is not deleted, just its registration within the Studio).
Templates
The list of entries that appears in the Create New dialog is defined by template definition files named templates.xml. The Studio reads the system definition file and combines it with any workspace and library definitions that are available for the current environment. This determines which entries appear in each category of the Create New dialog.
Use the Configure Create New dialog to maintain these registrations. Although templates.xml is an XML file, it should not be edited manually. The dialog updates the registration information for you and helps prevent broken entries caused by invalid XML, incorrect filenames or mismatched settings.
New components are created by selecting an option that starts a wizard or by selecting an option that creates a file based on a template file. Template files are stored in a “config” directory and, by convention, have a “.tpl” file extension. The config directories are defined in the workspace (the workspace’s AppSrc\config directory), in each library (each library’s AppSrc\config directory), and in the system library (…\pkg\config).
If you wish to add a new component to your Create New dialog, you will probably want to create a new template file for that component. To do this, simply create or copy the appropriate template file into your workspace’s AppSrc\config directory and save it using the suggested “.tpl” file extension. If you wish to change a template, find the file, load it, and change it.
Configuring Create New involves two related tasks:
- Registering the item in
templates.xml, so it appears in the correct category with the correct name, icon, component type and description. - Maintaining the file that is executed or copied when the user selects that item. This is usually a wizard executable or a template file.
The registration controls how the item is presented in the Create New dialog. The template or wizard controls what is actually created.
You should never change or add templates that reside outside of your workspace. This includes templates that reside in a library or system area. This is discussed below.
System & Library Templates
Only wizards and templates that have been added to the list for the current workspace can be edited or removed. System and Library wizards and templates are read-only.
- System wizards and templates are the wizards and templates installed with DataFlex.
- Library wizards and templates are the wizards and templates that belong to one or more libraries that are used by the current workspace.
If you wish to make changes to a library, you can do so by making that library the current workspace and invoking this dialog from that library’s workspace. Changes can be made to a library’s template file by loading the appropriate template file (located in the library’s AppSrc/config directory) and editing it. Changes made in the library’s configuration list or template content will be applied to all workspaces that use that library.
You should not change the contents of the system template files. If you need to change these templates, you can copy these files from the system config directory (…\pkg\config) into a workspace or library config directory where they can be edited.
When templates are selected, the Studio looks for the template file first in the following order:
- The workspace config directory
- Any library config directories
- The system config directory
For more information, see: Add/Remove Libraries.
File Category Treeview
The tree on the left of the dialog shows all the wizards and templates that have been registered, categorized by file category.
Project
Project wizards & templates.
View/Report
View and report wizards and templates.
Dialog/Lookup
Dialog and Lookup list (or selection list) wizards and templates.
Web Object
Web Service Object (WSO) or web object (Web View or Web Modal Dialog) wizards and templates.
Class
Class declaration wizards & templates.
Other
Templates and wizards for creating other types of files.
For more information, see: Component Files.
Data Entry
To edit an entry, first select it in the file category tree view. Note: System templates and wizards are read-only. Library templates or wizards can only be edited from the imported library's workspace.
Component Type
Select what type of component you are adding to the selected file category. Each file category will allow a different subset of component types. Select the one that best fits the template or wizard that you are adding or editing.
The Component Type is used by the Studio to classify the entry, determine where it appears, and decide for which kinds of projects it is valid. This means the component type affects both how the item is displayed in the Create New dialog and when it is available to users.
The valid component types depend on the selected file category: * Project: Windows Project, Basic Web Project, Web Framework Project * View/Report: Windows View, Windows Report * Dialog/Lookup: Windows Dialog, Windows Lookup * Web Object: Web Object * Class: Class * Other: Business Process, VDF File, Other File, SQL Executor
Templates are also filtered by project type. The supported project types are Windows, Web and Mixed.
The component types have the following meanings: * Windows Project - creates a Windows application project. * Basic Web Project - creates a basic web application project. * Web Framework Project - creates a web application project that uses the Web Framework project structure. * Windows View - creates a Windows data-entry view component. * Windows Report - creates a Windows report component. * Windows Dialog - creates a modal dialog component for Windows projects. * Windows Lookup - creates a lookup or selection list component for Windows projects. * Web Object - creates a web view, web modal dialog, web service object or similar web-facing component. * Class - creates a class declaration or helper class file. * Business Process - creates a batch-style business process component. * VDF File - creates a general DataFlex source file. * Other File - creates another kind of support or text file that does not map to a specialized Studio component type. * SQL Executor - creates an SQL-oriented support file for use with SQL Executor tooling.
In some cases, the component type will determine whether or not the template or wizard can be used to create a new file. This filtering is determined by the workspace's current project. For example, if the current project is a Windows Project, then you will be able to create a Windows View but not a Web Object (Web Objects can only be created for a Web Application Project).
Choose the component type that matches what the template or wizard actually creates, not just where you want it to appear. Choosing the wrong component type can cause the item to be filtered incorrectly or listed for the wrong project type.
For more information, see: Create New.
Name
Enter the name of the template or wizard that is displayed in the Create New dialog for this entry.
File Name
Enter the file name of the template or wizard. Wizard files must be executable applications. For example, "WinViewWizard.exe".
Most entries use either a wizard executable or a template file. Some system-defined entries use reserved internal names that the Studio interprets as built-in operations rather than physical files.
Note: The Studio only supports file and folder name characters using the standard ASCII character set (ASCII characters 32-127).
Large Image
Enter the filename of a bitmap file that is displayed in the Create New dialog for this entry. The set of system-defined bitmaps for each file category is listed in the combo to make these images easily accessible. The selected icon is displayed to the right of the filename. Template images must reside in the workspace's Bitmaps folder.
Long Description
Enter a description for the template or wizard. This description will be displayed in a box in the Create New dialog whenever the item is selected by the user.
Operations
Add
Click Add to add an entry to the currently selected file category.
Delete
Click Delete to remove the currently selected entry in the file category tree view. Note: System templates and wizards are read-only. Library templates or wizards can only be removed from the imported library's workspace.
OK
Click OK to save changes and close the dialog.
Cancel
Click Cancel to close the dialog and discard all changes.