Mobile Web from the RPG and Dojo Perspectives IBM has adopted the open-source Dojo toolkit as its internal standard! Is Open Source relevant to the IBM ILE community? How does Open Source Web and ILE work together? How good is RPG as a Web Server Language? What techniques does the RPG Programmer need to master? How does IBM promote ILE to the Web Technologies?
ILE-Web RPG & Dojo PC/Mac/Laptop RPG User Experience tg ******** 1 3 2
ILE-Web RPG & Dojo ipad/iphone RPG User Experience 1 3 5 2 4
ILE-Web RPG & Dojo Technologies to Master RPG Programmer The RPG Programmer does not need to become a Web Expert, but he needs to understand the Web Message Formats, and master the newer RPG language features. (V5R4 and newer) Awareness of (Apache) QHTTPSVR Subsystem Familiarity with IBM API s Pointers, User Spaces, Data Queues Work with IFS Files and Directories ILE Concepts Service Programs Procedures Binder Language Rational Tools and Editors (WDSC,RDP) RPG Free Form Qualified Data Structures JSON Data Structures
ILE-Web RPG & Dojo What is Qualified Data Structures? RPG Programmer D zapinullptr S * D zapisys DS qualified based(zapinullptr) D login likeds(zapisyslogin) D job likeds(zapisysjob) D env likeds(zapisysenv) D ifs likeds(zapisysifs) D zapisyslogin DS qualified based(zapinullptr) D action 8A D client 10A D nav likeds(zapisysnav) D host likeds(zapisyshost) D zapisysnav DS qualified based(zapinullptr) D browser 10A D platform 10A D language 10A Example Use: login.nav.platform = Win32 ;
ILE-Web RPG & Dojo What is JSON? RPG Programmer www.json.org JavaScript Object Notation Lightweight data-interchange format Easy for humans to read and write Easy for machines to parse and generate Programming language independent Structures Collection of name/value pairs (associative array) Ordered list of values (array, vector, list)
ILE-Web RPG & Dojo JSON Name/Value Pairs RPG Programmer IFS Web Content { "errcode": "OK", "errmsg": " Everything is fine", "javascript": "loginserver", nav: { "browser": "chrome", "platform": "Win32", "language": "en-us", "cookies": "true", "protocol": "http:", "username": "TG } }
ILE-Web RPG & Dojo JSON Array RPG Programmer IFS Web Content { } identifier: "rrn", items: [ {rrn: 1, "U2STAT": "AZ", "U2DESC": "Arizona"}, { rrn: 2, "U2STAT": "CA", "U2DESC": "California"}, { rrn: 4, "U2STAT": "FL", "U2DESC": "Florida"}, {rrn: 5, "U2STAT": "GA", "U2DESC": "Georgia"}, { rrn: 20, "U2STAT": "VA", "U2DESC": "Virgina"} ]
ILE-Web RPG & Dojo RPG Sample Program Syntax RPG Programmer Procedure: Main() gsysptr = HZA_GetSysPtr(); // Read JSON Document gsys.ifs.desc = HZI_OpenFile(%trim(gSys.ifs.path): 'READ '); jsonstring = HZI_ReadFile (gsys.ifs.desc); gsys.ifs.rtnc = HZI_CloseFile (gsys.ifs.desc); if Z_ChkSettings() = -1; return; endif; jsonbase glogin.nav.userid JZK_GetNode('nav'); glogin.client glogin.nav.browser. return; = JZD_GetInput(jsonString); = %trim(%xlate(glo: gup: jsonbase.userid)); = JZK_GetAttribute('client'); = JZK_GetAttribute('browser');
ILE-Web RPG & Dojo ILE Enhancements to Consider IBM Rational To make RPG even better, IBM should modestly increase funding for RPG compiler and tooling, and use the additional funds to: Finish the /Free Project (D,P,E Specs) Enhance API Include Library QSYSINC QSYSINCQDS (QDS = Qualified Data Structures) could be built in functions in the future Enhance RPG Conversion utilities CVTRPGSRC = Convert from RPG/400 RDP Convert Source to Free Format Educate the ILE community How to use the new API Include Library How to use IBM state of the art Web Tools Tell the community that RPG is not a 5250/DDS only language These enhancements would benefit the ILE environment, and would potentially make RPG a main stream language, which of course would be good business for IBM.
Open Source Toolkits Reside inside the browser Event Driven HTTP Technology: AJAX Message Formats: JSON/XML JavaScript Object Notation Extensible Markup Language
Toolkits www.jquery.com First release in 2006 Most popular library in use today Free, open source software Good for creating Websites Microsoft bundles jquery on their platforms Visual Studio ASP.NET Framework
Toolkits www.sencha.com previously EXTJS Multiple products, not all are free Sencha Touch, first mobile framework Some Interest in the AS/400 community http://openrpgui.com/ http://cnxcorp.com/valence/
Toolkits Official IBM support The Dojo Foundation, non-profit org. Free, open source software Comprehensive functionality Great for creating Web Applications Active Release Schedule Improved Documentation Incorporated into Zend Framework
Why Dojo? www.dojotoolkit.org
Why Dojo? With hundreds of proprietary and open Ajax implementations available, developers and architects are faced with yet another tough technology adoption challenge. The question is which Ajax platform will emerge as an enterprise standard. IBM has adopted the open-source Dojo toolkit (dojotoolkit.org) as its internal standard, is a key contributor to the Dojo project, and a committed member of the Dojo Foundation. The IBM commitments to the Dojo project include enterprise features such as internationalization, data binding, and accessibility support.
Why Dojo? The WebSphere Application Server Web 2.0 and Mobile Feature Pack uses standards-based technologies to help developers create more connected, interactive desktop and mobile applications. Standards-based technologies, including Ajax, REST Web services, and Dojo, are used to simplify and speed the addition of rich desktop and mobile user interfaces to WebSphere Application Server applications.
Why Dojo? http://devzone.zend.com/article/3545
Newest Dojo
Newest Dojo
Newest Dojo
Newest Dojo
Mobile Showcase - ipad
Mobile Showcase - iphone
Mobile Showcase - Android
ILE-Web RPG & Dojo Model-View-Controller Architecture Separation of Concerns Each Component can be developed independent of each other.
ILE-Web RPG & Dojo OPM/ILE Legacy Systems Architecture View Controller 5 2 5 0 Model DB2 Corporate Data ILE RPG or COBOL Business Logic With or Without API s
ILE-Web RPG & Dojo WEB from the ILE Perspective Architecture View J Controller HTTP: Stateless RPG-ILE or PHP-ZEND IFS S Model DB2 Corporate Data ILE: Stateful RPG or COBOL Business Logic With API s Web Content O N
ILE-Web RPG & Dojo 8 Step Workflow View Controller 1 IBM Web Server (Stateless) 8 wrkactjob IFS Steps: 2,3,4 + ILE Programs: HWEBHTP* 2 Keyed Data Queues IN 3 4 OUT Model Steps: 5,6,7 Listeners ILE Business Logic (Stateful) 5 7 wrkactjob 6 DB2 Corporate Data
ILE-Web RPG & Dojo Summary www.hugmar.com For more information about the subject matter of this session, please contact Throstur Gudmundsson: tg@hugmar.com www.amcuatlanta.com AMCU Atlanta, a COMMON user group, will be hosting a series of labs to introduce its members to Open Source Toolkits, and how they can effectively work with the ILE environment.