End Users require rich user interfaces. However, the forms painted with EAE and AB Suite are ‘presentation media neutral’ leaving it to the generate process to create the ‘media specific’ user interface application.
'Standard' Generator
- The 'Standard' ASP.NET Generator creates a basic ASP.NET application.
- The only way to enhance this is to either modify the generated ASP.NET application or write a custom generator.
- Neither of these options are appealing as it is an inflexible solution and the cost of maintenance is high.
CTC Generator
- All enhancements to the painted forms are specified as input to the generate process using the CTC Configurator, allowing the developers to take full advantage of the capabilities of ASP.NET.
- The CTC ASP.NET WebForms Generator then creates a rich ASP.NET application with added features and improved usability over the basic default GUI.
- Enhancements to the look and feel can be made by modifying any or all of the properties on the ASP.NET controls, as well as advanced enhancements such as replacing controls on the painted form with rich ASP.NET user controls.
- This approach provides a flexible solution that is easy to maintain and provides consistency across generates.
Those with a good working knowledge of ASP.NET will achieve the maximum benefit from the CTC ASP.NET WebForms Generator, by configuring the controls to take advantage of all the capabilities provided by ASP.NET.
CTC Generators are add-in generators to the Component Enabler Generate Environment and therefore the initial setup follows the standard instructions for any CE Compliant generator.
The first step before using a Generator is to setup a bundle in EAE or a folder in AB Suite that specifies the group of ispecs to be generated.
EAE Setup
- Within Enterprise Application Developer navigate to the Business Segment Options dialog.
- In the Component Enabler tab, check the field Component Enabler Capable and enter the details for Application Name, Package Prefix and CE Output Directory.
- Close the Business Segment Options dialog.
- Add a bundle to the Business Segment.
- Within the Component Enabler Bundle Options dialog, check the field View Generation Required and select the User Defined Generator option.
- In the Java Class field enter the name of the CTC Generator as shown here: CTCASPNETWebFormsGenerate.dll
- Close the Component Enabler Bundle Options dialog.
- Right click on the bundle, select Generate Bundle and select the ispecs required to be generated as part of the user interface.
For further details see the CTC ASP.NET WebForms Generator Help document or the Component Enabler User Guide.
AB Suite Setup
- Within AB Suite Developer open the Business Segment Class properties window.
- In the Component Enabler User Interface category, enter the details for Application Name, Package Prefix and CE Output Directory.
- Close the Business Segment Class properties window.
- Add a folder to the Business Segment Class.
- Open the folder properties window.
- Enable the property Deploy Component Enabler User Interface.
- In the property User defined View Generator enter the name of the CTC Generator as shown here: CTCASPNETWebFormsGenerate.dll
- Select C# for the property Ispec Model Source Language.
- Close the folder properties dialog.
- Add the ispecs required to be generated as part of the user interface to the folder.
- Right click on the folder, select the Rebuild option to generate the folder.
For further details see the CTC ASP.NET WebForms Generator Help document or the Unisys AB Suite User Guide.
Note 1: Infrastructure files required for the generated user interface application are automatically copied to the views directory by the generator. Therefore there are no manual steps required for this.
Note 2: The generated user interface application is automatically compiled by the generator.
Infrastructure files which are required for the generated application may be updated by CTC when creating a new updated version of the generator.
After downloading and installing an upgrade of the generator, it is therefore necessary to reinstall the infrastructure files for each user interface application that has been generated.
Follow the steps below to reinstall the infrastructure files.
- Start the CTC Configurator.
- Right click on the option node within a bundle and select 'Add Re-Install Bundle'. If this option is already added, just select the option.
- In the property pane, set the 'ReInstallBundle' property to true.
- Repeat steps 2-3 for all bundles for the generator in question.
- Click the Save icon to save this configuration.
When performing the generate of each of the bundles, the infrastructure files will automatically be copied to the views directory of the bundle and the ReInstallBundle option will be reset.
Note: In case you have changed/customized any of the infrastructure files, ensure you backup these files before you install the upgrade to the generator. After installing the upgrade you may have to compare the customized files with CTC files and reapply the changes.
AutoComplete is a property of the CTC ComboBox and therefore to set this property you must configure the Control Specifications of the ComboBox. Follow the steps below to configure AutoComplete on ComboBox:
- Start the CTC Configurator.
- Right click on the bundle node (or application node, or generator node) for which you want to configure the ComboBox control and select 'Control Specifications/Add Control Specification'.
- In the property pane, click on the 'ControlName' property to get the dropdown arrow and click to open the dropdown list.
- From the dropdown list, select ComboBoxControl.
- Click on the ControlProperties property to get the
button and click to open the Properties Editor window.
- In the Properties Editor window, scroll down to the AutoComplete property and change False to True.
- Click OK to close the Properties Editor window.
- Click the Save icon to save this configuration.
The CTC ASP.NET WebForms Generator includes examples of three custom controls - DatePicker, DataList and GridView. These controls are automatically added to the configuration when installing the generator. Follow the steps below to add any other custom control.
- Start the CTC Configurator
- Right click on the ‘generator’ node or the 'customControls' node if it exists and select ‘Add Custom Control’.
- In the properties pane, click on the Type property to get the dropdown arrow and click to open the dropdown list.
- From the dropdown list, select the custom control to be added.
- Click the Save icon to save this configuration.
The steps below show how to configure the generator to generate the DatePicker instead of the normal textbox for all date fields.
- Start the CTC Configurator.
- Right click on the ‘generator’ node and select ‘Control Substitutions’/’Add Control Substitution’ or right click the 'customSubstitutions' node if it already exists and select ‘Add Control Substitution’.
- In the properties pane, click on the ‘ControlName’ property to get the dropdown arrow and click to open the dropdown list.
- From the dropdown list, select TextBoxControl.
- Click on the ‘SubstituteWith’ property to get the dropdown arrow and click to open the dropdown list.
- From the dropdown list, select DatePicker.
- Click on the ‘MatchOnField’ property to get the
button and click to open the Expression Editor.
- In the Expression Editor window, drag and drop 'IsTypeDate' to the MatchOnField Expression box.
- Click OK to close the Expression Editor window.
- Click the Save icon to save this configuration.
When performing a ‘Build’ of the CE folders using AB Suite, the generate process, under certain circumstances, skips vital steps during the build process causing an incomplete generate of the CE User Interface application.
Methods such as PreGenerate(), CreateIspecList(0 and PostGenerate() on the Component Enabler interface are not invoked which means some files, such as the project file and the IspecList.xml, are not updated and the final compile of the generated user interface is not performed.
The workaround to avoid this problem is to always do a full ‘Rebuild’ of the Component Enabler folder(s) in AB Suite.