About the Book
Use IBM WebSphere sMash to Rapidly Deliver Scalable, Flexible Web 2.0 Applications
With the radically new IBM WebSphere sMash and the Project Zero platform, it’s far easier to develop, assemble, and run applications and mashups that align tightly with SOA enterprise infrastructures. Getting Started with IBM WebSphere sMash covers all aspects of architecting, designing, and developing solutions with these breakthrough technologies.
Authored by three IBM leading sMash experts, this practical tutorial shows how to create state-of-the-art web applications far more rapidly than you ever could with traditional Java or .NET enterprise platforms.
As you walk through sample projects based on real-life scenarios, you’ll master both basic and advanced sMash features, ranging from request handling to event processing, database access to security. You’ll also learn agile best practices for consistently writing better web applications, delivering them sooner, and getting more value from them.
Coverage includes
Installing and configuring IBM WebSphere sMash, and choosing your development environment
Creating handlers to efficiently service all types of requests
Understanding sMash’s “convention over configuration” approach, and knowing when to override convention
Rendering responses that include visual content, data, and other resources
Connecting with databases via Project Zero’s powerful data access API
Using sMash’s security model to protect inbound and outbound connections
Building more flexible applications with sMash’s sophisticated event processing
Extending sMash development to non-programmers with Assemble Flow
Programming client-side code with the Dojo Toolkit
Taking advantage of sMash’s PHP support
Table of Contents:
Introduction 1
Situational Applications 1
Rapid Application Development 1
IBM WebSphere sMash Development Process 2
Available IBM WebSphere sMash Offerings 2
What Is Covered in This Book? 3
Chapter 1 Installing the IBM WebSphere sMash CLI 5
First Things First: Java Development Environment 5
Installing the Command-Line Interface 6
Activating HTTP(S) Proxy Support 8
Test Your IBM WebSphere sMash Installation 9
Getting Started with the Command-Line Interface (CLI) 11
Conclusion 13
Chapter 2 Choose Your Development Environment 15
Introduction 15
AppBuilder 15
Getting Started 16
Sample Applications 16
Creating a New Application 18
Editing Applications 18
Eclipse 21
Sample Applications 21
Creating a New Project 23
Command-Line Interface Environment 27
Sample Applications 28
Creating a New Application 29
Deploying Your Application 30
Conclusion 30
Chapter 3 Your First Handler and Beyond 33
Introduction 33
Application Directory Layout 33
Source Directories 34
Supporting Directories and Files 35
REST 36
REST with the Zero Resource Model (ZRM) 38
Declaring a Dependency 41
Virtual Directories 43
Synchronizing a ZRM Model 43
Event Handling in Groovy 44
Running the Application 44
Explicit Event Handling 46
Event Handling in PHP 49
Event Handling in Java 52
Creating a Client 52
Groovy Templates 52
PHP 56
Dojo 59
Conclusion 61
Chapter 4 Configuration Files Explained 63
Application Configuration 63
Global Context and zero.config 63
Custom Configuration Data 64
Variable Substitution 65
Include Files 66
Handler Configuration 66
Dependency Management with Ivy 69
Ivy Modules 69
Ivy Files 69
Resolution and Resolvers 71
Environment Configuration 74
Useful Information About Your Application 74
Runtime Configuration 75
About the Author :
Ron Lynn is a Senior Software Engineer on the IBM Web Enablement and support team. He is currently working on internal projects utilizing WebSphere sMash. Ron joined IBM June 1995, as an indentured graduate student and has yet to return to academia. As an IBM neophyte, he spent his time working on a now-defunct project called Knowledge Utility (KnU). KnU allowed for exploration of many technologies and theories, from a then little-known language named Java to knowledge representation to what we now call portals and portlets. This led him to develop portlets for IBM Business Partners and proselytizing portals to the world. After landing on the Web enablement and support development team, Ron formalized his expertise into building portal applications in support of IBM’s biggest customer, IBM. The team’s fast pace and everchanging project line-up is a fertile environment for forging applications out of the latest IBM products and technologies, which led him to work with Web 2.0 technology and WebSphere sMash.
Ron’s primary passion for his job is the multiplicity of skills it draws upon from the mathematical, theoretical, scientifical, and engineerical to the personal, magical, and artistical. The constant variety and juggling keeps him forever learning and wondering what will smite him next--though there are dark times when he muses if he’d have the same passion for his work were he a juggler in the circus.
Ron calls a small farm in the San Joaquin Valley of central California home, where he lives with his fabulous wife, darling children, a great dog, and several cats of undetermined disposition. When he’s not bent over his computers, he spends his time as a father, husband, knitter, dressmaker, tailor, welder, carpenter, painter, plumber, gardener, pool boy, fine furniture builder, farmer, mechanic, writer, mad scientist, and water gun target. He loves to see the angelic delight on little faces as the latest in rocket launchers, onagers, or robots work wonderfully or fail fabulously. He doesn’t even mind the eventual chastisement when his lovely wife discovers the mess that the dog must have made. (Sorry Madison--someone had to take the fall.)
Karl Bishop is a Senior Software Engineer with IBM. He works for the Web enablement and support group within the IBM Software Services for WebSphere for IBM. As the name implies, his group develops and supports many internal IBM applications. His technical focus of late has been in Web 2.0 technologies in general, and the Dojo Toolkit in particular. Karl has worked for IBM for close to 12 years. Before that, he spent another dozen years honing his geek credentials at another computer company in California. Karl currently works out of his house, hidden away in the Sandhills near Pinehurst, North Carolina--no, he doesn’t play golf--but professes to be an original “Florida Cracker” by heart and birth.
When he’s not pounding away at the keyboard, Karl enjoys being the cool dad and husband. Karl likes to play with his son, Matt, building Lego’s and other contraptions. With his daughter, Aubri, he plays games, critiques her artwork, and generally goofs off. Other family enjoyments include biking, swimming, gardening, and playing disc golf. Karl also enjoys brewing when time permits and quaffing craft beers just about anytime. When work gets to be too much, the Bishop family frequently heads up toward the Appalachian mountains or the beach. Come on kids, we’re off to Boone-Tweetsie Railroad and the Mellow Mushroom are calling.
Brett King is a Senior Software Engineer with IBM, working on the WebSphere Commerce product. He is currently working on social networking enhancements to the product using WebSphere sMash. Prior to WebSphere Commerce, Brett was a developer on WebSphere sMash. Brett has been a software developer at IBM for almost 20 years, working in such varied areas as networking software, pervasive computing, and grid computing. He has been fortunate to work with advanced technologies throughout his career, including WebSphere sMash. He has particular interests in finding ways for developers to be more productive, whether through better tools or better software engineering processes, such as agile development.
Brett grew up in rural Pennsylvania but he has lived in the Research Triangle area of North Carolina since graduating from Lehigh University. In his free time, Brett has a wonderful wife, two kids, and a multitude of hobbies to keep him busy. He especially enjoys reliving his childhood through his own kids. Always eager to tap into his creative side, Brett enjoys playing role-playing games, constructing miniature terrain sets, and modding his muscle car. Brett also enjoys travel, with favorite destinations being places with historical significance, the homes of remote family members, and anywhere the Pittsburgh Steelers are playing.