POWERBUILDER IS HERE - SYS-CON · PDF fileUsing a Win32 API function from the Win32 library 20...
Transcript of POWERBUILDER IS HERE - SYS-CON · PDF fileUsing a Win32 API function from the Win32 library 20...
www.PowerBuilderJournal.com
POCKET POWERBUILDER IS HEREU.S. $15.00 (CANADA $16.00)
Focus: From the Trenches: Users Oscar Ramirez
Like to Sort and Filter …but they don’t like sort and filter expressions PART 1 6
PBDJ Feature: PowerBuilder Berndt Hamboeck
and Colors Calculating color values 12
From Sybase: It’s Time for Pre-8.0 Users Sue Dunnell
to Update Their PowerBuilder Version d 16
Book Excerpt: New Client/Server rBob Hendry
DataWindow Features 18
PBDJ Feature: Common Controls PART 1 Regan SizerUsing a Win32 API function from the Win32 library 20
Product Review: Quma Olan Knight
Version Control System 24
UML: PowerDesigner and David Dichman
PowerBuilder Using UML improves developer productivity 26
ROI: Maximizing the Return on Your Joe Fritsch
Investment in PowerBuilderPrepare for the future 28
Enterprise Application Studio JUNE 2003 - Volume: 10 Issue: 6
RETAILERS PLEASE DISPLAY UNTIL AUGUST 31, 2003
$15.00US $16.00CAN
Visual Basic Is Evilby Bob Hendry pg. 4
From the Co-editors Pocket PowerBuilder
by John D. Olson pg. 3
Industry Announcementsby Bruce Armstrong pg. 34
0 09281 03424 7
0 6
MULTI-PACK ORDER
SUBSCRIBE TODAYand get up to 3 FREE CDs!
SEE DETAILS ON PAGES 32 & 33
SAVE UP TO $400(WHILE SUPPLIES LAST)
2 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
AmyuniTechnologies, Inc.
www.amyuni.com
3www.POWERBUILDERJOURNAL.com PBDJ volume10 issue6
E D I T O R I A L A D V I S O R Y B O A R DBRUCE ARMSTRONG, MICHAEL BARLOTTA, ANDY BLUM,
RICHARD BROOKS, KOUROS GORGANI, BAHADIR KARUV, PH.D.,BERNIE METZGER, JOHN OLSON, SEAN RHODY
COEDITOR-IN-CHIEF: JOHN OLSONCOEDITOR-IN-CHIEF: BOB HENDRYEXECUTIVE EDITOR: NANCY VALENTINEASSOCIATE EDITOR: JAMIE MATUSOW ASSOCIATE EDITOR: GAIL SCHULTZ ASSOCIATE EDITOR: JEAN CASSIDYASSOCIATE EDITOR: JENNIFER VAN WINCKEL
ONLINE EDITOR: LIN GOETZTECHNICAL EDITOR: BERNIE METZGER
NEWS EDITOR: BRUCE ARMSTRONGDATAWINDOWS EDITOR: RICHARD BROOKS
W R I T E R S I N T H I S I S S U EBRUCE ARMSTRONG, DAVID DICHMAN, SUE DUNNELL, JOE FRITSCH,BERNDT HAMBOECK, BOB HENDRY, OLAN KNIGHT, JOHN D. OLSON,
OSCAR RAMIREZ, REGAN SIZER
S U B S C R I P T I O N SFOR SUBSCRIPTIONS AND REQUESTS FOR BULK ORDERS,
PLEASE SEND YOUR LETTERS TO SUBSCRIPTION DEPARTMENT
SUBSCRIPTION HOTLINE: 888 303-5282COVER PRICE: $15/ISSUE
DOMESTIC: $149/YR. (12 ISSUES) CANADA/MEXICO: $169/YR.OVERSEAS: BASIC SUBSCRIPTION PRICE PLUS AIRMAIL POSTAGE
(U.S. BANKS OR MONEY ORDERS). BACK ISSUES: $12 U.S., $15 ALL OTHERS
PRESIDENT AND CEO: FUAT A. KIRCAALIVICE PRESIDENT, BUSINESS DEVELOPMENT: GRISHA DAVIDA
SENIOR VP, SALES & MARKETING: CARMEN GONZALEZPRODUCTION CONSULTANT: JIM MORGAN
VICE PRESIDENT, SALES & MARKETING: MILES SILVERMANACCOUNTS RECEIVABLE KERRI VON ACHEN
FINANCIAL ANALYST: JOAN LAROSEACCOUNTS PAYABLE: BETTY WHITE
ADVERTISING DIRECTOR: ROBYN FORMADIRECTOR, SALES & MARKETING: MEGAN RING-MUSSA
ADVERTISING SALES MANAGER: ALISA CATALANOASSOCIATE SALES MANAGER: CARRIE GEBERTASSOCIATE SALES MANAGER: KRISTIN KUHNLE
PRESIDENT, EVENTS: GRISHA DAVIDACONFERENCE MANAGER: MICHAEL LYNCH
ART DIRECTOR: ALEX BOTEROASSOCIATE ART DIRECTOR: LOUIS F. CUFFARIASSOCIATE ART DIRECTOR: RICHARD SILVERBERGASSISTANT ART DIRECTOR: TAMI BEATTY
VICE PRESIDENT, INFORMATION SYSTEMS: ROBERT DIAMONDWEB DESIGNER: STEPHEN KILMURRAYWEB DESIGNER: CHRISTOPHER CROCE
CIRCULATION SERVICE COORDINATOR: NIKI PANAGOPOULOS CIRCULATION SERVICE COORDINATOR: SHELIA DICKERSON
JDJ STORE: RACHEL MCGOURAN
E D I T O R I A L O F F I C E SSYS-CON MEDIA
135 CHESTNUT RIDGE ROAD, MONTVALE, NJ 07645TELEPHONE: 201 802-3000 FAX: 201 782-9600
POWERBUILDER DEVELOPER’S JOURNAL (ISSN#1078-1889) is published monthly (12 times a year) for $149 by
SYS-CON Publications, Inc.,135 Chestnut Ridge Rd., Montvale, NJ 07645 Periodicals Postage rates are paid at
Montvale, NJ 07645 and additional mailing offices.POSTMASTER: Send address changes to:
POWERBUILDER DEVELOPER’S JOURNAL, SYS-CON Publications, Inc.,135 Chestnut Ridge Rd., Montvale, NJ 07645
© C O P Y R I G H TCopyright © 2003 by SYS-CON Publications, Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by anymeans, electronic or mechanical, including photocopy or any information storage andretrieval system, without written permission. For promotional reprints, contact reprint coordinator Carrie Gebert. SYS-CON Publications, Inc., reserves the right to revise,republish and authorize its readers to use the articles submitted for publication.
All brand and product names used on these pages are trade names,service marks or trademarks of their respective companies.
SYS-CON Publications, Inc., is not affiliated with the companies or products covered in PowerBuilder Developer’s Journal.
FROM THE CO-EDITOR
John D. Olson is principal of Developower, Inc., a consulting company specializing in software solutions usingSybase development tools. A CPD professional and charter member of TeamSybase, he is a coauthor of SYS-CON’s
Secrets of the PowerBuilder Masters books, and co-editor and author of two upcoming PB9 books.
Pocket PowerBuilderIt’s very cool!
My addiction began on Christmas 1997 when I received a PalmPilot as a gift. At first I foughtit and continued to keep information in my head and even write some of it down in anancient book called a “datymr,” a rough translation being “keeper of important stuff.”
Those books have since become obsolete, replaced by electronic organizers that allow storageof thousands of pages of information, quick searches, and can be easily backed up in minutes.The one time I lost my Day-Timer, I promised I would never again become so dependent onsomething so easily misplaced. But as with most New Year’s resolutions, it gave way to mypractical need to write down information rather than try to remember everything.
When the PalmPilot was given to me, I was skeptical of its abilities, but knew that my reliance onthe ancient book would eventually result in another loss. The addiction took hold over the first fewweeks that I owned the PDA. It took me a few weeks to put all my information in it and to retire myDay-Timer. Once the transition was complete, I became thoroughly dependent on the PalmPilot. Icouldn’t be without it for even a few hours. In a nightmarish series of events during a vacation inEurope, my Palm was destroyed and two weeks of my travel journal and other data input was lost.After that I upgraded, then again, and again. Finally, I combined my phone and Palm and am nowso thoroughly dependent on this device that it never leaves my side, except when I go swimming.
For years I’ve heard people say that the next great market for software will be for mobiledevices, so a few years ago I built some simple applications using Code Warrior and Adaptive SQLAnywhere. They weren’t that impressive, especially when compared to client/server applicationsbuilt with PowerBuilder. If I could have built applications easily, I might have built some share-ware utilities, but it was a hassle and I quickly moved on to other things. Over the past few years,many PB developers have begged Sybase to create a PB version that would deploy to the PalmO/S, but it wasn’t feasible. Deploying to Windows CE was, but the WinCE PDAs were not verygood, had very poor battery life, and weren’t well accepted by the public. Times have changed andproducts have evolved. Pocket PC devices, which run WinCE, are the hottest PDAs available. ThePalm O/S is losing ground because real applications can now be run on WinCE PDAs. Imaginegiving a PowerPoint presentation by hooking your Pocket PC into an overhead projector. Thesedevices now have real computing power and a powerful O/S.
With WinCE, the PDA market has truly opened up for the development of horizontal andvertical applications. PDA software no longer needs to offer only a small portion of your enter-prise functionality. Imagine taking your enterprise application and deploying large portions ofit to handhelds! Pocket PowerBuilder will allow just that! This new product from Sybase looksjust like PowerBuilder and is only limited by the confines of PDAs, such as the smaller screensize (form factor). Windows, DataWindows, nonvisual objects, and many other PB client/serv-er features can be used. You can take your existing enterprise applications, pull out the inter-faces you want to deploy to handhelds, make some modifications for screen size and otherlimitations, implement data synchronization, and in no time have it up and running onPocket PCs. To users it could look like the same application they run on their workstation!
My technical summary can be made in three words: it’s very cool!For more information and to get your hands on Pocket PowerBuilder, go to
www.sybase.com/pocketpb and sign up for the beta program. Watch for more articles on thistopic in future issues, demonstrations in the touring PowerBuilder Roadshow, and lots of fan-fare at TechWave 2003.▼
JOHN D. OLSON, EDITOR-IN-CHIEF
4
FROM THE CO-EDITOR
Over the past six months I have beenworking with programmers withVisual Basic backgrounds. Usuallythis is a recipe for disaster – like get-
ting dog people and cat people in thesame room. With the .NET languages infull swing, and PowerBuilder trans-formed into a language we would nothave recognized only three years ago,this whole thing about PowerBuilderversus Visual Basic has become out-moded and irrelevant. Now I would liketo take one parting shot at the worstclient/server language ever invented –Visual Basic.
Over my cube wall I can sometimeshear debates about using “data bound”versus “non-data bound” controls. I’veoften heard murmurs of such discus-sions but never paid them much mind.Take a quick peek at Visual Basic–relatednewsgroups and you’ll see them cloggedwith questions on how to bind databasecolumns to this-and-that control and soon. They start with, “Can anyone tell mehow to bind my DataGrid to an ADOcontrol?” “Why yes! First you build a….”The thread ends with “Thank you. Yourock dude!”
No dude, you don’t rock. Binding datato controls is a one-way ticket to hell.Visual Basic should never have allowedthis concept. I can only draw the con-clusion that Visual Basic is evil.
In the beginning, Visual Basic allowedpeople to take a programming class incollege and call themselves program-
mers. Drunk with the debauchery of thedot-com era, herds of nontechnical peo-ple learned Visual Basic so they couldcash in on the large salaries of the day.This is how it worked. First, the profes-sor shows the class how to drag-and-drop controls on the form to demon-strate how simple programming reallyis. After a remedial session on loopingconstructs and decision blocks, it’s timeto talk databases. Almost nothing ismentioned about relational, databasedesign, or implementation. Now it’stime to connect the database to the con-trols. With a few simple drag-and-drops,or by using a data wizard, the data fromthe database columns magicallyappears in controls such as a TextBox orDataGrid. The whole class beams withtheir accomplishment. High fives allaround. No dude, you don’t rock.
Better yet, the class is introduced tothe Visual Basic data environment – setup the connection, add a Commandclass or two, and then drag this beautifulcreation onto the form. The data envi-ronment will even create all the neces-sary TextBoxes for you. Another scenariois for the class to build a Web site usingWeb classes. Not only are you a program-mer, but a Web developer. Yaaaa-hooo!
Why are data binding, data environ-ment, and various associated wizards soevil? They limit you, the programmer.They prevent you from becoming better,making more money, and getting pro-motions. You don’t know what happens
behind the scenes, so when somethinggoes wrong, you’re so lost. Also, databinding locks you in – when you have togo beyond its abilities (which happens inall but the most trivial apps), it’s incredi-bly difficult to break through its limits.
What are the practical problemsyou’ll encounter with data binding? Thefirst one you’re likely to run into veryquickly is the inability to exercise dataconcurrency control. Say you have twousers accessing the same row of data.This is difficult enough to control withADO – with data binding it’s nearlyimpossible. The second, much more dif-ficult problem to resolve, you’ll run intolater, when the product has alreadybeen designed and written. This is theinability of the data binding engine toadjust itself to your database situation.The data binding engine does not knowwhere your database is, whether thepipe the data is traveling through is highor low bandwidth.
As a PowerBuilder programmer, Icould not care less about Visual Basic.The problem I have is when organiza-tions realize that Visual Basic wasdesigned for toy applications. At thispoint they move on to more robust tools,like PowerBuilder. Then the swarms ofVisual Basic programmers scream aboutthe inadequacies of PowerBuilder. Ioften hear “PowerBuilder does not sup-port data binding!” or “This was so mucheasier in Visual Basic.” Pass me the tis-sues. You should have never learnedVisual Basic in the first place.
With pure client/server languages inthe twilight of their careers, existingVisual Basic applications will either bemigrated to VB.NET or left to die on thevine. Rest in peace Visual Basic; I will notmiss you.▼
PBDJ volume10 issue6 www.POWERBUILDERJOURNAL.com
WRITTEN BYBOB HENDRY
AUTHOR BIOBob Hendry is a PowerBuilder instructor for Envision Software Systems and a frequent speaker at national and international PowerBuilder conferences.
He specializes in PFC development and has written two books on the subject, including Programming with the PFC 6.0.
Visual Basic Is Evil
“Binding data to controls is a one-way ticket
to hell”
5www.POWERBUILDERJOURNAL.com PBDJ volume10 issue6
Sybasewww.sybase.com/powerbuilder
www.POWERBUILDERJOURNAL.com6 PBDJ volume10 issue6
WRITTEN BY OSCAR RAMIREZ
The sort and filter window initially displaysthe columns in the browser DataWindow, butany sort and filter expressions currently set arenot interpreted. This design was satisfactory atfirst because the understanding was that thesort and filter expressions would be simple. Asusers became familiar with the user interface,they started to build more complicated expres-sions. They weren’t happy when they had tomodify an existing criteria by re-creating theentire expression only to add one more vari-able. An enhancement was in order.
Furthermore, users started to ask if theycould save the expressions they built so theycould just pick from a list, giving them the abili-
ty to switch views in their browsers very quickly. This article reviews how we went about
implementing a solution to this user request.I’ll lay the foundation by explaining how theinitial design works and then show how weimplemented the two new requirements.
This two-part article covers the followingDataWindow concepts:1. How to inspect all the objects defined inside
a DataWindow object dynamically2. How to examine each object and find its
data type, object type, and other properties3. How to keep track of the precedence of
columns in the sort criteria (e.g., Name Asc,State Desc or State Desc, Name Asc)
4. How to let users choose which columns theywant to see in their browser (from a prede-fined set)
5. How to control a DataWindow control in onewindow from the response window wherethe user is defining the sort and filter criteria
6. How to take the sort and filter expression theDataWindow object stores in its definitionand display it back on the defined user inter-face
7. How to store the sort and filter criteria forsubsequent sessions
Part 1 covers concepts 1 through 4; Part 2will cover concepts 5 through 7.
Design OverviewFigure 2 shows the response window’s
design. The window may be associated withany grid DataWindow object. The reference tothe grid DataWindow is passed via the Messageobject. When the response window is renderedon the screen, the list of all the columns andcomputed fields in the grid DataWindow (let’scall it the browser) are shown as rows in theSort/Filter and Display tab pages.
The Display tab page lets users choosewhich columns they want to view in the brows-er. The interface here is simple and to thepoint: users check the columns they want dis-played. Our application serves hundreds ofusers in offices around the globe, and satisfy-ing everyone is difficult. Over the years manycolumns have been added to the browser, buteach new column may have a limited interest-ed audience. With this tab, each region can settheir browser as best suits their businessrequirements.
The Syntax tab page is for debugging pur-poses only. I have a configuration setting thatallows me to sign in to the application in“debug” mode. Only in this mode is this tabpage enabled. The page displays the sort andfilter expressions in their “raw” format. Inother words, I write into these multi line editcontrols the expressions stored in the
…but they don’t like sort and filter expressionsPart 1
The application I currently maintain has ageneric sorting and filtering window thatallows users to reduce the number andorder of the rows they view on any of their
browsers. The design took into considerationthat our users don’t want to learn PowerBuildersyntax to build a sort or filter expression. Theyformulate their expressions using a simple userinterface (see Figure 1). Once they’re done, theinformation is interpreted, formatted into validsort and filter expressions, and applied to thebrowser DataWindow.
FOCUS
7PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
Table.Sort and Table.Filter attributes of thebrowser DataWindow object.
The Apply button, as its name implies,applies the logic to interpret the informationentered through the interface, builds theappropriate sort and filter expressions, andapplies them to the browser DataWindow. Thewindow remains open so users may see theresults of their work. This button is disableduntil a change is made. It remains enableduntil the user applies the changes.
The Reset button removes all sorting and fil-tering criteria from the Sort/Filter Data-Window. The user must then apply thechanges to the browser as mentioned in theprevious paragraph.
The OK button closes the dialog box, butwill first apply any changes not yet processed.The Cancel button closes the window withouttaking any action.
The DataWindow ObjectsThere are two Tabular External Data Source
DataWindows in this window: d_sortfilter andd_display. Figure 3 shows the definition ofd_sortfilter, and Figure 4 of d_display. TheDataWindow rows are inserted dynamically byreading the browser’s DataWindow object def-inition. Two columns in the DataWindowsidentify each column in the browser. The first,dbColumnName, is the PowerBuilder columnname. The second, columnName, is the dis-play name, which is set by using the browser’scolumn headers.
Initializing the DataWindowsThe code to initialize the three tabs is in the
of_initAlternate() function of the w_sortfilterwindow. The complete source code can bedownloaded from www.sys-con.com/pbdj/sourcec.cfm. This function, which is called inthe open event of w_sortfilter, uses the object’sattribute of the DataWindow to get a tab-delimited list of all the objects in the browserDataWindow. The syntax is:
ls_objects =
idw_target.Describe("DataWindow.Objects")
where idw_target is the browser DataWindowcontrol reference. This is an instance variableinitialized in the open event of w_sortfilter.
We are only interested in column and com-puted field objects, so we inspect each objectname we parse out of the ls_objects string vari-able using the following code:
ls_ObjectType =
idw_target.Describe(ls_ObjectName +
'.Type')
where ls_ObjectName is the object name parsedout of the ls_objects string. The object types forour objects of interest are “column” and “com-pute”. We ignore any other object types.
For each column and computed field weidentify its corresponding header to display its
text as the column name. We set a standardwhere all column and computed field headers inour browsers should have, as the object name,the name of the column they represent plus thesuffix “_t”. This already is the PowerBuilder stan-dard for columns. For computed fields you typi-cally have to add a header. You must be carefulto set the object name to the standard men-tioned above when building your DataWindows,or the column display name will be set to thecolumn’s PowerBuilder object name.
ls_ColumnLabel = ls_ObjectName + '_t'
ls_ColumnName =
idw_target.Describe(ls_ColumnLabel +
'.Text')
Finally we set the dbColumnName columnin d_sortfilter to the value in ls_Objectnameand columnName to the value ofls_ColumnName. We do this iteratively until allDataWindow objects are processed. Theresults may be found in Figure 1.
Tip: In a grid DataWindow, when you add acolumn after the DataWindow is first built, itgets added at the end. I added Full Name this
way, then moved it to the middle using thePreview section in the DataWindow painter.Yet, when I examine the objects, the Full Namecolumn is always listed at the end, regardlessof where I move it using Preview. How do youcontrol the order so that it shows in my listwhere it’s being displayed? Apply “Bring ToFront/Send To Back” to each column in theorder you want them to appear.
Identifying the Precedence of Sort Columns
Setting sort criteria is not hard: the user needonly specify whether the column should be sortedascending or descending. Given our user inter-face, though, we had the challenge of identifyingwhat the column precedence was when severalcolumns participated in the sorting expression.The sequence column in d_sortfilter (see Figure 3)is there to help us meet this requirement.
The user does not enter the sequence num-ber. The user interface keeps track of the orderin which the columns were selected. Users maytoggle a choice by clicking on the sort criteriaradio buttons. Using Figure 5 as an example, auser can remove sort choice number two by
FIGURE 1 The big picture
FIGURE 2 The sort, filter, and display dialog
8 PBDJ volume10 issue6 www.POWERBUILDERJOURNAL.com
clicking on the DESC radio button. This actionunchecks the button and removes the sequencenumber. If the same action is performed on sortchoice number one, the ASC radio buttonwould be unchecked, the sequence numberremoved, and all other sequence numbersreevaluated. In this case, sequence 2 willbecome sequence 1.
In the Clicked event of dw_sortfilter, we posta user-defined event, u_postclicked, where thecode is implemented. Why post an event? Soour code executes after PowerBuilder’sItemChanged event.
The DataWindow control’s Clicked eventthen has the following lines of code.
// If clicked field is the Sort Sequence
Field, then proceed.
IF dwo.Name = 'sortcriteria' THEN
this.EVENT POST u_postclicked(row)
END IF
The u_postclicked has the PowerScript logicprovided in Listing 1. In this listing,ib_SortChanged and is_PriorValue are instancevariables set in the ItemChanged event ofdw_sortfilter. The former is set to true when thesortcriteria column of d_sortfilter is modified.The latter stores the previous value of the sortcri-teria column (possible values are A, D, or null).
There are two distinct sections to theu_postclicked event. The first part (the IF) isexecuted only if the ItemChanged event wasexecuted, since that’s where we set thisinstance variable to TRUE. This code will exe-cute any time users change the value of thesortcriteria column from ascending todescending, or vice versa.
The ItemChanged event does not trigger if theuser clicks on the same radio button twice.Referring to Figure 5, if a user clicks on theascending radio button for Last Name, theItemChanged event does not fire, and theib_SortChanged instance variable would be set toFALSE when reaching the u_postclicked event. Inthat case, the ELSE portion of our script executes.
The IF section basically sets the sequencenumber to the next appropriate numericvalue. We have an instance variable,ii_MaxSequence, that helps in this endeavor.The ELSE portion of the code removes theradio button selection from the clicked row bysetting the sortcriteria column to null, as wellas removing the sequence number previously
assigned to it. Since we are removing asequence number, we must execute theu_recount event in which we resequence allother sequence numbers on the DataWindow(see Listing 2).
The key in the u_recount event is the hiddenDataWindow column maxSequence. This is acomputed field with its definition set tomax(sequence). It keeps track of the maximumsequence number value in the DataWindow atany time. We use this computed field to knowhow many values we need to look for in theDataWindow rows. This is better understoodwith an example.
Let’s say the user set four columns for his orher sort criteria. There would be sequence 1, 2, 3,4. If the user decides to remove the third columnin the criteria, we need to renumber 4 to 3. Theu_postclicked event’s ELSE portion of the codewould execute, leading us to the u_recountevent. When we arrive to u_recount, theDataWindow sequence column would have val-ues 1, 2, and 4, since the 3 was nullified inu_postclicked. When we get the value ofmaxSequence into the variable li_max, we wouldexpect the value 4 in this example. We then lookfor values 1 through 4 using the For/Next loop.We find 1, 2, and 4. Of course, we would not find3. The Find function would return a 0. Notice thatthe logic states that if li_next is not zero, we storethe row where we found the sequence in an array,and increment the variable J by 1. In our exam-ple, J would have a value of 3 by the time theFor/Next loop is done.
The second loop would go around threetimes, setting the sequence number sequen-tially up to the value of J. We know the rownumbers to set, since they’re stored in thelia_next[] array. Since we stored these rownumbers in the sequence in which we foundthem, the new sequence numbers preserve theorder of precedence originally desired by theuser. In our example, 4 becomes 3.
Setting the Filter CriteriaThe sign column is used for the filter criteria
and is a dropdown listbox with a specific set ofitems. These are the items required for ourbusiness operations. The signs defined by ourusers were =, >, <, >=, <=, IN, and NULL.
After selecting the sign, the user defines thefilterCriteria to go with the sign. These can be alist of values separated by commas (for the INsign), or a single value. Users do not have to
worry about quoting string values; they shouldnot have to worry about data types; that’s our job.
Translating DataWindowInformation into Sort and FilterExpressions
In Figure 5 we want to sort by Last NameAscending, State Descending, and they onlywant to see employees who started in 1995 orlater. We need to translate what’s on the screeninto the required PowerBuilder syntax. Thesort expression would be “emp_lname A,LookUpDisplay(state) D”. The filter expressionwould be “start_date > 1995-01-01”. The Statecolumn is a dropdown DataWindow so the sortexpression must be built using the displayvalue. This is more intuitive to users since it’sthe value they see on the browser they’re sort-ing. Note: The date format was set to a prede-fined format. This format is not the user’s con-cern. We take care of it in the code.
Two functions are used to build the neces-sary expressions: of_applySort() andof_applyFilter(). The complete listing for bothfunctions is in the source code.
The of_applySort() function determineshow many columns take part in the sort crite-ria by looking at the maxSequence computedfield. With this value, it loops that many timeslooking for sequence numbers from 1 to themaxSequence. When it finds the sequence, itgrabs the column name and does the appro-priate formatting based on the sort criteria andwhether the original browser column is a regu-lar column or a dropdown.
The dropdown code is worth noting. There isreally no way of directly knowing whether a col-umn is a dropdown listbox, a code table, or adropdown DataWindow. We indirectly look forthis information by checking the Values columnobject property. Only columns with an Edit Styleof dropdown listbox or code table have a list ofvalues. Unfortunately, dropdown DataWindowshave their own little category, and even thoughthey return “?” for values, we can specificallycheck the dropdown DataWindow name prop-erty to see if there’s an assigned name.
IF ls_Values = '?' THEN
// May be a DDDW.
IF idw_target.Describe(ls_Column+".DDDW.
Name") <> '?' THEN ls_Column =
"LookUpDisplay(" + ls_Column + ")"
END IF
FIGURE 3 The Sort/Filter DataWindow FIGURE 4 The Display DataWindow
9PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
Sybase, Incwww.sybase.com/pbextension
www.POWERBUILDERJOURNAL.com10 PBDJ volume10 issue6
ELSE
// Dropdown Listboxes and Code tables fall
in this category.
ls_Column = "LookUpDisplay(" + ls_Column
+ ")"
END IF
In either case we want to wrap the columnname with the LookUpDisplay function so thesort expression uses the values the user sees toimplement the sort order.
The of_applyFilter() function loops througheach row in dw_sortfilter and processes the rowonly if the sign column has a value. It’s worthnoting here that for the user’s convenience, ifthe filterCriteria column is filled but the sign isnull, the ItemChanged event of dw_sortfilterwill set the sign to an “=”. This is a conveniencefeature and you may want to refine it.
For each row where we find filter criteria, weexamine the column’s data type and whetherthe column will require a LookUpDisplay func-tion to be wrapped around it. This is the samecode used in the of_applySort() function.
I mentioned earlier that the user need notworry about the column’s data type whenentering filter criteria. As you can see from thesource code, it distinguishes between charac-ter, numeric, and date data types. It treats eachdifferently. Strings must be wrapped in quotes.Note specifically the code to treat the IN filtercriteria. In this case users enter several valuesseparated by commas. We need to individuallywrap each value with quotes.
For the date, we apply a date format weknow will be recognized properly by theDataWindow, regardless of what the userenters (within reason). The filter criteria col-umn is a string, so to use the String function toconvert the string to a proper format we coded:
ls_workString = String(Date(ls_workString),
"yyyy-mm-dd")
The String function accepts only dates in thefirst argument to format a date. If you pass it astring, it does not fail, but returns the mask(“yyyy-mm-dd”) instead of the formatted date
value. Figure 6 shows the resulting expressionsafter pressing the Apply button.
Controlling the Display of Columnsin the Browser
Finally, how do we implement the Displaytab? The d_display DataWindow has one checkbox that’s checked if the column is viewable inthe browser, and checked off if not. We imple-mented this using the Width attribute of thecolumn. We tried using the Visible attribute,but this led to an unexpected behavior. Aftersetting Visible to FALSE and then back toTRUE, the column kept changing locations.This was unacceptable, so we found a way todo it by setting the width to 0 when we did notwant the column viewable.
The of_applyDisplay() function implementsthis code (see the source code on the PBDJ Website). The function uses the GetNextModified()DataWindow function to see if any row wasmodified. For the modified rows, it inspects thevalue of the check box. If the check box ischecked, the value of the column widthattribute is set to 400, otherwise it’s set to 0.
SummaryIn Part 1, I explained the initial design of the
w_sortfilter window. In the process I showedyou how to inspect all the objects definedinside a DataWindow object dynamically; howto examine each object and find its data type,its object type, and other properties; how youcan keep track of the column precedence in thesort criteria; and how to let users choose whichcolumns they want to see in their browsers.
In Part 2 I’ll demonstrate how we imple-mented the users’ two new requirements. I’llshow you how we read the current browser’ssort and filter criteria and translated it into ouruser interface design. I’ll also show you how wepersisted our DataWindow settings so usersmay use them in subsequent sessions. ▼
AUTHOR BIOOscar Ramirez, an instructor and consultant, is currently working atGoldman Sachs, Inc., in New York City. He has been working withPowerBuilder since 1992. Oscar has spoken at several regional usergroup conferences and has written articles for PowerBuilderDeveloper’s Journal, and other technical journals.
FIGURE 5 Filled in DataWindow FIGURE 6 Resulting expressions after applying criteria
IF ib_SortChanged THENib_SortChanged = FALSEIF IsNull(is_PriorValue) THENii_MaxSequence++This.SetItem(al_row, 'sequence',ii_MaxSequence)This.PostEvent('u_recount')
END IFELSEthis.SetItem(al_row, 'sortCriteria', ls_null)this.SetItem(al_row, 'sequence', li_null)ii_MaxSequence --ii_MaxSequence = Max(ii_MaxSequence, 0)This.PostEvent('u_recount')END IF
integer I, J, li_max, li_next, lia_next[]
li_max = This.GetItemNumber(1, 'maxSequence')
FOR i = 1 TO li_maxli_next = This.Find("sequence = " + string(i), 1, il_NbrOfRows)IF li_next <> 0 THENJ++lia_next[j] = li_next
End IfNEXT
FOR I = 1 TO JThis.SetItem(lia_next[I], 'sequence', I) Next
ii_MaxSequence = J
Listing 2:
Listing 1:
11www.POWERBUILDERJOURNAL.com PBDJ volume10 issue6
Sybase, Incwww.sybase.com/powerbuilder
12 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
However, the following problem may haveoccurred: you want to create a cool window inwhich the data and the headers are displayedin different colors, but you can’t find the rightone. If you’ve come across this situation before,then this article is right for you.
What Is Light?Let’s discuss a bit of physics. If you look at a
cool DVD movie, you hear sound and see pic-tures. We can say that it’s a combination of lightand sound, both of which are made up ofvibrations or frequencies. The unit used tomeasure vibrations per second is hertz (Hz).Sound vibrations occur in the lower regions ofthe spectrum, whereas light vibrations can befound in the higher frequency areas. If we placethese vibrations into an electromagnetic spec-trum, then the sound vibrations occur in thelower regions of the spectrum (from 20 to20,000 Hz), whereas light vibrations (usuallycalled wavelength) can be found in the higher
frequency areas. Visible light is a small part ofthe electromagnetic spectrum, between thewavelengths 0.00078 mm or 780 nm (nanome-ter = billionth of a meter) to a wavelength of0.00038 mm (380 nm).
In 1666, Sir Isaac Newton used a glass prismto refract white light at different angles accord-ing to wavelength. He saw a rainbow of colors,which he passed through a second prism to re-form white light. He concluded that we per-ceive the various wavelengths as different col-ors, and that visible light is only visible becausewe can see the source and the objects beingilluminated. Thank you Mr. Isaac, this is goodenough for us; we are happy with this shortdescription (we’re developers, not physicists,right?). Sir Newton was playing with additivecolor mixing and the result was that no light (orcolor) is black. All light (all colors) is white.
Hue, Saturation, and BrightnessLet’s talk about colors. Usually, a color is
described as having three dimensions – hue,saturation, and brightness. 1. Hue is the name of the color; it places the
color in its correct position in the spectrum.If you look at Figure 1, the color blue is dis-tinguished from yellow, red, green, and theother colors.
2. Saturation refers to the degree of hue in acolor or a color’s strength. A neutral gray isconsidered to have zero saturation. You canexperience reduced saturation by settingyour monitor to gray scale.
3. Brightness describes differences in theintensity of light reflected from or transmit-ted by a color image. Photographers veryoften say that brightness is the single mostimportant quality of light. The hue of anobject may be green, but the terms dark andlight distinguish the brightness of one objectfrom another. It can be measured andrecorded in a numeric value, and the termLux is used to express the amount of bright-ness. To give you an idea, Table 1 providessome values.
Now, let’s look at how a computer producesdifferent colors.
Color MixingThere are only two ways to reproduce color:
additive and subtractive. These two methodsare based on the theory that all colors can becreated using three primaries (which I’lldescribe shortly).
ADDITIVE COLOR MIXINGIn additive color mixing, the primary colors
are red, green, and blue. Think of additive colormixing as three lights – red, green, and blue –all pointing to the same spot. These lights cangive off different amounts of light to create dif-
WRITTEN BY BERNDT HAMBOECK
FEATURE
FIGURE 1 Color spectrum
Have you ever looked at a rainbow andwondered how all the colors got there?Or wondered why grass looks green andyour jeans blue? Well, if you sit in front of
your computer as often as I do, you might not.
Calculating color valuesCalculating color values
13PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
ferent colors. When none of the lights are on,you have black. If they’re all on 100%, you havewhite. And you can create any other colors inbetween by varying the amount of light givenoff by each.
I’d like to describe the principles of additivecolor synthesis using a simple application(ColorChooser) that I have written for this arti-cle (it can be downloaded from http://codex-change.sybase.com, in the PowerBuilder/General section, or from www.sys-con.com/pbdj/sourcec.cfm). The application usesPowerBuilder’s built-in RGB function, whichtakes three arguments – the color value (therange is from 0 to 255) for red, green, and blue.It returns the computed color value. I’ll pro-vide some examples of how the color value isgenerated by PowerBuilder.
The call to the RGB function to get the colorvalue for red would be RGB(255,0,0), whichmeans that PowerBuilder should give me a realcool-looking red, but no green and no blue.This call would return 255 and if we look at thebinary value, this would look like “11111111”.Okay, this was easy.
Now we would like to see a beautiful greencolor (my eye specialist said last week I shouldgo outside more and look at some green treesand bushes to help my eyes relax a bit). So let’smake him happy and bring a green box (if youreproduce it with the ColorChooser applica-tion) on our screen by using RGB(0,255,0) forthe function. What do you think the functionwill return? Did you guess it? Yes, it is the value65,280, which shows up as a binary value form
“1111111100000000”. So the RGB functiontakes the value for G(reen) and multiplies it by256, which in our case means 255*256 =65,280.
Last but not least, we would like to display ablue value, so we call the function usingRGB(0,0,255). This returns 16711680, whichmeans “111111110000000000000000” in itsbinary form. So the RGB function calculatesthe blue part by using our B(lue) value andmultiplies it by 65536 (which is in fact256*256). What does all this mean? It meansthat the RGB function uses a double word (= 2words = 4 bytes) to return the color value. Itstores the values for red in the first byte, thevalue for green in the second byte, and the bluevalue in the third byte. If you mix some values,for example, to create a brown color, youwould call the function using RGB(127,64,64),which would be calculated this way:
R(ed)*1 + G(reen)*256 + B(lue)*256*256
which would end in a calculation:
127 + 16384 + 4194304 = 4210815
This also means that the value for white –RGB(255,255,255) – is 16777215, which is abinary value of “111111111111111111111111”.If you are one of those old C gurus, you mightask what happens to the last (the highest) byteif PowerBuilder uses a double word. We havejust seen three bytes used by PowerBuilder.That’s right, but PowerBuilder needs some-where to store custom colors and this happenshere. For example, if you open theDataWindow painter, then open the customcolor dialog (Design/Custom Colors), define acustom color as I did in Figure 2 (it is just thecolor black to display how it works internally),and assign this color to a column (as back-ground color), and then, if you export thesource, you’ll see that PowerBuilder adds thisline to your column:
background.color="16777216"
The binary value would look like this:
00000001000000000000000000000000
PowerBuilder uses the highest byte to storecustom colors.
I’d like to mention that if you use your owncolors within your code, it might be faster touse the color value, but it’s not as readable asthe RGB function. For example, what is the fol-lowing line doing?
dw_1.Object.emp_id.Background.Color =
'12632256'
Yes, it is setting the background color, but towhich color?
I’d say that this is much more readable (andyou might remember it yourself severalmonths later if you look at what you wanted toachieve):
dw_1.Object.emp_id.Background.Color =
RGB(192,192,192)
This line of code sets the background colorto a gray value, so it looks like this column isdisabled. If speed is really an issue in yourapplication, I’d recommend that you define
TABLE 1 Lux values
FIGURE 2 Custom color chooser
FIGURE 4 White
FIGURE 3 Black
Street light 10–20 Lux
Normal living room lighting 100 Lux
Office fluorescent light 300–500 Lux
Halogen lamp 750 Lux
Sunlight, 1 hour before sunset 1,000 Lux
Daylight, clear sky 10,000 Lux
Bright sunlight > 20,000 Lux
TABLE 2 Secondary colors
RED GREEN BLUE Color
255 0 255 Magenta
255 255 0 Yellow
0 255 255 Cyan
TABLE 3 Unequal proportions of primaries
RED GREEN BLUE Color
255 127 0 Orange
127 255 0 Lime
128 64 64 Brown
14 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
constants for your colors (for example, CON-STANT long DISABLEDLOOK = 12632256).
Let’s look at how this color mixing stuffworks so we can get the colors we’d like tohave.• Equal proportions of all three primary colors
create black or white. If all three values are 0,the color is black (see Figure 3); in Figure 4the color is white since all values are set to255.
• Equal proportions of two primary colorscreate a secondary color (see Table 2). If col-ors are mixed together, the brightness of thecolors are added together. This can be seen inFigures 5–7. For example, the yellow thatresults from red mixed with green will bebrighter than either the red light or green lightalone.
• Unequal proportions of two or three pri-maries create other colors (see Table 3 andFigures 8–10).
GET SYSTEM COLOR VALUES IN POWERBUILDERThe ColorChooser application that I’ve writ-
ten uses the RGB function to calculate thecolor value.
To get the color values your operating sys-tem uses, query Windows to dynamically getthe current color setting.
[External function declaration]
FUNCTION unsignedlong GetSysColor(int
nIndex) LIBRARY "user32.dll"
Use the parameters in Listing 1 defined in
winuser.h, which can be found within yourShared/PowerBuilder/cgen/nt/h directory.
SUBTRACTIVE COLOR MIXINGIf you’re one of those people who switch
off your computer and take a sheet of paperand start painting, you might be interestedin subtractive color mixing. It’s just theopposite of additive color mixing. You usepigments to absorb light and reflect thecolor(s). The primary colors are yellow,cyan, and magenta. To get black, you have tomix the same amount of each of the primarypigments together. And you use none forwhite.
SummaryColor can be obtained by either an additive
or a subtractive process; however, in eithercase light is required to see color. Color isdescribed as having three dimensions – hue,saturation, and brightness. There are two typesof color mixing – additive and subtractive. TVmonitors use additive color mixing. You needthe colors red, green, and blue. Subtractivecolor mixing is used when you start painting a(real) picture. ▼
AUTHOR BIOBerndt Hamboeck is a senior consultant for BHITCON. He’s a CSI,SCAPC8, EASAC, and SCJP2 and started his Sybase developmentusing PB5.
FIGURE 5 Magenta
FIGURE 6 Yellow
FIGURE 7 Cyan
FIGURE 8 Orange
FIGURE 9 Lime
FIGURE 10 Brown
Constant int COLOR_SCROLLBAR = 0Constant int COLOR_BACKGROUND = 1Constant int COLOR_ACTIVECAPTION = 2Constant int COLOR_INACTIVECAPTION = 3Constant int COLOR_MENU = 4Constant int COLOR_WINDOW = 5Constant int COLOR_WINDOWFRAME = 6Constant int COLOR_MENUTEXT = 7Constant int COLOR_WINDOWTEXT = 8Constant int COLOR_CAPTIONTEXT = 9Constant int COLOR_ACTIVEBORDER = 10Constant int COLOR_INACTIVEBORDER = 11Constant int COLOR_APPWORKSPACE = 12Constant int COLOR_HIGHLIGHT = 13Constant int COLOR_HIGHLIGHTTEXT = 14Constant int COLOR_BTNFACE = 15Constant int COLOR_BTNSHADOW = 16Constant int COLOR_GRAYTEXT = 17Constant int COLOR_BTNTEXT = 18Constant int COLOR_INACTIVECAPTIONTEXT = 19Constant int COLOR_BTNHIGHLIGHT = 20Constant int COLOR_3DDKSHADOW = 21Constant int COLOR_3DLIGHT = 22Constant int COLOR_INFOTEXT = 23Constant int COLOR_INFOBK = 24Constant int COLOR_DESKTOP = COLOR_BACKGROUNDConstant int COLOR_3DFACE = COLOR_BTNFACEConstant int COLOR_3DSHADOW = COLOR_BTNSHADOWConstant int CLOR_3DHIGHLIGHT = COLOR_BTNHIGHLIGHTConstant int COLOR_3DHILIGHT = COLOR_BTNHIGHLIGHTConstant int COLOR_BTNHILIGHT = COLOR_BTNHIGHLIGHT
Listing 1:
15PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
Sybase, Incwww.sybase-iad-services.com/30081a
16 PBDJ volume10 issue6 www.POWERBUILDERJOURNAL.com
WRITTEN BYSUE DUNNELL
FROM SYBASE
It’s Time for Pre-8.0 Users to Update Their PowerBuilder Version
Are you a long-time PowerBuilder user who’s still developing on an early version such as 5.x or 6.x? If so, now is the perfect time to move toPowerBuilder 9.0 for two reasons:
1. You’ll get the latest version of theindustry’s leading RAD environmentwith new client/server, Web, and dis-tributed functionality.
2. You’ll be on a supported version ofPowerBuilder. Engineering supportfor PowerBuilder 5.x and 6.x is nolonger offered, and Sybase hasannounced the end of engineeringsupport for all versions ofPowerBuilder 7.x effective July 15,2003.
Update to PowerBuilder 9.0PowerBuilder Enterprise 9.0 has just
been released and if you’ve been readingPBDJ regularly, you’ve already learnedabout many of the new features in thisexciting release.
If you’ve always wanted to be a Webdeveloper, with RAD JSP, you can easilybuild JavaServer Pages that access andconsume Web services.
If you need to use XML but haven’t hadtime to read up on it yet, or maybe youjust find it tedious and time-consuming,the DataWindow’s SaveAs(XML!) orPBDOM provides XML power with 4GLease. You can do data exchange via XMLwithout ever having to read, parse, ormanipulate one word of XML.
If your company has BEA WebLogic,IBM WebSphere, or Oracle9iAS, withPowerBuilder 9.0’s EJB client functional-ity you can access all the business logicin these J2EE application servers. You’llbe able to build new applications and
access the EJB business logic they’reaccessing, in a fraction of the time with abetter-looking and richer user interface.
If you need to integrate your applica-tion with .NET, PB’s Web services capa-bility will allow you to make yourPowerBuilder application interoperatewith any Web services component with-in the Microsoft .NET Framework, orwith any other Web service.
To take advantage of the powerful newPowerBuilder Native Interface (PBNI)functionality to solve problems, freedownloads and samples are available atthe new Sybase CodeXchange Web site,http://CodeXchange.sybase.com.
PowerBuilder 9.0 will launch yourdevelopment in new directions.Download the evaluation copy from theSybase download site, www.sybase.com/powerbuilder, and check out thesegreat features, as well as enhancementsto Source Code Control and the newOrcaScript tool, which will speed upcoding and building your applications.It’s the beginning of the next generationof PowerBuilder.
Update to PowerBuilder 8.0If you’re not ready for PowerBuilder
9.0, you can update to PowerBuilder8.0.3 instead.
When PowerBuilder 8.0 was launchedin June 2001, it introduced a new devel-opment environment. Like 9.0, PB8.0enables you to work on more than oneapplication at a time, and allows you to
access and manage your applicationthrough the new System Tree.
Do you need to bring your applicationsto the Web? PowerBuilder 8.0 incorpo-rates Web functionality into the IDE with4GL Web target programming and ASPsupport. And there are over 50 other pro-ductivity enhancements, all requested byour customers. New programming func-tionality – like Java style try-catch errorhandling and user-defined exceptions –is also included. This adds more power toPowerBuilder’s language. In addition,there are many new PowerScript func-tions, wizards, and more. Download theevaluation copy from the Sybase Web site.
The latest version of PowerBuilder 8.0,
version 8.0.3, was released in October2002. It’s the first version ofPowerBuilder to provide support for theWindows XP operating system andincludes enhancements such asimproved Source Code Control andmemory management, Unicode supportin databases, and the PowerBuilderResource Monitor. The PowerBuilder8.0.3 Maintenance Release is availableon the Sybase download site.
Whether you’re using PowerBuilder 8or 9, Sybase knows that either one ofthese releases will help speed yourapplication development and propelyou to higher levels of productivity. ▼
AUTHOR BIOSue Dunnell is the
product manager forPowerBuilder at Sybase.
Previously, she spentthree years in the
PowerBuilderCustom/Alliance Support
group. Later she held astaff position in Support
dedicated to internaltraining, communication,
hiring, and customer service. Sue works in
Concord, Massachusetts. [email protected]
TABLE 1 PB Maintenance Build Info
LATEST PB RELEASES BUILD NUMBERS9.0 5507
8.0.3 MR 9704
7.0.3 MR 10009
6.5.1 MR 620
5.0.4 MR 76
MR = Maintenance Release
“PowerBuilder 9.0 will launch your development in new
directions”
17PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
Sybase TechWave 2003
www.sybase.com/techwave2003
WRITTEN BYBOB HENDRY
18 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
BOOK EXCERPT
New Client/ServerDataWindow Features
Who says DataWindows can’t get any better. Since the inception ofPowerBuilder, the DataWindow has been a cornerstone of client/serversoftware development.
Its evolution over the years has keptPowerBuilder as the most powerful IDEon the market. This article will discussthe new or enhanced client/serverDataWindow features introduced inPowerBuilder 9.0:• DataWindow print enhancements• Child DataWindow retrieval• Group report scrolling
DataWindow PrintEnhancements
Several print enhancements havebeen added to DataWindows inPowerBuilder 9. Most of these proper-ties can be set programmatically orfrom the Print Specification Tab withinthe DataWindow Painter. All of thesenew/enhanced properties can beapplied in PowerScript via dot notationas well with the Modify and Describemethods:• DataWindow.Print.ClipText (new)• DataWindow.Print.OverridePrintJob
(new)• DataWindow.Print.PrinterName (new)• DataWindow.Print.Copies (enhanced)• DataWindow.Print.Collate (enhanced)
CLIPTEXTThe ClipText property allows you to
clip the text of a static field to the dimen-sions of a text field if the text field has novisible border setting. Text is automati-cally clipped for text fields with visibleborder settings even if this property isnot set. Values for this property are:
• Yes: The printed text does not overrunthe text field
• No (Default): The entire text can over-run the text field dimensions onprinted pages.
This enhancement is especially help-ful as some printers have the tendencyto render the printed size of a textboxdifferently – sometimes resulting in thereadable text being “chopped off.” Thisproblem is solved in version 9.0 by leav-ing this property at its default value(No).
OVERRIDEPRINTJOBThe PrintOpen method is used to
define and start a print job. Up to thispoint, print job settings could not beoverridden. PowerBuilder 9 supplies the DataWindow with the Over-ridePrintJob property. When on, thePrint settings as defined in theDataWindow Painter will override anysettings specified from the print job.
PRINTERNAMEIn past versions of PowerBuilder there
was no way to direct a printed version ofa DataWindow to any printer – exceptthe default one. The new PrinterNameproperty allows you to direct the printedDataWindow to the printer of yourchoice – without having the user dealwith the print setup window. If the specified printer doesn’t exist, theDataWindow is sent to the Window’sdefault printer for that computer.
PRINTING MULTIPLE COPIESThe new DataWindow Copies proper-
ty can be used to print multiple copies ofa report. Users no longer have to go intothe Print Setup Window if multiplecopies are desired. Even if the printerdriver does not support multiple copies,
the DataWindow engine will adjustaccordingly and print the specifiednumber of copies
COLLATE Previous versions of PowerBuilder
contained the DataWindow PrintProperty Collate. If the programmerwished to collate printed reports, thisproperty had to be supplied program-matically. PowerBuilder 9 adds thisproperty to the DataWindow painter.
Child DataWindow RetrievalIn previous versions of PowerBuilder,
child DataWindows would automatical-ly be retrieved with their parent.PowerBuilder 9 allows programmers toturn this functionality off. You can dothis by unchecking the Auto Retrieveproperty in the DataWindow Painter’sProperty Tab. This property is on bydefault. If this property is set to off, thechild can still be retrieved programmat-ically if a handle of its child is obtained.A common technique is to turn offAutoRetrieve and control the childretrieved from within your code.
GROUP REPORT SCROLLINGIf you use DataWindows with group
headers and trailers, you’ve probablynoticed that as the user scrolls up anddown, a small gray line may sometimesappear. Believe it or not, this is a fea-ture, not a bug. The appearance of thisgrey line is supposed to tell the userwhere the page break would be. Mostusers would prefer that this gray line beturned off. Well, enter the HideGrayLineProperty. This property can be set with-in the code or painter to prevent theappearance of a gray line while scrollinga DataWindow containing groups. ▼
AUTHOR BIOBob Hendry is a
PowerBuilder instructorfor Envision Software
Systems and a frequentspeaker at national
and internationalPowerBuilder
conferences. He specializes in PFC
development and haswritten two books onthe subject, including
Programming with the PFC 6.0.
This article is based on PowerBuilder 9
Client/Server Development by various
authors (ISBN 0672325004), published by
Sams Publishing. Also look for Power-
Builder 9 Internet and Distributed Appli-
cation Development.
19www.POWERBUILDERJOURNAL.com PBDJ volume10 issue6
Over 100 participating companies will display and demonstrate over 300 developer products and solutions.
Over 2,000 Systems Integrators, System Architects, Developers,and Project Managers will attend the conference expo.
Over 60 of the latest sessions on training, certifications, seminars, case studies, and panel discussions will deliver
REAL World benefits, the industry pulse and proven strategies.
WEB SERVICES EDGE WEST 2003 CALL FOR PAPERS NOW OPEN
Submit your papers online at:www.sys-con.com/webservices2003west
Contact information: U.S. Events: 201 802-3069 or e-mail [email protected]
PRODUCED BY
International Web Services Conference & Expo
SEPT. 30 - OCT. 2, 2003S a n t a C l a r a , C A
Focus on JavaFocus on Web ServicesFocus on WebLogicFocus on Mac OS XFocus on XML
For more information visitwww.sys-con.com
or call
201802-3069
BOSTONFebruary 24-27, 2004
WESTWeb Services Edge 2003
Java is a registered trademark of Sun Microsystems, Mac OS X is a registered trademark of Apple Computer, Inc.,All other product names herein are the properties of their respective companies.
XML
®
®
EXTENDING THE ENTERPRISE
WITH WEB SERVICES THROUGH JAVA,
Mac OS X AND XML TECHNOLOGIES
WebLogic
www.POWERBUILDERJOURNAL.comPBDJ volume10 issue620
Fortunately, these new controls, like allother controls, are exposed via the Win32application programmers interface (API).This article introduces you to the advancedfeatures of the Win32 API using external visual objects and external functions inPowerBuilder so that you can use those newcontrols more readily.
What Is the Win32 API?Most modern software packages include an
API, and the Microsoft Windows operating sys-tem is no exception. An API allows the user tocustomize the application, or simply reusefunctionality that has already been written andtested. The Win32 API allows developers toreuse common operating system functionsand provides a uniform interface to the GUIsubsystem. Each software application writtenfor the Windows operating system (or anyother Windows-based GUI) therefore shares acommon look and feel. In simplistic terms, an
API is a set of building blocks that program-mers can use to assemble more complex appli-cations. This article focuses on the GUI con-trols exposed by the Win32 API, specifically the“common controls.”
Finding Good DocumentationAn API is only as good as the documentation
that describes it. Finding good documentationis therefore critical to being able to use andunderstand the functionality exposed by theWin32 API. Fortunately, the common controlsare an integral part of the operating systemand Microsoft has provided extensive docu-mentation on their correct use and availablefunctionality. The first place to start is theMicrosoft Developer Network (MSDN), avail-able at http://msdn.microsoft.com.
Like most Internet searches, the key is toknow what to search for. An obvious startingplace would be to search for the term“Common Controls”. Future sections willdescribe the individual controls in more detail,which will allow you to be able to referenceindividual controls directly.
The Documentation Is in CAfter spending just a few minutes browsing
the MSDN library, you’ll notice two things: theamount of information is overwhelming.There are literally thousands of Win32 APIfunction calls performing all sorts of tasks,from simple file I/O operations to complexGUI controls.
All of the documentation is in C. Moreover,you will soon find out that the function proto-types aren’t 4GL friendly. This means thatpointers and variable size structures are usedextensively.
The Win32 API, like all good APIs, hides the
implementation details from the user, whichmeans that the value of constants is neverdefined in the documentation. Instead, youhave to look them up in a C include (*.h) filefrom the Windows SDK.
Mapping C Data Types toPowerBuilder Data Types
Part of the challenge of using the Win32 APIis the conversion of the function prototypesand the associated data types to PowerBuilder.Again, this is where good documentationalways helps.
Table 1 displays a list of C data types andtheir corresponding PowerBuilder equivalents.
It’s useful to point out the following Win32API naming conventions:• LPxxxx: Any variable that starts with “LP” is
a long pointer, which means you must passthat particular parameter by reference. Forexample, LPSTR is a long pointer to a stringvalue. One exception to this naming con-vention is the LPARAM variable name that isin fact a long parameter, and not a longpointer to an “aram”.
• LPCxxxx: Although they have the LP prefix,these are in fact “constant pointers” andthese parameters are passed by value.
• HWND or HANDLE: Used to denote windowhandles, which are always defined as longvalues. Each GUI control is referenced usingthe internal handle.
Mapping Win32 API Calls toPowerBuilder External Functions
After successfully converting the commonlyused C data types and structures to Power-Builder, the next step is to declare the Win32API call as an external function in Power-Builder.
Using a Win32 API function from the Win32 library
PART 1 WRITTEN BY REGAN SIZER
This article is based on PowerBuilder 9
Client/Server Development by various authors
(ISBN 0672325004), published by Sams Pub-
lishing. Also look for PowerBuilder 9 Internet and
Distributed Application Development.
FEATURE
Each new version of the Windows operating system always brings severalenhancements to the graphical user interface (GUI), including new controls.
Some of these newer controls are often introduced in Internet Explorer upgrades. As aresult, it becomes difficult for a developmenttool like PowerBuilder to offer immediate support for these new graphical controls.
21www.POWERBUILDERJOURNAL.com PBDJ volume10 issue6
The SendMessage function is defined as fol-lows in the Win32 API:
LRESULT SendMessage( HWND hWnd,UINT
Msg,WPARAM wParam, LPARAM lParam )
Using the data type conversion rules definedin Table 1, the PowerBuilder equivalent becomes:
Function long SendMessage( long hWnd, ulong
Msg, ulong wParam, long lParam ) Library
"user32" Alias For "SendMessageA"
In this example, the data types map cleanlyfrom C to PowerBuilder. The Library keyword isused to identify the dynamic link library (DLL)that contains the function, and the Alias key-word is used when the PowerBuilder functionname (SendMessage) does not match the actu-al implementation (SendMessageA).
You may be wondering where the libraryname “user32” came from. Using the Win32API documentation from MSDN, you’ll noticethat each function has a reference to a C head-er file and an import library. In this case, the Cheader file is listed as “winuser.h” and theimport library is “user32.lib”. Use the name ofthe import library (without the .lib extension)in the external function declaration. Keep thename of the header file in mind, as we will bereferring to this later.
What’s the Difference BetweenSendMessageA and SendMessageW?
One important detail that the Win32 APIdocumentation does not mention is the factthat there are two implementations of most,but not all, Win32 API functions. Any functionthat has a string (LPSTR) parameter or returnvalue will have both an ANSI and Unicodeimplementation. Differentiating between thetwo is done by looking at the suffix. The ANSIimplementation is suffixed with an “A”, where-as the Unicode (or wide-string) version is suf-fixed with a “W”.
Using the previous SendMessage example,
you’ll notice that we used the ANSI version.However, upon closer inspection you may havenoticed that SendMessage does not have anystring parameters, nor does it have a stringreturn type. Why does it have both an ANSI andUnicode implementation? The answer is due tothe fact that the LPARAM parameter is in fact apointer, and may be a pointer to a string orpossibly even a pointer to a structure. LPARAMmay also be a literal long value and not a point-er at all. The actual value of LPARAM is definedby the message that’s being sent.
For example, if we send a WM_SETTEXT mes-sage, LPARAM is in fact an LPSTR (pointer to astring). If we are sending the WM_CLOSE mes-sage, the parameter is not used and a value ofzero (0) is passed in. Sending a WM_ GETMIN-MAXINFO message requires that the LPARAMbe a pointer to a MINMAXINFO structure.
The best way to determine if a Win32 APIfunction has both an ANSI and Unicode imple-mentation is by reading the header file, in thisexample: “winuser.h”. Performing a full installof PowerBuilder 9 will install some of the head-er files in the \Program Files\Sybase\-Shared\PowerBuilder\cgen\h folder. UsingNotepad, open winuser.h and search for“SendMessage”. You will find function proto-types for both SendMessageA and Send-MessageW. There are several other utilitiesavailable from third-party vendors and devel-opers that will also help you find a list of theexported functions available in an EXE or DLL.
Overloading SendMessagePowerBuilder does not support pointers,
which means we need to explicitly tellPowerBuilder which data type we’re passing inas the LPARAM parameter. Assuming that we wanted to send the WM_SETTEXT,WM_CLOSE, and WM_GETMINMAXINFOmessages, we would have to create three exter-nal function declarations as follows:
Function long SendMessage( long hWnd, ulong
Msg, ulong wParam, long lParam ) Library
"user32" Alias For "SendMessageA"
Function long SendMessage( long hWnd, ulong
Msg, ulong wParam, ref String lParam )
Library "user32" Alias For "SendMessageA"
Function long SendMessage( long hWnd, ulong
Msg, ulong wParam, ref MinMaxInfo lParam )
Library "user32" Alias For "SendMessageA"
Current versions of PowerBuilder supportfunction overloading, but older versionsrequire that each external function have aunique name (e.g., SendMessage, Send-MessageText, and SendMessageMinMax).
Strings (excluding constant strings) andstructures are always passed by reference usingthe ref keyword. This is as close as you can getto pointers in PowerBuilder.
Creating Constants for theMessage IDs
Each control (or window) will respond to
various messages and each message is definedby a particular message ID. Three message IDshave already been mentioned: WM_SETTEXT,WM_CLOSE, and WM_GETMINMAXINFO.
Message IDs are defined in the C header filesas constants and need to be imported intoPowerBuilder, usually as instance variables. Asbefore, each message is defined in the MSDNdocumentation. In addition to the ID, eachmessage will also define the expected valuesfor both WPARAM and LPARAM.
All controls respond to the WM_xxx set ofmessages that are defined in winuser.h. Eachcontrol will also have a specific set of messagesthat is recognized or handled by that controlonly. These specialized messages will bedefined in the header file for that particularcontrol. For example, the message IDs for thecommon controls are defined in commctrl.h.Message IDs are defined as hexadecimal num-bers. Remember to convert from base 16 tobase 10 when importing into PowerBuilder.
As stated earlier, message IDs are usuallycreated as instance variables in PowerBuilder.These IDs should also be declared as publicconstants, for example:
Public Constant Long WM_SETTEXT = 12
// 0x000C
Public Constant Long WM_CLOSE = 16
// 0x0010
Public Constant Long WM_GETMINMAXINFO = 36
// 0x0024
Mapping C Structures toPowerBuilder Structures
Earlier, we saw that it’s relatively easy to mapa data type from C to PowerBuilder. Structures,however, are slightly more complicated due tothe fact that several structures require a sizeparameter. Since there’s no SizeOf() function inPowerBuilder, the size of the structure needs tobe manually calculated by adding up the bytevalues of each data type.
For example, all the standard controls (e.g.,listbox, textbox) are registered and initializedautomatically by the operating system. Themore complex common controls (e.g., calendar,date/time picker) are registered on demand andthe programmer must initialize them prior touse using the InitCommonControlsEx. Win32API function. This function takes a structure as aparameter and is declared as:
Function boolean InitCommonControlsEx( Ref
INITCOMMONCONTROLS LPINITCOMMONCONTROLS)
Library "comctl32.dll"
The MSDN documentation defines the INITCOM-
MONCONTROLS structure in C as:
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX, *LPINITCOMMONCON-
TROLSEX;
Several Win32 API structures have size astheir first attribute. Doing so allows the authorTABLE 1 Data type conversion
C TO POWERBUILDER DATA TYPE CONVERSIONC PowerBuilderBOOL Boolean WORD uintDWORD ulongHANDLE LongHWND LongLPSTR Ref StringLPBYTE Ref StringLPINT Ref LongINT LongUINT ulongLONG long ULONG ulongDouble Double char * Ref StringLPARAM long (short for LongParameter)WPARAM UlongLRESULT LongLPCSTR StringLPCTSTR String
www.POWERBUILDERJOURNAL.com22 PBDJ volume10 issue6
of the function to query the size of the structureto determine which version of a structure hasbeen passed in. Future versions of the sameWin32 API function may enhance the structureby adding more attributes. Adding more attri-butes increases the size, which means that asimple check on the size will determine whichversion is being used, thereby preserving com-patibility with older versions.
Calculating the size of this structure is rela-tively simple. INITCOMMONCONTROLS con-tains two DWORD elements, the equivalent ofa PowerBuilder ulong variable. A long inPowerBuilder is a standard 32-bit long integer,which is of course 4 bytes. So the size of thisstructure is 2 elements * 4 bytes each = 8 bytes.Declare the structure in PowerBuilder usingthe structure painter with the following fields(see Table 2).
The following code shows how to initializeboth the date/time picker class and theprogress bar class. ICC_DATE_CLASSES andICC_PROGRESS_CLASS are constants thathave been declared as public instance vari-ables and, just like the message IDs, aredefined in the header file for the common con-trols: commctrl.h. Multiple controls can be ini-tialized in a single step by adding multipleICC_xxx constants as follows:
// Declare local variable
INITCOMMONCONTROLS lICC
// Set the size of the structure (2 longs =
8 bytes)
lICC.dwSize = 2 * 4
lICC.dwICC = ICC_DATE_CLASSES +
ICC_PROGRESS_CLASS
// Initialize the Date/Time Picker and
Progress Bar common controls
InitCommonControlsEx( lICC )
Encapsulating the Win32 API CallsIt may be tempting to declare all the exter-
nal Win32 API functions and message IDs inthe same visual object as the control. This isgenerally a bad idea, and developers shouldtreat Win32 API calls the same as businesslogic. Business logic is usually encapsulatedinside nonvisual user objects, and visual con-trols then use, or are consumers of, the nonvi-sual components. This promotes code reuseand makes the business logic independent ofthe GUI. Consider porting a traditional GUIapplication to the Web. If all the code is con-tained in button or GUI scripts, porting toHTML would require significant effort. If,however, the business logic was containedwithin a library of nonvisual user objects, theapplication could easily be ported to a distrib-uted architecture with a thin HTML client, and
a thick middle tier that contains all the busi-ness logic.
External functions should be treated thesame way. This doesn’t mean you want to makeWin32 API calls in the middle tier of a distrib-uted application; it simply means that othercomponents may want to reuse the externalfunction declarations, the message IDs, orstructures. Porting a Win32 API function toPowerBuilder requires significant effort, andthat effort should be reusable where possible.
SummaryUsing a Win32 API function from the Win32
library involves:• Finding good documentation: Sifting
through the wealth of information can beoverwhelming, but a general rule of thumbis that every control or feature of theWindows operating system is exposed viathe Win32 API. After using this API for ashort period of time, you’ll become familiarwith how the related functions are grouped,and where to start looking.
• Locating the actual method signature: Useeither in the documentation described earli-er or the C header files to find the methodsignature. Recall that functions with stringparameters or return types will always haveboth an ANSI and Unicode implementation.
• Porting the function to PowerBuilder: Eachfunction needs to be declared as an externalfunction in PowerBuilder, and each of theparameter datat ypes needs to be convertedfrom C using the data type mapping rulesdefined in Table 1. Structures may also needto be converted.
• Creating constants for each of the messageIDs: Message IDs are always stored in the Cheader files, so it’s imperative that you locatethe correct header file (as well as the correctversion) for each control. Standard controls(e.g., the textbox, listbox, and label) are definedin winuser.h. Specialized controls (e.g., com-mon controls) will have their own header file.
• Encapsulating the Win32 API functionalityusing a nonvisual user object: All of the exter-nal functions and constants for the messageIDs should be declared in a nonvisual userobject. Encapsulating the Win32 API calls in anonvisual object allows the Win32 API calls tobe reused without requiring the use of the visu-al component. For example, the SendMessageWin32 API function may be reused by multiplecontrols. Similarly, an external structure maybe passed between multiple controls. ▼
AUTHOR BIORegan Sizer has 10 years of experience as a software engineer. Hehas been a supporter of PowerBuilder since the early days and triesto promote the product by providing free code samples that showcase some of the more advanced capabilities. He is currentlythe development manager at a large international bank and lecturespart time at the Illinois Institute of Technology.
TABLE 2 Structure definition
INITCOMMONCONTROLS STRUCTURE DEFINITION
DataType Variable Name
Unsignedlong dwSize
Unsignedlong dwICC
Calling Sleek Geeks Everywhere!
Make sure you have your finger on the pulse of i-Technology...bookmark http://developer.sys-con.com today.
i-Technology
Newsi-Technology
Viewsi-Technology
Commenti-Technology
Debate
STEP UPto the mike
and be...
STEP UPto the mike
and be...
ATTN: Developers
HEARD!HEARD!
Go to http://developer.sys-con.com
©C
OP
YR
IGH
T 2
002,
SY
S-C
ON
ME
DIA
W
WW
.SY
S-C
ON
.CO
M
Millionsof Linux UsersOne Magazine
SAVE 30%OFF!
REGULAR ANNUAL COVER PRICE $71.76
YOU PAY ONLY
$499912 ISSUES/YR
*OFFER SUBJECT TO CHANGE WITHOUT NOTICE
SUBSCRIBETODAY!
WWW.SYS-CON.COMOR CALL
1-888-303-5282
The World’s Leading i-Technology Publisher
Linux Business& Technology
There is no escaping the penetration of Linux into the corporate world. Traditional models are being turned
on their head as the open-for-everyone Linux bandwagon rolls forward.
Linux is an operating system that is traditionally held in the highest esteem by the hardcore or geek
developers of the world. With its roots firmly seeded in the open-source model, Linux is very much born from
the “if it’s broke, then fix it yourself” attitude.
Major corporations including IBM, Oracle, Sun, and Dell have all committed significant resources and
money to ensure their strategy for the future involves Linux. Linux has arrived at the
boardroom.
Yet until now, no title has existed that explicitly addresses this new hunger for information from the
corporate arena. Linux Business & Technology is aimed squarely at providing this group with the knowledge
and background that will allow them to make decisions to utilize the Linux operating system.
Look for all the strategic information required to better inform the community on how powerful an alternative Linux can be. Linux Business & Technology will not
feature low-level code snippets but will focus instead on the higher logistical level, providing advice on hardware, to software, through to the recruiting of trained
personnel required to successfully deploy a Linux-based solution. Each month will see a different focus, allowing a detailed analysis of all the components that
make up the greater Linux landscape.
FOR ADVERTISING INFORMATION:
CALL 201 802.3020 ORVISIT WWW.SYS-CON.COM
ALL BRAND AND PRODUCT NAMES USED ON THIS PAGE ARE TRADE NAMES, SERVICE MARKS, OR TRADEMARKS OF THEIR RESPECTIVE COMPANIES.
Regular features will include:
Advice on Linux Infrastructure Detailed Software Reviews Migration Advice Hardware Advice CEO Guest Editorials Recruiting/Certification Advice Latest News That Matters Case Studies
June 3–5...............LONDONJune 24–26 .........BERLINSeptember ..HONG KONGOctober ..........CALIFORNIA
www.sys-con.comPremieringJune 2003
at
www.POWERBUILDERJOURNAL.comPBDJ volume10 issue624
Quma VersionControl SystemQVCS PRO by Quma
Software, Inc.
Produ
ct Re
view
REVIEWED BY OLAN KNIGHT
AUTHOR BIOOlan Knight is a consultant with 20 years of full life-cycle softwaredevelopment experience, joyfully using PowerBuilder for the last 10
years! He is looking forward to migrating to PowerBuilder 9.
PBDJAPPROVEDPRODUCT
2003P B D J
S e a l O fE x c e l l e n c e
Quma Software, Inc.Web: www.qumasoft.com
E-mail: [email protected]
QVCS is a multiuser, file-based sourcecontrol system that comes in two fla-vors: QVCS and QVCS PRO. The
QVCS PRO version includes IDE integra-tion and works with the export files ofPowerBuilder objects.
QVCS PRO features include all thebasic Source Control Configuration(SCC) options that you would expect,including object isolation, versioning,PowerBuilder integration, archive coor-dination, good documentation, andtech support.
PowerBuilder IntegrationQVCS PRO uses the Microsoft SCC
APIs, and thus integrates with thePowerBuilder IDE. Once installed, thePowerBuilder popup menu from boththe System Tree and the Library Painterhas its source control options enabled(see Figure 1).
Object IsolationWhen set up properly, QVCS PRO
locks an object when a developer does aCheck Out on it. That object can’t bemodified except by the person who hasit checked out. Once that person does aCheck In or an Undo Check Out, theobject becomes available to other devel-opers.
VersioningThe SCC Manager applies a label to all
the objects in the archive at a specifictime, usually just after the code freeze ofa software release. Later, developers cancheck out the appropriate version oftheir objects based on the label theyselect.
Archive CoordinationDevelopers invoke the Get Latest
Version (GLV) function in order todownload the latest version of thearchived objects into their workingPBLs. This can be done at either theobject or the target level.
The Show History option will displayall the comments associated with eachCheck In of the object. This is an excel-lent way to determine if a particularobject is up-to-date, and to indicatewhich version of the object is loaded inyour PBL.
The Show Differences option invokesa utility called “Examdiff” in order tocompare the local version of the objectto what is stored in the source controlarchive.
Good DocumentationQVCS comes with a 200+ page docu-
ment that is comprehensive and com-plete. It also comes with online helpfiles, and the Web site has a “Frequently
Asked Questions” page. Note that noneof these files include any discussion ofusing QVCS with PowerBuilder.
Tech SupportJim Voris is the author of QVCS/QVCS
PRO and provides the tech support. Allcommunication is handled via e-mail,and I’ve found Jim to be very responsiveand most helpful.
Other FeaturesQVCS PRO includes some reporting
capabilities and handles branching andmerging. Our shop is not interested inthe reporting or the merging capabilityof the product, and we use branchingsparingly to prevent “object clutter” (toomany versions of the same object). Butthe features do exist for those whorequire them.
InstallationThe installation of QVCS PRO is a
breeze. The Zip file expands into a singlefolder that contains every piece of theQVCS PRO functionality. I installed thecode onto a shared network drive andadded a temp file to be used exclusivelyby the QVCS PRO software. I theninstalled a mirror of this setup onto eachdeveloper’s PC.
Note that since QVCS PRO is a file-based source control product, PaulHoran’s recommendations on setting upyour application directories areabsolutely vital (see Reference section).Every developer must have his or herdevelopment folders set up identically,and each PBL requires its own folder.Listing 1 outlines how we organized ourdevelopment folders. Listing 2 is anexpanded view of that structure showinghow the PFE libraries are placed.
Quirks and Workarounds1. Developers use e-mail to inform each
other when objects need to be added,updated, or deleted. This minimizes thenumber of target-level GLVs that needto be done and minimizes the perfor-mance hit of using source control.
Doing a target-level GLV is cumber-some and time-consuming, but thecumbersome portion of that issue willbe resolved in the next release of theproduct. Jim is also investigatingimplementing the new Sybase-spon-sored SCC API extension that willreduce source code comparisonsfrom the full source file to a single ver-sion number, which would signifi-cantly speed up this process.
2. Alex Ryder of InfoTech created an ini-tial set of QVCS PRO/PowerBuilderOnline Help files, which he generous-
www.POWERBUILDERJOURNAL.com 25PBDJ volume10 issue6
Product Review
Each folder marked with an asterisk (*) contains one sub-folder per PBL, with each PBL residing in its associatedfolder.
C:\AppsGroup_1_applicationsShared_g1_libraries*App_g1_1*App_g1_2*
Group_2_applicationsShared_g2_pbls*App_g2_1*App_g2_2*
.
.
.SharedCLASSCORPCORP_PFC*CORP_PFE*
PFC*PFE*
RESOURCE
ImagesRegistry Files
This is the folder structure for the PFE libraries. Thefolders, subfolders, and the PBLs are shown.
C:\Apps\SharedCLASSPFE
PFEAPSRVPfeapsrv.pbl
PFEDWSRVPfedwsrv.pbl
PFEMAINPfemain.pbl
PFEUTILPfeutil.pbl
PFEWNSRVPfewnsrv.pbl
Listing 2: Subfolders of Shared/Class/PFE
Listing 1: Application Directory Structure
ly shared with me. Over time I haveexpanded these files and modifiedthem to suit our needs as we learnedbetter ways of using QVCS PRO withPowerBuilder v8.0.3.
3. Occasionally you’ll get a blank dialogbox (see Figure 2). Alex says he nevergot this while using PB v8.0.1 but didsee it with PB v8.0.3, so this appearsto be a PB issue. Just click Yes andmove on.
PricingThe annual QVCS PRO license fee is
$40 per seat. Yes, you read it correctly.No, this is not a typo.
SummaryPROS1. Integrates nicely with PB 8.0.3 with a
few minor exceptions.2. Handles object isolation and version-
ing nicely.3. Has good documentation and good
e-mail tech support.4. Supports branching and merging.5. Easy to use.6. Inexpensive.
CONS:1. Must check in objects from the QVCS
interface.2. Target-level checkout and GLV (Get
Latest Version) process is cumber-
some. (The fix for this is slated for thenext release.)
3. There are a few minor quirks.4. Be sure to export your objects first.
RecommendationsIf you don’t have SCC reporting
requirements, QVCS is the best bang forthe buck on the market. It handles allthe basic source control functions easi-ly, and integrates well with thePowerBuilder IDE. Most of the prob-lems with PB/QVCS processing lie onthe PowerBuilder side of the equation.
It’s true that PVCS does more thanQVCS PRO and does many things auto-matically – like pushing new objectsonto the developer’s desktop, but QVCSPRO more than meets our needs, anddoes so at an extremely reasonableprice. It’s relatively easy to use and is anexcellent choice if what you need isbasic source control.
In my next article, I’ll discuss how weimplemented QVCS PRO into our shop.
References• Paul Horan’s articles on using source
control with PB8: www.sys-con.com/p b d j / a r c h i v e s 2 / 0 8 1 2 / h o r a n ,www.sys-con.com/pbdj/archives2/0901/horan ▼
FIGURE 1 Source control functions
FIGURE 2 Blank dialog box
www.POWERBUILDERJOURNAL.comPBDJ volume10 issue626
WRITTEN BYDAVID DICHMAN
UNIFIED MODELING LANGUAGE
PowerDesigner and PowerBuilderUsing UML improves developer productivity
PowerBuilder’s recent evolution has provided us with more options for developing our applications. We can use PowerBuilder to develop within service-oriented architectures,.NET environments, multitier architectures, and more.
However, this new capability providesnew challenges. How can you developthe discipline required to developPowerBuilder code that’s compatiblewith these new architectures? How canyou ensure you have followed the prop-er object-oriented design principlesneeded to successfully develop thesenew technologies? How can you reusethe client/server-based code whilerearchitecting your applications?
The answer to these questions comesfrom the Unified Modeling Language, orthe UML. The UML does for develop-ment what traditional data modelingdoes for database design and develop-ment. It provides a mechanism for visu-alizing our code at an architecture levelto help ensure we have organized ourcode along object-oriented principles,and can generate objects into languages,like PowerBuilder, to speed the develop-ment based on the architecture.
PowerDesigner 9.5.2 includes a fullUML implementation, and completeround-trip engineering capabilities forPowerBuilder 6, 7, 8, and 9. WithPowerDesigner, you can reverse engi-neer all your existing PowerBuilder codeinto a UML class diagram, and gain abetter understanding of your existingapplications. You can then use the UMLprinciples to rearchitect the reverse-engineered code, or to write new object-oriented code. PowerDesigner will thengenerate these objects back toPowerBuilder for final assembly, devel-opment, testing, and deployment.
Mapping PowerBuilder to UMLPowerDesigner maps the UML con-
cepts to PowerBuilder objects as follows:application, user object, structure, func-tion, window, and proxy will be modeledas classes. Support libraries (.pbl) andsource files (.srx) will be modeled asobjects classified by the type identifiedin PowerBuilder. For example, a Menuwill be a Menu in PowerDesigner. Forthose familiar with UML, we’re using the<<stereotype>> and UML Profile con-cepts to implement a class of type Menuinside PowerDesigner.
There are many advantages to usingPowerDesigner with PowerBuilder. Forexample, you can use PowerDesigner’sspecial PowerBuilder tool palette for cre-ating new objects – streamlining newapplication development for n-tier orobject-oriented systems. You may also usethe PowerDesigner’s “check model” fea-tures for model verification. And, sincePowerDesigner’s UML is tied directly tothe Database Design (PowerDesignerPhysical Data Models), we can managethe object/relational map that deter-mines how the data-access componentsrelate to the database tables, as well as
generate and reverse engineer thePowerBuilder extended attributes.
Reverse EngineeringUNDERSTANDING AN EXISTINGPOWERBUILDER APPLICATION
If you have an existing PowerBuilderapplication, and you don’t have usefuldocumentation on its design, you caneasily create a new UML class diagramin PowerDesigner. With this visual repre-sentation of the interdependencies ofthe PowerBuilder code, you’ll get ajump-start on maintaining the applica-tion, extending it with new capabilities,integrating it with other applications, orrefactoring it into a new architecturesuch as n-tier or Web services.
To reverse engineer with Power-Designer 9.5.2, simply go to theLanguage menu and select ReverseEngineer PowerBuilder. Either reverseengineer by reading the .PBLs or byreading source files (exported Power-Builder objects).
The Class DiagramNAVIGATING THE POWERBUILDER MODEL
Once you have successfully reverseengineered a PowerBuilder application,you’ll start to understand the makeup ofthe existing code. The UML model ismade up as follows: each library youreverse engineer will create a separatepackage. Objects are represented asclasses within the packages, with astereotype and a mini icon that tells uswhat type of object it is.
To determine how the objects dependupon each other, we’ll use a combina-tion of UML features (see Figure 1). Wewill use UML associations drawn fromthe reverse-engineering process, witheach object’s own list of dependencies toshow which menu or data window is
FIGURE 1 UML features
FIGURE 2 PB toolbar
27PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
used by which window, and inner class-es to represent controls.
Windows, Menus, and More…MANAGING ‘BLOB’D’ OBJECTS
Some PowerBuilder objects can’t bemapped into the UML concept for a stereo-type and a class. These objects are thePowerBuilder data window, menu, query,pipeline, and binary object. For all theseobjects, PowerDesigner will represent themas a special form of class, where an iconreplaces the class symbol.
To completely preserve the originalobject, the source code is stored in theHeader attribute of the Script tab. Whenyou go to regenerate the source code,simply return the original object intact.You can make modifications from thePowerBuilder interface and synchronizethem back to PowerDesigner if necessary.
Creating New ObjectsWORKING WITHIN THE CLASS DIAGRAM
Starting from the reverse-engineereddiagram, you can change associations,change a class operation, create newobjects to be used with the existing ones,or start to reorganize the code elementsinto a new n-tier or service-orienteddesign. For creating new PowerBuilderobjects, use PowerDesigner’s newPowerBuilder tool bar (see Figure 2).
As you change the UML diagram, youcan easily check your progress by using the“Code Preview” feature. Simply right-clickon any class or object, and select “CodePreview” from the context menu. If yousee something that you’d like to change,modify the PowerBuilder code in the codePreview window, and it will be reflected inthe model and the generated object.
Since we are also interested in docu-menting the system for future needs(maintenance, integration, enhance-ments, etc.), we’ll add RTF-formatteddescriptions into the model. Each objectcan be documented in detail. This docu-mentation effort can be shared withnon-PowerDesigner users through theReporting facility. This allows the RTF-formatted documentation, completewith the graphics and all the metadataabout the model that you choose toshare, to be generated into either aMicrosoft Word document (.RTF format)or a fully hyperlinked HTML documen-tation set.
Working with ControlsI mentioned earlier that controls are
treated a special way: they are representedas inner classes. To see the list of controls,open the properties of a window, select
the Inner Classes tab, and open the prop-erties of the inner class (see Figure 3).
By modifying, creating, and deletingthese inner classes, you can usePowerDesigner to design how you useyour controls, and generate the resultinto PowerBuilder for final testing anddeployment.
Preparing for GenerationPREVIEW AND MODIFY CODE
Before generating new objects intothe PowerBuilder environment, first pre-view the code. To do this, simply openthe properties of an object and select thePreview tab (see Figure 4).
For windows, user objects, applicationobjects, structures, functions, and proxies,you may change the code you see in thePreview window (for example, add attri-butes, modify operations, etc.). The modelwill be updated to reflect the changes.
VERIFY THE MODELPowerDesigner helps ensure a reli-
able, quality PowerBuilder applicationby applying sound object-oriented prin-ciples to the design. To help maintainthe consistency needed to ensure quali-ty, PowerDesigner provides a compre-hensive check model facility. To run thecheck model at any time, go to the Toolsmenu and select Check Model. The cus-tomized model validation will run toverify that the model is well defined.
PowerDesigner understands generalobject-oriented checks as defined in theUML, but there should be more wherePowerBuilder is concerned. To helpensure not only a good UML design, buta good PowerBuilder design, we haveadded PowerBuilder-specific checks tothe check model facility.
Generating the ApplicationFINISHING THE JOB
Once you’re satisfied with the finalresults of the model validation and havemodified and previewed all the code,you’re ready to generate the applicationobject back into PowerBuilder. Note: Wedon’t want this to be a one-time opera-tion. We expect you to reverse engineerand generate PowerBuilder objects itera-tively throughout the development lifecycle to ensure that the design maturesalong with the code as it’s written. Wealso want to be sure the code being engi-neered stays consistent with the princi-ples laid out in the original design.
To generate code into PowerBuilder,use the Language menu and select>Generate PowerBuilder Code. Fromthere, you may choose which objects
you want to generate, from a single win-dow to the whole model. Similar toreverse engineering, you can select togenerate into a .PBL, or into source files(.SRx) that can be imported into anyPowerBuilder library.
PowerDesigner andPowerBuilderTHE UML ADVANTAGE
PowerDesigner’s new PowerBuilderreverse engineering and code generationcapabilities are now extended to allPowerBuilder objects. Being able to cre-ate new PowerBuilder applicationsquickly and efficiently by easily manag-ing the complexities inherent in modernn-tier or service-oriented architecturesprovides PowerBuilder developers withgreater productivity. Reverse engineeringand code refactoring facilities help youreuse existing business logic as you tran-sition to the Web. Systems documenta-tion can emerge as we learn about legacysystems and document these discover-ies, so that maintenance and integrationprojects involving PowerBuilder are easi-er and more predictable over time.
PowerDesigner gives PowerBuilder usersthe same UML advantage Java and VB.NETdevelopers have been enjoying recently,keeping PowerBuilder skills current and rel-evant. The next time you need to work withany PowerBuilder code, think about takinga PowerDesigner model with you. ▼
FIGURE 3 Inner class properties
FIGURE 4 Preview window
AUTHOR BIODavid Dichman is aproduct manager [email protected]
28 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
WRITTEN BYJOE FRITSCH
ROI
Maximizing the Return on Your Investment in PowerBuilder
Prepare for the future
PowerBuilder has been a popular choice for client/server applicationdevelopment for many years and there are a half-million existing applications in production today.
The explosive growth of the Internethas changed the way companies dobusiness and led to the introduction ofmiddle-tier application servers as keycomponents of distributed Web-basedthree-tier applications.
For companies that have invested inPB in the past, it’s important to under-stand how to migrate existingclient/server applications to a multitierarchitecture in a way that maximizes thereturn on the investment in PB technol-ogy. The ROI of PB can be measured bythe ability to reuse existing code, tomove to the Web without significantretraining costs, and to integrate withother technologies.
Why Move PB Applications to the Web?
Although the traditional client/serv-er architecture meets the needs of manyorganizations, the growth of the Internethas introduced the need to extend busi-ness applications that were designed torun in a LAN environment to the entirecorporate enterprise. This means thatsubsystems or even entire applicationsmust be modified to run in anInternet/intranet environment to reachthe highest number of users with thelowest possible costs. The high cost ofmaintaining fat-client systems acrossthe enterprise and the inability of tradi-tional client/server architectures toscale to support the high user loads ofthe Internet has resulted in the intro-duction of middle-tier applicationservers. The application server hastransformed the two-tier client/serverarchitecture into an n-tier architecturewith the following benefits: • Thinner clients with zero client
administration
• Shared business logic across Web andnon-Web applications
• Reduced database load through data-base connection caching
• Higher performance, scalability, andhigh availability achieved throughhardware and software clustering
• Superior manageability• Better security
The application server technology hasalso had a profound effect on the land-scape of the PB marketplace. When SybaseEnterprise Application Server (EAServer)introduced support for PB objects asCORBA-compliant components, thepower of the PB development environ-ment for RAD programming was extendedinto the middle tier of the application.
Today, PB components are complete-ly interoperable with any other CORBAcomponents supported in EAServer,including COM, CORBA, C++, J2EE, andJava. Furthermore, EAServer provides anideal execution environment for mixed-language development and allows orga-nizations to capitalize on the return oninvestment of their prior applicationsdeveloped in PB, and also opens the doorto multivendor development through itssupport for the latest technologies,including XML and SOAP Web services.
What Is the Return on Investment?
As the requirements of an organiza-tion change to take advantage of thepower of the Internet, it is important todetermine the best way to receive divi-dends from existing software applica-tions. One of the basic premises ofachieving return on investment in soft-ware development states that it’s fasterand more cost effective to reuse an exist-
ing application than to redevelop anapplication from scratch. A competitiveedge can be obtained by this reductionin the time-to-market and the associat-ed cost of development. If an organiza-tion has made a significant investmentin PB, the ROI can be measured in thefollowing ways:• Ability to reuse existing code• Ability to move to the Web without
significant retraining costs• Ability to integrate with other tech-
nologies
ABILITY TO REUSE EXISTING CODEThere are many PB objects that can
be reused in a Web environment with lit-tle or no modification. The ability toreuse existing code, such as existingbusiness logic, window layouts, and theassociated database model and storedprocedures, can eliminate months oryears from the software developmenteffort. The resulting time savings con-vert directly into cost savings for theorganization that can add up to millionsof dollars for large applications.
BUSINESS LOGICThe business rules that are unique to
each organization are a key componentof any software application. In manycases, the only place the business logic isfully documented is in the application.Leaving this code behind in the move tothe Web would be costly, and re-imple-menting it in a new environment can beboth error prone and time-consuming.
Instead, the business logic can berehosted as CORBA components thatcan be called from various languagesand platforms. While the location of thebusiness logic moves from the clientmachine into the application server, the
29PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
W W W . J D J S T O R E . C O M
GUARANTEED LOWEST PRICES!
▲▲
▲▲
▲▲
▲▲
▲▲▲▲▲▲▲
▲▲
▲▲
▲▲
Web
Services journal
Readers’CHOICE AWARD
WSJWorld class
AWARD
SIMPLICITYSimplicity˙ Enterprise Lite
SYBASEPowerBuilder Enterprise v.8
Introducing PowerBuilder 8! The award-winning, indus-try-leading application development environment justgot better. Release 8 of PowerBuilder adds exciting newfeatures and capabilities that will make your develop-ment of Web, client/server, and distributed applications easier, faster, andmore cost-effective. New features focusing on improved productivity,tighter integration with EAServer, and Web application developmentmake this release indispensable to your development efforts.
ACCELTREEFULCRUM Professional Edition 1.1 - A Java
Code Assembler
“FULCRUM” is a Java development tool that uses a propri-etary concept of code templates that can be used as"building blocks" to construct efficient Java objects andapplications. Unlike code generators that impose their cod-ing techniques and run-time environments on the users, FUL-CRUM allow users to build their own coding standards in the templates andalso lets users switch to manual coding at any point in time.
$2,558.99
OFFER SUBJECT TO CHANGE WITHOUT NOTICE
Simplicity Enterprise Lite provides the ability tobuild server-side, enterprise class Web applica-tions. Using a palette of graphical modules, the developer links togethertheir desired functionality and interactively tests their application in oneseamless development environment. Application targets include Web sites,WAP-enabled mobile devices, n-tier application services, and enterpriseServlets.
$3,999.00$469.99
POINTBASEPointBase Embedded 4.4 - Windows Installer
PointBase® Embedded is a 100% Pure Java˙RDBMS ideal for embedding in your Java appli-cations, within the J2EE˙ and J2SE˙ platforms. PointBase Embedded utilizesa multi-threaded architecture allowing multiple connections from within thesame JVM. PointBase Embedded features also include small footprint archi-tecture, extensibility, referential integrity, near-zero administration, and a lowcost of ownership.
$353.00/N SOFTWARE
IP*Works! SSL Scripting Edition (1 cpu)
IP*Works! SSL adds SSL and Digital Certificate capabilitiesto the IP*Works! Internet Toolkit providing Secure WebBrowsing, Secure Client, Secure Server, Secure Mail,Digital Certificate Management Capabilities, and a lotmore. The current release consists of 15 components forsecure Internet connectivity.
$295.00
BORLANDJBuilder 7 SE NEW-USER 98/W2K/NT/LINUX/SOL
JBuilder˙ is the leading cross-platform environment forlearning Java˙ programming and personal applicationdevelopment. JBuilder 6 Personal includes an integratededitor, debugger, compiler, visual designers, wizards,and tutorials.
$389.99
SHOP ONLINE AT JDJSTORE.COM FOR BEST PRICES OR CALL YOUR ORDER IN AT 1-888-303-JAVA
Attention Java Vendors:To include your product in JDJStore.com, please contact [email protected]
GUARANTEED LOWEST PRICES!
Helping you enable intercompany collaboration on a global scale• Product Reviews• Case Studies• Tips, Tricks
and more!
Now in More
than 5,000
Bookstores Worldwide –
Subscribe NOW!
Go Online & SubscribeToday!*Only $149 for 1 year (12 issues) – regular price $180.
We bLogicDevelopersJournal.comSYS-CON Media, the world’s leading publisher of i-technology magazines for developers,software architects, and e-commerce professionals, brings you the most comprehensive coverage of WebLogic.
SPECIALOFFER!SAVE $31*OFFER SUBJECT TOCHANGE WITHOUT NOTICE
THE WORLD’S LEADING INDEPENDENT WEBLOGIC
DEVELOPER RESOURCE
30 PBDJ volume10 issue6 www.POWERBUILDERJOURNAL.com
PB code does not have to be significant-ly modified, reducing the possibility ofintroducing new software defects intothe codeline. One of the greatest justifi-cations for the ROI of PB applications isthat nearly all of this business logic isreusable without significant modifica-tions.
In addition, by moving the businesslogic into the middle tier of the applica-tion, the business rules are fully accessi-ble to the entire enterprise as CORBAcomponents or SOAP Web services. Theexposure of these business rules allowsthe organization to continue to inte-grate disparate systems into true enter-prise-wide applications. This extendsthe current business rules written in PBto the entire enterprise and enables theorganization to react to future changesin the business requirements.
DATAWINDOW TECHNOLOGYOne of the most powerful features of
PB is the DataWindow technology that isthe foundation of any application builtin PB. The data-aware DataWindowobject combines the visual presentationof the window with behind-the-scenesinformation required to update thedatabase into a single object-orientedcontrol that is unmatched in the indus-try. The DataWindow also tracks whichdata has been modified and can trans-late the data result into the latest tech-nologies including XML, browser-neu-tral HTML/JavaScript, and standard fileformats like Adobe PDF and MicrosoftExcel.
The DataWindow alone comprisesover half of most PB applications and pro-vides the key foundation to migratingexisting applications to the Web. Re-creat-ing existing screens as HTML andJavaScript without a tool is an enormoustask and should not be undertaken lightly.Especially since the existing DataWindowlayouts and table structures can be reusedin components that are moved to themiddle tier, eliminating the need toredesign and recode significant portionsof the application. The end result is thatexisting PB applications can be migratedto the Web in very short time frames.
In the past, many Web applicationshave been largely read-only or onlyallowed updates to simple forms. Today,by combining the ability of the PBDataWindow to manage and updatelarge results with the ease of construct-ing complex windows and forms, thetype of application that can be easilyconstructed on the Web has beenexpanded to include heavy-duty data-entry applications that were previously
only available in the client/server envi-ronment.
DATABASE STORED PROCEDURES,EMBEDDED SQL, AND THE EXISTING DATA MODEL
PB has traditionally been databaseagnostic but tightly integrated withdatabase servers to provide rich data-base applications through the use ofdatabase stored procedures and embed-ded SQL that references the existing datamodel. The existing data model does nothave to be modified to support a Webapplication and all the database storedprocedures in the database and embed-ded SQL in the PB applications can bereused in the Web application with littleor no modification.
ABILITY TO MOVE TO THE WEB WITHOUTSIGNIFICANT RETRAINING COSTS
In any organization, among its mostvaluable assets are the people whomake up the organization and theknowledge they possess about the day-to-day business activities that the orga-nization completes. The current devel-opment staff has detailed knowledge ofthe numerous software applicationsand the automated business rules thatsupport the organization. The ability tomaximize the current staff’s knowledgeabout the existing application whenmigrating it to the Web, without incur-ring significant retraining costs, cancontribute significantly to the ROI.
When migrating PB applications tothe Web, some new skills are required,such as knowledge of HTML, JavaScript,JSPs, and component-based develop-ment. The steepest and most difficultpart of the learning curve is compo-nent-based development and how todeploy the components to applicationservers. The best practices in compo-nent development are largely languageindependent and it’s generally acceptedthat it’s easier to teach someone a newsubject if it’s taught in a programminglanguage that’s already well understood.Experienced PB developers can easilybecome experienced PB componentdevelopers in three months or less,compared to the 12–18 month timeframe that it takes to become an experi-enced component developer and learnthe nuances of a new language at thesame time. This reduces the trainingtime by 9–15 months, and the savingscan directly impact the organization’sability to lower the time-to-market ofthe Web application and significantlyincrease the ROI of PB.
In addition, the PB IDE allows devel-
opers to develop HTML, JavaScript, andJSP-based Web applications withoutleaving PB. The PB IDE has many wiz-ards that lead new developers throughthe process of creating new componentsand has the ability to drag-and-dropHTML, JavaScript, and JSP language ele-ments directly into source code. It alsohas a WYSIWYG approach to Web devel-opment that allows the developer to seethe layout of the pages as they are beingdeveloped. All the features of the PB IDEhelp lower the learning curve andreduce the cost and time to bring Webapplications to the marketplace.
ABILITY TO INTEGRATE WITH OTHER TECHNOLOGIES
In today’s technology marketplace,things are changing quickly and it’simportant to stay up-to-date with theother technologies. PB has long beenknown for its ability to work with any ofthe major database vendors, and thatstrong database support continues today.PB currently supports native drivers to allthe major database vendors and workswith any ODBC-compliant datasource.PB also has a history of openness throughstrong support of other client applica-tions through the use of standarddatatypes and support for Microsoft OLEto allow applications to communicate. PBhas continued to expand the openness ofthe product with the addition of bidirec-tional XML support and the ability to actas a client to EJBs and Web services.
As the primary host for PB-basedWeb applications, EAServer follows inthe Sybase tradition of open productsby providing support for more compo-nent models than any other applicationserver (PB, J2EE, Java, CORBA, C/C++,COM) with full interoperability betweencomponent models, and it’s database-agnostic. EAServer also offers manycommon services necessary to supportenterprise Web applications, includingtransaction management, advancedperformance management, messaging,and clustering capability, which pro-vides load balancing, high availability,and failover. It’s the leader in standardsand role-based security and protectscritical data while in transit and whenstored with support for SSL and X.509digital certificates. EAServer also pro-vides a full-featured Web server andplug-ins for major Web servers includ-ing Apache, Netscape, IIS, and iPlanet.
PB is tightly integrated withEAServer, allowing point-and-clickdevelopment and deployment of Webapplications that rely on the power ofthe DataWindow under the covers while
31PBDJ volume10 issue6www.POWERBUILDERJOURNAL.com
the annual newsstand rateSAVE$31Off*
SAVE$31Off*
Receive 12 issues of PBDJ for only $149.00. That’s a savings of $31 off the annual newsstand rate.
Visit our site at www.powerbuilderjournal.com or call 1-888-303-5282 and subscribe today!
ANNUAL COVER PRICE
$180.00ANNUAL NEWSSTAND RATE
$149.00
$31
YOU PAY
YOU SAVEOff the AnnualNewsstand Rate
• New PowerBuilder Features • Tips, Tricks and Techniques in
Server-Side Programming • DB Programming Techniques • Tips on Creating Live PowerBuilder Sites • Product Reviews • Display Ads of the Best Add-on Products • PowerBuilder User Group Info
Here’s whatyou’ll find in every
issue of PBDJ
Here’s whatyou’ll find in every
issue of PBDJ• New PowerBuilder Features • Tips, Tricks and Techniques in
Server-Side Programming • DB Programming Techniques • Tips on Creating Live PowerBuilder Sites • Product Reviews • Display Ads of the Best Add-on Products • PowerBuilder User Group Info
*Offer subject to change without notice
AUTHOR BIOJoe Fritsch is a principaltechnology consultantfor Sybase, Inc.
exposing business logic in industry-standard waysthat are accessible throughout the enterprise.Together, PB and EAServer collaborate to provide anopen and flexible environment for integrating appli-cations built on the latest technologies, including Webservices, XML, J2EE, HTML, and CORBA while stillmaximizing the ROI for applications developed inPowerBuilder.
SummaryPB has helped thousands of organizations develop
a half-million production applications by providingopen and flexible technology. The PB technology hascontinued to be enhanced to ensure it stays open andcompliant with the latest technologies, includingXML, JSPs, EJBs, and Web services.
EAServer hosts more component types than anyother application server and provides componentinteroperability that’s ideal for mixed-language appli-cations. The added support for the latest technologies,including Web services, XML, J2EE, HTML, andCORBA, helps ensure that enterprise Web applicationsbuilt using EAServer are open and flexible.
When used together, PB and EAServer collaborateto provide the ability to reuse existing code, to move tothe Web without significant retraining costs, and tointegrate with other technologies. PB and EAServerallow the organization to maximize the return oninvestment in PB and position the organization for thefuture. ▼
PBDJ ADVERTISER INDEXADVERTISER URL PHONE PAGE
Advertiser is fully responsible for all financial liability and terms of the contract executed by theiragents or agencies who are acting on behalf of the advertiser. This index is provided as an addi-tional service to our readers. The publisher does not assume any liability for errors or omissions.
Amyuni Technologies, Inc. www.amyuni.com 866-926-9864 2
E.Crane Computing www.ecrane.com 603-226-4041 35
JDJ Store www.jdjstore.com 888-303-JAVA 29
Linux Business & Technology www.sys-con.com 888-303-5282 23
PowerBuilder Developer's Journal www.powerbuilderjournal.com 888-303-5282 31
PowerObjects www.powerobjects.com 612-339-3355 36
Sybase www.sybase.com/powerbuilder 925-236-5000 5
Sybase, Inc www.sybase.com/pbextension 925-236-5000 9
Sybase, Inc www.sybase.com/powerbuilder 925-236-5000 11
Sybase, Inc www.sybase-iad-services.com/30081a 877-230-6771 15
Sybase TechWave 2003 www.sybase.com/techwave2003 800-354-5687 17
SYS-CON Media http://developer.sys-con.com 888-303-5282 22
SYS-CON Reprints www.sys-con.com 201-802-3026 29
SYS-CON Subscription Offer www.sys-con.com/suboffer.cfm 888-303-5282 32-33
Web Logic Developer's Journal www.weblogicdevelopersjournal.com 888-303-5282 29
Web Services Edge West 2003 www.sys-con.com 201-802-3069 19
and receive yourFREE CD Gift Package VIAPriority MailEach CD is an invaluable developerresource packed with important articles and useful source code!
The largest and most complete library of exclu-sive XML-Journal articles compiled on one CD!Edited by well-known Editors-in-Chief Ajit Sagarand John Evdemon, these articles are organizedinto more than 30 chapters containing morethan 1,150 articles on Java & XML, XML &XSLT, <e-BizML>, data transition... and more!
LIST PRICE $198
The most up-to-date collection of exclusiveWSDJ articles! More than 200 articles offerinsights into all areas of WebSphere, includ-ing Portal, components, integration, tools,hardware, management, sites, wireless pro-gramming, best practices, migration...
LIST PRICE $198
The most complete library of exclusive CFDJarticles on one CD! This CD, edited by CFDJEditor-in-Chief Robert Diamond, is organizedinto more than 30 chapters with more than 400exclusive articles on CF applications, customtags, database, e-commerce, Spectra, enter-prise CF, error handling, WDDX... and more!
LIST PRICE $198
More than 1,400 Web services and Java articleson one CD! Edited by well-known editors-in-chief Sean Rhody and Alan Williamson, thesearticles are organized into more than 50 chap-ters on UDDI, distributed computing, e-busi-ness, applets, SOAP, and many other topics.Plus, editorials, interviews, tips and techniques!
LIST PRICE $198
The most complete library of exclusive JDJarticles compiled on one CD! Assembled byJDJ Editor-in-Chief Alan Williamson, morethan 1,400 exclusive articles are organizedinto over 50 chapters, including fundamen-tals, applets, advanced Java topics, Swing,security, wireless Java,... and much more!
LIST PRICE $198
An up-to-the-minute collection of exclusive LinuxBusiness & Technology articles plus MaureenO'Gara's weekly LinuxGram, which keeps a finger onthe pulse of the Linux business community. Editedby LBT's Editor-in-Chief Alan Williamson, these arti-cles cover migration, hardware, certification, and thelatest Linux-related products. Available June 2003!
LIST PRICE $198
The most complete library of exclusive WLDJarticles ever assembled! More than 200 arti-cles provide invaluable information on “every-thing WebLogic”, including WebLogic Server,WebLogic Portal, WebLogic Platform,WebLogic Workshop, Web services, security,migration, integration, performance, training...
LIST PRICE $198
Pick the CDsto go with yourMulti-Pack orderPick one CD withyour 3-Pack orderPick two CDs withyour 6-Pack orderPick three CDs withyour 9-Pack order
Your order will beprocessed the same day!
■ Web Services Resource CD■ Java Resource CD■ WebLogic Resource CD■ ColdFusion Resource CD■ XML Resource CD■ WebSphere Resource CD■ Linux Resource CD
Subscribe Online Today
A LIMITED TIME SAVINGS
Go To www.sys-con.com/suboffer.cfmSUBSCRIBE TODAY TO MULTI
3-PackPick any 3 of our magazines and saveup to $27500
Pay only $175 for a 1 year subscriptionplus a FREE CD• 2 Year – $299.00• Canada/Mexico – $245.00• International – $315.00
6-PackPick any 6 of our magazines and saveup to $35000
Pay only $395 for a 1 year subscriptionplus 2 FREE CDs• 2 Year – $669.00• Canada/Mexico – $555.00• International – $710.00
9-PackPick 9 of our magazines and saveup to $40000
Pay only $495 for a 1 year subscriptionplus 3 FREE CDs• 2 Year – $839.00• Canada/Mexico – $695.00• International – $890.00
RECEIVEYOUR DIGITAL
EDITIONACCESS CODEINSTANTLY
WITH YOUR PAID SUBSCRIPTIONS
www.sys-con.com/2001/sub.cfm
■ Web Services JournalU.S.- Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CDU.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CDCan/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ Java Developer’s JournalU.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CDU.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22Can/Mex - Two Years (24) $168 You Pay: $119.99 / Save: $48 + FREE $198 CDCan/Mex - One Year (12) $84 You Pay: $79.99 / Save: $4Int’l - Two Years (24) $216 You Pay: $176 / Save: $40 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ Linux Business & TechnologyU.S. - Two Years (24) Cover: $143 You Pay: $79.99 / Save: $63 + FREE $198 CDU.S. - One Year (12) Cover: $72 You Pay: $39.99 / Save: $32Can/Mex - Two Years (24) $168 You Pay: $119.99 / Save: $48 + FREE $198 CDCan/Mex - One Year (12) $84 You Pay: $79.99 / Save: $4Int’l - Two Years (24) $216 You Pay: $176 / Save: $40 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ .NET Developer’s JournalU.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CDU.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CDCan/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ XML-JournalU.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CDU.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CDCan/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ ColdFusion Developer’s JournalU.S. - Two Years (24) Cover: $216 You Pay: $129 / Save: $87 + FREE $198 CDU.S. - One Year (12) Cover: $108 You Pay: $89.99 / Save: $18Can/Mex - Two Years (24) $240 You Pay: $159.99 / Save: $80 + FREE $198 CDCan/Mex - One Year (12) $120 You Pay: $99.99 / Save: $20Int’l - Two Years (24) $264 You Pay: $189 / Save: $75 + FREE $198 CDInt’l - One Year (12) $132 You Pay: $129.99 / Save: $2
■ WebLogic Developer’s JournalU.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CDU.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CDCan/Mex - One Year (12) $180 You Pay: $169 / Save: $11Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CDInt’l - One Year (12) $180 You Pay: $179 / Save: $1
■ Wireless Business & TechnologyU.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CDU.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22Can/Mex - Two Years (24) $192 You Pay: $139 / Save: $53 + FREE $198 CDCan/Mex - One Year (12) $96 You Pay: $79.99 / Save: $16Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CDInt’l - One Year (12) $108 You Pay: $99.99 / Save: $8
■ PowerBuilder Developer’s JournalU.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CDU.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CDCan/Mex - One Year (12) $180 You Pay: $169 / Save: $11Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CDInt’l - One Year (12) $180 You Pay: $179 / Save: $1
■ WebSphere Developer’s JournalU.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CDU.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CDCan/Mex - One Year (12) $180 You Pay: $169 / Save: $11Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CDInt’l - One Year (12) $180 You Pay: $179 / Save: $1
■ 3-Pack ■ 1YR ■ 2YR ■ U.S. ■ Can/Mex ■ Intl.
■ 6-Pack ■ 1YR ■ 2YR ■ U.S. ■ Can/Mex ■ Intl.
■ 9-Pack ■ 1YR ■ 2YR ■ U.S. ■ Can/Mex ■ Intl.
•Choose the Multi-Pack you want to order by checkingnext to it below. •Check the number of years you want toorder. •Indicate your location by checking either U.S.,Canada/Mexico or International. •Then choose which magazines you want to include with your Multi-Pack order.
TOORDER
Pick a 3-Pack, a 6-Pack or a 9-Pack
OFFER FROM SYS-CON Media
OFFER SUBJECT TO CHANGE WITHOUT NOTICE
PLE MAGAZINES ONLINEAND SAVE UP TO $400 ANDRECEIVE UP TO 3 FREE CDs!
34 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
POWERBUILDERPocket PowerBuilder Beta4/14 – Sybase announced theupcoming beta release of PocketPowerBuilder, a new technologydesigned to simplify and speedthe creation of mobile and wire-less enterprise applications forPowerBuilder developers. UsingPocket PowerBuilder, developerswill be able to leverage theirexisting expertiseand applicationsto extend enterprise informationto Windows CE–based devices.www.sybase.com/pocketpb
PBDelta 4.04/01 – PowerBuilder Developer’sResource announced the releaseof version 4.0 of PBDelta. Thenew version features Java sourcecode parsing, batch processingoutput to popular formats, abatch wizard to easily createbatch files,support forediting of merged code, a newline compare feature, a new clip-board compare window, a newmerge results reports, support forpipeline objects, and color-coded reports. www.pbdr.com
CORPORATEEarnings4/17 – Sybase announced firstquarter pro forma diluted earn-ing per share (EPS) of $0.17 com-pared to $0.21 in the first quarter2002. First quarter EPS based onGenerally Accepted AccountingPrinciples (GAAP) was $0.13compared to GAAP EPS of $1.14reported in the first quarter 2002.
WestLake Internet Training4/15 – Sybase and WestLakeInternet Training announcedtoday a major partnership ineducational training. SybaseEducation will expand its currenttraining offerings to include Webdevelopment training usingWestLake’s premier Web develop-
ment curriculum. Sybase Edu-cation is offering Web develop-ment training starting in the NewYork Metro Area Learning Center,then expanding to several citiesthroughout the U.S.
CodeXchange4/08 – Sybase announced theavailability of CodeXchange, anew online forum for SybaseDeveloperN e t w o r k(SDN) members. CodeXchangeenables Sybase developers, cus-tomers, and partners to sharecode samples, collaborate onopen source projects, and partic-ipate in community discussions,among other activities. www.sybase.com/developer/codexchange
ENTERPRISE PORTALDOD Center of Excellence4/14 – Sybase announced that TheDepartment of Defense (DOD)Joint Program ManagementOffice (JPMO) selected SybaseEnterprise Portal for the deploy-ment of an online Center ofExcellence aimed at increasingthe effectiveness and ROI of theDOD-wide Standard Procure-ment System (SPS), an automatedinformation system designed tosupport procurement functions,from requirements definitionthrough contract completion.
iANYHWERENokia4/29 – iAnywhere Solutions, asubsidiary of Sybase, and Nokiaannounced that the My AvantGoservice is now available to Nokiaimaging phone users, marking thefirst availability of My AvantGo forwireless devices based on theSymbian operating system. Usersof the Nokia 3650 and 7650 imag-ing phones can access more than2,500 channels. Users can down-load the free software fromwww.myavantgo.com.
American Airlines4/07 – iAnywhere Solutions, asubsidiary of Sybase, announcedthat the My AvantGo travel sec-tion soars to new heights with themost up-to-the-minute flightschedule and loyalty programinformation for frequent fliers.My AvantGo expanded its mobilechannel offering, unveiling a newm o b i l eWeb sitefrom American Airlines. MyAvantGo channels enable com-panies to extend their marketingefforts to more than eight millionregistered mobile users world-wide.
ADAPTIVE SERVER ENTERPRISEPowerEasy ERP4/29 – PowerEasy Corporation andSybase introduced PowerEasy ERPfor Apple Xserve, a suite of enter-prise resource planning (ERP)applications powered by SybaseAdaptive Server Enterprise. Po-werEasy ERP’s e-commerce, logis-tics, and financials applicationsare specifically tailored to theneeds of small and medium busi-nesses that require enterprise-class power and ease-of-use.
VERSIFI Technologies4/15 – Sybase announced thatVERSIFI Technologies is achiev-ing faster time-to-market andlower total cost of ownership(TCO) by developing solutionson Sybase Adaptive ServerEnterprise 12.5, Sybase’s enter-prise-class rela-tional databasemanagement sys-tem. Sybase ASE’s rich Java func-tionality and commitment toopen standards enabled VERSIFIto rapidly port its Web contentmanagement applications fromMicrosoft SQL Server, reducingcosts and programming time sothe company is able to offer com-petitively priced solutions and
maintain a first-mover advantagein its market.
iForce4/14 – Sybase announced thatthe iForce solution for Econo-mical Data Management, jointlydeveloped with Sun Microsys-tems and based upon Sybase IQand Sun Fire V880 and V480 sys-tems, has been recognized as“Best e-Business Solution” at theinaugural iForce Partner Exce-llence ceremonies.
FINANCIAL FUSIONCorporate Banking Solution4/28 – Financial Fusion, a sub-sidiary of Sybase, announced thegeneral availability of FinancialFusion Corporate BankingSolution. The company alsoannounced the first customer tolicense the solution, FirstTennessee, one of the top 50banks in the U.S.with over $23 bil-lion in assets.Corporate Banking Solution is aWeb-based cash managementand global payments system.
Princeton eCom4/21 – Financial Fusion, a sub-sidiary of Sybase, and PrincetoneCom announced an agreementto provide the financial servicesindustry with a complete end-to-end ASP solution for bill pay-ment. The alliance will combineFinancial Fusion PaymentsSolution with Princeton eComRemittance Processing ASP.
EVENTSTechWave 2003August 4–8, 2003Orlando, Floridawww.sybase.com/techwave2003
PowerBuilder NewsAll things of interest to the PB community BY BRUCE ARMSTRONG
www.POWERBUILDERJOURNAL.com 35PBDJ volume10 issue6
E.Crane Computingwww.ecrane.com
36 www.POWERBUILDERJOURNAL.comPBDJ volume10 issue6
PowerObjectswww.powerobjects.com