DELL P-SERIES & U-SERIES MONITOR MOUNT. Completely open your workspace with a behind-the-monitor mounting solution.
Jul 1, 2013 ... manageability tools, HP thin clients help simplify IT while providing ... Platforms
available are the: HP t510, HP t610, and HP t610 PLUS.
to-manage cloud computing environment in end-to-end Dell ... learning environment (VLE) to support this, and for .... Nv
Installation Manual ... Recommended requirements for a thin client server . ....
Installation Requirements for Windows 2000 Server and Windows Server 2003.
These included Moodle, the school's VLE; Capita School Information Management. System, which governs timetabling, attend
Jul 27, 2004 - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT ... WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES.
Web Sites: An HTML Forms-Based Reverse. Engineering Approach. Sidi Benslimane. 1. , Mimoun Malki. 1. , Mustapha Rahmouni. 2. , and Adellatif Rahmoun. 3.
the state's postal code abbreviation in which the item occurred. Control totals and [ ] numbers ... Long-term care servi
Jan 1, 2016 - Payer made direct sales of $5,000 or more of consumer products (Box 9) ..... Rent and Royalty Property - G
enclosed forms will be lost if you do not save this file to your computer first. Once
you ... will shortly!). I will call my coach at the scheduled time (301-624-5746).
Taxpayer email address. Provider information: Business ... Tax Exempt or Living Abroad Foreign Care Provider (1 = TE, 2
Email, Work phone, Home phone, Fax, Mobile phone, Mobile phone #2. [16]. [24] ..... Were these wages earned for service
NOTE: Horizontal mounting feet MUST BE INSTALLED for proper device
operation if device is mounted horizontally. HP t610 PLUS Flexible Thin Client.
FRONT.
Various governmental agencies enable ordinary citizens to access and search their .... The spatial database is kept on the same computer .... As an example, we used two Excel files corresponding to EPA-regulated facilities that have Chlorine.
professional-managed data centers, sparing their customers the headache of buying and ... today: Citrix MetaFrame, Microsoft Windows 2000 Terminal Ser- vices, AT&T VNC ...... [12] DesktopStreaming Technology and Security. Expertcity.
Prototype for a Generic Thin-Client Remote Analysis Environment ... dure Calls [11], and the Simple Object Access Protocol [10], which also relies on ... being planned for Lizard and Hippodraw using Python as the exported interface matures.
Jade Software Corporation Ltd believes that the information furnished herein is ...
Support a set of controls that allows developers to cleanly encapsulate form logic.
..... that don't render as expected in Netscape are ComboBox, ListBox, and ...
HTML Thin Client – JADE Forms
JADE 6
JADE 6 JADE Development Centre
HTML Thin Client - JADE Forms In this paper . . . HTML THIN CLIENT - JADE FORMS
1
INTRODUCTION
1
OVERVIEW
2
CREATING AN HTML THIN CLIENT APPLICATION 8 HTML THIN CLIENT FRAMEWORK
13
HTML GENERATION
16
LIMITATIONS
41
PERFORMANCE CONSIDERATIONS
42
USER-DEFINED EVENTS (IE4+ ONLY)
43
USER EXITS
46
INTERNATIONALIZATION
49
FUTURES
49
APPENDIX A: APACHE SERVER CONNECTIONS
49
APPENDIX B: JADEHTTP INITIALIZATION FILE
49
APPENDIX C: CONFIGURING APACHE
49
APPENDIX D: INITIALIZATION FILE
49
APPENDIX E: DIRECTORY STRUCTURE
49
APPENDIX F: TYPICAL SETUP PROCESS
50
APPENDIX G: TROUBLE SHOOTING TIPS
50
APPENDIX H: ASP.NET WEB FORMS
51
Introduction The HTML Thin Client has been a feature of JADE since the release of JADE 4.0. The HTML Thin Client introduces two programming models: one built around JADE controls - a model in which controls render their own user interfaces by generating HTML to return to Web browsers and firing events that are handled by JADE code, and the other built around external HTML documents – a model that provides for maximum flexibility and scalability. Since all the action takes place at the JADE application end, virtually any browser can run an HTML Thin Client. This paper provides a detailed overview of the HTML Thin Client features using JADE forms, its applicability, and how to optimize this interface to provide maximum performance.
Jade Software Corporation Ltd believes that the information furnished herein is accurate and reliable and has been prepared with care. However, no responsibility, financial or otherwise, can be accepted for any consequences arising out of the use of this material, including loss of profit, indirect, special or consequential losses or damages. Copyright Jade Software Corporation Limited, 2003.
- 1-
HTML Thin Client – JADE Forms
JADE 6
Overview The HTML Thin Client technology is used to create programmable Web pages. They can present information, using HTML 3.2 or higher, to the user in any compliant browser and use code in the JADE application to execute application logic. With the HTML Thin Client there are no new languages or a new way of doing things. It is fully integrated with the rest of the JADE environment. When designed with the HTML Thin Client in mind, the same application can be used as a standard client as well. However, the HTML Thin Client only provides a subset of the functionality of JADE. Implementing a system using this facility requires an understanding of this subset. The supported subset is detailed in this document. HTML Thin Client forms: •
Can run on any HTML 3.2 (or higher) compliant browser and automatically render the correct, browser-compliant HTML for features such as styles, layout, and so on. Alternatively, you can run on a specific browser such as Microsoft Internet Explorer 4 (or higher) and take advantage of the features of a rich browser client.
•
Use the JADE environment for designing and programming the forms.
•
Support a set of controls that allows developers to cleanly encapsulate form logic.
•
Allow for separation between code and content on a page, eliminating the "spaghetti-code” often found in client-side scripting or server-side scripting (for example, ASP).
•
Provide session management features that preserve the state of a form between requests.
What The HTML Thin Client Helps You Accomplish Web application programming presents challenges that do not typically arise when programming traditional client-based applications. Some of these challenges are: •
Rich user interface. A user interface with a large amount of content, a complex layout, and rich
user interaction can be difficult and tedious to create and program using basic HTML facilities. It is especially hard to create a rich user interface for applications likely to run in many different browsers.
Separation of client and server. In a Web application, the client (browser) and server are different programs often running on different computers and maybe even on different operating systems. Consequently, the two halves of the application share very little information; they can communicate, but typically only exchange small chunks of simple information.
•
Stateless execution. When a Web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then, effectively, discards all page information. If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. In other words, servers have no memory of pages that they have processed. If an application therefore needs to maintain information about a page, this becomes a problem that has to be solved in application code.
•
Unknown client capabilities. In many cases, Web applications are accessible to many users using different browsers. Each of these browsers has different capabilities, making it difficult to create an application that will run equally well on all of them.
•
Data access. Reading from and writing to a data source in traditional Web applications can be complicated and resource-intensive.
Meeting these challenges for Web applications can require substantial time and effort. The HTML Thin Client addresses these challenges in the following ways. •
Browser-independent applications. The HTML Thin Client provides a framework for creating all application logic in the JADE application, eliminating the need to explicitly code for differences in browsers. However, it still allows you to automatically take advantage of browser-specific features to provide improved performance and a richer client experience.
•
Event-based programming model. The HTML Thin Client brings to Web applications the model of
writing event-handling methods for events that occur in either the client or in the JADE application. The framework abstracts this model in such a way that the underlying mechanism of capturing an event on the client, transmitting it to the JADE application, and calling the appropriate handler is all automatic and invisible. The result is a clear, easily written code structure.
•
Abstract, intuitive, consistent object model. The framework presents an object model that allows you to think of your forms as a unit, not as separate client and server pieces. In the model, you can program the form in a much more intuitive way than in traditional Web applications, including the ability to set properties for form elements and respond to events. In addition, the controls are an abstraction from the physical contents of an HTML page and from the direct interaction between the browser and the application. In general, you can use the controls the way you might work with controls in a client application and not have to think about how to create the HTML to present and process the controls and their contents.
•
Session management. The framework automatically handles the task of maintaining the state of your form and its controls, and provides you with explicit ways to maintain the state of application-specific information. This is accomplished without heavy use of server resources and without sending cookies to the browser, two traditional means for storing state.
•
Scalable performance. The framework allows you to scale your application from one computer with a single processor to a multi-processor multi-computer environment without any changes to the application's logic.
Processing Stages of an HTML Thin Client Form The life-cycle for an HTML Thin Client form is, generally speaking, similar to that of any Web process that runs on the server. Certain characteristics of Web processing — information passed via HTTP protocol, the stateless nature of Web pages, and so on — apply to these forms just as they do to other Web applications.
However, the framework performs many Web application services for you. As one example, the framework captures the information posted with the form, extracts the relevant values, and makes it available to you in object properties. Even so, it is helpful to understand the sequence of events that occur when a form is processed. This knowledge will help you know how you can program your forms effectively. Round Trips One of the most important things to understand is the division of labour in an HTML Thin Client form. The browser presents the user with a form, and the user interacts with the form. However, all processing that interacts with JADE application components must occur in the application. This means that for each action that requires processing, the form must be sent back to the application, processed, and returned to the browser.
Note
You can create client-script in these forms, which is useful for user input validation and for some types of UI programming. However, client script does not interact with the JADE application.
For example, if the user enters an order and you want to confirm sufficient inventory for the order, your application posts the page to the JADE application at an appropriate point in the user's order entry. The application logic examines the order, performs an inventory lookup, perhaps takes some action (such as modifying the form to indicate an error), and then returns the generated HTML to the browser for the user to continue.
In HTML Thin Client forms, most user actions such as clicking a button result in a round trip. For that reason, the events available in the form’s controls are limited. Most controls expose a click event, for example — an event that requires an explicit user action. Similarly, controls do not expose high-frequency events such as mouse move events, because each time the event is raised, it would require another round trip to the application, which would considerably affect response time in the form. The HTML Thin Client does generate client-side script for some mouse events, so that controls that support different images for rollover, mouse down, and so on, continue to work the same way on a browser. Updating the Form In most Web processing scenarios, pages are created from scratch with every round trip. In effect, as soon as the server finishes processing a page and sends it to the browser, it discards the page information. The next time the page is posted, the server starts all over in creating and processing it. For this reason, Web pages are said to be stateless; that is, the values of a page's variables and controls are not preserved on the server. In a traditional Web application, the only information that the server has about a form is the information that the user has entered into controls, because that information is sent to the server when the form is posted. Other information, such as variable values or property settings has been discarded. In the HTML Thin Client framework, whether a form is discarded is at the developer’s discretion. If the developer unloads the form, it is discarded. State information on the generated page allows the framework to retrieve the appropriate form when the page is posted. Linear Processing In client-side forms, the form is initialized and displayed along with its controls. Users then interact with the form, which causes events to be raised that in turn call event-handling methods. In a traditional server-based application, because user actions cause the page to be posted to the server and because the server must recreate the page with each round trip, processing is more linear than in a client-side form. Effectively, after being recreated, the page is processed in the same top-tobottom sequence each time. The result is that the form is not truly event-driven. The HTML Thin Client framework overcomes this strict linear processing in various ways. For example, the framework allows you to set up event-handling methods in application code for events that occur in the browser. When the user clicks a Button control, for example, the button raises an event that is transmitted via a form post to the application. There, the framework interprets the post information and as part of its normal processing, calls the appropriate event handler in your code to handle the event.
Stages in HTML Thin Client Processing During forms processing, the form goes through a number of distinct stages. The following table lists the most commonly used stages of page processing. These stages are repeated at each round trip; that is, each time the form is POSTed. Stage Process Request Event Handling Reply
Meaning Updates the form and control property values. Can be overridden by user logic. Calls the user-defined event handler. Sends a response back to the browser. This can be the generated HTML for the current form, a new form, the start up form, or an exception form. Can be overridden by user logic.
The following diagram shows the message flow.
Web Browser Web Server/jadehttp JADE Application
Request comes in from Web Browser jadehttp finds appropriate connection JADE application receives input
Create/Get Web Session
Create a web session or get an existing session
Process Request
Process the incoming string and set up property values for the form being processed
Call User Defined Event
Calls a user defined event handler e.g. btnOK_click Generates HTML based on changes
Generate HTML Sends the generated HTML back to the browser via jadehttp
HTML Thin Client Event Model Events in HTML Thin Clients work somewhat differently than events in traditional client forms or in client-based Web applications. The difference arises primarily because of the separation of the event itself from where the event is handled. In client-based applications, events are raised and handled on the client. In HTML Thin Client forms, on the other hand, events are raised on the client but handled by the JADE application. For events raised on the client, the event model requires that the event information be captured on the client and an event message transmitted to the application. This can happen via an HTTP post or an HTTP get for hyperlinks. The framework must interpret the post or get to determine what event occurred, and then call the appropriate method in your code to handle the event. The framework handles virtually all of the mechanics of capturing, transmitting, and interpreting the event. When you create event-handling methods, you can do so without thinking about the mechanics of how the event information is captured and made available to your code. Instead, you can create event-handling methods in much the same way you would in a traditional client form. However, there are some limitations on event handling in HTML Thin Client forms that you should be aware of. These are described in later sections. Architecture The HTML Thin Client will work with either Microsoft’s Internet Information Server (IIS), or the Apache server. For IIS, an ISAPI DLL (jadehttp.dll ) is used for communicating between the server and the application. For the Apache server, a similar module is used. The Web application framework is shown in the following diagram.
Named pipes are used by default for connection to JADE applications from the jadehttp module. Alternatively, this module can handle multiple TCP/IP address connections to the same application, which allows the web server to connect to multiple copies of the same JADE application on multiple hosts.
Note
The main advantage of a TCP/IP connection over a named pipe connection is that the machine hosting the Web server can be different from the machine that is running the JADE application, to provide greater security via firewalls. A TCP/IP connection is also slightly faster than a named pipe connection
Deployment HTML Thin Client deployment is most useful in situations where a JADE application needs to be deployed on the Web; for example, in situations where the JADE Smart Thin Client is not a viable alternative, such as casual users of the application. This feature is least useful in situations where you are designing a Web site, particularly where the Web site contains mostly static pages. In this case, the traditional approach of using a Web design tool to develop the pages would be the best approach. For the minimal set of pages where database storage and retrieval is required, the appropriate hooks can be put into the static pages to invoke an HTML Thin Client application and make use of user exits to customize the page as required.
Creating an HTML Thin Client Application In theory, any JADE application can be run as an HTML Thin Client. In practice, however, because of HTML limitations, designing a JADE application to be used as an HTML Thin Client requires careful consideration of these limitations. An HTML Thin Client application is developed in the same way as a standard JADE application but the design has to take into account the GUI limitations of the HTML. To web-enable an application use the Applications sheet of the Define Application Dialog as shown below:
Figure 1. The application type can be Web-Enabled or Web-Enabled Non-GUI. If Web-Enabled is selected, then the Web application monitor window is displayed when the application is launched. If Web-Enabled NonGUI is selected, the monitor window is not shown. The absence of a monitor window will improve the performance of the application, as the updating of this window is expensive in terms of resources. Note that this implementation still requires the use of Windows GUI and hence can be run only on a Windows platform. JADE 6 also has an alternate HTML Thin Client implementation. This implementation uses externally created HTML documents instead of JADE forms. Please refer to the white paper “HTML Thin Client Using HTML Documents”. All other options are those of a standard JADE application. In addition to this change, there is also a Web Options sheet where HTML Thin Client-specific options can be set as shown in Figure 2. The HTML Documents sheet is disabled and is used for the alternate HTML Thin Client Implementation.
Figure 2. By default communication between the JADE application and the Web server (via jadehttp) is by using a named pipe. Note that named pipes only work with IIS. The pipe name defaults to the application name. If you wish to use TCP/IP, in the Connection Name text box you enter the host name or host IP address followed by a : followed by the starting port number. For example, if the machine name was cnwchcs36 and the starting port number was 50000, then the following would be entered. Copyright Jade Software Corporation Limited, 2003. www.jadeworld.com
- 9-
HTML Thin Client – JADE Forms
JADE 6
cnwchcs36:50000
Application copies determines the number of copies of the application that will be started up when the application is run. When using TCP/IP, the first copy will open a port with the specified port number and each subsequent copy will have the number incremented by 1. If 5 copies were therefore started up, then the port numbers for the above example will be 50000, 50001, 50002, 50003, and 50004. As the jadehttp module also needs this information as well in order to communicate with the JADE application and the module can be outside a firewall, the information must also be present in the jadehttp.ini file. See the section “Jadehttp Ini File Settings”, later in this document, for further information. The virtual directory and physical directory names are used for HTML generation and as a directory for generating temporary image files, Java applet files, and OLE object data files. Note that the physical and virtual directory names must match the mapping as specified in the Web server. The virtual directory tells the browser where the temporary files are located and the physical directory tells JADE where to place the temporary files. When the firewall option (see “HTML Thin Client Ini File Settings”) is set to true, the HTML generation assumes that the directory is outside the firewall and passes the generated information and the directory information to the jadehttp module, which will then create the file in the appropriate directory. Note that the firewall option is available only when using TCP/IP for communication. The virtual directory is not used to generate URLs for post actions on the tag or for hyperlinks. The virtual directory for these tags is obtained from the Web server. The virtual directories and physical directories can also be specified in the application’s initialization file, in which case these settings will take precedence. See the “HTML Thin Client Ini File Settings” section for more information. The session timeout parameter, if specified, will start a timer for the session when a response is sent back to the browser. If no request is received within the given time period, the session is removed from the list of active sessions. If the user tries to reconnect after the timeout period, a default message is sent back to the browser informing the user that the session had timed out. You can override the default message. See “User Exits”, later in this document. The default setting of zero(0) implies that there is no timeout, that is, the session will stay connected until the application is terminated. Note that when a session is removed, either programmatically by calling the WebSession::removeSession method or automatically by using the session timeout parameter, all of the forms associated with this session are unloaded. All temporary files that were created are also removed except when using the firewall option, where the jadehttp module will periodically remove these. Along with these resources, an HTML Thin Client licence is also freed. For security and resource usage reasons, it is recommended that a reasonable timeout parameter be set for example, 10 minutes. The Maximum HTML Size value, if specified will stop the HTML generation when the HTML string exceeds this size. The following message will be appended to the already generated string before the response is sent back to the browser. *** Maximum size exceeded - output truncated
The Minimum Response Time value, if specified, will start a timer for the session when a request is received from the browser. If the HTML generation does not complete within this time, a default message is sent back to the browser informing the user that the response time has been exceeded. You can override the default message. See “User Exits”, later in this document, for more details. The default setting of zero(0) implies that there is no minimum response time; that is, the processing will continue until it completes. Note that if this processing takes more than 5 minutes, the jadehttp module will time out and the connection will be lost. In unusual circumstances where the processing is going to take more than 5 minutes, a background application that does all this processing should be started and a response should be sent back to the user immediately. The user can then choose to do some other operation (or wait) and when the background application has completed, the user should be Copyright Jade Software Corporation Limited, 2003. www.jadeworld.com
- 10-
HTML Thin Client – JADE Forms
JADE 6
informed of this or the results of the processing sent back to the browser on the next response cycle. Alternatively, an auto refresh page can be set up to inform the user of the progress of the background operation. It is generally not a good idea to hold up the main application thread for any length of time, as there could be other requests queued. The Scrolling Text value, if specified, will generate in-line JavaScript that will display the text on the status bar of the browser window in a scrolling fashion. This can be used to display non-intrusive messages, for example. This text will not be displayed if the browser is in Full Screen Mode or the status bar has been turned off. The Treat showModal as show value, if checked, will treat any calls to showModal as show. If this is not checked, calls to showModal will return an error to the browser. Note that when this option is checked, any code following a showModal will continue to be executed which is different behavior from a standard client. This option is useful in situations where the same forms are used for a standard client and an HTML Thin Client and when running in standard client the form should be displayed modally. Certain operations (for example, when shutting down the HTML Thin Client application) can cause a message box to be displayed if there are active sessions. The Disable Messages value, if checked, will cause these message boxes not to be displayed. The minimum requirement for using HTML Thin Client is that browsers support HTML 3.2. When the Browser Compatibility value is checked, the HTML 3.2 standard is used to generate HTML. When this is not checked, HTML 4.0, Cascading Style Sheets (CSS) Levels 1 and 2 and Document Object Model (DOM) Level are used to generate HTML for Internet Explorer 4.0 and above. HTML 3.2 is still used for all other browsers. However, if an initialization file setting UseHTML4ForNetscape is set to true, the generation uses HTML 4.0, CSS, and DOM for browsers that identify themselves as Netscape 5.0 or higher. The benefit of using HTML 4.0, CSS, DOM Level 1, and absolute positioning is that the user interface on the browser can be made to look very close to that of the standard client. In addition, with the use of DOM and CSS, HTML unsupported controls like the Folder control can be simulated. When using Internet Explorer 4.0 or above, the Form Style Display value will display the form with a caption and a close icon. Clicking on the close icon will unload the form and display the previous unloaded form (the start-up form is displayed when there is no previous form). Web Events With Internet Explorer 4.0 and above, click events can be defined for most controls, including list boxes and combo boxes. To enable this feature, click on the Web Events button. This will display the dialog shown in Figure 3.
In the standard implementation, the click event is only invoked for the following controls. Button OptionButton (caption only) CheckBox (caption only) Picture WebHotSpot Label The POST method (that is, submitting the page where all input is transmitted with the page) is only invoked for the Button control. All other controls become hyperlinks when there is a click method defined for them. Clicking on these controls only transmits the information related to that hyperlink. For example, if your Web page had a text box and you entered something in it and then clicked a hyperlinked label, the text box contents will not be transmitted. However, if you clicked a button, the text box contents would be transmitted. With the Web Events dialog, you can select the controls that should respond to a click similar to the button click. For example, selecting an item in a combo box can immediately refresh the page rather than having to select an item from the combo box and then clicking on a button. When used with a Table control, selecting a cell will return the row and column of that cell along with user-entered data. Table controls are special in that they can respond to one of three possible events (mutually exclusive) – rowColumnChg, click, and dblClick. The order of precedence is rowColumnChg will take precedence over click and click will take precedence over dblClick. If all three events are therefore defined the only one that will be invoked will be the rowColumnChg. However, if only dblClick is defined, then this is the event that will be invoked. See “User Defined Events”, for more user control on event handling on the browser. As explained in the following “HTML Thin Client Framework” section, you do not need to deal with the intricacies of the returned data (unless you choose to – see “User Exits”), as the JADE controls will be set up with the returned information before invoking the event handler.
HTML Thin Client Framework The framework consists of the following •
Jadehttp
•
Connection Classes
•
Web Session Manager
•
Web Session
•
Web Application Monitor
Jadehttp The Web server invokes jadehttp when a Web browser user connects to a HTML Thin Client application. Its principal functions are as follows. •
Handling requests from a browser. If this is a new session, the module finds an available connection and sends the information to the JADE application. If there are no free connections, the request is queued until one is available. If the request is for an existing session, the correct connection is found and the information is sent to the JADE application. If this connection is busy servicing another request, the request is queued until the connection is available.
•
Handling file uploads using the MIME-compliant content type multipart/form-data. The module receives the file contents, and depending on the firewall setting, it either writes directly to the transfer directory (firewall=false) or sends it through to the JADE application where the framework assembles this file and writes it to the appropriate directory. Note that users who do not use the standard framework may need to handle this in their code. See the JADE Installation and Administration Guide for details.
•
Writing image files - when the firewall parameter is set to true, dynamically generated files are sent to the jadehttp module. The module is then responsible for writing out the image file. It is the responsibility of the module to periodically remove temporary files created this way. The module does this by initiating a separate thread on start up. This thread then periodically removes files that are more than 12 hours old.
•
Logging - for debugging purposes and statistics by way of the Status_Request message on a browser request.
Changing the jadehttp name One reason for changing the name could be, in the case of IIS, to allow multiple copies of the module to be attached to the same Web server. This is useful, for example, where one server is servicing two environments. Connection Classes The Connection classes hierarchy in the RootSchema is defined as follows: Connection INFOConnection NamedPipe InternetPipe TCPIPConnection Copyright Jade Software Corporation Limited, 2003. www.jadeworld.com
- 13-
HTML Thin Client – JADE Forms
JADE 6
JadeInternetTCPIPConnection The classes used are InternetPipe and JadeInternetTCPIPConnection. Depending on the application setting, transient instances of InternetPipe (when named pipes are to be used) or transient instances of JadeInternetTCPIPConnection (if TCP/IP is to be used) are created, setting up as the callback function the openPipeCallback method. When jadehttp opens the pipe, this method is called, which then sets up the readPipeCallBack method as the callback function for reading input. When the input arrives, it is read and processed by this method. The sendReply method is used for sending responses back to the browser. Web Session Manager The Web Session Manager is an internal object that is created when the first HTML Thin Client application is started. It manages Web sessions by having responsibility for creating and deleting Web sessions. It also for keeps track of which application copy a given Web session belongs. Forms and applications are intrinsically tied together in JADE; that is, a form created in one application instance cannot be used in another application instance. With the help of the jadehttp module, which ensures that a given session is directed to the correct application instance, the Web session manager ensures that the forms, sessions, and application combinations are managed correctly. Web Session A WebSession instance is created for every new Web session. When this instance is created, a unique identifier is created for it and this identifier is transferred with the generated Web page and is used as a means of retrieving the WebSession instance when the page is returned from the browser. The WebSession instance is an instance of the WebSession subclass for that schema. You can add properties to save state information for a Web session and methods to do specialised processing, if required. A special system variable, currentSession, will always refer to the currently active Web session. For non-HTML Thin Client applications, this system variable will be set to null. This variable can therefore be used to test for the presence of HTML Thin Client in code. Web Application Monitor The Web Application Monitor is displayed when the web application is started (when the application type is set to Web-Enabled). This window shows a summary of incoming requests and outgoing messages. Figure 4 shows details about the browser and the contents of the request string that are returned from the browser.
HTML Generation In the following discussion, references to Internet Explorer 4 also includes browsers that identify themselves as Netscape 5 and above (such as Mozilla) when the initialization file setting UseHTML4ForNetscape is set to true. In the HTML Thin Client framework most of the processing is involved in the generation of HTML. HTML code generation can be done in one of two ways: •
Browser compatibility mode (all browsers that support HTML 3.2)
•
Internet Explorer 4.0 and above
Browser compatibility mode generates HTML 3.2 code (with some CSS Level 1) and Internet Explorer makes use of HTML 4.0, CSS Level 1, CSS Level 2 and Document Object Model Level 1 features. If the application is not specifically set to generate HTML in browser compatibility mode, the framework will generate the appropriate code based on the browser type for a given session. If browser compatibility mode is set, then essentially the same code is generated for all browsers. The only differences in this case are font handling and sizing. Note that if a browser does not support at least HTML 3.2, the generated code may not work correctly. Generation for Browser Compatibility Mode In the JADE Painter, control positioning and size are specified at the pixel level. HTML 3.2 does not provide this level of control on the individual controls. JADE therefore uses an HTML table in an attempt to position controls in the correct place. It calculates the row heights and column widths required based on the positions of visible controls and this is used in combination with ROWSPAN and COLSPAN attributes of the TD tag to place controls in the correct position. CSS Level 1 code is also generated to control height, width, font and color for some INPUT controls for Internet Explorer browsers. They are not generated for Netscape compatible browsers. Netscape ignores these settings (except for Netscape 6). As the HTML 3.2 specifications do not specify how the HTML is to be rendered on the browser, different browser vendors render them differently. Take the simple case of an INPUT type.
Figure 5 In Internet Explorer 6.0 it will render as
Figure 6 using the same font size of 3. With Internet Explorer 3 and above, it is possible to make the width and height of this input field the same as that defined in JADE by using CSS. However, CSS is ignored for most Netscape browsers. In the example above, for example, if the text box was designed to be 200 pixels, in Netscape it would display the text box as being wider, say 225 pixels. JADE attempts to compensate for the difference in the width of the rendered input field by reducing the size attribute for it. As explained earlier, Tables are used to simulate positioning and the table column widths are determined by control widths. If the calculated column widths do not match the width of the control when it is rendered on the browser, the browser will readjust the column width to be the width of the rendered control. Depending on the complexity of the page, this could have a rippling effect on other control positions on the page and the page can end up not quite looking like it was designed. Other controls that don’t render as expected in Netscape are ComboBox, ListBox, and Button. As an illustration of this, consider the following JADE form as displayed in a JADE application.
Figure 9 The display rendered by Internet Explorer is almost identical to that of the JADE application. However, the Netscape display is quite different. Other than the sizes of the controls being different, the Home Phone label is right next to the text box and all of the labels on the left are jutting against the window. This is because the browser has resized the combo box to be able to display all of the text and this resizing has altered the column width. This causes the overall display to be affected.
Adjusting the combo box width to fit the largest possible combo box entry causes Netscape to display as follows:
Figure 10 The display now looks much closer to the way it was designed. Generation for IE4+ and NS5+ Browsers HTML generation for Internet Explorer versions 4.0 and above uses HTML 4.0, Document Object Model and Cascading Style Sheets (CSS) Level 1 and Level 2 to provide an almost WYSIWYG interface and additional event handling functionality. Form Generation When a Web session is active, whenever a form is created only the JADE form object is created. The Windows copy of this form is not created unless the form contains OCX or ActiveX controls. This has significant savings in resources, especially GDI resources. The Form generation involves generating any system script (for example, the scrolling text) and userdefined scripts. If there are user-defined events (see “User Defined Events”) for the form, these will be generated against the BODY tag or the FORM tag depending on the event type. Several hidden fields are also generated. When the form is sent back to JADE, these hidden fields are used to determine the session id and the form that is being processed, among other things.
Description If the value of this property is not null, an tag is generated. When the information is returned to JADE, the value of this field is set to the form’s tag property. If the value of this property is M, the encoding type for the form will be generated as multipart/form-data. This property value is automatically set to M if the form has text boxes whose webInputType value is of type Web_InputType_File. If the form has a backbrush picture, an image file will be generated as the background image for the Web page, otherwise the background color of the page will be the background color of the form. The backbrush image must be able to be converted to JPEG or PNG format (that is, the image format must be JPEG, TIFF, BMP or PNG), otherwise it is ignored. The picture will be tiled on the Web page. If the value of this property is true, then all hyperlinks and form action will be generated as HTTPS otherwise it will be HTTP. This property can be used to specify a file name for the generated backbrush image. If there is no existing file and the property value is not null, the image will be generated once only instead of being generated every time the form is generated. If the file already exists, no generation occurs. If the value of this property is not null, it should contain script. JADE assumes that this property contains Java script and generates prologue/epilogue based on this assumption. The actual content is not validated and it is up to you to make sure that the code works as expected and works correctly across all browsers that the application is going to support. This script will generally be used to handle events for the BODY and FORM tags. The events that are supported for the BODY tag are ONLOAD, ONUNLOAD, ONBLUR and ONFOCUS and the events that are supported for the form tag are ONRESET and ONSUBMIT. Description Used to determine whether a visible control is to be displayed. If a control’s position is beyond the dimensions of the form, it is not displayed. Used for the tag Defines the URL to go to when the time specified in the webBrowserAutoRefreshInterval is reached. If this value is null, the URL is defined to be the JADE application. Specifies the interval in seconds to display the page before refreshing the page with the URL defined by webBrowserAutoRefreshURL If this option is set to true, the user will not be able to use the BACK button on the browser. Using this button will cause the currently displayed page to be redisplayed.
The following form methods behave differently when a Web session is active: Method show
Description Causes the generation of HTML for this form. The generated HTML is then
- 21-
HTML Thin Client – JADE Forms
JADE 6
sent to the requestor. If the application option Treat showModal as show is checked, this method will behave as per the show method or an exception is raised and the exception HTML string is then sent to the browser. The form is removed from the list of open forms for the current session.
showModal unloadForm
Submitting a form from the browser always generates a post action. Control Generation HTML code is generated for controls that are visible. A control is considered visible if it satisfies all of the following criteria. •
visible property is set to true
•
Control is within the parent container
•
Current session’s userSecurityLevel is greater than or equal to the control’s securityLevelVisible property.The current session’s userSecurityLevel is a property of the session object and can be set in application code
Note that you can still generate hidden fields by using a TextBox control and setting its webInputType to WebInputType_Hidden. Only system-defined control classes are supported. Specifically, no HTML will be generated for subclasses of BaseControl. Other user-defined controls will inherit the HTML generation of the system control class of which it is a subclass. The following Window and Control level properties that are used in the generation apply to all controls. Property top, left
Description These property values are used to position the control at the appropriate position on the Web page. IE 4+ generation uses absolute positioning otherwise positioning is by using the HTML TABLE control and its associated tags. IE4+ generation uses CSS to specify exact pixel width and height for all HTML controls. The width and height are otherwise specified using row height, column width, and row and column spanning. When the value of this property is false, IE4+ generation uses HTML 4.0 features to display the HTML control in a disabled state. For other browsers, if the control has any text (for example, a caption) the control will be rendered as text. If there is no text, nothing will be displayed. If the value of this property is false, no HTML is generated. If this setting is greater than the current session’s userSecurityLevel value, the control is treated as disabled. If this setting is greater than the current session’s userSecurityLevel value, the control is treated as not visible and no HTML is generated If this property in non-null and the image represented by this property can be converted to a jpeg or png, then the background for this control will be the image (IE4+ only). Used to define the background color for the generated HTML control. Some browsers do not support this attribute for all HTML controls, in which case the setting will be ignored. Uses CSS to generate the border style based on the value of this property (IE4+ only). Generated as bubble help for HTML controls. This works only for some controls. If the JADE control is a Label control, the bubble help is displayed on the status line.
Description Generates the appropriate font information for the corresponding HTML control. Some browsers do not support these attributes for all HTML controls, in which case the setting will be ignored.
Uses CSS to generate a border style to give the HTML control a threedimensional look (IE4+ only). Uses HTML 4.0 to set up tab ordering for the generated HTML controls (IE4+ only).
The following control methods behave differently when a Web session is active: Method setFocus zOrder
Description IE4+ generation uses scripting to set the corresponding HTML control to the control that has focus. Not all HTML controls (for example, TextBox) respond to the setFocus method. IE4+ generation uses CSS to set the z-order for the corresponding HTML control.
Controls Supported by HTML Thin Client BrowseButtons This generates an HTML tag with the image being the control as displayed on a standard client. For processing purposes, the image is divided into four equal areas corresponding to the four buttons that can be pressed. When this image is clicked on a Web browser, the HTML Thin Client processing determines the button that has been pressed and calls the browse method for the BrowseButtons instance, passing the appropriate button that had been pressed in the browseType parameter of the click event for the control. There are no additional properties used in the generation. Button Clicking on this control on the browser initiates a POST. A Button control generates an INPUT HTML control. The exact type is determined by property settings.
The following properties are used in the generation. Property buttonPicture caption default picture pictureDisabled pictureDown value webFileName
Description If this property value is non-zero, an image is generated based on this value and the input type is set to IMAGE. Caption for the HTML control. For IE4+ generation, if the caption has an & a shortcut key is set up. If the input type is not IMAGE, if this property value is true, the input type is set to SUBMIT else it is set to BUTTON (IE4+ only). If this property value is non-null, an image is generated and the input type is set to IMAGE. If this value is non-null and the control is disabled, an image is generated. Input type is set to IMAGE for IE4+ generation and an tag is generated for other browsers. An image is generated and scripting code added to display this image when the mouseDown event occurs on this control (IE4+ only). On return processing, the value property of the button is set to true if the button was clicked. This property can be set to the name of an existing image file, in which case the HTML Thin Client will not generate images if they already exist in the virtual directory. If they do not exist, then the images will be generated once only. Note that the same name is used to set up the three images if required, except that the pictureDown image will be suffixed with _mouseDown and the pictureDisabled image will be suffixed with _pictureDisabled.
Netscape-compatible browsers may ignore the height and width of this control. These browsers use the caption and font properties to determine the height and width. The exception is if the button has an image. If the form has multiple buttons, for presentation purposes it is better to have images on the buttons for these browsers. CheckBox This generates an HTML control. If the control has a click method, the caption for this control will be set up as a hyperlink. For IE4+ generation, the control can be set up for Web events, in which case clicking on the control initiates a post and the click event of this control will be called.
The following CheckBox properties are used in the generation: Property alignment caption readOnly transparent value
Description If alignment = Alignment_Left the caption is generated to the right of the check box , otherwise it is generated to the left of the check box. Caption to generate alongside the check box. HTML does not support readOnly for check boxes, therefore when the value of this property is true the control is considered be disabled. If the value of this property is true the background color setting is not generated. If the value of this property is true the attribute CHECKED is added to the input tag.
ComboBox This generates a HTML control with an tag for each entry in the combo box. For IE4+ generation, the control can be set up for Web Events, in which case a change of the item that is selected on the control initiates a post and the click event of this control will be called. The following ComboBox properties are used in the generation. Property itemBackColor itemForeColor itemText listIndex
Description Generates CSS to set the background color of each item in the list to the appropriate color (IE4+ only). Generates CSS to set the foreground color of each item in the list to the appropriate color (IE4+ only). Generates the tag based on the value of this property. If the value of this property is greater then 0, then the attribute SELECTED is generated against the corresponding tag.
Netscape-compatible browsers may ignore the height and width of this control. These browsers use the text and font properties to determine the height and width. Folder As there is no equivalent HTML control, this control is simulated. IE4+ generation uses HTML 4.0, CSS and DOM to do this. For other browsers, the folder tabs are simulated by using the HTML control. If there is no sheetChg event defined for this control, the IE4+ generation generates HTML for all the sheets in the folder otherwise HTML is generated only for the top sheet. For other browsers, HTML is generated only for the top sheet.
The following Folder properties are used in the generation: Property tabActiveColor tabInactiveColor tabsFixedWidth tabsHeight topSheet
Description Used to define the background color for the active tab. Some browsers do not support this attribute, in which case the setting will be ignored. Used to define the background color for the inactive tabs. Some browsers do not support this attribute, in which case the setting will be ignored. If the value of this property is true, the generation sets all of the tabs to the width of the widest tab otherwise the width of each tab is dependant on its caption. If this property value is non-zero, it is used as the tab height (IE4+ only). Used to determine what sheet to generate or what sheet to display as the top sheet when all sheets are generated. When this control has the sheetChg event implemented, only the topSheet is generated, otherwise all sheets are generated.
As generation for Netscape uses Button controls to simulate the tabs, Netscape- compatible browsers may ignore the height and width of this control. These browsers use the caption and font properties to determine the height and width. Frame In the HTML Thin Client implementation, a Frame can be used for the following purposes. • • • •
As As As As
a a a a
container for other controls container for text (by using the caption property) horizontal rule (by setting the height to be less than 10) way of producing a report type output (see writeHTML method below)
Note that frames in JADE are not the same as the tag in HTML. JADE frames are generally used as containers for other controls whereas tags are used in HTML to display multiple web pages in the same window.
The following Frame properties are supported in the generation: Property bevelColor, bevelInner, bevelInnerWidth, bevelOuter, bevelOuterWidth, bevelShadowColor, boundaryBrush, boundaryColor, boundaryWidth caption transparent wordWrap
Description All of these properties are used to draw the frame. The HTML 4.0 tag and CSS is used to do this (IE4+ only). For Netscape-compatible browsers, only the boundaryWidth and bevelOuterWidth properties are used.
If this value is non-null, it will be displayed as text inside the frame (IE4+ only). If the value of this property is true, the background color setting is not generated. If the value of this property is false, the generated text for this caption is truncated if it is wider than the frame width.
The following additional methods are also provided for generating report type output. Property clearHTML writeHTML
Description Used to clear the HTML string that had been generated by the writeHTML method. When this method is called, the current state of the frame is saved in HTML format. The frame’s contents can then be changed and the method called again, which will then append the current state (in HTML format) to its previous state. This method can thus be called repeatedly to generate an HTML stream that represents, for example, a report output. When the HTML is generated for the form, this string is inserted in the appropriate place. This technique is satisfactory for simple output. If, however, you wish to produce well-formatted reports with page breaks and so on, creating a Portable Document Format (PDF) file or a file created with Microsoft Word with a link to this file would be more appropriate than using this method.
GroupBox This is used as a container for other controls. The tag introduced in HTML 4.0 performs the equivalent functionality of a group box. HTML versions prior to this do not have an equivalent tag and has to be simulated. Therefore IE4+ generation used the tag and generation for other browsers uses the
The following GroupBox properties are supported in the generation. Property caption transparent
Description The value of this property generates static text to be displayed with the group box. If this is set to true, the background color setting is not generated.
JadeDockBar, JadeDockContainer In the HTML Thin Client implementation, a JadeDockBar or a JadeDockContainer can be used for the following purposes: • •
As a container for other controls As a container for text (by using the caption property)
The following JadeDockBar or JadeDockContainer properties are supported in the generation. Property alignContainer caption borderHeightBottom, borderHeightTop, borderWidthLeft, borderWidthRight
Description The control will be drawn in the appropriate position on the form based on the value of this property This property value is generated as the caption for the HTML control. All of these properties are used to draw the border (IE4+ only).
Note that the drag/drop features of these controls are not available in the browser. JadeEditMask Edit mask facilities are not available for Web-generated forms and they will displayed as text boxes. Return processing will validate the text based on the edit mask and will return an error if it is invalid. JadeMask Clicking on this control on the browser initiates a POST. A JadeMask control generates an HTML tag. The following JadeMask properties are supported in the generation: Property caption picture
Description This property value is generated as the caption for the HTML control. For IE4+ generation, if the caption has an &, a shortcut key is set up. If this property value is non-null, an image is generated and the input type is set to IMAGE.
- 29-
HTML Thin Client – JADE Forms
JADE 6
Property pictureDisabled
Description If this property value is non-null and the control is disabled, an image is generated. If this property value is non-null, an image is generated and scripting code added to display this image when the mouseDown event occurs on this control. If this property value is non-null, an image is generated and scripting code added to display this image when the focus event occurs on this control. If this property value is non-null, an image is generated and scripting code added to display this image when the mouseOver event occurs on this control. The mouseOver event is not triggered in some versions of Netscape for tags. On return processing, the value property of the button is set to true if the button was clicked The value of this property can be set to be the name an existing image file, in which case the HTML Thin Client will not generate images if they already exist in the virtual directory. If they do not exist, the images will be generated once only. Note that the same name is used to set up the four images if required, except that the pictureDown image will be suffixed with _mouseDown, pictureDisabled image will be suffixed with _pictureDisabled, and pictureRollOver will be suffixed with _mouseOver.
pictureDown pictureFocus pictureRollOver
value webFileName
The pictureMask property value is not used in the generation. The clickable portion of this control will always be the rectangular area defined by the width and the height. Label This control is used to display static text or hyperlinked text. If the hyperlink property is not null or the control has a click method, then the caption is set up as a hyperlink. For IE4+ generation, the control can be set up for Web events, in which case clicking on the control initiates a post. The following Label properties are supported in the generation: Property alignment
caption
Description Alignment code is generated based on the value of this property. CSS is used for IE4+ but some versions of IE do not support the vertical-align CSS attribute. In this case, it is treated the same as other browsers and the
tag with the ALIGN and VALIGN attributes are used. Generates the text to be displayed
tag is used for sheet generation. The following properties are supported in the generation. Property caption icon transparent
Description Generates text for the tab on the parent folder. If the value of this property is not null, generates an image file and code to display the picture on the tab for the parent folder (IE4+ only). If the value of this property is true, the background color is not generated.
StatusLine HTML generations use the
tag (IE4+) or the
tag to simulate the StatusLine control. This can be used as a container for other controls.
The following properties are supported in the generation. Property bevelColor, bevelInner, bevelInnerWidth, bevelOuter, bevelOuterWidth, bevelShadowColor, boundaryBrush, boundaryColor, boundaryWidth caption wordWrap
Description All these properties are used to draw the frame. The generation uses the HTML 4.0 tag and CSS (IE4+ only).
The value of this property is used to generate text when there are no child controls. If the value of this property is false, the generated text for this caption is truncated if it is wider than the width.
Table HTML generation uses the
,
and
tags. The following properties are used in the generation. Property accessMode alignment cellControl columnVisible columnWidth comboIndex comboList fixed3D fixedColumns, fixedRows gridColor
Description Uses the value of this property to set up attributes for the table, row, column or cell. Generates the appropriate CSS attribute based on this property value (IE4+ only) or uses the ALIGN and VALIGN attributes of the
tag (other browsers). When the value of this property is non-null, HTML is generated for the cellControl object if the HTML Thin Client supports it, or no code is generated. If this is set to false, the column is ignored in the generation. Generates the specified column width for the column. Note that Netscapecompatible browsers could override this column width if at least one of the cells in this column is wider than columnWidth. If the cell’s inputType is InputType_ComboBox, then this property value is used to generate the SELECTED attribute for the tag. If the cell’s inputType is InputType_ComboBox, then this property value is used to generate the tags for the tag. Generates CSS code to display the fixed rows and columns in 3D (IE4+ only). Generates CSS code to display fixed columns and rows in the correct color (IE4+ only). Generates the specified grid color if grid lines are set.
Description If the value of this property is true, grid lines are generated. This integer array contains a list of all columns for which a hyperlink should be generated. The generation sets up a hyperlink for all cells in the specified column. This hyperlink will return the row and column of the cell that was clicked. The HTML Thin Client processing will set the row and column of the corresponding control in JADE and invoke the sheetChg event if one is defined for it. The setHyperlinkCell method allows hyperlinks to be set on specific cells (see below). The following input types are supported in the generation. InputType_None: Static text is generated. InputType_CheckBox: is generated. Attribute CHECKED is set if the value of text is equal to one (1). InputType_TextBox or InputType_TextNumeric: is generated. Initial value of the TEXT attribute is set to the value of the text property. Numeric check is only done on return processing. The maxLength property value is used generate the MAXLENGTH attribute. InputType_ComboBox: Uses the comboList property value to generate tags and the comboIndex property to set the SELECTED attribute. If the inputType property value is InputType_TextBox or InputType_TextNumeric, then the value of this property is used to generate the MAXLENGTH attribute. If the value is zero, this attribute is not generated. If the value of this property is non-null, an tag is generated for this cell. A file containing this picture is also generated. The name of this file will
rc.jpg (or .png). Generates the specified row height for the row. Note that Netscapecompatible browsers could override this row height if at least one of the cells in this column is taller than rowHeight. If this is set to false, the row is ignored in the generation. When the table has sheets, the background color of the active tab is set to this color (IE4+ only) When the table has sheets, the background color of the inactive tabs are set to this color (IE4+ only)
- 36-
HTML Thin Client – JADE Forms
JADE 6
Property text
topRow wordWrap
Description InputType_None: text is generated as static text. InputType_CheckBox: If the value of text is equal to one (1) the generated check box tag has an attribute of CHECKED. InputType_TextBox or InputType_TextNumeric: text is used as the initial value. If the cell is a hyperlinked cell, the text is shown as hyperlink text. The specified row will be scrolled into view if it is not visible (IE4+ only) If the value of this property is false, the generated text for this caption is truncated if it is wider than the column width.
Additional Table methods for HTML Thin Client are as follows. Method isHyperlinkSet resetAllHyperlinks resetHyperlinkCell setHyperlinkCell
Description Takes as parameters row and column and returns true if the cell is a hyperlink cell or false otherwise. An exception is raised if row or column is invalid. Clears all the hyperlink settings for the table. Takes as parameters row and column and clears the hyperlink setting for this cell. Does nothing if the cell is not a hyperlink cell. An exception is raised if row or column is invalid. Takes as parameters row and column and sets the cell as a hyperlink cell. The inputType property value for this cell must be InputType_None, otherwise the call does nothing. An exception is raised if row or column is invalid.
TextBox Generates an tag or a tag. values.
The exact type is determined by property
The following properties are used in the generation. Property alignment dataType decimals
Description Generates CSS to align the text to the left, right, or center as determined by this property value (IE4+ only). A Web error is raised on return processing if the input field does not match the dataType value. A Web error is raised on return processing if the input field does not represent a decimal value. The number of decimal places is not checked.
Description Generates the MAXLENGTH attribute if the value is non-zero. Generates an input type of PASSWORD if the value is true. Generates the READONLY attribute for this tag (IE4+). Generates static text based on value (other browsers). If maxLength = 0, if the value of this property is true then the MAXLENGTH attribute is not generated, otherwise the MAXLENGTH attribute is calculated from the width of the control and generated. If this property value is true, generates the tag instead of tag. This is what the HTML Thin Client uses to decide whether to generate a single line or a multi line text box. Also see the webInputType property. Generates the VALUE attribute with text as the initial value. For non-IE4+ browsers, if the control is disabled or readOnly, generates static text. If value is: Web_InputType_TextArea (or scrollVertical is true) generates .. Web_InputType_Hidden generates Web_InputType_Password (or passwordField is true ) generates Web_InputType_File generates Web_InputType_Text generates The order of processing this is as above. For example, if scrollVertical is true and the webInputType setting is Web_InputType_Password, the webInputType setting is ignored.
WebHotSpot HTML generation only happens for this control when it is placed on a Picture control. It generates the tag. Currently the only supported shape is rect (that is, rectangular).
The following properties are used in the generation: Property caption hyperlink
Description Generates the text to be displayed Generates a hyperlink. No validation is done on this setting. An invalid link will produce the HTTP 404 error. If the value is null and a click event is defined for this hot spot, a hyperlink will be generated back to the JADE application. Note that in some versions of Netscape, if a hyperlink exists only for some of the hotspots, none of the hyperlinks will work.
WebHTML This control allows free-form HTML to be added to the generated output. IE4+ generation embeds the text of this control inside a
tag. For other browsers, text as entered is generated. If the text contains tags that will return data to the application (for example tags), as the JADE application does not know about these they will not be handled. It is up to the user to handle these by reimplementing the WebSession::processRequest method (see “User Exits”, for details). A use for this control could be to generate tags, for example. No validation is done on the contents of the text. It is up to you to ensure that it works as expected across multiple browsers. When JADE generates size and position information for this tag, it is based on the top, left, height, and width of the control at the time of generation. The actual size will depend on the contents of the text property, which JADE cannot ascertain. Because of this, control positioning may be affected. The following properties are supported in IE4+ generation only. Property ignoreHeight ignoreWidth text transparent
Description If this property value is true, the height CSS attribute is not generated. If this is false then the contents will be truncated from the bottom if the height of the control is not big enough (IE4+ only). If this property value is true, the width CSS attribute is not generated. If this is false, the contents will be truncated from the right if the width of the control is not big enough (IE4+ only). Contains the text to be included in the generation. If this is set to true, the background color setting is not generated (IE4+ only).
Note that the default for non-IE4+ browsers is to take up whatever space is required to display the text and the default for IE4+ is to display within the height and width of the control, truncating the contents where necessary. WebInsert This control is similar to the WebHTML control except that the contents come from an external file. The contents can be loaded in Painter by updating the fileContents property (static) or they can be loaded in at run time via the loadFile method (dynamic). WebJavaApplet This generates the tag. The MAYSCRIPT attribute is always generated to allow the applet to be scriptable by Java script functions. The following properties are supported in the generation. Property appletName code
Description The name of the applet. If the value of this property is null then the generation uses the control name suffixed with CLASS. This property value can be updated through Painter or in code. Note
- 39-
HTML Thin Client – JADE Forms
codebase horizontalSpace hyperlink parameters
verticalSpace
JADE 6
that it is assumed that the code being loaded is Java VM code. At generation time, the Java class file is generated using the appletName as the file name and this property value as its contents. If this property value is non-null, the CODEBASE attribute is generated with this value otherwise the virtual directory is used. Generates the HSPACE attribute. If this is non-null, generates the ARCHIVE attribute These can be set up in Painter or from code. If this is set in code, the parameter names and parameter values must be separated by #’09’. For example, an applet taking two parameters could set up the parameters string as follows. parameters := ‘Username’ & #’09’ & ‘Smith’ & #’09’ & ‘Password’ & #’09’ & ‘blah’ & #’09’; Code is generated for each name-value pair using the tag. Generates the VSPACE attribute
MenuItem This generates a hyperlink if the menu item is enabled and has a click event. When using IE4+ browsers in non-compatibility mode, additional script is generated to be able to drop down and close up submenu items. The following properties are supported in the generation. Property caption description
Description Generates the text to be displayed. Generates bubble help (IE4+ only).
- 40-
HTML Thin Client – JADE Forms
JADE 6
Property disableReason level picture webFileName
Description Generates bubble help for disabled menu items (IE4+ only). Generates CSS to display a 3D border if the value of this property is one (1) (IE4+ only). If the value of this property is not null, an image file is generated based on this value and code generated refer to this file (IE4+ only). This property can be set to the name of an existing image file, in which case the HTML Thin Client will not generate images if they already exist in the virtual directory. If they do not exist, the images will be generated once only (IE4+ only).
Limitations The JADE standard client and the JADE Smart Thin Client have a rich set of UI functionality, a lot of which is not available in the HTML Thin Client implementation. The following list details some of these limitations when compatibility mode is set (that is, HTML 3.2 is used): •
HTML Thin Client controls only respond to the click event for Button, Label, Picture, CheckBox, OptionButton, JadeMask, and WebHotSpot controls. All the other controls do not respond to any events. Further, only click events on Button and JadeMask use the post method. Clicks on Label, Picture, CheckBox, Option Button, and WebHotSpot are treated as hyperlinks.
•
Although every effort is made to position the controls in the right place, the exact position on the browser window will not always correspond to that defined in JADE. This is particularly true of Netscape-compatible browsers when for some controls (for example, Button), the width and height are determined by the contents and not by the size that is specified.
•
Because it is generic, it is likely that the generated code will be more verbose than a custom written code.
•
A one-pixel row is always used by the generation at the top of the Web page. This must be taken into account when painting your form, in particular when you have images on the page and you also have a background image.
Performance Considerations Web Application Monitor The Web Application monitor window records all request and response details. Because it is appending text to the window, it is a relatively slow operation. The display should be turned off for production systems and used only for debugging purposes. This can be turned off using a menu item on this window or using an initialization file setting (see “HTML Thin Client Ini File Settings”, later in this document). Running the application as a Web-Enabled Non-GUI application is another option. Static Pictures By default the pictures on Button, Picture, JadeMask, Table, and Form (backBrush) are dynamically generated every time the HTML is generated. The generation involves copying the image to a file or transmitting the binary representing the picture to the jadehttp module to copy to a file (when the firewall parameter is set). A webFileName property is available on all of the above controls (except the Table control) that can be used to set a file name. The file name can be that of an existing file. If the file already exists, no picture generation occurs. If the file does not exist, the picture is generated once only and used for the duration of the Web session. So, for example, if you use a common logo on various forms and you set the webFileName property on all these forms to the same name, picture generation will occur once only. Depending on the size of the picture and how often it is used, this can have a significant effect on generation time if the value of this property is null. Disabling Controls Controls that are disabled can take less time to process. This is particularly true of Label and Picture controls. In the majority of cases, these controls are for static display only (that is, they cannot be clicked on). Disabling these controls will usually speed up generation time. Note that in IE4+ generation, a disabled Label control will have the ‘disabled look’. Large Output When executing a user query, for example, it can produce a large result set. Rather than displaying all the results in one page, which can incur significant generation time, only display a subset of this result, providing Next and Back buttons (or use the BrowseButtons control) for the user to browse through the list. Provision should also be made to allow the user to search within the result set. You can also show the progress of a long operation by effective use of the webBrowserAutoRefreshURL and webBrowserAutoRefreshInterval properties on the Form class. Scripting Avoid user scripting if this is not strictly necessary, as this generates more code.
Combo and List Box Items The number of items in a combo box or list box affects generation. This should be taken into consideration when designing for the Web. Static Pages Where dynamic generation is not required, these pages should be statically generated or hard-coded and kept on the Web server, if possible. Forms A form that has a lot of controls on it will be expensive in terms of HTML generation. Consider splitting a complex form across several forms. Application Copies For better throughput, run multiple copies of the application. This will obviously be of real benefit only when running in a multi-processor machine. Generation Performance When HTML for a control is generated, this information is retained and regeneration is necessary only when a property on the control changes. Avoid making unnecessary programmatic changes to controls, to speed up the generation process.
User-Defined Events (IE4+ only) The HTML Thin Client framework provides a means for you to define your own events against HTML controls. In order to do this you will require knowledge of JavaScript. The framework provides the following property and methods to allow you to write your own event handling code. These are all defined in the Window class. Name userScript
Purpose Use this property to define the JavaScript functions. The value of this property is generated between tags. Note that function names beginning with _jade are reserved for internal use. If there are scripting errors, the application may not perform correctly. It is up to you to make sure that there are no scripting errors.
- 43-
HTML Thin Client – JADE Forms
Name addWebEventMapping
clearWebEventMappings getWebEventMappings
JADE 6
Purpose Call this method to set up a mapping between the event and the function. Multiple events can be set up for each form or control. The event name and the function name are passed as parameters. If the event has already been defined, it is replaced with the incoming function name otherwise it is added. A return value of true indicates success, a value of false indicates that the name of the function starts with _jade which is reserved. When the HTML is generated for the form or control, all event handlers are generated as well. Call this method to clear all currently defined mappings. Call this method to get a list of the mappings currently defined for a form or control. The mappings are returned in a HugeStringArray instance with each entry being of the form: =
removeWebEventMapping
Call this method The event name of true indicates a false indicates
to remove an event from a form or control. is passed as the parameter. A return value that the mapping was successfully removed and that the mapping was not found.
Events defined at the form level are treated differently. Depending on the type of event, the event handler may be defined on the tag or the tag as shown in the table below. Event onblur onfocus onload onreset onsubmit onunload
Where Defined
User-defined events take precedence over system-generated events. For example, if Web events have been defined for the Label control, JADE will generate an onclick event handler for it. However, if you define an onclick event for a Label control instance, your onclick event will be used. The actual events that are supported by the different HTML controls are many and varied, and are beyond the scope of this document.
Example of a User-Defined Event: In the form load method: userScript := ' function openWindow() { popupWin = window.open("http://www.jadeworld.com"); } function mouseOver(me) { me.style.cursor = "hand"; } function mouseNotOver(me) { me.style.cursor = "default"; } '; label1.addWebEventMapping("onClick", "openWindow()"); label1.addWebEventMapping("onMouseOver", "mouseOver(this)"); label1.addWebEventMapping("onMouseOut", "mouseNotOver(this)");
In this method, label1 is a Label control defined on the form. This will then generate (only the relevant portions shown) the following.
The HTML Label control tag will look like:
Go To Jade
The effect of this code is to change the cursor to a hand when it is over the label and change it back to a default when it is not. On clicking the label, the browser opens a new window with the specified URL as the target (in this case, the JADE Web site). Copyright Jade Software Corporation Limited, 2003. www.jadeworld.com
- 45-
HTML Thin Client – JADE Forms
JADE 6
User Exits The HTML Thin Client framework allows you the freedom to use all, some or a minimal subset of its features to implement a Web-enabled JADE application. For example, you can subclass the Connection subclasses, reimplement some or all of the methods and have full control over the communication with jadehttp and not use any of the other features at all. In this section, the discussion centers around you being able to provide user hooks as part of the standard framework. WebSession Methods The following methods can be reimplemented in the current schema’s WebSession subclass to alter the standard process flow: Method processRequest
reply
Purpose The framework to process the data that is returned from the browser calls this method. The input parameters to the method are httpString and queryString. By reimplementing this method, you can examine the data that has been returned and take some alternate action, if required. This alternative action could be to retrieve and save the returned data and then continue with normal processing by calling inheritMethod, or bypass this altogether by formulating a new HTML string and going directly to the reply method. Note that if the incoming string is altered in any way and inheritMethod is called, it is your responsibility to make sure that the altered string is structurally still valid, or the results are unpredictable. This method is called by the framework prior to returning the generated HTML, which is the input parameter of this method to the browser. This HTML string can be examined, any required values retrieved and saved, and updated. It is your responsibility to ensure that the changes made are correct.
Connection methods Similarly at a higher level, you can subclass the InternetPipe or the JadeInternetTCPIPConnection class or both, and the readPipeCallback and the sendReply methods can be reimplemented (not recommended if using the rest of the standard framework, unless inheritMethod is called).
_executeMethod Another user exit is provided so that if one of the parameters returned from the browser has a name of _executeMethod, the framework assumes that a user method is to be executed. The value of this parameter must have the format :: where method name has to be prefixed with web_ (to prevent the execution of unauthorized methods). This user exit can be used, for example, to generate XML data to return to a client browser that made this request using scripting. Executing code this way bypasses the framework’s session handling so the currentSession system variable will be null if referenced in any of the methods that get called. If this method does not exist, a default error page is returned. This error page can be customized by reimplementing the Application::executeMethodNotFoundMessage method in the current schema’s application subclass. Form Methods These methods do not affect the process flow, but are included here for completeness. Method generateHTML
Purpose This method returns a string representing the HTML for the form. In the parameters you can specify the following. includeDefaultSessionInfo : Boolean
If set to true, generates session information useControlNames: Boolean
By default, the framework uses object ids for the generation. This is to handle cases where controls were created dynamically but were not given unique names. If this parameter is set to true, control names are used. generateFormDataOnly: Boolean
A setting of true for this parameter will generate only the HTML between the and tags. You are then free to add HTML or scripting code before and after this tag. internetExplorerOnly: Boolean
A setting of true for this parameter will generate code that works correctly with only IE4+ browsers. The default is to generate HTML 3.2. Method
Note that the ACTION attributes for the tag and internal hyperlinks will not be set up correctly. To generate HTML with a fixed protocol, machine name, and virtual directory, use the generateHTMLStatic method defined below. Same as generateHTML except it takes three more parameters: machineName: String
The machine name to use when generating the ACTION attribute for the tag or when generating hyperlinks. virtualDirectory: String
The virtual directory name to use when generating the ACTION attribute for the tag or when generating hyperlinks. protocol: String
The protocol to use when generating the ACTION attribute for the tag or when generating hyperlinks. The value of this parameter should be HTTP or HTTPS. Application Methods The following methods defined in the Application class are for detecting certain error conditions. All of these methods can be reimplemented. Method executeMethodNotFoundMessage
Purpose This method is called when JADE receives an _executeMethod request and the method does not exist. The following response is returned to the browser.
Method Not Found The method that you are trying to execute is not available or is invalid. Please try a different operation. invalidWebSessionMessage
This method is called when a request is made with a session id that is not valid. The following default response is returned to the browser.
Invalid Web Session The session id is no longer valid. Please refresh your browser.
Method licencesExceededMessage
Purpose This method is called when there are no more licences to start up a new HTML Thin Client session. This method can be reimplemented. The following default response is returned to the browser.
Number of Licenses Exceeded Please try again later.
minimumResponseTimeExceededMsg
This method is called when the processing of the request exceeds the minimum response time specified in the application options. The following default response is returned to the browser.
Minimum Response Time Exceeded The allowed response time has been exceeded. Please retry your operation. timedOutSessionMessage
This method is called when the time difference between the time of the last request and the time of the current request exceeds the timeout specified
in the application options. The following response is returned to the browser.
Session Timed Out Your session has timed out. Please sign on again.
Internationalization The HTML Thin Client supports internationalization. When a browser user first connects to the application, JADE obtains all of the languages that have been defined for this user from the Web server. It then searches for a locale in the user schema that matches one of these languages. As soon as one is found, this locale is set as the locale for the session. If no matching locales are found, the application’s default locale is used. Please refer to the browser documentation on setting up languages for your browser of choice. An alternative way of handling multiple-language systems is to provide the user with a way of selecting the desired language and setting up the appropriate locale in the JADE application whenever a session connects.
Futures Web Services Support for Web Services will be incorporated in the next release of JADE.
Appendix A: Apache Server Connections Refer to “HTML Thin Client – HTML Documents”, for details.
Appendix B: Jadehttp Initialization File Refer to “HTML Thin Client – HTML Documents”, for details.
Appendix C: Configuring Apache Refer to “HTML Thin Client – HTML Documents”, for details.
Appendix D: Initialization File Refer to “HTML Thin Client – HTML Documents”, for details.
Appendix E: Directory Structure Refer to “HTML Thin Client – HTML Documents”, for details.
Appendix H: ASP.NET Web Forms The .NET platform includes a framework called ASP.NET for designing applications to run on Web browsers. A feature of this framework is Web Forms. Web Forms can be created using Visual Studio.NET. The following test was carried out using Beta 2 (SR1) of the .NET Framework and Visual Studio. The form layout was set to GridLayout and the target browser was set to Netscape, as this is the option that most-closely matches the Compatibility Mode option in the Jade HTML Thin Client. Setting the target browser to IE 5 generates absolute positioning code. The form was painted to look similar to that of Figure 7. In the Visual Studio.NET designer, it looks like the following:
Figure 12 shows the end result of the generation on Internet Explorer 6.0.
Figure 12 Figure 13 shows the same form under Netscape 4.7.
Text boxes have the default length
Width increased to fit text
Labels are wrapped around
Figure 13 The Web Forms implementation uses the same technique as the JADE HTML Thin Client implementation to position controls (that is, by using the TABLE tag) when generating for Netscape 4.0 (in JADE terms, compatibility mode) and when generating for IE 5 it uses absolute positioning. In Figure 13, the beta version of ASP.NET generates the default length for text boxes (with the default property settings). The browser, to be able to display the longest text in the combo box, increases the width of the combo box. This causes other controls to be realigned, as was the case with JADE. The difference, however, is that the .NET implementation wraps the text and the JADE implementation does not.
For completeness, Figure 14 shows the results of generation for Netscape when the width of the combo box is increased to fit the widest text at design time. The resulting display is closer to the original design.
Text is closer to the left text box than designed
Figure 14 The ASP.NET framework is new technology that will require investment in resources to be able to use it effectively, even if your organization already has people who are already familiar with Visual Studio, VB, HTML and ASP. The HTML Thin Client technology is an integral part of JADE and a JADE developer needs no additional training to develop an HTML Thin Client application.