Table of Contents
Acknowledgments iii
Preface ix
1 IBM i and Open Source 1
Why Open Source on IBM i? 2
It's All About the Community 2
2 The PASE Environment 5
PASE and ILE 6
Installing PASE 8
PASE Applications 8
Using PASE 10
3 The Integrated Language Environment (ILE) 13
ILE's Origins 13
Modularity and Binding 14
The Benefits of ILE's Integration 15
4 The Beast That Is XMLSERVICE 17
Installation 18
Next Steps 19
XMLSERVICE Examples 22
First Step: Prepare the Apache Server 22
Second Step: Serve the Web Pages 25
5 i Object! 33
Classes 34
Encapsulation 35
Inheritance 36
Interfaces 37
Polymorphism 37
Have Some Class 38
6 Ruby and IBM i 39
Installation 42
IDEs and irb 42
Language Basics 48
Variables 48
Scope 49
Built-in Functions 52
Containers 53
Hashes 57
Program Structure in Ruby 59
Modules 59
Control Flow in Ruby 64
Using Case 70
A Brief Aside into Error Handling 71
File, I/O, and System Operations 72
A Brief Aside into I/O 73
Files 74
System Commands 79
The Ruby Toolkit 80
Alternatives 85
Using JRuby with ActiveXML Service and ActiveRecord 90
Something New 97
7 Rails and Ruby 99
Getting Started with Rails 99
Building a Rails Application 101
Rails and MVC 105
Structure of a Rails Project 107
Database Access in Rails 108
Accessing Resources with Routes 109
Summing It Up 110
8 PHP on IBM i 111
Where PHP Lives on IBM i 112
Installation 113
Running Scripts 114
Programming Basics 115
Variables 116
Operators 118
Iteration 119
Strings 120
Accessing System Resources 122
Files 122
Running System Commands 123
Database Access 124
Accessing IBM i Commands and Programs 127
Simple Commands 127
Calling Programs and Procedures 133
PHP in the Web World 138
9 Python 145
Installation 146
Programming in Python 147
Numbers 148
Strings 148
Lists 148
Tuples 149
Dictionary 151
Functions 152
Modules 154
Classes in Python 159
File Access in Python 161
System Access 163
DB2 Access 164
Accessing RPG 165
Feel the Power 168
10 Node.js on IBM i 169
Jiving with JavaScript 170
Classes and Objects 177
Arrays and Hashes 181
Functions 186
Node.js 190
Vexing Versions 192
System Access 203
DB2 Database Access 204
11 Apache and Tomcat on IBM i 213
Apache 214
Tomcat 218
12 The IBM i Open Source Garden 221
User Groups 222
Virtual Communities 223
Notable "Solos" 223
Index 225