INSTALLATION OF powerEXT Core Version 1 --------------------------------------- Includes: * Special version of CGIDEV2 - UTF8/16 file support - Responce Object Support * powerEXT API: HTTP connecter & Productivity Services The powerEXT API is documented on (case sensitive) http://powerEXT.com/pextdoc_CGI.htm The installation procedure is simple and requires i5/OS V5R2 & WDS: ** the installation should be run under an ** ** user profile with *ALLOBJ authority ** 1. Download the savf to your PC 2. FTP it to a savf on your iSeries 3. Restore the library PEXTCD2 from it 4. Run CALL PEXTCD2/PXCRTCD2 - converts all source files to your CCSID and recompiles all programs to current i5/OS version. 5. include PEXTCD2 in your library list powerEXT Core ------------- - MIT licensed, for the CGIDEV2 part please see the license notes included in CGIDEV2 - supports basic client centric RIA development - features and methods on http://www.powerEXT.com/pextdoc_CGI.htm - lowest OS i release V5R2 - builds on an enhanced CGIDEV2 and uses the following subprocedures from CGIDEV2: - clrHtmlBuffer - getEnv - zhbGetInput - zhbGetVarCnt - zhbGetVar - getHtmlIfs - updHtmlVar2 - wrtSection - wrtNoSection - wrtHtmlToStmf (enhanced by Scott to support UTF-8) - zhbBufAddr (added to CGIDEV2 as part of the powerEXT project) - zhbBufSize (added to CGIDEV2 as part of the powerEXT project) - can run on any other middleware that provides the same basic functionality i.g. IceBreak powerEXT Core Combined with PowerEXT Application Framework ---------------------------------------------------------- - the Core provides all needed basic methods for development of the framework. powerEXT Core Combined With CGIDEV2 ----------------------------------- - all Core features can run in a mix with old CGIDEV2 methods Enhances CGIDEV2 with the following features: - add's Node and Encode Support for HTML, XML and JSON - generates structured documents for readability - supports UTF8 IFS files - supports access to buffer address and size powerEXT Core Combined With Scott Klement's HTTPAPI --------------------------------------------------- - add's HTTP Client ability to the powerEXT Core Enhances HTTPAPI with the following features: - add's ILOB support via bufAddr() and bufSize() methods - add's Node & Encode Support for XML and JSON - generates structured documents for readability - add's template support - can write generated request object to IFS for test Sample Program: *===================================================================== * Project : powerEXT Core * Title : Basic Sample Program * Build : 2010.02.07 * * Copyright © HR Software Development, Denmark * Author : Henrik Rützou * License : MIT license * Website : powerext.com *===================================================================== h datfmt(*iso) h timfmt(*hms) h decedit('.') h actgrp('POWEREXT') dftactgrp(*no) h bnddir('TEMPLATE2') * powerEXT API Connectors /copy qsrc,pxapicgicn Basic HTTP connecter & Productivity Services * Internal Variables d hello s 18 inz('Hello <> "Hello"') d world s 18 inz('World <> "World"') d testbuf ds based(buffaddr) d result 42 d buffaddr s * d buffsize s 10i 0 * Include CGIDEV2 /copy's here if "old" CGIDEV2 is needed /copy qrpglesrc,prototypeb /copy qrpglesrc,usec /copy qrpglesrc,variables3 * Include LIBHTTP /copy's here if needed * and add HTTPAPI in h'specs bnddir *copy qrpglesrc,httpapi_h /free // Clear Service Program & Responce Object clearSrvPgm(); setContent('*none'); // Build Inline HTML Response Object echo(''); echo(''); htmlNode('table':'style="padding: 0 18px 0 0;"'); htmlNode('tr'); htmlNode('td':'':hello); htmlNode('td':'':world); htmlEndNode(); htmlEndNode(); // Build Inline XML Response Object echo(''); echo(''); xmlNode('xmlTest':'id="a"'); xmlNode('messageA':'':hello); xmlNode('messageB':'':world); xmlEndNode(); // Build XML Response Object Based on Template setExtVar('hello':encodeXML(hello)); // mixing CGIDEV2 and powerEXT example updHtmlVar('world':encodeXML(world)); echoCGI('/powerEXTtmp.xml':'xmlTemplate'); // Build Inline JSON Response Object echo(''); echo(''); jsonNode('*object'); jsonNode('*string':'messageA':hello); jsonNode('*string':'messageB':world); jsonEndNode(); // Internal Responce Object Handling buffaddr = bufAddr(); buffsize = bufSize(); dsply result; dsply buffsize; // Send it with HTTPAPI // rc = http_url_post_xml('https://wwwcie.ups.com/ups.app/xml/Track' // : buffAddr // : buffSize // : %paddr(StartOfElement) // : %paddr(EndOfElement) // : *NULL ); // Write Responce Object To Disk echoToStmf('/powerEXTtest.txt':1208); // Write Responce Object To Client // echoToClient(); *inlr = *on; return; /end-free The output from the sample program:
Hello   <> "Hello" World   <> "World"
Hello <> "Hello" World <> "World" Hello <> "Hello" World <> "World" { "messageA":"Hello <> \"Hello\"" ,"messageB":"World <> \"World\"" }