Home
DYNAMIC DATAWINDOWS WEB SERVICES EDGE
Contents
1. Next go into the window and add a user event called ue lookup In the script for this event code displayvalue will contain the dis play value the user has selected from ddlb or dddw column string displayvalue displayvalue dw_l getitemstring dw_l getrow dis play In the ltemchanged event for the main DataWindow dw_1 code check to see if the ddlb or dddw column is the correct one they are changing use the column number of the ddlb or dddw column if getcolumn 3 then parent event post ue_lookup end if ADDING A DDDW AT RUNTIME had some trouble getting this to work apparently you have to reconnect to the database for it to function proper ly Here is an example that builds the Modify string with the attributes see Listing 1 Listings 1 3 can be downloaded from www sys con com pbdj sourcec cfm e Make dept id the data column e Make dept name the display col umn e Insert an arrow on the dropdown list e Allow editing in the text box e Insert a vertical scroll bar on the drop down list Be sure that we are assigning the DataObject of the child DataWindow dynamically which might end in an error message in the compiled code only PBDJ volume10 issue2 17 Autor Bio Berndt Hamboeck is a senior consultant for BHITCON He s a CSI SCAPC8 EASAC and SCJP2 and started his Sybase development using PB5 The GetChild function returns 1 when
2. reports we ll use that as our model Let s pretend our users want awindowto view reports We can put this together using one window one DataWindow control one listbox one object level function a few DataWindow objects about a dozen lines of code and some elbow grease Only a dozen lines of code We only need one DataWindow control Yes that s all we need if we use the dataobject property of the DW con trol dynamically at runtime i Most folks starting out with PB get into a habit of using one DW control with one mrd mn ri Ia mwr k I mr Hebie ject at vegt da i Sekirei jerk i Slk da ere oh result set 28 PBDJ volume10 issue2 e Create a main Object level function for retrieving the DataWindow DW object defined at design time Good for starting out but not very flexible With a little creativity we can have so much more for so much less Fireup the new PC you got in December from your i rich relatives and follow along with me e Create a new workspace and target or just use ones you already have w_reports Drop a DataWindow DW control named dw_1 and change the name of the listbox to Ib reports Save the window i e Create three DataWindow objects 5 Set the dataobject property of the using the sample database EAS Demo DB V4 1 dw employee A simple report show
3. Also the column name for the processing of dw choices is expected to be the same as the variable i_str column column_name We expect that PBDJ volume10 issue2 13 the first column of the temporary table is the column to be used as the retrieval criteria thus the code refers to column number one to populate the DS ds temptable link In case a column does not reguire a browser but just one value we use the itemchanged event of the criteria DW The event s code calls the func tion of modify paraminfo passing it all three parameters of the itemchanged event The code of the function isin Listing 12 and is very similar to the code of the OK button in Listing 11 Finally the function of prepare criteria prepares all temporary tables before a report retrieval see Listing 13 It drops and re cre ates all temporary tables in case another report window modified them for itself and then calls the Update function for the ds temptable link DataStore of each element of thei_str_colinfo array The second argument of the function is set to False not to reset flags thus allowing temp table INSERTs the next time the function of prepare criteria is called The report retrieve follows immediately Lets look at an example of a reports stored procedure that uses a temporary table Assume we have a table that describes stocks and we want to retrieve information about certain ones If a user does not select anything we want all stoc
4. to a client with version 7 2 Prior to that However there are also methods avail able to handle intermediate data With some other databases this is accom plished through the use of temporary tables Much the same can be done with Oracle except that instead of creating a physical temporary table we create something similar in memory Welll use the code in Listing 1 for our examples Note that PL SOL record types can also be declared to be equivalent to a table definition through the ROW TYPE attribute So we could have used this instead TYPE r employee IS emp rowtype Or more simply TYPE constrainedcursor IS REF CURSOR RETURN emp rowtype The actual element by element record type declaration is used in the examples ww w POWERBUILDER OURNAL com in Listing 2 because it offers greater flexi bility with regard to mixing elements from more than one table or elements that are independent of any table though it does reguire a bit more work types first CREATE R REPLACE TYPE EMPINFO IS OBJECT empno number 4 0 ename varchar2 10 Job varchar2 9 CREATE OR REPLACE TYPE EMPINFOLIST AS TABLE OF EMPINFO We re going to use those object types as a method of storing intermediate data Notethat we used actual datatypes rather than column type references to createthe object type see Listing 3 Listings 3 5 can be downloaded from www sys con com pbdj source
5. Autocomplete DDDW We would like to implement the type along search functionality for a Drop DownDataWindow This means that when we start typing in our DDDW col umn we want the column to display the next matching value automatically see Figure 3 The steps to accomplish this are e Make your DDDW column editable e Code the editchanged for DDLB and itemfocuschanged for DDDWS This can befound in the PFC I ve pre pared a complete sample where I extracted the code from the PFC it can be downloaded from PBDJ s Web site www sys con com pbdj sourcec cfm or from www bhitcon net In this sample you ll find the autocomplete feature as well as everything we were discussing Conclusion The DropDownDataWindow DDDW edit style is one of PowerBuilder s most use ful features Its essentially a DataWindow within a DataWindow Its most common use is as a listbox type control where the DataWindow that s actually dropped down looks and acts like a listbox control allow ing the user to select a row But as we ve seen this is just the beginning of what can be done with dropdowns DDDWS are a powerful feature in PowerBuilder they re not easy to use but if you Know how to use them correctly you re one step closer to becoming a PowerBuilder expert v ___admin bhitconnet_ ww w POWERBUILDER OURNAL com Calling Sleek Geeks E verywhere Make sure you have your finger on the pulse of i Technology bookmark http
6. ENTERPRISE PORTAL Digital China 12 03 02 Sybase announced a strategic alliance partnership with Digital China China s largest systems integrator in pro viding e business solutions in China Through the partnership Digital China is expected to PIN RES Digital China become one of the first and biggest portal systems integra tors in China www digitalchina com hk iANYWHERE Aw ards 12 17 02 iAnywhere Solutions announced that the company recently received industry acco lades from Field Force Automation Forbes and InfoWorld These pub lications recognized iAnywhere Solutions leadership in the mobile BELETTEN E k KEKEN NL O and remote enterprise computing industry extending business criti cal information to workers any where anytime Market Share 12 17 02 iAnywhere Solutions a subsidiary of Sybase announced that it leads the mobile database market for the sixth year in a row Sybase was able to increase its share of the market from 68 in 2000 to 73 in 2001 As the global economy slowly pulls out of reces sion the mobile DBMS market is expected to pick up fairly rapidly Gartner is predicting a compound annual growth rate of over 16 through 2006 This will cause the market to more than double from slightly under 70 million in 2001 to around 150 million in 2006 ADAPTIVE SERVER ENTERPRISE HP 12 16 02 Sybase and HP announced an expansion to their strategic all
7. Employee List of runreport dw employee CASE 3 Employee Phonebook of_runreport dw_phonebook END CHOOSE Run the application The DW control 7 Perform a Retrieve or Update on Make sure you save the window will be empty initially Just click on one the DW control before leaving the instance variable of the reports Each time you select a area report it will change the DW control l Il assume you already have SQLCA suc Create an object level function called dataobject property reset the transac cessfully connected to the database if you of runreport Make it with one tion object connection and retrieve the dont review my December article We input parameter of type DataWindow data Figure 2 shows the completed win must usethe lt dw_control gt SetTransObject Code it as shown in Figure 1 dow By using one DW control the print lt tranx object gt function However we Select the listbox Ib reports On the button logic is simple dw_1 Print must remember the following rule if we Properties panel select the Items tab Now you havea base report module You change the dataobject property the con We ll make our report pick list may want to add a few bells and whis nection is broken and we must reset the DW Create the items as follows tles such as radio buttons to re sort AUTHOR Bio control to the transaction object Were Customer List the data from ascending to de
8. Liquid Data indicates that a race is on to provide the best tools to help companies achieve that goal Recently Sybase launched a free online Information Liquidity assessment tool to help busi nesses transform data into economic value To assess your company or find out more about this concept go to www informationliquidity com Have you lost your excitement for the DataWindow Has it become a boring blas topic Granted we ve been publishing articles and books about the DataWindow since 1994 so it isn t exactly a new topic However it is the premier feature of PowerBuilder and it keeps getting more and more powerful Every year when we put together the editorial calendar for PBDJ we plan on having an issue that focuses on the DataWindow Its a feature that interests all our readers whether developing client server n tier or Web This year with the release of PowerBuilder 9 nearly upon us the excitement about the DataWindow is mostly about the new XML features Certainly it will catch the interest of Web developers but it is also a valuable feature for n tier and client server development That point is often overlooked because people don t understand the value of XML in general nor of the DW XML features At a minimum it gives us an additional format for storing our DataWindow data and presentations Even more it s simply a string but as XML it will be self descriptive and in some situations will be usable by non PB cli
9. amp height autosize yes criteria trail footer yes name dw_nested_2 amp visible 1 dw_l Modify ls_modstring slideup directlyabove The nested report named dw_nested 2 uses d composite tab as its DataWindow object It s important to point out that even though nested reports can be created dynamically the DataWindow objects that they are associated with cannot In this example d_composite tab must already exist It can t be created dynami cally via a SyntaxFromSQL function Although SyntaxFromSQL can be used to dynamically create a DataWindow object to be used as the source of a DataWindow or DataStore it s no help to us when using nested reports Sharing Data Between Reports Because nested reports within a composite DataWindow are truly DataWindow children the same result set can be shared among them with a ShareData method Of course the col umn sets must match in all of the nested DataWindows that share the result set Sharing a result set is much faster than retrieving all nested reports individually as only one data base retrieve needs to be performed The fol lowing code retrieves a result set into a DataStore then shares it with two nested reports DataStore lds prod into 10 PBD volume10 issue2 DataWindowChild ldwc_nestl DataWindowChild ldwc_nest2 lds_prod_info CREATE DataStore lds_prod_info DataObject d composite_tab lds_prod_info SetTransObject SOLCA lds prod Anr dw_
10. DataWindow So the student reretrieves saved into the database You might also con sider of users forget when you test your applica tion you havejustafew rows in your DDDW checking the V ScrollBar property This is something a lot TYY A TECHNIQUES an IPIGKS One step closer to PowerBuilder expertise When you go into production you ll havea lot of rows there but now the user cant scroll with the mouse to these rows Now well start by describing some problems beginners frequently run into when they are using DDDWs The first problem I ve encountered as a trainer in the Fast Track to PowerBuilder classes is the following A student creates a DataWindow and wants to define a column with the DropDownDataWindow edit style He or she opens a second DataWindow painter and creates the DDDW and saves it remember the naming conven tion for DDDWS Yes it s d dddw_xxxx where xxxx is your part of the name Now the student switches back to the column and configures the edit style The next step is to test the DDDW col umn by inserting a new row or collaps ing the column on an existing row Well the student expects to see his or her DDDW data from the database but that s wrong The DDDW is empty see Figure 2 but why Well the DDDW is filled only after a retrieve of the the data and voil everything is fine when we look at the column The next thing we should talk about is DDDWS with
11. Help ME Cai rui Beer M CaaTrarrsach H B IDI Him Package a i Dj Zeevis BHD Senet bed a al HE Comecton Caches HI E IraianraP ook r Deploy the pbsecurity jar to EAServer at cm I a B Canu m om 1 EI 1E t i Jiri J i ww w POWERBUILDER OURNAL com extension into the JVM that EAServer uses By default EAServer contains its own JDK directo ries in the SYBASE SHARED Sun jdk directo ry The JVM contains an extensions directory in which every jar file dropped into the direc tory is automatically made available to the JVM without having to make any BOOTCLASSPATH or CLASSPATH modifications Be especially careful and never arbitrarily drop a jar file into this location as it s assumed that only trusted code would ever be placed here The next jar file you ll need is on the same page named something like jce jdk13 116 jar under the Clean Room JCE and Provider header e Step 1 Copy the bcprov jdk14 116 jar file into the SYBASE SHARED Sun jdk jdk1 4 jre lib ext directory on your machine Copy the jce jdk13 116 jar into your JAGUAR root directory If you ve used EAServer for some time you re familiar with some of the classloader idiosyn crasies it displays This is one of them Because of article deadlines I didn t have time to fully explore why this configuration works but it does Despite placing the Bouncy Castle provider into the extensions folder of the JDK and the fact that JDK 1 4
12. Nested Reports The first way to include a report within a report is to add one to an existing Data Window Nesting reports is a common practice when dealing with a master detail relation ship Adding a nested report is straightforward within the master DataWindow select the report icon from the control palate then drop it in the detail band Figure 1 contains a master DataWindow that displays the columns from the department table Within the detail line on the left hand side is a nested report that contains a list of all employees who work within the department displayed on each detail line The nested DataWindow takes the department ID for a retrieval argument A design time view is dis played in Figure 1 6 PBDJ volume10 issue2 When it was created the nested Data Window d_chap_emps was defined to accept a retrieval argument the department ID and then display employee information for that department To establish the link between the master DataWindow and the nested one sup ply the arguments property of the nested DataWindow with an appropriate value in this case the value of the dept id column Now when the master detail window is retrieved the department ID will be passed as a retrieval argument to the nested DataWindow in turn displaying all employees for that department Nested reports don t always have to exist in the detail band Figure 2 displays a master DataWindow grouped by the state column The group band
13. Region String mm Nested report In a group band PBDJ volume10 issue2 7 Compara Hams Header T eer Nait in 7 Nested report in the header band The code to retrieve them would be DataWindowChild DataWindowChild dw_1 GetChild dw_cust ldwc_cust dw_l GetChild dw_product ldwc_product ldwc_cust SetTransObject SOLCA ldwc_product SetTrans0bject SQLCA ldwc_cust Retrieve IL ldwc_cust ldwc_product ldwc_product Retrieve Central Notice when obtaining a handle to the DataWindow child the actual name of the nested report is specified not the DataWindow object associated with it Furthermore for the sake of brevity and readability return codes were not checked in the this code example Because the nested DataWindows are truly DataWindow children a GetChild method can be called to obtain their handle Any method that is valid for a DataWindow child may now beused If you don t want or need to obtain the nest ed reports as DataWindow children theres a way in which they may be retrieved directly without obtaining their child handle Retrieval arguments can be specified within the DataWindow Painter as a general property of the composite DataWindow see Figure 5 Now that the retrieval arguments are a gen eral property they need to be plugged into the nested DataWindows From within the DataWindow Painter right click on the nested repo
14. Two Years 24 360 You Pay 189 99 Save 170 FREE 198 CD Int l One Year 12 108 You Pay 99 99 Save 8 Int l One Year 12 180 You Pay 179 Save 1 Si SYS CON MEDIA www sys con com suboffer cfm CORPORATE AvantGo 12 20 02 Sybase and AvantGo a leading provider of mobile enterprise software announced that they have signed a definitive agreement for Sybase to acquire AvantGo in a cash merger valued at approximately 38 million PYS Sybase intends to operate AvantGo under its iAnywhere Solutions subsidiary The acgui sition is expected to be complet ed during the first guarter of 2003 www avantgo com Intraw are 12 19 02 Intraware announced that Sybase selected the Intraware SubscribeNet solution to provide electronic delivery of product releases to the Sybase global customer base Sybase will utilize the Intraware Sub scribeNet service to provide any time anywhere access and deliv ery of product releases on a glob al basis www intraware com NEA ware THE WAT GATAL GOD MYI S amp P Upgrade 12 06 02 Standard amp Poor s Application and Systems Soft ware equity analyst Jonathan STAN DARD amp POORS Setting the Standard Rudy upgraded the stock of Sybase to a Buy ranking from a Hold based on the integration provider s attractive valuation level www standardandpoors com News All things of interest to the PB community
15. a retrieval argument I m guite sure you ve already seen that if you use a DDDW that has retrieval argu ments PowerBuilder will prompt the user for those arguments displaying an DropDownDataW indow DDDW edit style is one of PowerBuilder s outstanding tres ves I know there are a lot of new and exciting capabilities in the upcoming release of PowerBuilder but in this article I ll try to solve some of the current problems with the existing features that are popping up in nearly every project I ve seen ugly window when you retrieve the par ent DataWindow This is of course not the normal behavior you want your application to have The solution is to retrieve the DDDW before you get data for the primary DataWindow The problem is that we need a reference to the DDDW so we can issue a Retrieve or InsertRow func tion on it To gettheobject handleto the DDDW use the GetChild function Since PowerBuilder 8 we are able to prevent the retrieve of the DDDW by dis abling the Autoretrieve property This lets us retrieve the DDDW anytime also after the retrieve of the master DataWindow We can also prevent the retrieval of a DDDW by saving it with a blank row and adding a row on the DDDW in the DataWindow painter To do so click on the column specification window on the data tab and insert a blank row using the right mouse button This saves the DataWindow with one blank row pre loaded for us Since PowerBuilder wi
16. an Oracle 8 data base the stored procedure would be the object type would CREATE TABLE TEMP_EMPINFO empno number 4 0 ename varchar2 10 job varchar2 9 lit Argens Origine Parenter ipi Wan Usin Data Conclusion END SBP PKG We ll modify our stored procedure as _shown in Listing 4 Although our temp table in this case iS permanent we don t need to track the session ID in it because we aren t per forming a COMMIT without our proce dure The only data well see and Either approach requires object support tobeenabled on theserver In Oracle8 you must havetheenterprise edition in orderto use objects 8i and later support objects in thestandard edition To verify whether you have support for objects use the following query which will return TRUE or FALSE to delete in the table is the data we ve put there within the session Beginning with Oracle8i support for temporary tables was introduced with the GLOBAL TEMPORARY keyword pair for the CREATE TABLE DDL state ment It basically does the same thing we ve accomplished here Stored Procedures for indow Updates If you re going to be using stored pro cedures to query the database either you won t allow updates from the DataWindow it s a report or you ll allow updates and there s a good chance you ll be using stored procedures for the updates as well If you re using the stor
17. childid Handle ldwc ddlb CHOOSE CASE notificationcode THEN CASE 2048 Post Event ue_DDLBRowFocusChanged END CHOOSE END IP Some samples for notification code are shown in Table 1 One caveat the pbm command event is invoked for just about every thing that goes on in a DW thats not already captured by another event In other words it will be invoked a lot To limit the number of times the code in this event is invoked you can map another user event to the event ID pbm dwnmousemove Dont put any code in this event This will cause all mouse move events to go to the other event instead of the one mapped to pbm_ command Collapsing the DDDW This might also help you if you have one or more rows in your DDDW where your display and data value appear more than once but you wantto set another col umn dependingon aDDDW column that s not used for the display or data value If you have such a row PowerBuilder does not recognize or fire an itemchanged event which from PowerBuilder s point of view is correct but does not solve our business problem A good solution is to trap the cursor keys and look at which row the user is in in the DDDW and set the dependent column by hand You can achieve what you want by mapping one user event to pbm_dwn dropdown to figure out when a DDDW wes opened and another one to pbm_ ncpaint which is fired when a DataWindow needs to berepainted and then code something like Listing 3
18. developer sys con com today i Technology News i Technology Views i Technology Comment i Technology Debate SCREEN COPYRIGHT 2002 SYS CON MEDIA WWW SYS CON COM NET GURNAL ONLINE ester E en www sys con com dotnet or Call meaa L 900 303 5262 developers of all levels especially those in the trenches creating NET code on a daily basis For beginners Each issue contains step by step tutorials e For intermediate developers There are more advanced articles SAVE 16 ANNUAL i e For advanced NET developers COVER PRICE In depth technical articles and columns 6 o yy gt lt written by acknowledged NET experts D I a o Regardless of their experience level NET YOU PAY Developer s J ournal assumes that everyone 99 reading it shares a common desire to THE ANNUAL COVER PRICE 69 understand as much about NET and the business forces shaping it as possible Our G et 12 Issues of N ETDJ 613 89 aim is to help bring our reader developers closer and closer to that goal with each and fo r O n ly 6929 SEA AU STEEN every new issue COVER PRICE OFFER SUBJ ECT TO CHANGE WITHOUT NOTICE ww w POWERBUILDER OURNAL com PBD volume10 issue2 19 Since I spend most of my time on the computer I formed the habit of changing the Windows desktop with his latest por trait both at work and at home However the initial excitement faded due to my inherent laziness needed
19. flexible data flow But this term also brings new meaning to the table Webster s describes liquidity as the quality of being readily convertible to cash Sybase describes information liquidity as the efficiency at which businesses transform enter prise data into economic value and says In the same way that ATMs redefined expanded and improved cash liquidity for consumers Information Liquidity redefines the Speed Flow and Quality of data within the enterprise Sounds great though maximizing data availability and flow has been a goal of companies for decades Is it possible Sybase isnt just coining a new term to describe existing ideas butis goingto provide a mechanism that will revolutionize data quality management and use Sybases goal is to provide the best tools for viewing and aggregating enterprise data from a broad variety of sources with maximum flexibility and power Its enterprise portal and data warehousing tools are the main components of a diverse set of products that are aimed at helping companies achieve this goal Undoubtedly just like openness has been a key aspect of each of Sybase s products so too is intercommunication and interoperability which is nec essary to achieve the level of liquidity Sybase is endeavoring to provide Imagine that a com pany s systems old and new seamlessly share data as well as make it available for viewing worldwide via an enterprise portal BEAs recent announcement of
20. hiring not only prefer experienced candidates but also people who are well rounded These days it takes more than a college degree up to date skills and a pair of Doc Martens to land a job Employers still place a high value on expertise prompting many tech professionals to earn certification in the most popular tech skills with Microsoft certification being one of the most popular Certification helps employers differenti ate one candidate from another However even experience and certifi cation will not guarantee a job in today s climate Like other industries the health of the tech world hinges on employer confidence Some experts estimate that the tech job market will lag for another 18 to 24 months before employers start hiring again Temporary or contract work is still out there at a reduced rate When things improve these workers will be among the first to be called back Since employ ers are nervous about making long term commitments to full time employees they are increasingly farming out small projects to free agents Don t give up Keep your r sum up to date Focus on the whys and not the hows As one headhunter told me you should be able to explain why your past project was able to use XML to streamline data access and provide value to its users and you should be able to explain it in nontechnical terms Chances are that the person interviewing you could care less if you know a SAX parser fr
21. i BE iI mn p ern Eleni nk a 23 ow can Sybase s EAServer architecture help create a bridge between the worlds of Java and PowerBuilder to access advanced cryptographic functionality that isn t natively available in PowerBuilder Part 1 of this article A Little Security in an Insecure World PBDJ Vol 9 issue 12 estab lished a level playing field by introducing you to terminology that as PB developers we typi cally don t deal with on a daily basis Oneof the key points in Part 1 was that there is more to security than just hiding something behind a user ID and a password PowerBuilder does not expose a robust cryptographic library meaning critical security functionality like encryption secure hashing and even rudimentary Base64 encoding capabilities isn t easily available The world of Java exposes many crypto graphic capabilities from inside the Java Cryptography Extensions library JCE TheJCE can be configured to work with JDK 1 2 2 and beyond see http java sun com for detailed specifications What that means to us PowerBuilder developers is that with a little configuration it is possible to employ thetech nigues covered herein using any combination of PowerBuilder 7 0 and beyond with EAServer 3 6 1 running no less than JDK 1 2 2 and beyond As sit here in my favorite coffee estab lishment drinking a Caramel Macchiato my laptop is configured solely with PowerBuilder 8 0 and EAServer 4 1 3 ru
22. in the database It takes three arguments report ID the dataobject and the corresponding full state Restore and Retrieve Algorithms for a Plain DataWindow with or Without DDDWs A plain DW may be restored by its syntax but DDDWS will not be restored automatically With the use of the full state all DDDWS are restored automatically as long as they re placed into the detail band of the parent DW If a DW has DDDWSsin bands other than details they haveto be replaced with computed fields based on the LookUpDisplay function call for correspond ing DDDWS and DDDWs themselves have to be moved into the detail band and made invisible To obtain a DW full state that allows its restoration at runtime the code has to assign its dataobject to a DW or DS and call the GetFullState function No additional process ing is reguired The retrieve of such a DW is straightforward once all the retrieval argu ments are set in temporary table s by the Retrieve function call without arguments Restore and Retrieve Algorithms for a Composite DataWindow It s possible to re create all the nested reports of a composite DW through full state if all the nested reports are plain DWs They can t contain nested reports or DDDWs all of them will be lost after a composite DW is restored The code to save data for a composite DW so that it may be restored at runtime is in Listing 3 The variable adw references a DW control with the composite DW no
23. is supposed to ship with the JCE EAServer 4 1 3 under JDK 1 4 requires the addition of the jce jdk13 116 jar file to its CLASSPATH and BOOTCLASSPATH con figurations in its JAGUAR bin serverstart bat Not adding this jar file in the aforementioned paths results in a NoClassDefFoundException like that listed below when encryption and decryption is attempted from our EJB java lang NoClassDefFoundError javax crypto Cipher at com getpersonified pbdj CryptOps encrypt CryptOps java 58 at com getpersonified pbdj CryptoBean encrypt CryptoBean java 52 at com getpersonified pbdj _sk_PBSecurity_ Crypto invoke _sk_PBSecurity_Cry In EAServer 4 1 3 the CLASSPATH and BOOTCLASSPATH are configured around lines 417 and 468 respectively e Step 1 5 Add the following lines after the respective configuration lines set EAS_CLASSPATH_P1 set EAS_CLASSPATH_P1 EAS_CLASSPATH_P1 JAGUARS jee jdk13 115 jar and set EAS BOOTCLASSPATH Pl set EAS BOOTCLASSPATH P1 EAS_BOOTCLASS PATH _P1 JAGUARS jee jdk13 115 jar I fired off several e mails to Sybase engineers but with the holiday break I hadn t received a response prior to my submission deadline as to why this extra jar might be necessary HR Providers to the JVM With our JCE provider class files now in place and EAServer s idiosyncrasies addressed we need to inform the JVM that it should include the Bouncy Castle provider class in its search path for c
24. report for that specific row is accessed An expression is then applied to the salary column Notice the syntax below the row of the nested report is being refer enced integer li_row FOR li row 1 to dw_l RowCount IF String dw_l Object dept_id Primary li_row 100 THEN dw_l Object dw_nested_rpt li_row Object sal ary Color amp 255 sE lt Selary gt 60000 END IF NEXT 23593 U If the report does not have a row associated with it no row specification is needed when accessing the nested report The following code is valid if accessing a nested report in the header footer or summary band within the base DataWindow If the report is in a header of a trailer band the row number for the band must be specified dw_l object dw_nested_report Object state co lor amp 1255 t If state lt gt IL 255 0 NESTED REPORTS AND THE GETCHILD METHOD Earlier mentioned that report objects nest ed within a DataWindow are not DataWindow children thus any call to getchild will fail OE 8 8 n There is a way around this In the source editor open the base DataWindow and change pro cessing 0 or whatever it is to processing 5 This is the actual trick to change the base DataWindow s presentation style to compos ite The getchild function can now be used to access the nested report This is a cool trick because it opens up all methods that can be called for DataWindow childr
25. sector including broadcasting companies call centers and managed data firms are still hiring Some of us have turned to other careers or taken cover in graduate school many of us are waiting out the storm by taking lower paying or temporary jobs or going into business for ourselves We were among thefirst professionals to feel the impact of the economic slow down starting with the dot com bust late in 2000 Before that we were the darlings of the working world com manding signing bonuses high salaries and on the job perks The technology workforce is suffering more than any body as the labor market were experi encing has affected the tech industry the most The unemployment rate among tech professionals is 12 20 depending on your market In my market Chicago recent tech professionals have been especially hurt by massive layoffs at large companies such as Motorola Sears Tellabs Arthur Andersen and Lucent Because there is so much overcapacity supply of labor salaries and contract rates have fallen With so many experienced professionals on the market there is almost no work for recent graduates or for those with lit tle or no experience If you are a recent graduate and are lucky enough to find any tech job start ing pay is stagnant starting salaries for bob sys con com Arnon THE GO EDITORD ONIS computer science and engineering graduates range from 39 000 to 45 000 Companies that are
26. to The following is a list of the tools that I reviewed that work with UltraLite e CodeWarrior e MobileVB e MobileBuilder Java e Embedded Visual Basic CodeWarrior from Metrowerks is for experienced C developers It has a nice IDE and you can accomplish many things with it One nice feature is the debug option with the emulator as it allows you to see how the variables and workflow are really being used Its IDE history is from the Mac arena so it may seem hard in the beginning but it s easy to work through I like this product When I create an application for the Palm OS I just send out onefile making it easy to deploy There are tools for Palm Symbian and J2ME environ ments One nice feature from Metrowerks is CodeWarriorU com an online tutorial section Check it out it has some good courses MobileVB from Appforge works on Palm Pocket PC and Symbian If you understand Visual Basic you won t have any problems with this tool This is an add on package for the VB Studio it works on dragging and dropping visual objects onto the screen You then code the events with business logic to com pletethe application You ll need to pur chase the Booster VM separately so the application can interpret the code effectively MobileBuilder from PenRight is a single custom application package designed to generate handheld applica tions specific to certain operating sys tems This is a nice feature if you ll be
27. we try to reference the DropDown DataWindow This is because Power Builder compiles only used objects into an executable If we assign a DataObject or in our case a DDDW programmatically using a string PowerBuilder does not recognize this DataObject as used The solution is that we assign a pbd out of the pbl contain ing that particular DataObject in our case dw popup table list or we should includeit in a pbr file as pibblename pbl dw_popup table list FILTER DDDWS You may have already encountered this problem we would like to filter a DDDW depending on a valuein the current row If we filter out some values in the DDDW the dropdown shows only description data for rows that are in the primary buffer In all other rows we see the data value The trick here is not to filter You need to have the description or display value in the primary buffer One method is to use SetDetailHeight to mimic filtering e Unfilter all rows and set detail height to standard height Filter out rows you want to display yes the good ones SetDetailHeight to O for the rows in the primary buffer this will make them invisible Unfilter the DDDW You ll be left with all the rows so the display value can be found but the rows you don t want to see have a height of O see Listing 2 The Cursor Keys We can code an event using pbm_dwnkey to get the keys pressed by NUMBER EVENT 769 Retrieve End 1
28. 024 UpdateStart 2049 SelectionChanged 2318 ScrollVertical 2319 SOLPreview Notification codes for WM COMMAND 18 PBD volume10 issue2 a user on our DataWindow however if you type the up or down arrows while the cursor is positioned on a DDDW the itemchanged event usually gets trig gered bypassing the pbm dwnkey event This might be bad in some situa tions for example we have problems trapping as these keys are the first and last row in our child DataWindow The solution is to trap these in a user event mapped to pbm_command From the win32 helpfile WM _COM MAND TheWM COMMAND messageissent when the user sdects a command item from a menu when a control sends a notification message to its parent window or when an accd erator keystrokeis translated This means that in PowerBuilder whenever an event occurs in the DataWindowChild it sends a notifica tion code to the parent DataWindow This code can be intercepted in the user event mapped to a pbm command DataWindow event If we want to exper iment to determine which events you can intercept try adding the following code to ue command mapped to pbm_ command mle status text hwndchild strimng hwndehiLd T childid bd Stringionildid notlfri cationcode String notification code Taran The code needed to intercept the dropdown arrow is int Li re li rc this GetChild dept_id ldwc_ddlb IF
29. 1 GetChild dw nested 1 ldwc_nest1 dw_l GetChild dw_ nested 2 ldwc_nest2 ae lds_prod info ShareData ldwc_nestl o Retrieve lds_prod info ShareData ldwc_nest2 Notice the composite DataWindow does not reguire a transaction object or a database retrieve The DataStore handles database transactions Remember that each time data is retrieved into the composite DataWindow all references to DataWindow children are lost Always make sure to reestablish the child han dle with a new call to the GetChild function before trying to share data LIMITATIONS ON SHARING DATA Usingthe ShareData function produces some unexpected results on nested reports When you use ShareData with nested DataWindows that are part of a composite DataWindow there are some instances where the ShareData will not work Usethefollowing rules of thumb e Sharing data from a DataWindow or a DataStore with a nested report okay e Sharing data from a nested report with a DataWindow or DataStore will not work e Sharing data from a nested report with another nested report will not work These three rules apply to all nested reports regardless of whether or not they are being used in a composite DataWindow presentation style A good way to get around this problem is to use RowsCopy when the ShareData function will not work An example of the RowsCopy func tion is dw_2 1 dw_l RowsCopy 1 1 primaryl primary Of course whene
30. ESSIONS OR COLUMN VALUES When the argument is equal to a database column in a nested report that is not a com posite DataWindow its value is supplied in double quotes The following code example passes the current value of the cust_id column as a retrieval argument dw_l Modify dw_product Nest_Arguments nM cust_id wy USING STRING VALUES String values must be entered in single quotes within the double quotes dw_l Modify dw_product Nest_Arguments Central A USING NUMERIC VALUES When using numbers omit the single quotes Noticethat the literal value 100is still surrounded by double quotes Remember the double quotes denote the value for the retrieval argument for the nested report they do not denote a string dw_l Modify dw_product Nest_Arguments pe 1D w PROMPTING THE USER FOR RETRIEVAL ARGUM ENTS When more than one argument is needed they are separated by commas If not enough or too many arguments are defined a run time error will occur If you want to prompt the user to enter the retrieval arguments at run time specify and empty parentheses like dw_l Modify dw_product Nest_Arguments a HOW DYNAMIC CAN WE GET When using nested reports in a composite ww w POWERBUILDER OURNAL com web Services conference amp expo CONNECTING THE ENTERPRISE WITH Ws SERVICES JAVA A XML AND NET Featured technologies and topics will include
31. LDER OURNAL com PBDJ volume10issue2 21 WIRELEOG SOLUTIONS N N SCOTT HEFFRON Development T00 S Gain a competitive edge recently presented a case study on mobile business at a local ColdFusion Users Group in Salt Lake City Two questions dominated the Q amp A section How productive can you be with a handheld and what tools can you use to create applications for it To give you an idea of productivity I m writing the first part of this article at my daughter s swim meet Trying to be a good father I stop during her races to cheer her on As the workforce becomes more mobile business people need to have customer information on hand in order to have a competitive edge New devices and technologies such as handhelds Bluetooth and Smartphones are becom ing available in the marketplace busi nesses are trying to understand how to incorporate these devices into their infra structure to get the advantage they desire Not only do these devices have to be placed into the infrastructure there also needs to be applications available in order for businesses to provide better ser vice to their customers and get a full ROI for the company The mobile configura tion that I currently use is a Handspring Prism with the following accessories folding keyboard modem digital cam era 16MB Flash memory and scanner The mobile application world is fasci nating We need to create applications that ca
32. PowerBuilderJournal com U S 15 00 CANADA 16 00 DEVELOPER S ourna Enterprise Applicaton Studio o FEBRUARY 2003 Volume 10 Issue 2 nn Fm PowerBuilder J web services conference ry dni Ji van 5 CT d UDRH i Composite versus nested reports to existing applicati Berndt Hamboeck Scott Heffron Gain a competitive edgein business 22 _sAILS ON PAGES 32 amp 33 Jason We ss RETAILERS PLEASE DISPLAY Call cryptographic methods k 24 UNTIL APRIL 30 2003 15 00US 16 00CAN 02 gt David Hart Take your PB appsto thenext level 28 o 0928105424 Bruce Armstrong 30 Amyuni Technologies Inc Www amyuni com 2 PBDJ volume10 iss x 2 ww w POWERBUILDER OURNAL com AI Ii A ww w POWERBUILDER OURNAL com Liquidity he dizzying whirlwind of terms we are bombarded with is well dizzying Apparently the age old term data flow was no longer capable of describing what we want to do with our data Or maybe Sybase wants to take our data to the next level and make it really valuable because we haven t been squeezing the last bits of efficiency and value out of it Recently Sybase began using a new term information liquidity I hate new terms created solely to grab our attention but I hope Sybase trademarked this one because I love it At first I thought liquidi ty was an adjective to help describe really fast and
33. SET FULL STATE ablb state WHERE REPORT ID al_ report id AND DATAOBJECT as_dataob ject Listing 3 Composite DataWindow saving the full state adw is a reference to the DW to process dint a 14 PBDJ volume10 issue2 The code listing for this article can also be located at WWW SYR onf ww w POWERBUILDER OURNAL com PBO Books Www pb9books com Branor HAMBOEGK Here I ll focus on DropDownData Windows including How to get started with DDDWs Filtering DDDWS without losing the display value in other rows e Catching the collapsing of a DDDW e Trapping the cursor keys in a DDDW e Autocomplete DDDW values Getting Started The basics are well covered in the PowerBuilder User s Manual but if you still have problems defining them look at Figure 1 Click on the column you want and Akwi Editing Emply Shrug ir FALL Fep Ales Shoe Lit FF drwg Diepe turner M Hima be Voss Spi Hors Ed Buse r FF ul irh wu Lines In Dent win Wih of Dysgl cards pri I ad ma id i dddes_depi i I AE iN tard role ala Column Defining a DDDW 16 PBDJ volume10 issue2 its edit style yes click on edit on the proper ties as DDDW choose DropDownDW as Style Type Next choose your DataWindow display column and data col umn The display col umn is the kind of data thats displayed to the user The data column value is the one that s
34. So far so good The problem occurs when I want to programmatically access the data con tained in the display column of the DDDW i e the name the user selected have gone through all the documenta tion I can find and I can t figure out how to obtain this information SOLUTION 1 RECOMMENDED Take advantage of the Describe Evaluate function In the following code the DDLB or DDDW column is called state code string ls_rownumber ls_displayvalue ls_rownumber string dw_l getrow ls_displayvalue dw_l describe Evaluate lookupdis play dept id ls_rownumber This solution does not reguire the def inition of an additional computed col umn on the DataWindow Note This solution will not work in the itemchanged event of the main Department Shag a Mukai rez HED HED www POWERBUILDER OURNAL com DataWindow It must be done in an event that occurs after the itemchanged event has completed by creating a cus tom unmapped user event ue_ getdis playvalue and then windowname postevent ue getdisplayvalue from the itemchanged event of the DataWindow SOLUTION 2 COM PUTED COLUMN APPROACH Go into the DataWindow painter and add a computed column The expression should be Lookupdisplay dept id where dept id is the name of your DDLB or DDDW column Name the computed col umn display Place the computed col umn anywhere since we will make it invis ible with Modify
35. Sphere Resource CD _ CF Advisor Complete Works CD The complete works of CF Advisor are now on one CD Check out over 200 exclusive articles on topics such as e commerce custom tags Fusebox databases object oriented CF WDS upgrading CF wireless Verity and more Plus find interviews editorials and source code LIST PRICE 198 OFFER FROM SYS CON Media RECEIVE YOUR DIGITAL EDITION ACCESS CODE INSTANTLY AND SAVE UP TO 5400 AND RECEIVE UP TO 3 FREE CDs WIP ALLE TEESE MENDE P ick d ee y cur LE U ML AL 3 Pack A E r iS l ra ox ML 6 Pack or a 8 E er 9 Pack V WebLogic Developer s Journal Can Mex U S Two Years 24 Cover 360 You Pay 169 99 Save 190 FREE 198 CD U S One Year 12 Cover 180 You Pay 149 Save 31 Can Mex _ Can Mex Two Years 24 360 You Pay 179 99 Save 180 FREE 198 CD Can Mex One Year 12 180 You Pay 169 Save 11 Can Mex Int l Two Years 24 360 You Pay 189 99 Save 170 FREE 198 CD Int l One Year 12 180 You Pay 179 Save 1 Java Developer s Journal ColdFusion Developer s Journal U S Two Years 24 Cover 144 You Pay 89 Save 55 FREE 198 CD U S Two Years 24 Cover 216 You Pay 129 Save 87 FREE 198 CD U S On
36. al trends in its growing preprint advertising busi ness www latimes com EVENTS 5th Annual Sybase Tools Seminar Bloomington MN April 7 2003 POWER a Offers even more presenters and room for more attendees www power objects com seminar TechWave 2003 Orlando FL August 3 8 2003 Www sybase com techwave2003 Y En bl a WR a 3 _ bee di ark nu 1 eee iad Wis u red i i E Eek a p pa yo mn EK E Crane Computing WWW eCrane comM Sybase Inc www sybase com
37. allpapers then the acceptable sequences are than I can count Thanks to digital cameras it s so easy to take and Ve son is only 18 months old but I have taken more pictures of him store pictures a b d c b a c d d c a b etc a b a d is not acceptable though it s random because it missed c What s the easiest way to tell the pro gram about all the available files think most of you will agree that it is to create a folder and let the program display all the files from there When new pictures are available this folder can be updated accordingly Also one of the controls in PB can be used to populate all the file names from a Windows folder again by one line of code Yes I m talking about the good old Dirlist function for listbox At this point to incorporate the de sired randomness I can easily pick up one of thefiles from the folder using the rand function but that function alone is not enough because of my other reguirements Thus the displayed wall paper information must be saved some where A heavy duty database is out of the guestion A profile file function like SetProfileString which is available in PB immediately came to mind When the program runs for the first time it creates the empty profile file with the required section It then choos es a filerandomly and in addition to set tingthewallpaper it saves its position in the listbox tags recent1 recent2 etc It also saves
38. als applets advanced Java topics Swing security wireless Java and much more LIST PRICE 198 YML Resource CD Gwg ni De UML Wichiti Erer kma a FAAL gu The largest and most complete library of exclu sive XML Journal articles compiled on one CD Edited by well known editors in chief Ajit Sagar and John Evdemon these articles are orga nized into more than 30 chapters containing more than 1 150 articles on Java amp XML XML amp XSLT lt e BizML gt data transition and more LIST PRICE 198 A LIM ITED TIM E SAVINGS a and recave your FREE CD Gft Package VIA WebLogic lnside EEal The most complete library of exclusive WLDJ articles 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 WebSahe lesource ii Germen a De FM The most up to date collection of exclusive WSDJ articles More than 200 articles offer insights into all areas of WebSphere includ ing Portal components integration tools hardware management sites wireless pro gramming best practices migration LIST PRICE 198 Subscribe Online Today _ Web Services Resource CD _ Java Resource CD WebLogic Resource CD _ ColdFusion Resource CD _ XML Resource CD Web
39. an just Base64 encode the clear text message To decrypt the message we submit the Base64 encoded text along with the RSA private key Mathematically speaking only the private key can successfully decrypt text encrypted with the public key and vice versa The decrypted text is then displayed as shown in Figure 4 The other two tabs Base64 and Hashing are fairly self explanatory so I won t cover how they re used here Conclusion Having access to cryptographic operations is critical in this day and age I ve demonstrat ed how the combination of PowerBuilder and EAServer can be utilized to expose advanced cryptographic operations to PowerBuilder applications and PowerBuilder components Using the sample code I encourage all of you to set off and play with the various crypto graphic topics we covered in Part 1 Until next time I say to all of you R28gOnVja2V5ZXMt LSBCZWFOIE1pY2hpZ2FulO Y AUTHOR Bio Jason Weiss is the chief software architect at Personified Technologies LLC where he spends his days architecting digital rights management DRM solutions for clients jason getpersonified com _ SHOP ONLINE AT DJ STORE COM ron Best Prices OR CALL YOUR ORDER IN AT 1 090 303 AVA GUARANTEED LOWEST PRICES PointBase Embedded is a 100 Pure J ava PointE RDBMS ideal for embedding in your J ava appli 3 cations within the J 2EE and J 2SE platforms PointBase Embedded utilizes a multi threaded architectu
40. and Retrieve Algorithms for a Report Criteria DataWindow For the sake of brevity let s consider restor ing a report and criteria DWs The criteria DW lets the user set retrieval arguments the report DW shows the report itself Both DW controls are based on the standard visual user object u_dw base when a DataStoreis to be used its based on the standard class user object u ds base To restore a DW by its full state stored in a variable of type BLOB sim ply usethe function SetFullstate call How to prepare full state to store in a database and how to retrieve data in a restored DW depends on the DW type Welll consider the following DW types a plain DW with or without DDDWs a composite DW and a DW with nested reports To store full state the following table was created create table AR FULLSTATE REPORT ID numeric 8 not null DATAOBJECT varchar 100 FULL_STATE text null not null The column REPORT ID identifies a report to be processed the DATAOBJECT specifies the dataobject of a DW to be restored and the FULL_STATE contains corresponding full state This table is used to restore report and criteria DWs and if needed all nested DWs Both user objects u_dw_base and u_ds base have the function of set dataobject that takes two parameters long al_report id is the report ID and string as dataobect is the dataobject name see Listing 1 Listing 2 provides the text of the function that stores a BLOB
41. as either a criteria or a report Thecodeto populatetheDWd datawin dows is in Listing 15 After a user sets the report ID for a DataWindow it may be stored in the database using the code for the DW s type plain com posite see Listing 3 or with nested reports see Listing 6 The window that describes cri teria DWs needs an additional DW control in which a user specifies temporary table syntax to pass the criteria value or a list of values for each column Also the dataobject for the browser window is set if needed Conclusion Thedescribed algorithm allows you to add new reports to an existing application without rede ploying it It may be further enhanced by adding links between criteria columns when a value set in one of them limits a list of available values for the others processing criteria other than list of values for example the LIKE criteria and more Acknowledgements We would like to thank Angelo Delgiudice and Daniel McNatty Without their help this article would never have been completed V AUTHOR Bios Igor Skokin is an assistant vice president for Deutsche Bank in Manhattan Igor holds a master s degree in theoretical physics from Kiev State University in the Ukraine Charles Silbergleith is an independent consultant and has been working in the financial industry for over 20 years building a variety of applications from mainframes to Web sites igor skokin db com csilbergleith earthlink n
42. ate xox BY a Interoperability a 4 20 The Largest j 0 l p Enterprise Networks ten Ne gt Web Services Java gt Securing Web Services SN a sad Wm A XML7and NET London gt Integrating existing networks a Conf i Fuel gt Leveraging your existing software ght A amr he Real Time Web Services Where and When Should I Use WD Servic Na vl Web Services From Consumption to Pudlicatior June 24 2 UDDI Contact information U S Events 201 802 3069 or e mail grisha sys con com European amp Asian Events 011 44 208 232 1600 i FU DE f me AEM OWNED BY SYS CO PURRA World MMEA RAL IOUERA ae Mm h l SORES JAVA lava WebServices MINA qam SAMS Times Conference program available online PRODUCED BY yv reL i ia Er P ME Tn a www sys con com webservices2003east SEART NET asp netPRo Weblogic wireless CF Advisor pet CEES powerBuilder Jif U Retrieval Argument Name Type Retrieval arguments as a general property Nare eeen Supplying retrieval arguments to a nested report DataWindow or one of a different presentation style the nested report does not need to exist at design time it can be created dynamically The following code example dynamically cre ates a nested report Scring ls_modstring Scr Ling ls rg ls_modstring create report band sum mary dataobject d_composite_tab amp x 1083 y 12 height 796 width 1001 border 0
43. c cfm modified as follows i ENE aU PED Pee cd il he arig 7 pn FF A PL SOL record type TYPE r_employee IS RECORD empno emp empnostype ename emp ename type job emp job type A constrained cursor our result set TYPE constrainedcursor IS REF CURSOR RETURN r_employee no definition of result set in An unconstrained cursor declaration TYPE Unconstrainedcurseor Io REF CURSOR A stored procedure returning our constrained type PROCEDURE callconstrained a_dept IN emp deptno type c_emp OUT iconstrainedcursor folist AS empinfolist Before we show the unconstrained example we ll create a couple of object parameter Stored procedure update dialog Listing 1 CI Bu A Be RE LACH PACKAGE I I AU we use the record Finally let s pass back the data OPEN c_ empinfo FOR SELECT FROM THE SELECT CAST v_empin FROM DUAL indicate if the option is installed select value from v option where Objects If object support is not enabled on the server or if you re working with a 7 2 or 7 3 database which does not have the objects option we can use some thing more like a physical temp table approach We ll need to create a table that will define our result set just like The TABLE operator was intro duced with Oracle8i as a replacement for the THE operator in Oracle 8 0 If you re working with
44. contains a nested report that has been set up to accept state as an argument If you place a nested report in any band except the detail band the autoheight property of the nested report becomes meaningless as the detail band is the only DataWindow band that will adjust its size to fit its contents Also note that when adjusting the height or width of a nested report or band it may be necessary to save changes exit the DataWindow painter and then reenter to see the formatted changes The previous examples demonstrate how to use a nested report when a master detail rela tionship exists Actually no relationship needs to exist at all A nested report can exist in any en r we band within the DataWindow Where a nested report exists and what it displays is up to you The DataWindow in Figure 3 contains a nested report in the header band As long as the nest ed report does not require a retrieval argu ment this is perfectly valid When placing nested reports in bands other than the detail band there are times when you may want to repress the display of the nested report For example rather than displaying the nested report at the top of every page only show it on the first page This will be discussed later in this column series when cover DataWindow bands NESTED REPORTS HOW DOES THE DATA GET RETRIEVED When running or previewing a DataWindow containing a nested report the actual number of database retrievals is
45. d for double entry or entering data from a fax by the As you can see many products are salesperson has been removed and cus tomer service problems and requests are handled in a timely fashion We are also seeing areas for better forecasting of products and services This helps not only the company but also the clients It s a win win solution for everyone V heffrons earthlink net AUTHOR Bio Scott Heffron is a senior software engineer in the Salt Lake City area He has been involved in client server GIS Web and mobile computing projects for the past 16 years He is currently working on handheld device technologies The World s Leading Java Resource Here S what you ll find in every issue of JDJ Industry insights The latest software trends Technical expertise Career opportunities In depth articles on Java technologies sion up ONLINE www javadevelopersjournal com OFFER SUBJECT TO CHANGE WITHOUT NOTICE ANNUAL COVERPRICGE BNR KR YOU PAY 49 99 YOU SAVE 30 www POWERBUILDER OURNAL com CF te annual cover price JDJEDGE CONFERENC J FA lar EEI Prec La PHUM be tara Techniques Fum i Say gom ae HTE Ts uym a ia i J ROME Ape heus PBD volume10 issue2 Lm oj iraid y grin r g lras zi T Teasin Filth IET rijs em imig TEP i a a wr aiani a den ree amp EXPO DEVEL A JOUR FIE lf Im tik ee groch j n
46. determined by which band the nested report is in First the data is retrieved for the base DataWindow If the detail band contains a nested report each row of the detail band will retrieve the nested report that is associated with it If the detail band contains ww w POWERBUILDER OURNAL com 100 lines 100 retrieves will be performed for the nested report Nested reports not in the detail band are retrieved once for however many times that band exists NESTED REPORTS ACCESSING OBJECTS Since a nested report is not a DataWindow child objects within the nested report cannot be accessed with a getchild method To set object properties including expressions dot notation must be used The syntax is del jd TT leap ers leni hes Nested report in the detail band ww w POWERBUILDER OURNAL com dwcontrol 0bject nestedreportlname row Object dwcontrolname property property value For example the following code will set the expression for the salary column within the nested report The syntax below will set the expression for all instances of the nested report dw _emps dw_l object dw_emps Object salary color 299 L Ir selar gt 30000 255 It s possible to access and change properties in a nested report object if they are dependent on a value in the base DataWindow The fol lowing code example loops through all rows in the base DataWindow if the department ID is egual to 100 the nested
47. e Year 12 Cover 72 You Pay 49 99 Save 22 U S One Year 12 Cover 108 You Pay 89 99 Save 18 Can Mex Two Years 24 168 You Pay 119 99 Save 48 FREE 198 CD Can Mex Two Years 24 240 You Pay 159 99 Save 80 FREE 198 CD Can Mex One Year 12 84 You Pay 79 99 Save 4 Can Mex One Year 12 120 You Pay 99 99 Save 20 Int l Two Years 24 216 You Pay 176 Save 40 FREE 198 CD Int l Two Years 24 264 You Pay 189 Save 75 FREE 198 CD Int l One Year 12 108 You Pay 99 99 Save 8 Int l One Year 12 132 You Pay 129 99 Save 2 Web Services Journal Wireless Business amp Technology U S Two Years 24 Cover 168 You Pay 99 99 Save 68 FREE 198 CD U S Two Years 24 Cover 144 You Pay 89 Save 55 FREE 198 CD U S One Year 12 Cover 84 You Pay 69 99 Save 14 U S One Year 12 Cover 72 You Pay 49 99 Save 22 Can Mex Two Years 24 192 You Pay 129 Save 63 FREE 198 CD Can Mex Two Years 24 192 You Pay 139 Save 53 FREE 198 CD Can Mex One Year 12 96 You Pay 89 99 Save 6 Can Mex One Year 12 96 You Pay 79 99 Save 16 Int l Two Years 24 216 You Pay 170 Save 46 FREE 198 CD Int l Two Years 24 216 You Pay 170 Save 46 FREE 198 CD Int l One Year 12 108 You Pay 99 99 Save 8 Int l One Year 12 108 You Pay 99 99 Save 8 NET Develo
48. e named class appropri ately cast Whilethisis an oversimplification of what actually goes on suffice it to say that it allows code to be written that doesnt form a dependency on the class being instantiated As long as the named class implements the well defined interface the factory can dynamically find load and cast the class to a well known interface By adding the Bouncy Castle provider to this list we can now request and instan tiate the asymmetric algorithms that we need to perform public key cryptography Consider this line of Java code from the CryptOps class KeyPairGenerator keyPairGenerator KeyPairGenerator getInstance RSA PBDJ volume10 issue2 25 E Fom Bet de Secu itr eres EEN aeron ee Pablk Phe a SOE Be pee FEN hia Pit FIGURE 2 The KeyPairGenerator class is the factory we ve been talking about and getlnstance is the static method on that class that does the actual work At runtime it looks up the con crete class that provides RSA asymmetric func tionality and instantiates it This method inter rogates each of thelisted providersin java secu rity in seguence asking them if they can serve up a KeyPairGenerator named RSA Once the JCE finds our Bouncy Castle provider in the list an RSA KeyPairGenerator is instantiated As a result of this design new cryptographic algo rithms can be added at anytime without recom piling or redistributing the core JVM classes Building the PBSecur
49. ed procedure to provide for infor mation hiding preventing the user from selecting directly off the base tables it doesn t make sense to allow them to have direct update capabilities on those same tables We ll add a couple more procedures to our package see Listing 5 and use them for the update specs see Figure 1 Hopefully this article will have removed some of the mystery concern ing how to use Oracle stored procedures to return result sets While the server side technigue differs considerably from that used by other vendors and the interim PBDMS approach believe you ll find it flexible and powerful once you get comfortable using it Y bruce armstrong teamsybase com AUTHOR Bio Bruce Armstrong Is a senior PowerBuilder developer with the Los Angeles office of Kforce com A member of TeamSybase he has been using PowerBuilder since version 1 0 B He was a contributing author to PowerBuilder 4 0 Secrets of the Masters He is also a member of the editorial board for PowerBuilder D eveloper s Journal and the author of several PBD articles including a monthly news column Listing 2 CREATE OR REPLACE PACKAGE BODY SP_PKG AS PROCEDURE callconstrained a_dept IN emp deptno type type to define e emp OUT constrainedcursor IS BEGIN About the simplest thing we could do OPEN c emp FOR SELECT empno job lt some other code gt A stored procedu
50. ely while the private key should remain in a secure location and never be disclosed Once you ve generated ww w POWERBUILDER OURNAL com WB PowerBuilder Secar ily Curie Conrat Ta GaSe Fu Encrypaon HSA Enogpilon Public Prrvata Kegel y Eu ob Cha ind to Ermrypi Tar unt bear ix pes peer De lazy do Encrepted Teri jepreserted in Bose encoding Hashing Encryp SF Y JAMEL od EDF FRAC yee CYD PA any DORR Mw rade lecFid mn ig colt Ta ESE pd wl a Dyd dain ed Terp ber Cg hof wiog a iG Y AE 3D Hy MEDD glos Decrspted Tew Pepp Th gurk Wian Eia pini Gear Ge lai iiaj FIGURE 4 the key pair the RSA Encryption tab becomes enabled Clicking on that tab reveals a single line edit where you can enter in your clear text message that you want to encrypt In Figure 3 we can see that our clear text message was suc cessfully encrypted and then Base64 encoded for display Encryption was performed using Decryption of the encrypted and Base64 encoded message the RSA public key as emphasized by the mes sage boxes that display during the process You might want to try and copy the Base64 encoded encrypted message and paste it into decode single line edit on the Base64 page Be prepared to see a bunch of funny characters and hear a couple of system beeps as the nonprintable and control characters are well printed This should serve as a sanity check that we did more th
51. en A drawback of this method is that since the base DataWindow s presentation style has been changed to composite and composite windows have no data source the base DataWindow s data source cannot be changed unless processing is changed back from 5 Also it should be pointed out that the above technigue is not supported by Sybase and should be used with extreme cau tion Composite Reports An alternative to using nested reports is the use of the composite DataWindow presenta tion style A composite DataWindow is really a collection of unrelated DataWindows see Figure 4 Composite DataWindows by nature do not havea data source the data comes from the data source of the composite DataWindow objects RETRIEVAL CONSIDERATIONS Even though a composite DataWindow has no data source if all enclosed DataWindows have no retrieval arguments all may be retrieved via one Retrieve function The fol lowing code will retrieve all DataWindows within a composite report dw_l SetTrans0Object SOLCA dw_l Retrieve This approach works well when all nested DataWindows within the composite report have no retrieval arguments If retrieval argu ments are needed there are two ways they can be specified First they can be supplied to the DataWindow child For example let s say the composite DataWindow in Figure 4 takes two retrieval arguments Nested DataWindow Retrieval Argument d_cust list d product graph State String
52. ents It ll be like the PSR but mostly open rather than proprietary and won t require a PB plug in DLL or exe in order to read it Since a string is a basic data type imagine being able to pass the DW including pre sentation and data between clients of widely differing types written in any language on any platform COM CORBA C Java PB JavaScript application server component Windows client etc That s DataWindow liquidity AUTHOR Bio John Olson is principal of Developower Inc a consulting company specializing in software solutions using Sybase 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 PBDJ volume10 issue2 3 Bon HENORY h workers stunned by rounds of layoffs in the aftermath of the dot com crash and the downturn in the economy continue to hit a wall in a labor market that has fewer jobs lower salaries pickier bosses and a new job requirement soft skills Soft skills Today tech workers who do not expand their experiences and interests outside the world of computers and labs may get passed over for those who also have good communication and leadership skills and can work in teams Employers are adamant that they have to have soft skills They want to see people who are better rounded not just absorbed in the techie thing Five years ago employers were lo
53. et string S objects s current ob bleombibsieaite datawindowchild dwc datastore ds public subroutine of_set_dataobject long al_ report id String as ataob Ect blob bib stare SELBCTBLOB WULIL STATE INTO bb state FROM AR_FULLSTATE WHERE REPORT ID al report id AND DATAOBJECT as_dataobect this SetFullState blb state Listing 2 Storing a full state BLOB in the database pue subroutine of store tullstate long al report 1c String as dakasbgeet blob ablbestate Tat ay se COD SHEE Gh Count A INTO FROM AR FULLSTATE sa i Count WHERE REPORT TD al report 1d AND DATAOBJECI as dataob ject IF i_count 0 THEN INSERT INTO AR FULLSTATE REPORT ID VALUES zal report lc as dataob ject END IF IF adw Describe DataWindow Processing lt gt 5 THEN Return ds create datastore s_objects adw Describe datawindow objects t DO WHILE Pos sob jects Val gt 0 s Current obj leres objects Poss objects 2t i s Objects Mid s objects Pos s objects et 1 IF adw Describe s_current_obj type report THEN IF adw GetChild s_current_obj dwc 1 THEN dwc InsertRow 0 ject ds dataobject adw Describe s_current_objt dataob ds GetFullState blb state of store fullstate il report id ds dataobject blb state END IF END IF LOOP adw GetFullState blb_ state of _store_fullstate il_ report _id adw dataobject blb state DATAOBJECT UPDATEBLOB AR FULLSTATE
54. eturn result sets is not as widespread a practice with Oracle data bases as it is with other database products This article an excerpt from an upcoming book on PowerBuilder 9 is an attempt to address this situation The interim PBDBM S solution is going away In PowerBuilder 8 support for the PBDBM S was restricted to the O73 driver and with PowerBuilder 9 support for it will be dropped completely If you re still using that old technigue and need to migrate or you would just like to learn the new one this article should help Using a Stored Procedure for the SOL Source for a DataWindow While a SOL SELECT statement is the typical way data is retrieved from the data base into a DataWindow there is another approach Using a stored procedure to do the retrieve is popular with a number of other databases because they offer some advantages over a standard SELECT state ment First stored procedures in the data base are precompiled which means they ll significantly outperform uncom piled SQL statements In addition stored procedures provide for data hiding i e the end user doesn t need to know or have the ability to access the underlying tables in order to retrieve the data Note that neither of these advantages are significant when using an Oracle data base Provided the application is beingrun with binding enabled the database is stor 30 PBDJ volume10 issue2 ENGERPI In Your Datawindows ing the bound and com
55. fo on the temporary tables to pass criteria values to the retrieving SELECT or stored pro cedure The type of the array is a structure named str_column_info that contains the fol lowing fields column_name string The name of the col umn in the criteria DW temptable syntax string The syntax of a temp table corresponding to the column temptable name string The name of the temporary table extracted from temp table syntax ds temptable link DS The link to a tem porary table its DataWindow is created dynamically and contains all temp tables columns To insert criteria data into a temp table the code inserts a row s in this DS and calls the Update function ds interface DS If a browser window will be used to set a list of values for the column this DS will store the presentation of the browser DW When the browser window is closed this DS will keep information about checkboxes selected by a user The code for the function of prepare para meters to initialize the array is in Listing 10 The data retrieved from the database is stored in the array named i_str_colinfo In the data base the information is stored in the table AR PARAMETERS with the following syntax create table AR PARAMETERS REPORT ID numeric 8 COLUMN NAME varchar 100 DW_SYNTAX text null TABLE SYNTAX text null not HOLL not null The column DW_SYNTAX contains syntax for the browser DW if required to be used t
56. hic operations all the results displayed and returned from the com ponent I ve developed are automatically Base64 encoded for readability and easy stor age for example in a database column usinga varchar or similar datatype Sun s JDK ships with a small set of cryptograph ic implementations and in fact doesnt provide ww w POWERBUILDER OURNAL com any asymmetric algorithms like the industry dominant RSA algorithms In fact many Java cryptology experts recommend avoiding Sun s JCE provider altogether because once the Sun provider is loaded it prevents the use of other providers see Professional Java Security by Jess Garms and Daniel Somerfield for more details Sincethe PKI operations we want to demon strate reguire public and private key genera tion we need to look beyond the Sun JCE provider for an alternate that supports asym metric algorithms One of the best JCE providers that I ve worked with is from The Legion of the Bouncy Castle http bouncy castle org and that s what we ll set up You ll need to download two jar files from the legion at www bouncycastle org latest _releases html The first jar file is the JDK 1 4 Provider under Signed Jar Files header named something like bcprov jdk14 116 jar Once you have this jar file you ll need to install it as an 7 hae ercpal Sawa 1 lil Fie Wew Tome Sy Packages Eik y Je nn Jiet Mi eid gd O Agents u ial ia ur Dj Sev gt Sep ators
57. hing Digging into the PowerBuilder Code You ll notice that the library contains two proxy objects crypto and cryptohome as well as two supporting structures cryptolist and ctscompo nents_stringseg These four objects represent the entire set of objects necessary to provide crypto graphic capabilities from inside PowerBuilder Each of the operations on the client window follow the same basic approach look up the home proxy object cryptohome get an instance of the proxy for the bean crypto and invoke the desired method CryptoHome lnv_home Crypto lnv crypto PBSecurity Crypto com getpersonified pbdj icn_jag lookup inv_home CryptoHome lnv_crypto lnv_home create String base64Text base64Text lnv_ crypto stringtobase64 sle 1 text Of particular interest is that in order to per form the public key encryption you must first obtain a set of keys Feel free to hit the Create button a couple of times comparingthetimeit takes to generate the first key pair to the time it takes to generate the second through nth key pairs That first time the cryptographic engine is priming itself with random data from your system thus the added delay cant be avoided Remember the methods in the EJB automati cally Base64 encode the keys so they can easily be displayed In Figure 2 we see that we ve obtained public and private RSA keys To reiterate an important point in PKI the public key can be distributed fre
58. iance that will provide customers with greater choice for implementing a high perfor mance cost effective data man agement solution The companies plan to provide customers with a total solution comprising Adap tive Server Enterprise running on HP UX and Red Hat Linux operat ing systems powered by HP s Itanium 2 based servers The companies also announced plans for Sybase ASE to be available on HP s forthcoming EV7 processor based AlphaServer systems www hp com PeopleSoft CRM 8 8 12 09 02 Sybase announced their support of PeopleSoft CRM 8 8 PeopleSoft CRM 8 8 includes more than 40 new features and product enhancements to address the market demand for highly scalable systems PeopleSoft CRM 8 8 expands upon PeopleSoft s functionally rich CRM applica tions making CRM easier to use and deploy globally New features include more than 30 enhance PeopleSoft ments to its analytics suite a mul tichannel module for e mail and live chat and a redesigned user interface www peoplesoft com CYA HOTBackup 12 02 02 CYA Technologies announced that CYA HOTBackup CYA is now available for use with Sybases Adaptive Server Enterprise www cya com INDUSTRY WAREHOUSE STUDIO Los Angeles Times 12 03 02 Sybase announced that the Los Angeles Times had selected Industry Warehouse Studio for Media to monitor advertising mar ket penetration product effective ness and financi
59. ill see the DataWindow object d_ product by region which takes a string argu mentin which wearesupplyingthevalue Central Notice how the tilde character was used to denote the double guote character within a string The DataObject property for the nested report looks and acts the same way as it would for a DataWindow What is noteworthy is the Nest Arguments property for the nested report This property is used to supply either a literal value expression or a column value as a retrieval argu ment s for a nested report The number of values provided in the list has to match the number of retrieval arguments defined for the nested report Even though this example is in the composite report section it will work for nested reports as well that is when a DataWindow is not of the com posite report type but does include nested reports The syntax for supplying dynamic retrieval argu ments via the Nest Arguments property follows argl F3 arg2 args yess b Notice that this list is not a quoted string The whole list is surrounded by an open and a A composite DataWindow close parenthesis respectively Each argu ment is also surrounded by an open and a close parenthesis Finally the argument is enclosed by quotes Also the way the argu ment is treated by PowerBuilder differs depending on how it s presented Sound con fusing It is The following examples should help simplify this USING EXPR
60. incorporate them e CodeWarrior www metrowerks com e MobileVB www appforge com MobileBuilder www penright com UltraLite and supported platforms limits CodeWarrior for Palm development I like the text based and OO development amp ik 10 Sai ini E 2 de Fer Ed g began TE Farhan Soo ar ai 53 or hiphm e UltraLite Component Suite Java Embedded VB veloper mobile ulcs available that can be used to create applications for handheld devices This list is just the beginning and there will be more coming down the pipeline as sys tems mature and developers push the of those systems use approach Reusing classes helps reduce development time also realize that each developer is different so please check out what s available I am looking forward to developing a J2ME applica tion for a phone to see how it works As I was looking at the various target ed platforms I noticed that the ARM processor is being used in Pocket PC sys tems I m looking forward to seeing what will happen with the Palm OS 5 since it s using the ARM processor Will these products that are targeting the ARM processor also be able to use Palm OS devices along with Pocket PC devices Only time will tell Businesses are starting to see how mobile applications can help them a www sybase com de better guality of data is being entered into the system the nee
61. ing all employees in alphabeti 6 ConnecttheDW control to your trans 2 dw_customer A simple report showing all customers in alphabeti cal order cal order 3 dw_phonebook A join between Leyniumu Repeat ode Lice Coleman Tascha Joas um ow that the holidays are over it s back to work back to school and back to he basics In my December column PowerBuilder and ODBC 101 PBD ol 9 issue 12 we discussed hooking up to a database via ODBC employees and department group ed by department At this point we have all the basic pieces to put together a report module Let s review the steps reguired to get a DW talking to the database L Initialize a transaction object your window called 2 Populate the transaction object prop control and alistboxonto it Leavethe own or use SOLCA erties needed for your database 3 Try connecting to the database 4 Check the transaction object s SqlCode property to see if the connec tion was successful DataWindow control at design time or programmatically dw_1 dataobject lt dw object name gt action object dw_1 SetTransObject lt tranx object name gt Be sure to check the return code for a successful connection Guia Li Emgluseu Let ESE Ld bee Bie SEE Ei er EE EITE in alas EEE ww w POWERBUILDER OURNAL com Customer List of runreport dw customer CASE 2
62. isher of developer magazines and journals MED brings you the most comprehensive coverage of Web services y leon SKOKIN AND CHARLES SILBERGLEITK Add reports to existing applications without recompiling task of restoring the dataobject of a DataWindow DW or DataStore DS dynamically at runtime has been discussed many times in PBD One method is to use DW syntax but it has some limitations It doesn t work for composite DWs or DWs with nested reports If a DW contains DropDownDataWindows DDDW they re not restored automatically An elegant way of restoring them is shown in the article Dynamically Creating or Modifying DropDownDataWindows DDDWS from Syntax at http my sybase com detail id L001992 Another problem is how to build generic codeto retrieve a DW with retrieval arguments The article Report Deployment Using Generic DataWindow Retrieval by Sameer S Kulkarni PBD Vol 7 issue 4 describes a service that replaces references to retrieval arguments in DW syntax with their actual values the service doesn t process lists of values In this article we show how to use full state to restore DWs dynamically and how to use temporary tables to set values or lists of values for DW retrieval arguments The method allows restoring DWs with DDDWS nested 12 PBD volume10 issue2 reports and composite DWS It may be used to add reports to an existing application without having to recompile it Restore
63. itional config uration necessary beyond the installation of the Bouncy Castle provider covered earlier Step 3 Connect to EAServer using Jaguar Manager right click on the Packages folder and choose deploy EJB as shown in Figure 1 In the resulting dialog enter the full path or browse to the PBD lib pbsecurity jar file includ ed with the pbsecurity zip file you downloaded Note Be sure to install the package into EAServer as well by right clicking on the Installed Packages folder under theJaguar server and choosing the Install Package menu item PBSecurity PowerBuilder Client Application Overview Time to fire up our trusty PowerBuilder IDE Included in the pbsecurity zip file is a work space named securityclient pbw that should automatically include the securityclient pbl as a target when opened The client application is a single window no flames about the GUI design it s a demo that contains a hidden tab control until you successfully establish a con nection with EAServer Note Be sure to review the code in the Open event of w client to ensure it points to your EAServer installation Once a connection to EAServer is estab lished the tab control is made visible There Base64 encoding of encrypted clear text are four tabs that demonstrate the different aspects of security we ve been talking about including Base64 encoding public private key generation asymmetric encryption and final ly secure has
64. ity Crypto Component For those who like to tinker and are familiar with Apache Ant I ve included the Ant script I used to build and deploy the EJB Running the default target displays the following help C starbucks pbdj pbdj gt ant Buildfile build xml help echo Welcome to the JCE security for PowerBuilder ant script This script is used to build the entire JCE EJB example The following tasks are available build builds the JCE EJBs that PowerBuilder will call deploy deploys the JCE EJBs to EAServer javadoc builds JavaDoc documentation for the EJB BUILD SUCCESSFUL Total time 2 seconds In essence the three targets will build deploy and document the component In fact the easiest way to deploy the pbsecurity jar file is through the deploy target Be sure to verify your configuration before running the deploy 26 PBDJ volume10 issue2 Generation of RSA public and private Keys FIGURE 3 target by inspecting lines 21 through 24 that set up where EAServer is running lt property name jaguar host value local host gt lt property name jaguar port value 9000 lt property name jaguar user value jagad min y gt lt property name jaguar password value dey gt Deploying the PBSecurity Crypto Component For those who are anxious to just deploy the code and not tinker with Apache Ant the zip file contains an EJB jar file ready for immedi ate deployment There is no add
65. jumping between different platforms don t see this happening too often since many information system administra tors don t like swapping devices it caus es headaches and heartburn One thing about this software is that you also need a runtime library to operate your appli cation on the device Java is used within the UltraLite Component Suite Toolkit Native UltraLite for Java supports the Jeode VM on Windows CE ARM devices including the Compag iPAO and NEC MobilePro P300 which have the Jeode VM Windows operating systems other than Windows CE are supported for testing and development purposes only The Embedded Visual Basic piece is an ActiveX component targeted for 386 and ARM processor devices I have not had a chance to do any research with this product so I can t say much about it All these packages help create appli cations for handheld devices You will need to know the available features in order to get a firm grasp on which pack age to use Realize also that these pack ww w POWERBUILDER OURNAL com 2 0 cr en ages will leapfrog each other This means that if one toolset has a feature that s liked by the general populace the others will follow to make sure they re not los ing clients As these tools get more sophisticated there will be libraries cre ated to make development even easier In many cases these libraries already exist You just have to know where to look and how to
66. ks to be included in the report Assume the information is stored in the table STOCK with theinteger field STOCK ID as a primary key The temporary table populated with IDs of stocks selected by the user has the following syntax CREATE TABLE Listing 1 Restoring a DataWindow or DataStore by its full state t Stoektad int not null In this case the stored procedure to show info on stocks in this way may look like Listing 14 Maintenance Window Main Elements Let s look at two maintenance windows one to store the info on report DW and another to storetheinfo on criteria DWs and their columns Both windows are inherited from a base window that has a DW control named dw_datawindows It presents a user with a list of all DWs contained within a selected PBL To get the list the function LibraryDirectory is used It takes two argu ments the path to a PBL and the enumerated value DirDataWindow to specify we need only the list of DataWindows The function returns a tab separated string of DW names dates of modification and comments The string may be imported into the dw_datawindows control with the ImportString function Its dataobject is an external DW with the first three columns set up to accommodate the string returned by the LibraryDirectory function their types are string datetime and string Other columns reguired for processing may be appended In this case we need the ID of a report where a selected DW is used
67. ld would return 1 As usual don t forget to use SetTransObject on the child before you code a retrieve Once we have our refer ence to the dropdown we can do almost anything with it that we can do to a nor mal DataWindow including using Modify Describe SetTransObject Find Sort and Filter Be sure that the data value for a col umn that uses the DropDownData Window edit style is limited to 511 char acters Share DropDownDataWindows If you use a lot of DDDWS it might be a good idea to populate a DataStore for each DDDW and share with the DataStore An important point to remember is that you must prevent the retrieve of the DDDWS prior to sharing DDIAD Hb Employee Fixi Mame Wihitresg Cobh Lhe J Jordan ats Bit rkzza Eiri Jammu Brh and MM mr Dl Jans Frans H si my hum Gha Ln od Last Hama this is usually accomplished in the open event of the window or the DDDWS will initially do a retrieve If this happens you will be retrieving twice for each DDDW To stop the retrieve of the DDDW do an insert row into the ChildDataWindow from the open event of the window Get the Display Value I ve come across a problem with a PB 6 5 app on a DataWindow I have a DDDW that accesses a simple two col umn name number table The DDDW uses name as its display column and number as its data column The user is able to select a name from the list and the number is stored in another table
68. le it looks like ra_string string ra_long number ra_dat etime datetime where names of retrieval arguments are put in quotations The order of arguments in the expression given by the nest_arguments property matches the order of the elements of the retrieval arguments list To substitute all references to retrieval argu ments in the SELECT expression with the actual values the function f global replace is used see Listing 9 Processing of the Criteria Information The criteria DW allows for the setting of val ues or lists of values as arguments to the report DW retrieval All values are passed to the report DataWindow using temporary tables To set one value we may use either a DDDW or an edit editmask field To set a list of values we ll open a browser window with a list of available values for the column and a checkbox against each value The code of thereport retrieval will create and populate all necessary temporary tables Below all columns are considered inde pendent values set in one don t interfere with values set in all other columns The values entered in columns will not be validated by the code Also the code will not enforce the reguired property of columns Theinformation retrieved from the database parameters about the criteria DW as well as about criteria values set by a user is stored in the window s instance array one element per column of the criteria DW The array also has in
69. le contains a pre compiled properly formatted EJB jar file at pbdj lib pbsecurity jar that s ready for deploy ment into EAServer 4 1 x The Crypto EJB com ponent is comprised of three Java classes and two Java interfaces To be more concise its actually a single stateless session EJB with two utility classes I intentionally placed all the oe f cryptographic operations in the standalone utility class com getpersonified pbdj CryptOps so that you would have the opportunity to reuse this cryptographic code outside of an EJB con tainer The Base64 code is included for accessi bility but was originally written by Robert Harder and downloaded from http iharder sourceforge net base64 A simple review of the EJB s implementation class com getpersoni fied pbdj CryptoBean reveals that the exposed cryptographic methods are merely wrapper calls out to either the Base64 or CryptOps utili ty class In essence the EJB provides the necessary methodsto perform Base64 encoding decoding RSA key pair generations for use in asymmetric cryptography and production of an SHA 1 mes sage digest secure hash I ll leave it up to you to extend the methods adding support for addi tional symmetric algorithms and such Now lets get EAServer set up to perform some cryptography It s probably worth reminding everyone that in the ASCII character set not every character is printable As a result especially when deal ing with cryptograp
70. ll see at least one row in the DDDW it won t try to issue its own retrieve This also allows us to retrieve the DDDW anytime Now that we know how to prevent the retrieve of a DDDW the next step is to get the DDDW handle and retrieve it alone We can accomplish this by using the GetChild function Normally when you interact with a column on a DataWindow you use the column name to get or set the current value However we want to interact with the DDDW that is on a column not with the column itself GetChild provides us with a ref erence variable that points to the actual DataWindow in memory We can use this variable to issue functions against the DDDW such as Retrieve Insert Row and Modify ww w POWERBUILDER OURNAL com Here s a sample of how to use GetChild DataWindowChild dwc IF dw_1 GetChild dept_id dwc gt 0 THEN dwc SetTransObject SQLCA IF dwc Retrieve 0 THEN amp dwc InsertRow 0 END IF Notice that GetChild returns an inte ger This integer tells you whether GetChild was able to return a reference to the child DataWindow into the vari able dwc GetChild looks on your parent DataWindow for the column you specify It then assigns the DataWindow control used to retrieve that column to the vari able dwc If the column dept id is a DDDW then dwc should hold a reference to the DDDW If we had misspelled the name of the column or the column didn t exist on the DataWindow GetChi
71. m as often as manager for NEC USA 149 00 you wish I currently have over 200 pictures and the Inc has worked with PB YOU SAVE scheduler runs this program every 15 minutes You since version 3 and has can also run it as often as every minute to create a 11 years of programming slide show effect If you prefer you can always code experience He is also a the Windows timer event Sybase certified Note If you like to run this program interactively PowerBuilder developer comment the close this in the open event of the associate and a certified window v Sun Java programmer with a degree in L akkane yahoo com RS computer science An Off the Annual N ewsstand Rate 1 ssues of PBDJ for only 149 00 f 31 off the annual newsstand rate owerbuilderjournal com 2 and subscribe today Here s what YS he welds kading II find in avar BETEN tee woes ening you ll ind d in every HIHI PJI 9 RE iN ly Sire ESP LSS DLE TIFELTHZLEZA issue of BD Tips Tricks and Tech n due in New PowerB u T der Feature Server Side Programming DB Programming Techniques Tips on Creating Live Powe el Ider Sites Product Reviews Display Ads of the Best Add on Products PowerBuilder User Group Info Offer subject to LEARN WENN TECHNO mr DU manen ACH T1 l TECHNICAL JOURNALS IN THE INDUSTRY S00 513 411 www sys con com Si The world s leading i technogy publisher MEDIA wn ww w POWERBUI
72. me and a row number The code to save data for a DW with NRs so that it may be restored at runtime is in Listing 6 The variable adw references a DW control with the report no retrieves done The code inserts a row in the DW then loops through NRs and inserts a row in each Because the function InsertRow may not be called for NRs a DS with the same dataobject is created a row is inserted there and the data is copied into the NR using the dot notation The full state of such a DW may be saved Also all the NRS full states are saved in the database To retrieve the restored report see Listing 7 First the parent DW is retrieved with the Retrieve function call without arguments Then in a loop the code checks whether the DW has NRs named from nested_1 to nest ed 20 All found NRs are populated with data in each row For this an object named ds of u ds base type is created the nested report s DW is restored in it using the NR s dataobject property the code retrieves data into ds then the data is copied into the corresponding NR usingthedot notation Theretrieval arguments are obtained using the Evaluate function for the corresponding row of the parent DW Retrieval arguments of each NR are described in both the parent DW and the NR Using the former the code gets actual values the latter allows you to replace references to the NR s retrieval arguments with the actual values Then retrieve for the DataSto
73. me10 issue2 UTILITY n Power bunder Reinvent the wheel with PB Windows API Description Let s declare this Local External Function on my Window Function Long SystemParametersInfoA uint uAction uint uParam String lpvParam uint fuWinIni LIBRARY user32 d11 Since this API does much more than deal with wallpapers the first argument lets the API know what it s supposed to do The second argument is always zero because the wallpaper setting does not require this argument The third argument isthe bitmap BMP filename which is our wallpaper The fourth argument is used to preserve the new settings The purpose of this program is to set wallpapers and hun dreds of them Since I ll be constantly changing it I ll set this argument to zero Given the above information it s just a matter of one line of code to set the wallpaper from within PowerBuilder Please note that the file has to be a bitmap file so I had to convert my JPG files to BM P I then guickly tested setting new wall paper from within the PB application and started thinking about my other reguirements Let s recap those the program should be able to 1 Set wallpapers one at a time from a given number of files 2 Perform Step 1 randomly 3 Not miss any file For example if the program knows about four pictures a b c and d and this program is run four times and every time it s run it sets one of the four w
74. n a result set from an Oracle stored proce dure Support for that feature is being dropped and its use should bediscontin Powerful and flexible acle was slow to introduce support for returning result sets from stored edures W hen they finally did add such support they did so in a manner hat was somewhat different than the approach used by other vendors Window was created through theexecution of the stored procedure Therefore while both are supported the use of an uncon strained ref cursor could lead to runtime errors This is particularly true because the developer could inadvertently modify the result set description after the initial cre ation of the DataWindow and the uncon strained ref cursor would allow the modi fied statement to compile In the case of a constrained ref cursor a modification to the result set without modification of the ref cursor data type declaration would Regardless using stored procedures for the data sourceis an option and may result in an error during the stored proce dure compile alerting the developer to the issue On the other hand there are some techniques particularly using object types to store and return the data that necessi tate the use of an unconstrained ref cursor The ref cursor can be populated by a number of methods and a straight select statement is the most common Oracle introduced the concept of ref cursors a cursor that can be passed back
75. n be distributed so workers can do their jobs and not be tied to a desk To improve worker performance many companies want to put a focused amount of enterprise data into an application that resides in a pocket size device I think James Bond would be proud of what we can do these days I ll focus on platforms and development tools that work with the UltraLite deployment tool Let s first look at handheld OS plat forms You d think this would trim down the field on development tools but not this time The UltraLite can be deployed on the following platforms e Palm e Windows CE e Symbian 22 PBDJ volume10 issue2 As you can see the UltraLite deploy ment package works on major handheld platforms This is nice to Know in case your company changes platforms because of feature reguests or enter prise architectural changes It doesn t happen often but it can Table 1 pro vides a matrix for Ultral ite and support ed platforms This brings us to which tools you can use to create handheld applications There are several to choose from it all depends on your criteria and what you want to accomplish Review your reguirements when looking at which tool you want to use Realize also that there are implicit constraints on the hardware that you might be overlook ing These could include memory speed and screen size Going from client server or browser based to hand held application development can take some getting used
76. nningJDK 1 4 I feel compelled to remind everyonethat the code examples here are just that examples and I leave it up to each of you to determine the applicability of using this code in a produc 24 PBDJ volume10 issue2 7 amp 7 J tion environment I should also mention that at present it isn t possible to easily access Java libraries from a traditional two tier client serv er program PowerBuilder 9 0 exposes the new PowerBuilder Native Interface and I ve already begun to see some of my peers working on examples that demonstrate how to access Java code directly from PowerBuilder without reguiring a bridge like Sybase EAServer in the middle Until the release of PowerBuilder 9 0 well have to stick with the EAServer in the middle approach Clearly I don t have room here to provide an in depth explanation of theJava language the build and deployment process use of the JCE APIs and accessing the final EAServer compo nents from within PowerBuilder Instead we ll focus on what is reguired to properly configure EAServer to access the JCE and the API exposed by the EAServer component I ve written avail able at www sys con com pbdj sourcec cfm and call the cryptographic methods from with in a PowerBuilder application Let s start by downloading and unzipping the pbsecurity zip file available from the PBDJ Web site For those with limited exposure to Java let me say up front that the zip fi
77. o create the DS ds interface The column TABLE_SYNTAX describes syntax to create a temporary table The function takes one argu ment the criteria DW control The instance variable i_ _report_id is equal to the ID of the current report The code goes through the DW s columns and retrieves corresponding values of the columns DW SYNTAX and TABLE_SYNTAX for each one If the DW_SYN TAX value isnt empty the DS ds interface is dynamically created Then the code creates the temp table using the TABLE SYNTAX value and creates the DS ds temptable link dynami cally with the source Select from created temporary table Finally the DS is modified to become updateable TheDS ds interfaceis used if a browser win dow is reguired The browser window is opened with a parameter of array i_str_colin fo element for the corresponding column The structure is stored in the browser s instance variable i_str column The browser window has one DW object dw choices for the user to select values out of the list It also has OK and Cancel buttons In its open event the window populatesthedw_choices control with what we havein the DS ds interface blob blb state i_str_column ds_interface amp GetFullState blb state dw_choices SetFullState blb state The code for the OK button updates the DS ds temptable link with users choices see Listing 11 The DW must have the column selected as a checkbox and the value one corresponds to checked
78. ok ing for code warriors employees who knew what all the acronyms meant That has all changed Today they re looking for employees who have the ability to work in teams communicate effectively and be aware of the social and cultural context of what they re doing and how it enables them to relate to others A cou ple of years ago employers would have hired somebody with great technical skills today potential employees have to have morethan that For tech workers accustomed to winning over employers with their beefy r sum s the demand for soft skills could be a challenge The days of head down coding are over at least for now Code jockeys are so last century During the bubble and the ensuing war for talent some hiring managers wanted to get a person in front of the computer as soon as possible Now the motto is to get the right person for the right job at the right time Things are bound to slowly pick up Still we may be in for a long winter The tech industry is on life support nationwide Large employers that laid off thousands aren t expected to hire again anytime soon And much of the growth in technology is in areas such as security defense and biotechnology which may reguire a set of skills many of us do not yet have There are glimmers of hope The gov ernment pharmaceutical companies and some banks have been able to pick up highly skilled tech workers they couldn t afford before and the informa tion
79. om a DOM parser He or she wants to know how you can take your knowledge and experience and communicate it to a team both technical and nontechnical v Auruor Bio Bob 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 PBDJ volume10 issue2 ww w POWERBUILDER OURNAL com Sybase Inc www sybase com ww w POWERBUILDER OURNAL com PBDJ volume10 issue2 n my early PowerBuilder days was very impressed with how easy it was to create and format DataW indows for either online or printed reports At its easiest a simple print method is reguired to send a W hat you see is what you get version of the DataW indow to the printer Even when the printed version of a DataW indow is different from the visual one a smple ShareData function would be all that is reguired What took a while however was learning how to display and print reports that either had a master detail relationship or no rela tionship at all In short what if I need to create or print a report that s based on different SOL statements There are two solutions to this problem 1 Create a master or base DataWindow then add additional nested DataWindows nested reports 2 Create a report by using the DataWindow composite presentation style
80. ons Using a palette of graphical modules the developer links together their desired functionality and interactively tests their application in one seamless development environment Application targets include Web sites WAP enabled mobile devices n tier application services and enterprise Servlets ee pea IN SOFTWARE 295 00 IP Works SSL adds SSL and Digital Certificate capabilities to the IP Works Internet Toolkit providing Secure Web Browsing Secure Client Secure Server Secure Mail Digital Certificate Management Capabilities and a lot more The current release consists of 15 components for secure Internet connectivity BORLAND 389 99 Builder is the leading cross platform environment for learning ava programming and personal application development Builder 6 Personal includes an integrated editor debugger compiler visual designers wizards and tutorials OFFER SUBJECT TO CHANGE WITHOUT NOTICE C O M PBDJ volume10 issue2 27 POWERBUILDER 101 Dynamic Hepori Module Basics lake your PB apps to the next level WRITTEN BY Davao Haar This month let s look at the most important item to hook up to a data base a DataWindow Our apps are all about viewing data and the Data Window is the nucleus of all data view ing in PowerBuilder apps Source code for this article can be downloaded from www sys con com pbdj sourcec cfm Since most DataWindows function as
81. orts and are therefore never updateable Y Autor Bio Bob Hendry is a PowerBullder 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 ___bob sys con com _ ww w POWERBUILDER OURNAL com NET JOURNAL Th e Best LEARN WEB SERVICES GET A NEW J OB NET Fage Subscribe today to the world s Suarantegg leading Web Services resource Get Up to Speed with the Fourth Wave in Software Development Real World Web Services XM L s Killer App e How to Develop and Market Your Web Services How to Use SOAP in the Enterprise e EAI and Application Integration Tips Demystifying ebXML for success The Marketplace Tools Engines and Servers Authentication Authorization and Auditing e Integrating XML in a Web Services Environment Wireless Enable Your WAP Projects and Build Wireless Applications with Web Services e Real World UDDI Swing Compliant Web Services BPM Business Process Management e Latest Information on Evolving Standards e Vital technology insights from the nation s leading Technologists Industry Case Studies and Success Stories e and much much more Making the Most of NET e Web Services Security SC a OO e i VISION SN SYS CON Media the world s leading i technology publ
82. per s Journal WebSphere Developer s Journal U S Two Years 24 Cover 168 You Pay 99 99 Save 68 FREE 198 CD U S Two Years 24 Cover 360 You Pay 169 99 Save 190 FREE 198 CD U S One Year 12 Cover 84 You Pay 69 99 Save 14 U S One Year 12 Cover 180 You Pay 149 Save 31 Can Mex Two Years 24 192 You Pay 129 Save 63 FREE 198 CD Can Mex Two Years 24 360 You Pay 179 99 Save 180 FREE 198 CD Can Mex One Year 12 96 You Pay 89 99 Save 6 Can Mex One Year 12 180 You Pay 169 Save 11 Int l Two Years 24 216 You Pay 170 Save 46 FREE 198 CD Int l Two Years 24 360 You Pay 189 99 Save 170 FREE 198 CD Int l One Year 12 108 You Pay 99 99 Save 8 Int l One Year 12 180 You Pay 179 Save 1 XML Journal PowerBuilder Developer s Journal U S Two Years 24 Cover 168 You Pay 99 99 Save 68 FREE 198 CD U S Two Years 24 Cover 360 You Pay 169 99 Save 190 FREE 198 CD U S One Year 12 Cover 84 You Pay 69 99 Save 14 U S One Year 12 Cover 180 You Pay 149 Save 31 Can Mex Two Years 24 192 You Pay 129 Save 63 FREE 198 CD Can Mex Two Years 24 360 You Pay 179 99 Save 180 FREE 198 CD Can Mex One Year 12 96 You Pay 89 99 Save 6 Can Mex One Year 12 180 You Pay 169 Save 11 Int l Two Years 24 216 You Pay 170 Save 46 FREE 198 CD Int l
83. piled statements in its SHARED SQL area which means that SQL SELECT statements will achieve similar performance as stored procedures Further Oracles role based security model can and should be used to restrict the user s ability to access data only in the context of the application session Thatis the role they need to access the data can be enabled only for the application ses sion and only for the duration of the application session nondefault roles expire when the session ends particularly be preferred for consistency when the application has to support a number of different database vendors and stored procedures are used as the source for other vendors Ref Cursors Sybase provided a workaround in PowerBuilder known ued Therefore our discussion will focus entirely on the ref cursor approach To return a ref cursor it must first be declared as a data type generally in apack age specification A ref cursor can be con strained which means that the result set description isdefined when theref cursor is declared or it may be unconstrained which meansthat the result set description isdetermined upon use PowerBuilder sup ports the use of either but it does bind the DataWindow to the particular result set description it obtained when the Data as PBDBMS named after the package created by PowerBuilder in the database used to return the data to enable you to retur
84. re ds may be done with the Retrieve function call without arguments To avoid a retrieval argu ments popup window at retrieve the code removes the description of the retrieval arguments from the syntax of the NR Listing 8 Shows the code of the function of get_row_select that does the trick The func tion takes the following arguments adw is the reference to the DW control al_ row is the cur rent row number as select is the SELECT statement of the NR as_args_main is the par ent DW s description of the NR s retrieval argu ments and as args nested is the description of the retrieval arguments in the NR To obtain the parent DW s description of the NR s ww w POWERBUILDER OURNAL com retrieval arguments the Describe function is used as follows Describe nest report name nest_arguments If for example an NR has three retrieval argu ments correspondingto the following columns of the parent DW sval of string type lval of numeric type and dtval of datetime type the returned expression is sval Ival dtval If a retrieval argument is an expression it will be placed within quotations like Ival 2 After all the expressions have been evaluated we have to take the SELECT expression of the NR and sub stitute all references to the retrieval arguments with actual values The list of retrieval arguments of an NR may be obtained from its syntax For the mentioned examp
85. re allowing multiple connections from within the same J VM PointBase Embedded features also include small footprint archi tecture extensibility referential integrity near zero administration and a low cost of ownership ase Code Assembler FULCRUM is a J ava development tool that uses a propri etary concept of code templates that can be used as building blocks to construct efficient J ava objects and 5 applications Unlike code generators that impose their cod da ing technigues and run time environments on the users FUL CRUM allow users to build their own coding standards in the templates and also lets users switch to manual coding at any point in time WWW ww w POWERBUILDER OURNAL com Attention J ava Vendors To include your product in J DJ Store com please contact Rachel sys con com Introducing PowerBuilder 8 The award winning indus try leading application development environment just got better Release 8 of PowerBuilder adds exciting new j features and capabilities that will make your develop ment of Web client server and distributed applications easier faster and more cost effective New features focusing on improved productivity tighter integration with EAServer and Web application development make this release indispensable to your development efforts 3 999 00 Simplicity Enterprise Lite provides the ability to build server side enterprise class Web applica Sim picty ti
86. re returning our unconstrained type PROCEDURE callunconstrained a_dept IN emp deptnostype esempimnfo OUT unceonstrainedeursor END SP PKG ww w POWERBUILDER OURNAL com ename FROM emp WHERE deptno END callconstrained a_dept PBD volume10 issue2 The code listing for this article can also be located at WHS f 31 More than 1 400 Web services and Java articles on one CD Edited by well known editors in chief Sean Rhody and Alan Williamson these articles 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 fesa tel aren Pe i a i y Eni Ree COP Er Pred an ney CP The most complete library of exclusive CFDJ articles on one CD This CD edited by CFDJ editor in chief Robert Diamond is organized into more than 30 chapters with more than 400 exclusive articles on CF applications custom tags database e commerce Spectra enter prise CF error handling WDDX and more LIST PRICE 198 Priority Mail Each CD is an invaluable developer resource packed with Important articles and useful source code The most complete library of exclusive JDJ articles compiled on one CD Assembled by JDJ Editor in Chief Alan Williamson more than 1 400 exclusive articles are organized into over 50 chapters including fundamen t
87. reports In most circumstances nested re reports are not considered DataWindow children there fore they cannot be accessed via a GetChild method There is an unsupported workaround that will allow the programmer to treat the nest ed report as a true DataWindow child are wn ome em ill TA HU VAT P g BAL x 6 NW Composite reports are a DataWindow pre sentation style that provides the programmer with a place to put unrelated mutually inde pendent DataWindow objects When run each DataWindow is retrieved independently no relationship exists with either the base DataWindow or any other DataWindow within the composite report presentation style When supplying retrieval arguments they must be supplied in the code Unlike using nested reports the composite report presentation style treats the contained DataWindow objects as DataWindow children so the GetChild method can be used to access the report and any objected contained within it Just remember to name the report objects in the composite DataWindow if you want to obtain its handle via a GetChild method Similar to using nested reports the composite report DataWindow presentation style is used when the data is read only When the user runs a DataWindow that either contains nested reports or was built with the composite report presentation style the base DataWindow is rendered in Print Preview mode Both compos ite and nested reports are true rep
88. retrieves are done The algorithm goes through each nested report and inserts a row in it then the full state of such a DW may be saved Also all the nested reports full states are saved in the database The code to retrieve the restored report is in Listing 4 Listings 4 15 can be downloaded from www sys con com pbdj sourcec cfm A simple Retrieve call for the restored DW won t work To solve the problem we have to popu late all nested reports in a loop At each loop step the code gets the dataobject property for the current nested report and restores it in a variable ds of type u ds base Then the Retrieve function call without retrieval argu ments populates the DataStore ds and the data ww w POWERBUILDER OURNAL com is copied into the corresponding nested report with the RowsCopy function Restore and Retrieve Algorithms for a DataWindow with Nested Reports To process a DW of this type we need refer ences to all nested reports NRs The function GetChild may not be used with NRs so we have to use the dot notation This means that the names of all NRs have to be hard coded Here we use the names from nested 1 to nested 20 for NRS To address NRs we need a function that returns the dwobject reference to an NR by its name and row number We need one such function for DWs and one for DSs Listing 5 shows the script of both functions It takes three arguments a reference to a parent DW or DS an NR na
89. rt and supply its retrieval argument under the General Properties tab see Figure 6 This figure ties in the state retrieval argu ment for the nested report to the state retrieval argument that was supplied in Figure 5 as a general property of the composite DataWindow The same steps should be taken to supply the region argument to the other nested report but the steps are redundant and so won t be repeated here The final step in this method of composite DataWindow retrieval is the actual code dw_l SetTrans0Object SOLCA dw_l Retrieve IL Central Notice that when retrieving nested reports for composite DataWindows in this fashion 8 PBDJ volume10 issue2 Summary t Footer t FIGURE 4 you don t have to programmatically obtain the DataWindow child DYNAMIC NESTED REPORTS The DataWindow object of the nested report does not have to be defined at design time it can be dynamic The following PowerScript determines the DataWindow object as well as any arguments dw_l SetTrans0Object SOLCA If gs_userid MANAGER Then dw_l Modify dw_product Data0bject d product oraph Else dw_l Modify dw_product Data0bject d product by region dw_l Modify dw_product Nest_Arguments Central e o End If dw_l Retrieve In this code the nested report named dw prod uct will contain the DataWindow Object d_prod uct graph if the user logged on is MANAGER All other users w
90. ryptography algorithm imple mentations The architecture of the JDK inspects a file named java security that lives inside the JDK jre lib security directory to locate the names of known JCE providers Step 2 Open up the SYBASE SHARED Sun jdk jdk1 4 jre lib security java security file using your favorite text editor After a large comment block at the top theres a section header that reads List of providers and their preference orders see above We want to modify this section to include a reference to our Bouncy Castle provider class To emphasize the subtlety of the title the order these classes are listed in is very important Modify your list to read ij List of providers and their preference orders see above security provider l sun security provider sun security provider 2 com sun rsajca Provider security provider 3 org bouncycastle jce provider BouncyCastleProvider security provider 4 com sun net ssl inter nal ssl Provider security provider 4 com sun crypto provider ounJCE security provider 5 sun security jgss SunProvider The JCE uses a factory design pattern and what weve done is give a list of providers that the JCE should search in order when a specific crypto graphic algorithm is reguested A factory design pattern takes a string es input that represents the name of a dass that implements a well defined interface or extends a well known super class returning an instance of th
91. s con com 888 303 5282 een zi Case Studies Tips Tricks Sybase Inc www sybase com pbextension and more Sybase Inc www sybase com 800 8 SYBASE _ iaman FL E Now in More d af than 5 000 Bookstores Worldwide SYS CON Subscription Offer Www sys con com suboffer cfm 888 303 5282 i r Subscribe NO W SYS CON Media http developer sys con com 888 303 5282 Web Logic Developer s J ournal www weblogicdevelopersjournal com 888 303 5282 a Go Online amp Subscribe Today Web Services Edge 2003 www sys con com 201 802 3069 O nly 149 for 1 year 12 issues regular price 180 Web Services J ournal www wsj2 com 888 303 5282 WebLogic com SYS 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 Advertiser is fully responsible for all financial liability and terms of the contract executed by their agents or agencies who are acting on behalf of the advertiser This index is provided as an addi Se SYS CON tional service to our readers The publisher does not assume any liability for errors or omissions MEDIA www POWERBUILDER OURNAL com PBDJ volume10 issue2 29 This has a couple of consequences for PowerBuilder developers The first is that the PBDBMS approach was developed within PowerBuilder as an interim workaround The second is that using stored proceduresto r
92. scending David Hart is a goingto do just that change the dataobject Employee List a button for filtering and a button that certified PB and ASE property on the fly in our app giving us a Employee Phonebook turns on the prompt for criteria func instructor developer He very flexible report tool Let s start coding e Code the SelectionChanged event of tionality resides in Rancho e Open w reports in the window Ib reports to determine which report Changing properties on the fly at Cucamonga California painter was selected by the user and retrieve runtime is a key concept to master to and is putting the Declare an instance variable of type it as follows take your PB apps to the next level finishing touches on his DataWindow Happy coding Y first book PowerBuilder CHOOSE CASE index PED ___ 101 A Practical W ay to datawindow idw report CASE 1 ML cu o NS Sn PB THEWORLD SLEADING ADVERTISER ae B N DEPENDENT WEBLOGIC 3 NET Developer s J ournal www sys con com dotnet 888 303 5282 Amyuni Technologies Inc www amyuni com 866 926 9864 D EVELO DER RESO U RCE Pp y E Crane Computing www ecrane com Helping you enable J ava Developer s J ournal www javadevelopersjournal com 888 303 5282 intercompany J DJ Store www jdjstore com 888 303 J AVA F Ek 3 r rE collaboration on PB9 Books www pb9books com ki i nk a a global scale e Product Reviews PowerBuilder Developer s J ournal www sy
93. something automatic some computer program to change the wallpaper for me also want ed something that would accept my new pictures without reconfiguring the pro gram not only wanted a random effect also wanted the program to use all the pictures before it started repeating searched the Internet and found sev eral wallpaper changing programs but none of them did exactly what wanted Besides didn t want to take the risk of downloading some unknown 2MB file just to change the wallpaper either I then decided to reinvent the wheel Can you guess which tool used to build a program like this Yes you got it PowerBuilder It took me less than a day to write and test the wallpaper program using my favorite tool Most people think of PowerBuilder as a traditional client server tool They re mistaken Since it can call most Windows APIs it also gives you the power to talk to the machine at a lower level and hence accomplish tasks for which there is no standard PowerBuilder function The rest of this article explains the important steps and technigues I used to create this little utility Before could begin the design I wanted the Windows API that would change the wallpaper to the desired image file searched Microsofts Knowledge Base and found the Sys temParametersinfoA API and gave it a shot Although the Microsoft site used Windows 95 as an example the API worked fine on my Windows 2000 machine 20 PBDJ volu
94. the total number of wallpa pers displayed in the profile file variable lastrecent This variable will be used to keep track of the number of times this program is run When this number equals the number of files in the folder all the wallpapers have been shown As long as the files in the directory remain the same delete the profile file ww w POWERBUILDER OURNAL com whenever you add remove picture files in the fold er the order of the files in the listbox is going to be the same no matter how many times the program is the annua run hencetheres no need to save the filename Also new gute rate it s a whole lot easier to search if a particular wall paper is already set I ll build a string of all the pre viously shown wallpapers and see if the new ran dom number is present If it s not there in the list I have found my new wallpaper I could have done this with a DataStore but I didn t want to create another object When all the pictures in the directory are shown once all the history in the profile file has to be cleared re creating the file does that as a side effect Before you build the executable change the instance variable as it stores the folder location ANNUAL NEWSSTAND RATE where all your wallpapers are stored AUTHOR Bio YOU PAY Now that the program is ready you can use the Atul Kane an MIS zs Windows scheduler to run this progra
95. ver you call a ShareData or RowsCopy0 function both the source and destination column sets must match Limitations Nesting Composite Usually nested reports tend to be of the more common DataWindow presentation styles such as FreeForm Tabular or Grid For the most part you re allowed to nest the various types of DataWindow presentation styles However sig nificant limitations apply to two of them e Crosstab You cant place a crosstab with retrieval arguments within another report as a related nested report However you can include a crosstab in a composite report e RichText Rich Text reports cannot be nested in any way You are not allowed to place a RichText report in another report and you cannot place a RichText report within a com posite DataWindow What s the Difference Composite vs Nested Nested reports are not a DataWindow style but DataWindow objects used within DataWindows Nested reports are usually hierar chical they have a detail relationship with the base DataWindow To create a nested report open the base DataWindow then place a report object in the desired DataWindow band The nested report can be linked to the base DataWindow by setting its retrieval argument property The crite ria for nested report retrieval can be a column value in the base DataWindow or a constant When retrieving a base DataWindow con taininga nested report the base DataWindow is retrieved first then each of the nested
Download Pdf Manuals
Related Search
Related Contents
Wurster - Severin Clique aqui e baixe o manual da Serra Mármore GDC Service Manual Fiche de Sécurité Chapin 22190 Focus Electrics 86628 Manuel d`utilisation Nokia E71 Dons, prêts, apports, … aux compagnies et théâtres : mode d`emploi E-trace manual Copyright © All rights reserved.
Failed to retrieve file