Combining kbmmw and kbmwabd for kbmwabd v and kbmmw v

Similar documents
Creating a Webserver in 5 minutes using kbmmw!

Resolving for kbmmw v Pro, ProPlus and Enterprise Editions

Eastern Mediterranean University School of Computing and Technology. ITEC319 Rapid Application Development

Intraweb versus Morfik

Connect for SAP (NetWeaver)

Remobjects for Webservices

THREE. Multiple windows

kbmmw and Windows Performance Monitor

Getting started with Lazarus

Connect for SAP (Classic)

Le nouveau Morfik est arrivé (The new Morfik has arrived)

RAD Server (EMS) and TMS WEB Core

Delphi MVC Framework. Mathias Pannier

A method is a procedure that is always associated with an object and defines the behavior of that object.

Text box. Command button. 1. Click the tool for the control you choose to draw in this case, the text box.

C# Programming: From Problem Analysis to Program Design. Fourth Edition

Debugging. Thus the typical developer, develop according to what is defined as a waterfall model:

C# Syllabus. MS.NET Framework Introduction

Recipes4Success. FileMakerPro6

DataSnap 2009 Overview

Datastore metadata for kbmmw v

For more detailed information on the differences between DelphiScript and Object Pascal, refer to the DelphiScript Reference document.

SteelCentral Packet Analyser Walkthrough

First Visual Basic Lab Paycheck-V1.0

Lesson 1: Turbo Start

This document is intended for Multilizer users that have been localizing software using component localization.

unigui Developer Manual 2016 FMSoft Co. Ltd.

HelpAndManual_unregistered_evaluation_copy NET Reports 3.0

Getting Started with Access

DbSchema Forms and Reports Tutorial

Event-based Programming

The following content has been imported from Legacy Help systems and is in the process of being checked for accuracy.

DbSchema Forms and Reports Tutorial

(1) Trump (1) Trump (2) (1) Trump ExampleU ExampleP (2) Caption. TrumpU (2) Caption. (3) Image FormTrump. Top 0 Left 0.

Visual Basic 6.0 Handout 5 Deere & Company

CSC 330 Object-Oriented

The scripting system handles two types of components: Visual and Non-visual components.

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS

<Insert Picture Here> The Latest E-Business Suite R12.x OA Framework Rich User Interface Enhancements

CERTIFICATE IN WEB PROGRAMMING

Fundamentals of Database Development (with Delphi) DB/1

MetaReport Metamatica Software

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Database Development with dbexpress

Having fun with Delphi and AMQP starter

Using Windows Explorer and Libraries in Windows 7

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

Collection Views Hands-On Challenges

Database charts. From tutorial files: Database charts. Contents

1 Installing the ZENworks Content Reporting Package

Tutorial - Hello World

Getting started with Morfik: Creating a GUI

About the Author... xiii Introduction... xiv Acknowledgments and Thanks... xv Terminology... xvii Sample Code... xvii

Creating Accessible Web Sites with EPiServer

PowerPoint Tips and Tricks

Geographical Information Systems Institute. Center for Geographic Analysis, Harvard University. LAB EXERCISE 1: Basic Mapping in ArcMap

INTViewer Tutorial Cube Tutorial

Prototyping a Swing Interface with the Netbeans IDE GUI Editor

TMS FNC Object Inspector

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

INFORMATION SEARCH POWERING SUCCESSFUL PRACTICES TM VETERINARY SOLUTIONS

ASP.NET: Hands-on Introduction

MerlinX Extension. For Adobe Creative Cloud Applications. MerlinOne Inc. 17 Whitney Road Quincy, MA T (617)

VUEWorks Report Generation Training Packet

Dynamic Event Handling

GIS Virtual Workshop: Creating a Final Map

Exercises for Delphi Advanced Programming Technology (English Version)

Calendar Management A Demonstration Application of TopBraid Live

Delphi Generics.Collections

Center for Faculty Development and Support Making Documents Accessible

Software Release Communication 02/07/2014. Topics covered. Solutions You Can Count On

DELPHI FOR ELECTRONIC ENGINEERS. Part 5: measuring with the sound card COURSE

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

Lesson 1. Hello World


2017/ st Sec Final revision Final revision

Create & Use Your Own Teaching Website BJORN CANDEL FUJAIRAH MEN S COLLEGE

Webnodes Developers Quick Guide

Prentice Hall CBT Systems X In A Box IT Courses

Bouml Tutorial. The tutorial must be read in order because I will not repeat each time the general commands to call a menu etc...

Copyright Notice SmartBear Software. All rights reserved.

A Guide to CMS Functions

A demo Wakanda solution (containing a project) is provided with each chapter. To run a demo:

ITNP43 HTML Practical 2 Links, Lists and Tables in HTML

4 BSM FOUNDATION BOOTCAMP

Visit for more.

Chapter 1 Getting Started

JScript Reference. Contents

User Guide. Cloud Connect App Board

Java Application Development

Website Pros Database Component. v

Getting started 7. Setting properties 23

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011

Griffin Training Manual Grif-WebI Introduction (For Analysts)

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

UICapture Macintosh Training Session

Copyrighted Material. Copyrighted. Material. Copyrighted

Diploma Thesis. XSLGui. A Graphical Template Editor for Web Content Management. Patrick Büchler, D-INFK February 28th 2003

Assignment 1. Application Development

Transcription:

Combining kbmmw and kbmwabd for kbmwabd v. 2.44+ and kbmmw v. 1.00+ The combination of kbmwabd and kbmmw gives a very powerful web application setup with advanced database handling and separation of business logic from the web server itself. A 4-tier solution. It is really pretty easy to use kbmmw with kbmwabd. If you have already used kbmwabd with databases, you will already have seen some of the techniques needed to combine it with kbmmw. The purpose of this whitepaper is to create a relatively simple web application as a front end to the standard kbmmw demo server (in this whitepaper we use the BDE server, but any other compatible demo server can be used). Preparing for building the web application First we start the demo application server to have something to work against and make sure to click on Listen to activate the server. This makes the application server ready for clients to contact it. 1

Building a web application the RAD way Now we must start a new web application using kbmwabd. In Delphi (version 6 used for this whitepaper) create a new DLL This gives us an empty DLL skeleton. 2

Then we add two new TDatamodules, one which in the kbmwabd terminology is called the session manager module, and the other which is called the session module. The session module is the one producing the web pages for a client browser. The session manager module is the one controlling the lifetime of the clients connected and lots of other administrative stuff. Read more about it in the document kbmwabd_gettingstarted.pdf document which can be downloaded at www.components4developers.com from the kbmwabd products page. Thus select File->New->Datamodule or File->New->Other and select Data Module: This created an empty datamodule (TDatamodule1) which will serve as our session manager module. Then add another datamodule the same way. This new one (TDatamodule2) will serve as our session module. Now your DLL project contains two datamodules. On TDatamodule1 add a TWABD_SessionMgr component: 3

On TDatamodule2 add a TWABD_Session and a TWABD_Form component: Set the MainBody property of the WABD_Session1 component to WABD_Form1. Now back to TDatamodule1 (the session manager module) where we have to fill in some code in the OnCreateSession and OnDestroySession events of the TWABD_SessionMgr. Before doing that we need to add Datamodule2 to the uses section by File->Use Unit and select Unit2. Make the OnCreateSession event look like the following: procedure TDataModule1.WABD_SessionMgr1CreateSession( var NewSession: TWABD_Session; Request:TWABD_CustomRequest); begin with TDataModule2.Create(nil) do NewSession := WABD_Session1; end; 4

Make the OnDestroySession event look like the following: procedure TDataModule1.WABD_SessionMgr1DestroySession( Session: TWABD_Session); begin Session.Owner.Free; end; Finally we need to add a little code to the initialization section of Unit1.pas (TDatamodule1) - right before the final end. statement: Initialization DataModule1 := TDataModule1.Create(nil); These operations should make your complete unit1.pas look like this: unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, WABD_Objects,WABD_Request; type TDataModule1 = class(tdatamodule) WABD_SessionMgr1: TWABD_SessionMgr; procedure WABD_SessionMgr1CreateSession(var NewSession: TWABD_Session; Request: TWABD_CustomRequest); procedure WABD_SessionMgr1DestroySession(Session: TWABD_Session); private { Private declarations } public { Public declarations } end; var DataModule1: TDataModule1; implementation uses Unit2; {$R *.DFM} procedure TDataModule1.WABD_SessionMgr1CreateSession( var NewSession: TWABD_Session; Request:TWABD_CustomRequest); begin with TDataModule2.Create(nil) do NewSession := WABD_Session1; end; procedure TDataModule1.WABD_SessionMgr1DestroySession( Session: TWABD_Session); begin Session.Owner.Free; end; initialization DataModule1 := TDataModule1.Create(nil); end. This is just about the same setup you would get by using basic.zip as the base for your web application. This is a good point to save your web application. 5

Getting kbmmw into the picture Now we need to add a little kbmmw functionality to it. We would like to display the result from a query on a web browser and issue a call to the inventory service to list the different services available for the clients to use. First add a TkbmMWClientTCPIPIndyTransport, a TkbmMWClientConnectionPool and a TkbmMWPooledSession to the Session manager module: Connect the kbmmwclientconnectionpool1.transport property to the kbmmwtcpipindyclienttransport1 component. Connect the kbmmwpooledsession1.connectionpool property to the kbmmwclientconnectionpool1 component. Set the SessionName of the kbmmwpooledsession1 component to something. Eg. DEMO Set the Host and Port properties of the kbmmwtcpipindyclienttransport1 to the IP address and port number of the kbmmw based server. If its running on the same machine as you are developing on, simply write 127.0.0.1 for Host and 3000 for Port. These steps have now prepared the web application for connection to the application server. 6

Preparing the session module for kbmmw Before designing the web pages, we need to prepare the session module by adding a few kbmmw components. Add a TkbmMWPooledSimpleClient, a TkbmMWClientQuery, a TkbmMWBinaryStreamFormat and a TDataSource to the Session module (TDatamodule2): In File->Use Unit select Unit1. This gives access to TDatamodule1 s components from TDatamodule2. The pooled simple client will be used for getting the inventory from the application server. The clientquery and binary stream format are going to be used to get the results of a query from the application server. Set the kbmmwclientquery1.transportstreamformat property to point on kbmmwbunarystreamformat1. Set the kbmmwclientquery1.sessionname to DEMO (the same name as the TkbmMWPooledSession.SessionName). Set the kbmmwpooledsimpleclient1.connectionpool to point on the kbmmwclientconnectionpool1 on TDatamodule1. Set DataSource1.Dataset to point on the kbmmwclientquery1 component. 7

Designing the page layout A very easy way to design a dynamic web page in kbmwabd in to add display elements to the TWABD_Form. This is done via the form editor. Double click the TWABD_Form on TDatamodule2: Add a TWABD_FormSection, and a TWABD_DataTable (select them in the combobox and click Add ). Select WABD_DataTable1 and set its visible property to false. Then in the Top Level Objects list select the WABD_FormSection you just added: 8

The formsection is a container for other form elements like text boxes, labels, buttons etc. The datatable is a higher level component which resembles a TDBGrid, but only for the web. Click Edit Form Section to start designing the contents of the formsection container. Now we add a TWABD_Label, two TWABD_Button s and a TWABD_Memo: The components can be pulled to the wanted placement, and resized by dragging the little blue cornermark on them when they are selected. 9

Select the WABD_Label1 to change its caption: Select WABD_Button1 to change its caption and write some code in its OnUserClick event: The code in the OnUserClick event is executed the moment the client clicks the Inventory button on the web page. Write the following code in the OnUserClick event: procedure TDataModule2.WABD_Button1UserClick(Sender: TObject); var v:variant; begin v:=kbmmwpooledsimpleclient1.request('kbmmw_inventory','','',[]); WABD_Memo1.Lines.CommaText:=v; end; This will contact the application server and ask for a list of services. The list will be returned in a commatext format directly usable for presentation by the WABD_Memo component. 10

Next is to give TWABD_Button2 another caption and write some event code for it: Make the event handler look like this: procedure TDataModule2.WABD_Button2UserClick(Sender: TObject); begin kbmmwclientquery1.query.text:='@all_events'; kbmmwclientquery1.open; WABD_DataTable1.Visible:=true; end; What it does is to request the result of a predefined (named) query on the application server. The query could contain a complete SQL statement instead if you would like that as long the application server accepts client side SQL. What is missing now is to display the result of the query. That s why we have added a TWABD_DataTable. Select the TWABD_DataTable from the TWABD_Form s formeditor and set its DataSource property to point on the DataSource1 component. Now save it all, and compile it. To run it, either use Internet Information Server 4 or newer from Microsoft, or use wwwserver which can be downloaded for free from www.components4developers.com 11

Running the creation After starting the webserver, access the ISAPI dll. Eg: http://localhost/project1.dll You will get a screen similar to this: 12

Click the Inventory button, and the web application will make a call to the application server and show the services defined as public services on the server in the WABD_Memo1 text area: 13

Now click on the Query button to have the query executed on the application server: 14

That concludes the whitepaper of how to combine kbmmw and kbmwabd. Best regards Kim Madsen kbm@components4developers.com 15