Lab Jam WASv8 Development Lab
Lab Jam WASv8 Development Lab
Application Infrastructure
WebSphere Application Server V8
Developers
Lab Exercise
WebSphere
Lab Number
Contents
LAB 1 DEVELOPING A MOBILE WEB APP WITH RATIONAL APPLICATION DEVELOPER AND THE WEB
2.0 & MOBILE FEATURE PACK FOR WEBSPHERE. ...................................................................................... 7
1.1 START THE MYSURANCE PROJECT ............................................................................................................. 9
1.2 CREATE THE WEB PAGE .......................................................................................................................... 10
1.3 CREATE THE HOME VIEW ......................................................................................................................... 16
1.4 CREATE THE MY PROFILE VIEW ............................................................................................................... 22
1.5 TEST WITH THE MOBILE BROWSER SIMULATOR ......................................................................................... 25
1.6 ADD A FORM TO THE MY PROFILE VIEW .................................................................................................... 29
1.7 ADD THE PROFILE PAGE CONTROLLER CLASS........................................................................................... 33
1.8 TEST WITH THE MOBILE BROWSER SIMULATOR. ........................................................................................ 36
1.9 CREATE THE ACCIDENT TOOLBOX VIEWS.................................................................................................. 37
1.10 ADDING THE GOOGLE MAP WIDGET TO THE POLICE VIEW ........................................................................... 39
1.11 ADDING THAT FINAL USABILITY TOUCH ...................................................................................................... 42
1.12 TESTING THE FINAL MYSURANCE APP ....................................................................................................... 46
1.13 SUMMARY ............................................................................................................................................. 48
LAB 2 INTRODUCTION TO JAX-RS........................................................................................................................... 49
2.1 PART 1 W HAT THIS EXERCISE IS ABOUT .................................................................................................... 49
2.2 PART 2 W HAT YOU SHOULD BE ABLE TO DO .............................................................................................. 49
2.3 PART 3 INTRODUCTION ........................................................................................................................... 49
2.4 PART 4 W ORKSPACE SETUP ................................................................................................................... 50
2.5 PART 5 RUN BACK-END SERVERS ............................................................................................................ 51
2.6 PART 6 CREATING REST BASED SERVICES ............................................................................................. 54
2.7 PART 7 CLEAN UP THE SERVER FOR NEXT EXERCISE ............................................................................... 76
LAB 3 INTRODUCTION TO OSGI ............................................................................................................................... 78
3.1 BEFORE YOU BEGIN................................................................................................................................ 78
3.2 ABOUT THE APPLICATION YOU WILL DEVELOP ........................................................................................... 78
3.3 A CLOSER LOOK AT THE OSGI APPLICATION ............................................................................................. 79
3.4 A CLOSER LOOK AT THE SCA APPLICATION ............................................................................................... 80
3.5 CONVENTIONS ....................................................................................................................................... 80
3.6 PART 1: START RAD AND THE WAS TEST ENVIRONMENT ......................................................................... 81
3.7 PART 2: DEVELOP THE OSGI API BUNDLE ............................................................................................... 82
3.8 PART 3: DEVELOP THE OSGI IMPLEMENTATION BUNDLE ............................................................................ 85
3.9 PART 4: DEVELOP THE OSGI W EB BUNDLE .............................................................................................. 91
3.10 PART 5: DEVELOP THE OSGI APPLICATION .............................................................................................. 95
3.11 PART 6: IMPORTING THE SCA PROJECT AND COMPOSITE ........................................................................... 99
3.12 PART 7: INVESTIGATE THE WIRES, REFERENCES AND SERVICES ................................................................ 101
3.13 PART 8: DEPLOY THE APPLICATION ........................................................................................................ 104
3.14 PART 9: USE THE OSGI BANKINGAPPLICATION W EB APP ........................................................................ 105
3.15 PART 10: USE THE SCA STOCKTRADER W EB SERVICE ........................................................................... 107
3.16 PART 11: RETRIEVE THE SCA LOGGINGSERVICE ATOM FEED .................................................................. 110
3.17 CONCLUSIONS ..................................................................................................................................... 111
APPENDIX A. COMMON TASKS .............................................................................................................................................. 7
APPENDIX B. NOTICES ........................................................................................................................................................ 129
APPENDIX C. TRADEMARKS AND COPYRIGHTS ............................................................................................................. 131
Contents Page 3
IBM Software
The app contains a number of views. The first view is the home view which allows you to access two
functions; the My Profile and the Accident Toolbox view. In the My Profile view you provide your personal
information. The Accident Toolbox view contains four services which will help you at the accident scene.
The services are Call the Police, Call for a Tow Truck, Exchange Driver Info, and Record Accident
Location.
Call the Police and Call for a Tow Truck brings up a Google Map of your current location and searches
for the nearest police office and towing company. Exchange driver information allows you to capture
information about the other driver. Record Accident Location uses the GPS location in your device to
determine your location, and then performs a reverse geocode lookup to discover the address of the
accident scene.
You will use IBM® Rational® Application Developer™ (RAD) and the mobile authoring tooling that is
available since version 8.0.3. This version of RAD includes an early beta version of the latest version of
the Dojo Toolkit, v1.7beta1. The Dojo Toolkit is an extensive framework for developing Rich Internet
Applications (RIA), also often called Web 2.0 applications. Since version 1.5 the Dojo Toolkit has been
extended with the Dojo Mobile project and now allows you to develop device independent mobile web
apps which run in the web browser of the mobile devices. This allows you to use your existing skills in
HTML, CSS and JavaScript to develop apps for mobile devices. If the app is running on an iPhone/iPad,
Android or Blackberry device Dojo Mobile provides predefined style sheets for the platform which makes
the app look just like a native app specifically written for the platform.
This lab focuses on the client side code, the code running on the mobile device, of the Mysurance app.
No server side code is being developed. There are also no functions developed to actually transmit an
insurance claim to a server. For a fully functioning solution this portion would need to be implemented,
and there would also need to be a server side REST service which receives and processes the claims.
Upon completion of this exercise you should have gained basic understanding of
how to use the mobile authoring tooling in RAD to visually create a mobile web app
how to test a mobile web app using the Mobile Browser Simulator
You should possess basic knowledge of HTML, CSS and JavaScript. Familiarity with IBM® Rational®
Application Developer™ or the Eclipse Platform is an asset, but is not required.
Important note!
In our lab we will develop a fully functional mobile web app using Dojo Mobile.
However we will not create a so called Dojo Custom Build which combines all
the Dojo JavaScript files our app requires into one single file and shrinks it. This
step is highly recommended before putting a Dojo application into production (or
even on test servers) as it significantly reduces the load time and the amount of
data transferred over the wire.
__a. In the VMWare image double-click the Rational Application Developer Standard
Edition icon on the desktop.
__c. Expand the Mysurance project by clicking the plus sign in front of it in the Enterprise
Explorer view.
The WebContent folder is the document root for the web app and is where we have the
artifacts we have built for this lab.
The Dojo framework is located in the dojo folder under WebContent. You can expand
this folder as well to see how the Dojo framework is organized. The Dojo Mobile
components live in the dojo/dojox/mobile folder. Should you ever want to see the source
files this is where to find them.
__e. Among the files that have been built already are some images in the images folder,
some JavaScript files in the js folder, some Dojo classes and widgets in the mysurance
folder, and some Mysurance custom style sheets for iPhone and Android in the themes
folder. Dojo Mobile also has platform specific style sheets for Blackberry but we have not
added any Mysurance-specific style sheets for Blackberry.
The _extra folder contains some files you will use to copy/paste throughout the rest of
the exercise.
__a. Right-click the WebContent folder and select New > Web Page.
__c. In the Template section select Mobile HTML/XHTML. Click the Options button.
__d. With Document Markup selected in the left pane, select UTF-8 as Encoding in the right
pane. Select HTML5 as the Document Type.
__e. Click Mobile Web Page in the left pane. Dojo Mobile provides a class called
deviceTheme which automatically detects the device’s platform and loads the platform-
specific style sheets. To use this method you would select Detect Device.
If instead you would like to tailor your app for a specific platform you would select
dojox.mobile.stylesheet and select the appropriate style sheet.
If you would like to handle loading the correct style sheet yourself you would select the
No CSS option.
__f. We will also add two JavaScript files that you have created already. Click JavaScript
Files in the left pane. Then click the Add button.
__g. In the JavaScript dialog expand WebContent/js folder and select geolocation.js.
__h. Click the Add button again and repeat the procedure to add the utils.js file as well. Click
the Close button when done.
If the Note for Web Page Browsing alert appears dismiss it by clicking OK.
__a. RAD now opens the index.html page using the default Page Designer. This editor does
not support proper rendering of the Dojo Mobile widgets so this is not what we want to
use for mobile authoring. Close the editor.
__b. Right-click the index.html file and select Open With > Rich Page Editor (beta).
In the upper left corner is the Design view showing the selected device’s canvas. This is
where we can drag and drop Dojo Mobile widgets to build our app. At the bottom is the
Source view showing the HTML code for the page. These two are kept in sync by the
Rich Page Editor. Remember that in the current release of RAD the Rich Page Editor is
still in beta so not all of the Dojo Mobile widgets are supported, but the majority are.
__c. Click the Vertical mode icon on top. This places the two panes side by side and gives
you more screen estate for the device canvas.
__d. Click the Source tab at the bottom to enlarge the HTML source.
At the top of the HTML our two JavaScript files, geolocation.js and utils.js, have been
added:
Note that the files have been added with the language=”JavaScript” tag, which is
obsolete in HTML5. You may want to change that to type="text/javascript" instead,
which validates ok.
Below that are some new meta tags which you may not have seen before. The first tells
the device’s browser that it should display our app full screen, and with no option to
change its size:
The second tells the device’s browser that it should hide the normal browser address
field, back/forward buttons and any menus:
Combining these two meta tags means our app will cover the whole device’s screen.
Note: There are several other meta tags that can be used to customize an app, such as
specifying an icon to be used when bookmarking the app to your device’s home screen,
setting the color of the status bar etc. This is widely documented on the Internet.
Below these meta tags are the line that loads the Dojo framework and configures its
parser:
And finally below that are some lines that import the necessary Dojo classes using the
dojo.require statement:
dojo.require("dojox.mobile.parser");
dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat");
dojo.require("dojox.mobile.deviceTheme");
dojo.require("dojox.mobile.View");
The dojox.mobile.parser runs as soon as the HTML has been loaded into the browser
(but before the DOM has been finalized). It parses the HTML and injects the JavaScript
code for any Dojo widgets found.
The browsers on mobile device’s such as iOS and Android are based on the WebKit
HTML rendering engine. In case you would view the page on a non-WebKit browser
(such as Mozilla Firefox) the dojox.mobile.compat layer is loaded as well to provide
compatibility with such browsers.
The dojox.mobile.deviceTheme is the class that detects the device’s platform and loads
the correct style sheet.
The final imported class is the dojox.mobile.View class. This is the Dojo Mobile widget
that gives us a view in the web page.
In the <body> tag you can see that RAD has already given us a default view. The data-
dojo-type specifies which Dojo class this is (dojox.mobile.view) and the data-dojo-
props specifies any properties that the class needs in order to render.
Note: The data-dojo-* tags are compliant with the HTML5 specification and are preferred
over the previously used dojoType tag (for specifying the class name) and any custom
tags.
With this all loaded and explained we are ready to start adding widgets to our app.
__a. Click the Split tab to see both the Design and the Source views.
__b. The default view added by RAD was given an id of “view0”. In the source code change
this from “view0” to “home” to give it a more meaningful name.
__c. While developing it can be useful to use a device which has a smaller screen size to
leave more screen estate to the other views. Click the device selection dropdown in the
upper right corner and select Mobile > Apple iPhone 3GS.
__d. The rightmost pane on the screen contains three tabs; Outline, Snippets and Palette.
Click the Palette tab. In the Palette find and click the Dojo Mobile Widgets section to
reveal the widgets available.
__a. Select the Heading widget and drag it to the upper left corner of the design view. A
placement icon will appear telling you that the current insertion point is "Insert into
<div>". Drop the heading here.
Should you make any mistake, just press Ctrl-Z to undo the last action and retry.
Now look at the source code (scroll all the way to the right) you can see that a <h1>
heading with a Dojo type of dojox.mobile.Heading has been inserted into the view div:
__b. To change the label double-click the white “Heading” text in the Design view. Replace
the text with “Mysurance” and press Enter.
__a. Next step is to lay out buttons for the two functions available from the Mysurance home
view; My Profile and Accident Toolbox. For now we will just place these in a
dojox.mobile.RoundRectList widget. Later we will improve the look and feel of the main
screen.
Select the RoundRectList widget from the palette on the right and drag it onto the
canvas. Make sure the insertion point says "Insert after <h1>" and drop it. The mouse
cursor should be to the right in the light blue area below the heading for the correct
insertion point to appear.
__b. Double-click the “Item” text and replace it with “My Profile”. Then press Enter.
__c. In the Design view, select the My Profile widget and click the Insert After icon which
appears above the widget to insert another Item widget.
__d. Double-click the “Item” text and replace it with “Accident Toolbox”, and press Enter.
__e. We now want to add a small icon before the text to improve the visual appearance.
Select the My Profile item and click the Properties tab below the Design/Source/Split
tabs.
Then click Mobile List and then List Items in the list at the bottom left.
__f. Click the Icon field (which is currently empty) and then click the small dotted browse
icon that appears. See picture above.
__g. In the Insert Image dialog click the Browse button and then the Select button. Browse to
the Mysurance/WebContent/images folder and select the profile_small.png icon.
Then click OK. The icon is now added before the My Profile text.
__h. Repeat the process for the Accident Toolbox but select the toolbox_small.png icon.
Our home view is now almost ready and we can move on to the next view in our app, the
My Profile view.
Checkpoint!
If you have made any mistakes or your view does not look like
the one in the picture above, you can now replace the entire
contents of your index.html file with the contents of the
WebContent/_extra/solution/indexhtml_AfterHomeView.html
file.
__a. From the palette drag a View widget onto the canvas (you may have to scroll down to the
bottom of the Widget list to find it). Make sure the insertion point is "Insert after <div>"
and that the end of the arrow touches the right border of the canvas (the mouse cursor
should be far down in the light blue area, or outside the canvas, in one of the scroll bars).
Then drop the view widget.
Enter My Info in the Label field, Home in the Back button label field, and make sure
home is selected in the Back button target dropdown.
Now let’s have a look at what has been generated so far. In the Source code view press
Ctrl-Shift-F to reformat the code and make it easier to read.
The code within the <body> should now look like the following:
<body>
<!-- HOME VIEW -->
<div data-dojo-type="dojox.mobile.View" id="home"
data-dojo-props="selected:true">
<h1 data-dojo-type="dojox.mobile.Heading"
data-dojo-props="label:'Mysurance'"></h1>
<div data-dojo-type="dojox.mobile.RoundRectList">
<div data-dojo-type="dojox.mobile.ListItem"
data-dojo-props="label:'My
Profile',icon:'images/profile_small.png'"></div>
<div data-dojo-type="dojox.mobile.ListItem"
data-dojo-props="label:'Accident
Toolbox',icon:'images/toolbox_small.png'"></div>
</div>
</div>
__a. Click the My Profile item in the design view and then click the Properties tab at the
bottom.
Click Mobile List and then List Item at the lower left.
In the Move To column for the My Profile view (first row) select myInfo. On the same
row select slide as the Transition effect.
You can see that there is now a right arrow in the My Profile item in the Design view. This
indicates that clicking this items transitions to another view.
The My Profile list item in the Source view has now been modified to read:
<div data-dojo-type="dojox.mobile.ListItem" data-dojo-props="label:'My
Profile',icon:'images/profile_small.png',
moveTo:'myInfo',transition:'slide'"></div>
__a. In the Enterprise Explorer view on the left find the index.html file. Click the right mouse
button and select Run As > Run on Mobile Browser Simulator.
__b. In the Run On Server dialog select the AJAX Test Server and click Finish.
RAD will now publish the project onto the AJAX Test Server and start it, and then bring
up the Mobile Browser Simulator.
__c. Test your app by clicking My Profile item. This should take you to the My Profile view,
which is currently empty. Clicking the Home button in the upper left should take you back
to the home view.
__d. You can also add additional devices to see what your app will look like. Click the Add
Device dropdown and select another phone, e.g. an HTC Desire Android phone.
__e. If you have multiple devices with different platforms (such as iPhone and Android) you
may see that they both use the iPhone stylesheet, so the app on the Android phone
actually looks like an iPhone app. If this is the case then click the Enable Useragent
Switching checkbox. This tells the Mobile Browser Simulator to send the correct user
agent string, uniquely identifying each mobile device. Then refresh the browser by
pressing F5.
Note: The first time you use the Mobile Browser Simulator and you enable useragent
switching you will be prompted to install a Firefox extension. This extension handles the
useragent switching and also provides some Mobile Browser Simulator support for non-
Wekbit based browsers such as Firefox. Follow the instructions on the screen to install it.
__f. The Mobile Browser Simulator also allows you to adjust the size of the phone on the
screen to its actual physical size. In the Scale All Devices dropdown select Physical
device size. This brings up a blue credit card shape.
__g. Now take a real physical credit card from your wallet and place it over the card on the
screen. Adjust the screen card so it is the same size as your credit card. Then click the X
in the upper right of the Physical Size Calibration dialog to close it.
__h. You can also click the Rotate button to see what the Mysurance app looks like in
landscape orientation.
We will use the Mobile Browser Simulator later to see our improvements to the app, so
keep it running.
__a. Switch back to RAD and make sure index.html is visible on the screen.
__b. Position the cursor below the <h1 data-dojo….></h1> section in the myInfo view. Make
sure it’s positioned after the closing </h1> but before the closing </div>.
__c. Start typing <ul data and then press Ctrl-Space. This brings up RAD's content assist
feature for JavaScript. We want the unordered list (ul) to be rendered as a Dojo widget,
so select data-dojo-type in the drop down list.
__d. Position the cursor between the double quotes and type dojox.mobile. and then press
Ctrl-Space.
__e. Press Enter a few times to get some space below. Then close the unordered list by
typing </ul>.
To make it easy for us to parse the form values and save its contents to the device browser’s
local persistent storage we will use features of Dojo's Model-View-Controller framework, called
dojox.mvc.
</div>
This defines a dojox.mvc.Group class and tells it to use the profileModel field of the
profileCtrl class as its target. We will add this profileCtrl class later.
__b. Add a few lines between the <div...> and </div> to make room for all the fields.
__c. Expand the WebContent/_extra folder and open the myprofile_form.html file. Press
Ctrl-A to select all of it, and then Ctrl-C to copy the content.
__d. Switch back to index.html and position the cursor between the <div …> and </div> you
added. Press Ctrl-V to paste the code in. This adds the complete My Profile form to your
index.html page.
__e. Since we now have typed in code manually RAD has not added the necessary import
statements for these Dojo classes so we need to do that ourselves.
At the top of the index.html source add the following lines last in the list of dojo.require
import statements:
dojo.require("dojox.mvc");
dojo.require("dojox.mvc.Group");
dojo.require("dojox.mvc.Output");
dojo.require("dojox.mobile.TextBox");
dojo.require("dojox.mobile.ToolBarButton");
__f. Before we are done with the My Profile page we will also add a small button in the upper
right corner of the view to be able to clear the form fields.
Find the beginning of the My Profile view. Then find the <h1 data-dojo-type….></h1>
section which defines the header.
Position the cursor between the > and < and press Enter a few times.
This adds a Clear button and places it to the right (float:right) on the heading row.
__g. When a user clicks the Home (back) button in the upper left corner we want to save the
current profile to the browser’s persistent storage. For this we need to invoke the
leaveProfile() method. Modify the <h1…> line and add the onClick invocation as shown
in bold below:
<h1 data-dojo-type="dojox.mobile.Heading"
data-dojo-props="label:'My Info',back:'Home',moveTo:'home'"
onClick="profileCtrl.leaveProfile();">
The whole <h1> header section should now look like the following:
Note however that you can not run the app in the Mobile Browser Simulator yet since it
now depends on the profileCtrl class which we have not yet created.
For the purpose of the Mysurance app we will create so called Controller classes for the various views.
These follow the Model-View-Controller design pattern, with the Controller class being responsible for
dealing with the information coming in from the view, and going back out to the view.
__1. For the My Profile view we will create a ProfileController class using Dojo.
__a. Select the WebContent folder and click the right mouse button. Select New > Dojo
Class.
__b. In the Dojo Class dialog enter mysurance.controllers the Module Name field. Enter
ProfileController the Class Name field. Leave the other fields at their defaults. Then
click Finish.
__d. Expand the WebContent/_extra folder and open the ProfileController.js file. Press
Ctrl-A to select all and then Ctrl-C to copy the content.
__e. Switch back to the empty ProfileController class you just created and replace all of it
with the current content of the clipboard, by pressing Ctrl-A and then Ctrl-V (to select all
and paste to replace it).
The first few lines defines some variables. The constructor initiates the profileModel
variable to a dojox.mvc.newStatefulModel and passes the empty profileDefault as
input.
After that a number of methods defined. Pay attention to the syntax of the method
definitions, and also that the methods (and the variables at the top) are separated with a
comma character.
Look at the loadProfile method. It looks for existing profile data in the browser’s HTML5
localStorage. If a saved profile is found it is read and the profileModel variable is
updated. It then calls the setRef method (defined in utils.js) which connects the
profileGroup (defined in the My Profile form’s dojox.mvc configuration) with the
profileModel.
When we click the Home (back) button on the My Profile form the leaveProfile method
is invoked (using a regular onClick JavaScript invocation). This method converts the
fields of the form to a JSON object and then saves it to the browser’s localStorage.
Instead of using multiple onClick invocations to call our methods you could use Dojo’s
dojo.behaviour feature which is a convenient method to connect events with methods.
__g. To instantiate the ProfileController class in the index.html file we need to add a few more
lines.
__h. For Dojo to find our new PageController class we need to register its path. Below the
existing dojo.require statements add the following two lines:
dojo.registerModulePath("mysurance", "../../mysurance");
dojo.require("mysurance.controllers.ProfileController");
__i. We now also need to add some JavaScript code to instantiate the ProfileController
class and call the loadProfile method when the page is loaded.
Below the dojo.require statements (but before the closing </script> statement) add the
following lines:
var profileCtrl = new mysurance.controllers.ProfileController();
dojo.ready(function() {
profileCtrl.loadProfile();
});
The dojo.ready method is invoked when the whole page has been loaded into the
browser, Dojo has parsed the source and the DOM has been setup. This is the place to
put code you want executed as the web page is ready for action.
Checkpoint!
If you have made any mistakes or have any problems with your app
you can now replace the entire contents of your index.html file with
the contents of the
WebContent/_extra/solution/indexhtml_AfterMyProfileView.html
file which we have provided for you.
__b. Click the My Profile to show the form you just created.
__c. Click the Home button to go back. This calls the leaveProfile which saves the form to
persistent local storage.
You can then refresh (F5) the browser to reload the page, or even close the browser
completely and reopen it. When displaying the My Profile view again the information you
entered should remain since it was persisted to the browser’s local storage and reread as
our app started.
The form currently looks a bit skewed because the input fields are not properly aligned.
We will fix that later when we add our own customized Mysurance style sheet.
__1. Since these different views involves a lot of typing we will save you time by allowing you to
copy/paste all of it from a pre-created file.
__a. Open the WebContent/_extra folder and find the accidenttoolbox_views.html file.
Open it and press Ctrl-A and then Ctrl-C to select and copy the entire content of the file.
__b. Go back to your index.html file and in the source find the last closing </div> tag just
before the closing </body> tag. Add a few empty lines between the </div> and the
</body> tag.
Then press Ctrl-V to paste the content before the </body> tag.
These new views also use Page Controllers for their data flow. The necessary Page
Controller classes were already imported into the WebContent/mysurance/controllers
folder. You may want to spend a few minutes understanding what they do. You will see
that they follow the similar pattern as the ProfileController class you created before.
However for these classes to be made available we must first import them using
dojo.require.
__c. In the source find the line which imports the the ProfileController:
dojo.require("mysurance.controllers.ProfileController");
__d. Then find the following line which instantiates the ProfileController:
var profileCtrl = new mysurance.controllers.ProfileController();
__e. Finally add the following two lines last in the dojo.ready method:
accInfoCtrl.loadAccidentInfo();
accLocCtrl.loadLocation();
dojo.ready(function() {
profileCtrl.loadProfile();
accInfoCtrl.loadAccidentInfo();
accLocCtrl.loadLocation();
});
This code imports the three Page Controller classes, instantiates them and calls their
respective load method to load data from the browser’s persistent local storage when the
page has initialized.
__f. The long HTML code chunk you pasted uses some new Dojo Mobile widgets so also add
the following two lines to your dojo.require list to import them as well:
dojo.require("dojox.mobile.RoundRectCategory");
dojo.require("dojox.mobile.EdgeToEdgeList");
dojo.require("dojox.mobile.FixedSplitter");
dojo.require("dojox.mobile.Button");
Dojo Widgets are based on the Dojo Dijit framework which contains a number of predefined widgets,
ranging from basic widgets such as Button, Checkbox, and ValidationTextBox, to more advanced
widgets such as gauges, charts and legends. You can easily extend the predefined widgets to create
your own even more feature-rich customized widgets in an object oriented fashion.
But for the purpose of this lab we will just extend the basic dijit._Widget class.
__a. Select the WebContent folder and click the right mouse button. Select New > Dojo
Widget.
__b. In the Dojo Widget dialog enter mysurance.widgets in the Module Name field. Enter
GoogleMap in the Widget Name field.
__c. RAD now creates the mysurance.widgets.GoogleMap widget class and fills in some
skeleton code for you. Inspect the code and see if you can understand what it does.
RAD has also created two new folders in the mysurance/widgets folder, called
templates and themes. These contain skeleton HTML template and CSS files that we
could use for styling our widget. We will not need this for our Google Map widget so you
can delete these folders if you like (or leave them as is, since they will not interfere with
our work).
__d. Since our GoogleMap widget involves quite a lot of code you will copy/paste it from pre-
created source.
Open the WebContent/_extra folder and find the GoogleMap.js file. Open it and press
Ctrl-A to select all of it, and then Ctrl-C to copy the entire content.
__e. Switch back to the GoogleMap.js class you created. Position the curson inside the file
and press Ctrl-A to select all of it, and then Ctrl-V to paste and replace with the content
you copied from the pre-created GoogleMap.js file.
Look at the top of the file and you see that it defines a number of variables, one of them
is called reqtype. When we call the Google Map widget we will pass a text string to this
field, and that will be used to search the Google Maps API for nearby resources such as
police offices or towing companies.
You may want to spend a few minutes looking at the code to see what it is doing. Also
open the WebContent/js/geolocation.js file and see how the getLocation function uses
the HTML5 navigator.geolocation API to determine the current GPS position.
__g. For the Google Map to work we also need to import the Google Maps JavaScript API.
Add the following line to the top of the index.html file where utils.js and geolocation.js
are imported:
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places">
</script>
__h. And finally we also need to import our widget into the HTML page. Add the following
lines below the dojo.requires which imports the other mysurance classes (Note: these
lines must not be added above the dojo.registerModulePath line):
dojo.require("mysurance.widgets.GoogleMap");
dojo.require("mysurance.widgets.FixedSplitter");
The Accident Toolbox view and the four sub-views are now completed.
1.10.1 Connect the home view with the Accident Toolbox view
__1. To be able to access the Accident Toolbox view we need to add a transition to it from the home
view.
__a. In the Design view (or Split) click the Accident Toolbox item. Click the Properties tab
at the bottom. Then click Mobile List and List Items at the bottom left.
__b. Click the Move To field for the Accident Toolbox row and select the accHelp view. Then
click the Transistion field and select slide.
For the Google Map to work at all and to align the forms we need to add some custom style sheets to our
app. We have provided our own setupStyleSheets method in the utils.js file which does this for us.
__a. Add the following line to index.html after the dojo.require statements but before the
instantiation of the mysurance.controller classes:
In case our app is running on a tablet device we can benefit from the larger screen size to give a better
user experience.
At the bottom of the index.html file you should have a view with an id of ”accHelpFrames” which sets
up a mysurance.widgets.FixedSplitter widget (which extends the dojox.mobile.FixedSplitter widget)
to always show the four Accident Toolbox options on the left, and the respective views with maps and
forms on the right. Compare this to the phone layout which shows the Accident Toolbox and then slides
out the Accident Toolbox view and slides in the view for the selected function, completely replacing the
Accident Toolbox view on the screen.
__b. Replace the line with the following line, which invokes the setupIfTablet method:
<body onload="setupIfTablet();">
The setupIfTablet method is defined in utils.js. You may want to take a look at it to
understand what it is doing.
To make the home view a little more appealing we will replace the simple RoundRectList and the two
ListItems with two large icons for easier access.
__a. Find the current home view and change its id from “home” to “homeold”.
__b. Modify the “selected:true” to “selected:false” to make sure the old view is hidden.
__a. Expand the WebContent/_extra folder and open the home_view_new.html file. Press
Ctrl-A to select and then Ctrl-C to copy all of its content.
__b. Switch back to your index.html file and position your cursor before the old home view’s
opening <div> (right after the <body….> tag). Then press Ctrl-V to paste the new view.
This view adds two icons and sets up an onClick event for them. The events,
myInfoClicked and accHelpClicked, are defined in utils.js.
If you look at the accHelpClicked method in utils.js you can see that if we are running
on a phone (the PHONE variable is initialized in the first line of utils.js) we make a
programmatic slide transition to the accHelp view. If we are running on a tablet we make
a transition to the accHelpFrames view instead.
Checkpoint!
If you have made any mistakes or your app does not work
properly you can now replace the entire contents of your
index.html file with the contents of the
WebContent/_extra/solution/indexhtml_final.html file.
__a. Switch to the Mobile Browser Simulator and hit F5 to refresh your browser.
You should now see a fancier home view with two large icons instead of the previous
simple RoundRectList (first image below).
__b. Click the Accident Toolbox and then Call the Police. This should bring up a Google
Map of your current location (actually the location where your outbound IP address has
been recognized by Google, so it may not be spot on).
__c. If you are in a non-english speaking country a search for “police” may not return any hits
for you (as is the case for the map picture in the picture above). If this is the case you can
modify index.html and make the “police map” search for the word police in your
language.
To do this find the police map page view in index.html and change the word “police” on
the GoogleMap <div> to your language’s translation (after the reqtype). Then refresh
the Mobile Browser Simulator again.
Another option is to hard code the location to a US city, e.g. Las Vegas. To do this open
the geolocation.js file in the js folder. Swap the comment on the following two lines so
that the first becomes active and the second is commented out:
__d. The current version of the Mobile Browser Simulator simulator does not report the correct
width and height of the browser screen to the app. This means that since we in utils.js
detect if we are running on a phone or a tablet by looking at the screen size our current
detection mechanism doesn’t work well in the Mobile Browser Simulator. Simulating an
iPad 2 e.g. reports a screen size of 200x200 pixels and our app detects that as a phone.
If you want to see what your app would look like on an iPad you can use Google
Chrome and browse to http://localhost:8080/Mysurance/index.html and ensure the
window is large enough (>600 pixels in both width and height).
You should then be able to see the difference of the Accident Toolbox page with the
menu always available on the left with the Tablet layout, as shown below.
Note:
Since Firefox in a non-Webkit browser it works best within the Mobile Browser Simulator.
Chrome on the other hand works well outside of the Mobile Browser Simulator, but on the
other hand does not support useragent switching, not even inside the Mobile Browser
Simulator (a limitation of the Google Chrome browser architecture). So depending on
what you want either Firefox or Chrome will help you out.
1.13 Summary
In this lab you have learned how to use the mobile authoring capabilities of Rational Application
Developer to build a platform independent mobile web app. You have seen how using Dojo and Dojo
Mobile can help you speed up development and make your app more user friendly, and also give you a
nice clean separation of components and classes in your app. You have also seen how to use the Mobile
Browser Simulator to get a visual of what your app will look like on a real physical device.
As a next step to make the app production ready you should create a Custom Dojo Build to merge all
the different Dojo JavaScript files into one single file, and shrink it. This improves page load time
significantly and should always be done before releasing a Dojo application for production use. Rational
Application Developer provides access to the Dojo Build system but this exercise is left to the reader.
Note: See the section later in this template about using bulleted and numbered lists.
REST is an acronym that stands for REpresentational State Transfer, and is a style of coding pioneered
by Roy Fielding, one of the principal authors of the HTTP specification..
In this lab, you will model a simple REST API for the ProductSearchService. You will be utilizing the
GET verb primarily. The class diagram is shown below for the service.
The Mime type would describe the format of the data. Because you are building an Ajax front end using
the Dojo Toolkit, you will use JSON, JavaScript Object Notation. You will use the JSON4J API that is
part of the IBM WebSphere Application Server Feature Pack for Web 2.0 to translate your Domain
Objects to JSON. The Domain was implemented using the Java Persistence API (JPA). You will be
operating on the Product and Category (shown below) Objects in this lab.
__ b. if this is not your current perspective, click Window > Open Perspective > Other > Java
EE
__ a. In the Servers view, click the Start Server button: with WebSphere Application
Server v8.0 selected.
__ b. Wait for the server to start. When the server has started you should see:
__ c. Type su – db2inst1. This will temporarily switch your user to a valid db2 user.
__ d. Select Finish
Now the back-end services have been started and are running properly.
__ a. From the main file menu, select File->New->Dynamic Web Project as shown below.
__ d. Press OK and then Next. Leave the default values for Java and press Next
__ e. Press OK and then Next. Check Generate web.xml deployment descriptor and click
Next. Leave the default values for Context Root and Content Directory and press Next
__ f. On the JAX-RS Capabilities page, notice that IBM WebSphere JAX-RS Library for WAS
v8.0 is selected. Uncheck the Udpate deployment descriptor. Accept the defaults and
press Finish.
__ h. Right click your newly created Web project and select properties. Go to Deployment
Assembly, select the Manifest Entries. Press Add and select the
CustomerOrderService.jar, which contains our Java EE artifacts you are going to
expose.
__ 2. There are various ways of adding JAXRS support to your Web Application. In order to take
advantage of the WebSphere Application Server v8 annotation scanning, you need to create a
JAXRS application class.
__ c. Add the annotation @ApplicationPath and set the URL pattern to “jaxrs/*” as shown
below. To correct the error, add the statement import javax.ws.rs.ApplicationPath; as
shown below.
__ 3. You are now going to create your JAX-RS Resource. You will create a REST resource for
the/Product/{id} resource.
__ e. Examine the file. The @Path(“/Product”) annotation describes the web page path.This
makes your class a JAX-RS resource. @Singleton makes it a Singleton EJB. EJB 3.1
now allows you to define EJB’s in the Web Container. This is often referred to as EJB 3.1
Light because not all parts of the EJB spec is supported in the web container.
__ ii @Path on the method will append it to the /Product path. The {id} indicates it is a
dynamic pattern.
__ iv @PathParam tells JAXRS to populate the value of productid from the URI pattern
/Product/{id}. For example, /Product/1.
__ 4. Next, you will annotate your Business Data for JSON Serialization. WebSphere Application
Server v8 uses the JSON Jackson provider for POJOs.
__ b. We are only interested in serializing the top level properties. To the getter and setter of
Category, add @JsonIgnore as shown in the figure below. This will tell the Jackson
parser not to include it in the json payload.
__ c. Next, add the @JsonProperty annotation and set the value to “id” on the getter and setter
of the productId as shown. This will change the attibute name in the json to id.
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
__ a. Select File > Save All or strike Shift+Ctrl+S to save all the changes you made
__ b. Select WebSphere Application Server v8.0 in the Server view -> right click -> select
Publish to publish updates to the server
__ 6. You can exercise you resource now. We will use the firefox plugin POSTER for this initial test.
__ a. Open the POSTER plugin. You can do this by selecting the P icon on the bottom right
hand corner of the browser window.
__ d. Try another ID in POSTER like 44, you should get a 404 not found as shown in the figure
below.
__ b. Review the method getProductsByCategory. This code is very similar to the previous
code, except that there is no @Path which means you use the class level /Product. Also,
there is a @QueryParam annotation. This will allow you to access the query parameters.
(Organize your imports)
__ c. Now, back in POSTER, test your resource. Select Headers and make it to receive json
output as below
__ h. Change categoryId=133 to category=133 as shown below and press GET. You should
get back a 400 Bad Request response.
__ 3. Now, you are going to create another resource for the Category resources.
__ a. Import CategoryResource.java from the file system following the same instructions as
before.
__ b. Examine the file, you should see similarities between this file and ProductResource.java.
__ c. Back in CustomerOrderServices EJB project, open the Category JPA Object as shown
below.
__ d. Use the Jackson Annotations like you did before. Look at the screenshot below. If you
get errors, try adding the following imports for packages:
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
__ e. Select File > Save All or strike Shift+Ctrl+S to save all the changes you made
__ f. Select WebSphere Application Server v8.0 in the Server view -> right click -> select
Publish to publish updates to the server
__ 4. We have been working with one Media Type, primarily JSON. One of the strengths of JAXRS is
the ability to produce multiple Media Types with Content Negotiation. In this part of the lab, you
will review how to expose the product list as an Atom feed as well.
__ b. Copy the images folder from /Labfiles80/jaxrs into the WebContent folder of your web
application. Do this by dragging and dropping from the file system to RAD.
__ e. Next go into POSTER and enter the URL as shown. Go into the Headers tab and enter
an Accept Header of application/atom+xml as shown in the figure below. Then issue a
GET
__ g. Next, switch the Accept Header to application/json and issue the request again as shown.
__ 1. Expand the WebSphere Application Server v8.0 Server as shown below. Right click the
CustomerOrderServicesApp and select Remove as shown in the figure below.
Congratulations!
You have reached the end of the exercise!
You should possess basic knowledge of the Java™ programming language. Familiarity with
IBM® Rational® Application Developer™ for WebSphere® Software or the Eclipse Platform is
an asset, but is not required.
To follow this exercise, you will require:
• This document.
• The Java files and other resources that accompany this exercise.
• IBM® Rational® Application Developer for WebSphere® Software 8.03, henceforth RAD,
including the features “Service Component Architecture Development Tools” and “OSGi
Development Tools”, installed on a supported operating system.
• IBM® WebSphere® Application Server Version 8.0 Test Environment 8.0 (henceforth
“WAS”) including features “ Service Component Architecture” (version 1.0.1) and “OSGi and
Java Persistence API 2.0”.
withdraw from and access bank accounts. It also provides operations to work with bank
account owners. It includes a front-end JSP Web application for working with bank accounts
and their owners.
3. The StockTrader SCA application provides operations to buy and sell stocks, and exposes
these operations via a SOAP Web service. The application keeps a log of stock transactions
retrievable over an Atom feed. The application relies on the services of
StockManagerApplication and BankingApplication to function.
This diagram depicts the overall design of the business application:
3.5 Conventions
The bold typeface is used for text you need to enter or controls or objects such as push buttons
and tree nodes that you need to interact with.
The italic typeface is used for dialog titles, control labels and other information displayed by the
tools.
A few “variables” are used in this exercise to represent host names, port numbers and other
configurable aspects of RAD and WAS. The values shown here match the configuration of the
VMware images accompanying the exercise. If you are following this exercise on your own
installation, you may need to substitute different values.
In this part of the exercise you started RAD and the WAS Test Environment, opened the Web
perspective, enabled RAD to use the external Firefox browser, and deployed the Java EE
“StockManagerApplication” enterprise application and the “StockManagerModule” EJB module
project it contains to the WAS Test Environment. The EJB within this application provides
operations to look up and get the share prices of stocks by their ticker symbols. These
operations will be used by the StockTrader SCA component later on in the exercise.
The com.ibm.example.banking.api bundle defines and exports three Java API interfaces and
classes that the other two bundles rely upon. It does not contain any business logic that
implements, extends or use the API.
Separating API and business logic into different bundles is a best practice. It allows the freedom
to define multiple implementations that extend or use the API without having to duplicate the API
interfaces and classes themselves.
g) Press Finish.
h) If the Technology Quickstarts view opens, close it.
e) Press Finish.
f) Press Properties... , enter 1.0.0 in the Version field and press OK.
g) Select File > Save or strike Ctrl-S to save the updated manifest.
In this part of the exercise you created an OSGI Java bundle project containing some reusable
API consisting of a business interface and two data beans. You used the bundle manifest editor
to export the package containing the API. The bundles you will create in the next new parts of
the exercise will depend on the API exported by this bundle.
g) Press Finish.
h) If the Technology Quickstarts view opens, close it.
f) Press Properties... , enter 1.1.0 in the Maximum Version field and press OK. This
follows the OSGi semantic versioning policy for API implementors (i.e. only imports
API definitions that are compatible for implementations).
g) Select File > Save or strike Ctrl-S to save the updated manifest.
d) In the tree view beneath the field, check the folder com.ibm.example.banking.impl.
e) Press Finish.
c) The editor is equipped with Design and Source tabs. Select the Design tab if it is not
already selected.
__5. Create the Blueprint Structure, the blueprint content have been provided to you to save time.
a) Select the Source tab.
c) Select all content from the given blueprint file then press CTRL+C
e) Select File > Save or strike Ctrl-S to save the blueprint.xml file.
f) Go to the Design Tab striking Design Tab Button
In this part of the exercise you created another OSGI Java bundle project containing the central
business logic of the BankingApplication. You used the bundle manifest editor to establish a
dependency from this bundle on the API package exported by the com.ibm.example.banking.api
bundle. You defined a Blueprint bean and service that will be used by the third and final bundle
in the next part of the exercise.
f) Press Properties... , enter 2.0.0 in the Maximum Version field and press OK. This
follows the OSGi semantic versioning policy for API clients (i.e. only imports API
definitions that are compatible for users of the API).
g) Select File > Save or strike Ctrl-S to save the updated manifest.
__3. Import the web.xml, Java servlet, JSP and CSS source files.
The web.xml, Java servlet, JSP and CSS files for the Web bundle have been provided to you to
save time typing in code.
a) In the Enterprise Explorer, right-click com.ibm.example.banking.web and select
Import > Import....
b) In the Import wizard, select General > File System and press Next >.
c) In the From directory field, enter
/Labfiles80/OSGi/resources/com.ibm.example.banking.web then strike the Tab key.
d) In the tree view beneath the field, check the folder com.ibm.example.banking.web.
e) Press Finish.
f) If a Question dialog appears asking to overwrite web.xml, press Yes To All.
b) Double-click BalanceServlet.java to open and review it in the Java editor. This is one of
six Java servlet classes that process HTTP POST messages from index.jsp. The class'
implementation of the inherited doPost method extracts parameters from the incoming
HTTP message that originated from fields of index.jsp, uses the
javax.naming.InitialContext API to look up AccountManager service which you created
in the com.ibm.example.banking.impl bundle's Blueprint XML configuration file, then
invokes appropriate business methods on the AccountManager service. Notice that the
code does not care which bundle provides the actual service implementation of the
AccountManager interface. The task of identifying and injecting the service is left to the
OSGi runtime.
c) Close the Java editor.
d) Optionally, you may open and review the other servlet classes, however, they all have
implementations similar to BalanceServlet.
e) In the Enterprise Explorer, collapse Java Resources, then expand WebContent and
confirm the presence of index.css, index.html and index.jsp. Also expand WEB-INF and
confirm the presence of web.xml.
In this part of the exercise you created the third and final OSGI bundle – in this case, a Web
bundle – containing the JSP Web front-end application for working with bank accounts and bank
account owners. As in the com.ibm.example.banking.impl bundle, you used the bundle manifest
editor to establish a dependency from this bundle on the API package exported by the
com.ibm.example.banking.api bundle.
g) Press Finish.
h) If the Technology Quickstarts view opens, close it.
e) Select File > Save or strike Ctrl-S to save the updated manifest.
In this part of the exercise you created an OSGi application containing the three OSGi bundles,
and exporting a service for use by the SCA assembly you will develop over the next few parts of
the exercise. As of this point you have completed development of the OSGi BankingApplication.
In the next few parts of the exercise you will turn your attention to the development of the
StockTrader SCA assembly.
c) Select Select Archive file check item and as target file enter
/Labfiles80/OSGi/resources/StockTrader.zip
d) In the Enterprise Explorer, expand project StockTrader > src to verify four packages'
worth of Java classes have been successfully imported into the project. You should find
a total of nine Java source files spread across four packages.
e) In the Enterprise Explorer, expand project StockTrader > SCA Content > Composites,
then select StockTrader to verify the SCA composite that have been imported with the
project. Inside SCA Composite we have 3 SCA Components.
f) The SCA Composite has been provided in order to save you time typing and configuring
code.
around them.
editor with four tabs down the left side, Core, Interface, Callback and Binding. The
Properties view provides forms for editing the detailed attributes of the various elements
of an SCA composite that would otherwise clutter the main editing canvas.
c) Select the Binding tab if it is not already selected.
In this part of the exercise you investigated the loggingRef and accountManagerRef references
on the StockTrader component to services on the LoggingService and AccountManager
components. You looked at an EJB binding on the stockManagerRef reference of the
StockTrader component to point to the EJB within the Java EE application
StockManagerApplication, You saw an Atom binding on the Collection service of the
LoggingService component. Last but not least, you took a look at a Web service binding on the
StockTrader service of the StockTrader component. Remember that wires are used for
communication between components deployed to the same SCA domain, while bindings are
used for communication between components and applications residing outside the SCA
domain.
e) In the Servers view, fully expand StockTrader. The OSGi BankingApplication appears
as a child of StockTrader, and the three OSGi bundles appear as children of
BankingApplication.
In this part of the exercise you deployed the SCA StockTrader contribution to WAS. During the
deployment process, the tools detected a component with an OSGi application implementation –
BankingApplication – and automatically deployed the OSGi application as well. If you wanted to
deploy the OSGi application on its own without the SCA StockTrader contribution, you would
instead right-click on the BankingApplication OSGi application project and select Run As > Run
On Server.
b) Open http://localhost:9080/com.ibm.example.banking.web/index.jsp
c) The International Bank of Bundles Web application should appear.
In this part of the exercise you used the OSGi Web application to create a new account owner
(or client) and a new bank account. You deposited funds into the bank account which will be
important if you are going to buy any stock in the next part of the exercise.
d) In the Navigator pane, select WSDL Main to display the Open WSDL form.
If you receive an exception, ignore this because the result should be the same.
h) In the Navigator pane, select buy.
i) In the Actions pane, in the Invoke a WSDL Operation form, under the Body section of
the form, you should see a buy twistie with three arguments beneath it – arg0, arg1 and
arg2. These arguments represent respectively the ticker symbol, number of shares to
buy, and the bank account number from which to withdraw the funds for the purchase.
p) Press Go.
q) In the Status pane, you should see a response body showing a buyResponse identifying
the stock grant that was purchased in terms of the number shares, share price and
ticker symbol.
r) In Firefox, select the Bundle Bank tab to re-display the International Bank of Bundles
OSGi Web application.
s) Near the bottom of the Web application, press Refresh.
t) In the Administer Accounts table, the balance of account number 1000 should be
updated to $8,351.60.
In this part of the exercise you In this part of the exercise you used the Web Services Explorer
to drive the StockTrader application via its Web service entry point. When you used the “buy”
operation to purchase stock, you exercised all three components of the SCA assembly, the
Blueprint service within the OSGi application, and the EJB in the Java EE StockManager
application.
c) The browser should display a feed with a single entry – a record of the stock purchase
you executed in the previous part of the exercise. The feed is being delivered via the
Atom binding on the Collection service of the LoggingService component.
d) Optionally, review the System.out.println(...) output in the Console view in RAD for a
glimpse into the sequencing and execution of the various Java classes that make of the
OSGi, SCA and Java EE applications.
e) Stop the server for the next lab.
In this part of the exercise you pointed Firefox at the Atom feed delivered by the Atom binding
on the Collection service of the LoggingService component, which the StockTrader component
invokes within the SCA composite to record stock transactions.
Congratulations!
You have reached the end of the exercise!
3.17 Conclusions
In this exercise, you used IBM Rational Application Developer for WebSphere Software with the
WebSphere Application Server Test Environment to create, run and test an application based
on the OSGi and SCA programming models.
You explored several of the wizards, editors and other features of RAD for developing OSGi and
SCA assemblies, such as the New OSGi Bundle Project wizard, the New OSGi Application
Project wizard, the OSGi bundle manifest editor, the OSGi application manifest editor, the new
SCA Project wizard, the new SCA Composite wizard, the SCA composite editor, the SCA
contribution editor, and the Validators and Server tools that simplify the deployment of OSGi
applications and SCA contributions to the WebSphere Application Server.
You learned about the basics of the OSGi programming model which supports a modular
approach to the design and deployment of Java application code. You learned how to create
bundles with different kinds of application content, and to specify the contract between bundles
using package import and export lists. You learned how to define a Blueprint bean and a
Blueprint service, and saw how in Java to look up and use a Blueprint service – the basis for
building loosely coupled, fine grained, container managed service components in the Java
language.
You learned about the basic of the SCA assembly model which supports the organization of
diverse IT assets into reusable service components capable of interacting with other IT assets
over a variety of communication protocols. You sampled a few of the implementation kinds
supported by SCA: The Java class and the OSGi application. RAD and WAS also support
Spring applications, Java EE enterprise applications and HTML documents as implementation
kinds. You sampled a few of the bindings supported by SCA: The EJB binding, Web service
binding and Atom binding. RAD and WAS also support JMS and HTTP bindings.
Below are some common tasks that you may need to perform several times during this lab
./startServer server1
./stopServer server1
startNode
stopNode
startManager
stopManager
__ a. As shown below navigate to VM -> Removable Devices -> CD-ROM (IDE1:0) ->
Edit
Appendix B. Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program, or
service that does not infringe any IBM intellectual property right may be used instead. However, it is the
user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can
send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES
CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some
states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this
statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part
of the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Any performance data contained herein was determined in a controlled environment. Therefore, the
results obtained in other operating environments may vary significantly. Some measurements may have
been made on development-level systems and there is no guarantee that these measurements will be
the same on generally available systems. Furthermore, some measurements may have been estimated
through extrapolation. Actual results may vary. Users of this document should verify the applicable data
for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
All statements regarding IBM's future direction and intent are subject to change or withdrawal without
notice, and represent goals and objectives only.
This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental. All references to fictitious companies or individuals are
used for illustration purposes only.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs
in any form without payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for
which the sample programs are written. These examples have not been thoroughly tested under all
conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs.
Page 130 Discovering the Value of WebSphere Cast Iron Cloud Integration
IBM Software
Adobe, Acrobat, Portable Document Format (PDF), and PostScript are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, other countries, or both.
Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other
countries, or both and is used under license therefrom.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United
States, other countries, or both. See Java Guidelines
Microsoft, Windows, Windows NT, and the Windows logo are registered trademarks of Microsoft
Corporation in the United States, other countries, or both.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel
SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
ITIL is a registered trademark and a registered community trademark of the Office of Government
Commerce, and is registered in the U.S. Patent and Trademark Office.
Other company, product and service names may be trademarks or service marks of others.