IBM Host Access Transformation Services: Rich Client Platform Programmer's Guide Chapter 1
Total Page:16
File Type:pdf, Size:1020Kb
IBM Host Access Transformation Services Rich Client Platform Programmer's Guide Ve r s i o n 9.5 SC27-5903-01 IBM Host Access Transformation Services Rich Client Platform Programmer's Guide Ve r s i o n 9.5 SC27-5903-01 Note Before using this information and the product it supports, be sure to read the general information under Appendix B, “Notices,” on page 125. Eighth Edition (November 2015) © Copyright IBM Corporation 2007, 2015. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Introduction ........1 Using the runtime service .........36 Code examples .............2 Using the application service ........37 Using the API documentation (Javadoc) .....2 Using the client service ..........37 Using the session service ..........38 Chapter 2. Plug-ins and application Integration with other Eclipse UI views .....41 classes ...............3 An incoming communication scenario ....41 Samples ...............42 Plug-in project extension points ........4 Sample class and methods showing how to Allowing only one instance of an application . 4 access the different runtime services .....42 HATS runtime extension plug-in........5 Listening for 3270 Print Jobs........46 Application classes ............8 Creating a custom composite for use with the HostAccessApplication ..........8 Show action .............50 HostAccessWorkbenchAdvisor .......9 HostAccessWorkbenchWindowAdvisor ....10 Chapter 7. Integrating business logic 53 HostAccessActionBarAdvisor .......11 Incorporating Java code from other applications . 54 Chapter 3. Perspectives and views. 13 Using global variables in business logic .....55 Business logic examples ..........57 The Host Access perspective.........13 Example: Date conversion ........57 Applications view ............14 Example: Adding values that are contained in an Programmatically starting an instance of an indexed global variable .........58 application .............14 Example: Reading a list of strings from a file into Transformation view ...........15 an indexed global variable ........58 Extending the transformation view's menu . 16 Using custom screen recognition .......60 Example of custom screen recognition ....61 Chapter 4. Transformations ......19 Custom screen recognition using global variables 62 || Editing transformations ..........19 HATS-specific controls...........19 Chapter 8. Creating custom The ComponentRendering class ......19 components and widgets.......65 The DefaultRendering class ........20 Components and widgets properties for RCP The MacroKey class ..........20 applications ..............65 The GlobalVariableControl class ......21 Creating a custom host component ......66 The HostKey class ...........21 Extending component classes ........68 The ApplicationKey class .........21 Creating a custom widget .........68 Transformation classes...........22 Extending widget classes .........70 Samples ...............23 Widgets and global rules .........70 Sending a key from a button .......23 Registering your component or widget .....70 Updating an input field after the user selects a HATS Toolkit support for custom component and SWT List widget item ..........24 widget settings .............72 Setting the value of a global variable from a transformation ............24 Setting and retrieving global variable values . 24 Chapter 9. Using the HATS Validating input on a transformation .....25 bidirectional API ..........75 Customizing the host keypad .......26 Data Conversion APIs ...........75 Customizing the application keypad .....27 ConvertVisualToLogical .........75 Overriding the default monospaced font....27 ConvertLogicalToVisual .........75 Integrating other user interface widgets ....27 Global Variable APIs ...........76 getGlobalVariable ...........76 Chapter 5. Templates ........31 getSharedGlobalVariable .........76 || Editing templates ............32 BIDI OrderBean .............76 Samples ...............32 BIDI OrderBean methods ..........77 Customizing host color mappings ......32 Removing borders from input fields .....34 Appendix A. HATS Toolkit files ....81 Application file (.hap) ...........81 Chapter 6. Runtime services .....35 <application> tag ...........81 Accessing the service manager ........36 <connections> tag ...........82 © Copyright IBM Corp. 2007, 2015 iii <connection> tag ...........82 <disconnect> tag ...........113 <eventPriority> tag ...........82 <play> tag .............113 <event> tag .............82 <perform> tag ............114 <classSettings> tag ...........82 <pause> tag .............114 <class> tag .............82 <sendkey> tag ............114 <setting> tag .............83 <globalRules> tag ...........114 <textReplacement> tag .........90 <rule> tag .............114 <replace> tag .............90 <associatedScreens> tag .........116 <defaultRendering> tag .........91 <screen> tag.............116 <renderingSet> tag ...........91 <description> tag ...........117 <renderingItem> tag ..........92 <oia> tag ..............117 <globalRules> tag ...........94 <string> tag .............117 <rule> tag ..............94 <nextEvents> tag ...........118 Connection files (.hco) ...........96 <event> tag .............118 <hodconnection> tag ..........97 <remove> tag ............118 <otherParameters> tag .........102 Macro files (.hma) ............119 <classSettings> tag ..........103 <macro> tag.............119 <class> tag .............103 <associatedConnections> tag .......119 <setting> tag ............104 <connection> tag ...........119 <poolsettings> tag...........106 <extracts> tag ............119 <userconfig> tag ...........107 <extract> tag ............119 Screen combination files (.evnt) .......108 <prompts> tag ............120 <combinations> tag ..........108 <prompt> tag ............120 <enddescription> tag ..........108 <HAScript> tag ...........121 <navigation> tag ...........108 Screen capture files (.hsc) .........121 <screenUp> tag ...........108 BMS Map files (.bms and .bmc) .......122 <screenDown> tag ..........109 Image files (.gif, .jpg, or .png) ........123 <keyPress> tag ............109 Spreadsheet files (.csv or .xls) ........123 <setCursor> tag ...........109 Host simulation trace files (.hhs) .......123 <sendText> .............109 ComponentWidget.xml ..........123 Screen customization files (.evnt) .......109 <event> tag .............109 Appendix B. Notices ........125 <actions> tag ............110 Programming interface information ......126 <apply> tag .............110 Trademarks ..............127 <insert> tag .............110 <extract> tag ............111 Glossary .............129 <set> tag ..............111 <execute> tag ............113 <show> tag .............113 Index ...............137 <forwardtoURL> tag ..........113 iv IBM Host Access Transformation Services: Rich Client Platform Programmer's Guide Chapter 1. Introduction | The Host Access Transformation Services (HATS) Toolkit offers many tools for | creating and customizing rich client platform (RCP) HATS applications that | provide an easy-to-use graphical user interface (GUI) for your character-based 3270 | or 5250 host applications. HATS rich client applications can be developed to run in | an Eclipse Rich Client Platform (RCP) implementation, in Lotus Notes®,orinthe | Lotus® Expeditor Client to provide native client applications targeted for an end | user's desktop. HATS can also be used to create service-oriented architecture (SOA) | assets from logic contained in your character based 3270, 5250, or VT applications. Because HATS rich client applications are Java™ programs that are deployed as Eclipse plug-ins, you should be familiar with following topics to create your own HATS rich client applications: v Java programming v Eclipse plugin development v Standard Widgets Toolkit (SWT), which is the graphical user interface toolkit used by Eclipse If not, refer to the following technical documentation: v Java Tutorials v Eclipse documentation You might find that your HATS application requires some additional function that you cannot add using the wizards and editors in HATS Toolkit and IBM® Rational® Software Delivery Platform (SDP). This Rich Client Platform Programmer's Guide explains several ways that you can extend your HATS application with additional programming. It also assumes that you are familiar with basic HATS concepts such as: v How HATS processes host screens v Creating a transformation using components and widgets v Events and actions v Using global variables v Recording a macro If you are not already familiar with any of these topics, refer to the information about them in HATS User's and Administrator's Guide so that you will have the necessary background to make good use of the information in this book. You should also be familiar with using Rational SDP to create rich client applications. This Rich Client Platform Programmer's Guide describes ways to enhance your HATS application by programming. You can: | v Extend the workbench classes provided by HATS to customize the workbench | window where your application is running. Refer to Chapter 2, “Plug-ins and | application classes,” on page 3 for more information. | v Customize the transformation view of your application, by extending the view | class provided in your plug-in project. See “Extending the transformation view's | menu” on page 16 for more information. © Copyright IBM Corp. 2007, 2015 1 | v Programmatically interact with a HATS session. For example, send a command | from another Eclipse view. See “Integration with