blob: 271bab1e68249c6afa89c8b234dfdba064116044 [file] [log] [blame]
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="ContributingWebServiceRTWithUI_files/filelist.xml">
<link rel=Edit-Time-Data
href="ContributingWebServiceRTWithUI_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Contributing a Web service runtime with UI in WTP</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>chng1me</o:Author>
<o:LastAuthor>chng1me</o:LastAuthor>
<o:Revision>4</o:Revision>
<o:TotalTime>380</o:TotalTime>
<o:Created>2006-12-05T14:50:00Z</o:Created>
<o:LastSaved>2006-12-05T16:39:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>1568</o:Words>
<o:Characters>8941</o:Characters>
<o:Company>IBM</o:Company>
<o:Lines>74</o:Lines>
<o:Paragraphs>20</o:Paragraphs>
<o:CharactersWithSpaces>10489</o:CharactersWithSpaces>
<o:Version>10.6735</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>BestFit</w:Zoom>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
font-family:Arial;
mso-font-kerning:16.0pt;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
@page Section1
{size:8.5in 11.0in;
margin:.5in 63.0pt 45.0pt 1.0in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="3074"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<h1>Contributing a Web service runtime with UI in WTP</h1>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Overview:</b><span
style='mso-spacerun:yes'>  </span></p>
<p class=MsoNormal style='tab-stops:58.5pt'>The WTP 1.0 Web services wizards
are configurable so that new Web services runtimes can be plugged into their
framework.<span style='mso-spacerun:yes'>  </span>Most runtimes are themselves
configurable with many options that can be selected by a user.<span
style='mso-spacerun:yes'>  </span>This document describes how new Web services
runtimes plugging into this runtime framework can also contribute UI pages.<span
style='mso-spacerun:yes'>  </span>Refer to the <a
href="ContributingWebServiceRT.html">Contributing a Web service runtime</a>
document for more detail description of the Web service creation framework and how
to contribute a Web service runtime.<span style='mso-spacerun:yes'> 
</span>This document will focus more on how a Web service runtime can contribute
UI pages.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>Introduction:</b> </p>
<p class=MsoNormal>In order to demonstrate how UI pages can be added to the Web
services framework an example plug-in was created.<span
style='mso-spacerun:yes'>  </span>This document will describe how this example
plug-in code contributes UI to the framework.<span style='mso-spacerun:yes'>  
</span>Here is a link to the <a href="ExampleRuntime.zip">sample plug-in</a>.<span
style='mso-spacerun:yes'>  </span>Before getting into a detailed discussion of
this sample code, let’s have a look at how this sample code affects the Web
services wizard.<span style='mso-spacerun:yes'>   </span>In the bottom up Java
bean scenario the user usually selects a Java bean and then brings up the Web
services wizard as seen below.<span style='mso-spacerun:yes'>  </span></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:420.75pt;
height:466.5pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image001.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=561 height=622
src="ContributingWebServiceRTWithUI_files/image002.jpg" v:shapes="_x0000_i1025"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>In the screen shot above the runtime is set to Apache
Axis.<span style='mso-spacerun:yes'>  </span>The sample plug-in code, however,
has added a new Web services runtime called, “Web services example
runtime”.<span style='mso-spacerun:yes'>  </span>We will select this runtime to
show the example UI pages that have been added.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75"
style='width:299.25pt;height:300pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image003.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=399 height=400
src="ContributingWebServiceRTWithUI_files/image004.jpg" v:shapes="_x0000_i1026"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>When the user clicks next in the Web services wizard the
page below is displayed.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75"
style='width:337.5pt;height:280.5pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image005.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=450 height=374
src="ContributingWebServiceRTWithUI_files/image006.jpg" v:shapes="_x0000_i1027"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>This page was contributed by the sample code.<span
style='mso-spacerun:yes'>  </span>The sample code contributed thee main items
for this page, the title shaded in green, a description shaded in yellow, and a
SWT composite shaded in blue.<span style='mso-spacerun:yes'>  </span>Web
services runtime extenders can contribute any kind of composite that is
required to gather the necessary options from the user.<span
style='mso-spacerun:yes'>  </span>Any number of pages can be used to collect
information from the user.<span style='mso-spacerun:yes'>  </span>In the screen
shot above an example is shown of how an optional page can be added.<span
style='mso-spacerun:yes'>  </span>If the user selects the “Do you want to see
the next page?” check box and then clicks on the next button an optional second
page will be displayed.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1028" type="#_x0000_t75"
style='width:318.75pt;height:255pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image007.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=425 height=340
src="ContributingWebServiceRTWithUI_files/image008.jpg" v:shapes="_x0000_i1028"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>A contributed composite can indicate if it is valid or not. <span
style='mso-spacerun:yes'> </span>If it indicates that it is not valid the
wizard framework will grey out the next and finish buttons so that the user can
not proceed forward in the wizard until the page is made valid again.<span
style='mso-spacerun:yes'>  </span>In this example selecting the check box will
cause the page to become invalid.<span style='mso-spacerun:yes'>   </span>The
validation code can include a message to indicate why the page is invalid.<span
style='mso-spacerun:yes'>  </span>The screen shot below shows what is displayed
if the check box is selected.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1029" type="#_x0000_t75"
style='width:318.75pt;height:254.25pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image009.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=425 height=339
src="ContributingWebServiceRTWithUI_files/image010.jpg" v:shapes="_x0000_i1029"><![endif]></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><span style='mso-tab-count:1'>                    </span></p>
<p class=MsoNormal style='tab-stops:58.5pt'>The sample also contains code to
show how UI pages can be added for the skeleton scenario.<span
style='mso-spacerun:yes'>  </span>In this example the first skeleton page looks
like this:</p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><!--[if gte vml 1]><v:shape id="_x0000_i1030"
type="#_x0000_t75" style='width:322.5pt;height:267pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image011.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=430 height=356
src="ContributingWebServiceRTWithUI_files/image012.jpg" v:shapes="_x0000_i1030"><![endif]></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'>This scenario shows a slightly more
complex flow of pages.<span style='mso-spacerun:yes'>  </span>In this case the
first skeleton wizard page can be followed by either just page 2, or just page
3, or both page 2 and page 3.</p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><b style='mso-bidi-font-weight:
normal'>Detailed code discussion:<o:p></o:p></b></p>
<p class=MsoNormal style='tab-stops:58.5pt'><b style='mso-bidi-font-weight:
normal'><o:p>&nbsp;</o:p></b></p>
<p class=MsoNormal style='tab-stops:58.5pt'>Now that you have seen how this
example runtime is rendered in the Web services wizard, let’s have a look at
the code that made this happen.<span style='mso-spacerun:yes'>  </span>First we
will take a look at the plug-in extensions using the Example Runtime as an
example:</p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><!--[if gte vml 1]><v:shape id="_x0000_i1031"
type="#_x0000_t75" style='width:393.75pt;height:82.5pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image013.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=525 height=110
src="ContributingWebServiceRTWithUI_files/image014.jpg" v:shapes="_x0000_i1031"><![endif]></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'>The extension above defines the new
Web services runtime and its label.</p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><!--[if gte vml 1]><v:shape id="_x0000_i1032"
type="#_x0000_t75" style='width:477pt;height:172.5pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image015.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=636 height=230
src="ContributingWebServiceRTWithUI_files/image016.jpg" v:shapes="_x0000_i1032"><![endif]></p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'>The extension above establishes
that this runtime uses a Java implementation, that both top down and bottom up
scenarios are supported, and that the runtime class<span
style='mso-spacerun:yes'>  </span>is: </p>
<p class=MsoNormal style='tab-stops:58.5pt'><o:p>&nbsp;</o:p></p>
<p class=MsoNormal style='tab-stops:58.5pt'><span style='font-size:10.0pt;
font-family:"Courier New";color:green'>org.eclipse.example.webservice.runtime.ui.ExampleRuntime<o:p></o:p></span></p>
<p class=MsoNormal style='tab-stops:58.5pt'><span style='font-size:10.0pt;
font-family:"Courier New";color:green'><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal>This class is used to get the IWebService class and the
IWebServiceClient classes for this new runtime.<span style='mso-spacerun:yes'> 
</span>In this example null is returned for the client, since we are focusing
on the Web services creation scenarios in this example.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1033" type="#_x0000_t75"
style='width:450.75pt;height:168pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image017.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=601 height=224
src="ContributingWebServiceRTWithUI_files/image018.jpg" v:shapes="_x0000_i1033"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>The ExampleWebservice class shows how an extender can inject
a sequence of commands at different points in the Web services wizard flow(
i.e. develop, assembly, deploy, install, and run )<span
style='mso-spacerun:yes'>  </span>For this example commands are only added into
the develop method.<span style='mso-spacerun:yes'>   </span>This develop method
is shown below.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1034" type="#_x0000_t75"
style='width:513pt;height:312.75pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image019.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=684 height=417
src="ContributingWebServiceRTWithUI_files/image020.jpg" v:shapes="_x0000_i1034"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>In the code above a DataModel object is created to store the
state data that is needed between commands and between commands and UI
objects.<span style='mso-spacerun:yes'>  </span>This class is only used by the
extender so it can be anything that the extender wants it to be.<span
style='mso-spacerun:yes'>  </span>After the DataModel is declared two sets of
commands are created, one for the bottom up scenario and one for the top down
scenario.<span style='mso-spacerun:yes'>   </span>In this example the model is
passed into all of the commands, but it doesn’t need to be if the command does
not need the model.<span style='mso-spacerun:yes'>  </span>The key commands for
the UI code above are <span style='font-size:10.0pt;font-family:"Courier New";
color:black'>Page1ComesUpBeforeThisBUCommand </span>and<span style='font-size:
10.0pt;font-family:"Courier New";color:black'>
Page1ComesUpBeforeThisTDCommand.<span style='mso-spacerun:yes'>  </span></span>As
we will see later, plug-in extensions will be added that will associate UI
objects with these commands.<span style='mso-spacerun:yes'>  </span>The<span
style='font-size:10.0pt;font-family:"Courier New";color:black'>
ExampleDefaultingCommand </span>command is also used by the UI objects.<span
style='mso-spacerun:yes'>  </span>This command is used to pass the DataModel
object to UI objects.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>Now that you have seen how to add commands into the Web
services wizard flow, let’s look at how the UI objects are added.<span
style='mso-spacerun:yes'>  </span>In the example code the extensions for adding
the UI objects into the Web services framework is the following:</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1035" type="#_x0000_t75"
style='width:531pt;height:150pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image021.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=708 height=200
src="ContributingWebServiceRTWithUI_files/image022.jpg" v:shapes="_x0000_i1035"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>These extensions define the UI page objects that will be
added to the Web services wizard flow.<span style='mso-spacerun:yes'> 
</span>In these extensions an association is made between a command class and a
WidgetContributorFactory class.<span style='mso-spacerun:yes'>   </span>When
the Web services framework attempts to execute a command it first checks to see
if there is a WidgetContributorFactory associated with it.<span
style='mso-spacerun:yes'>  </span>If one is associated the UI objects
contributed by this WidgetContributorFactory are displayed before this command
is executed.<span style='mso-spacerun:yes'>  </span>For example a command may
have several parameters to be gathered before it is executed.<span
style='mso-spacerun:yes'>  </span>One or more UI pages can be displayed to
gather these parameters from the user before the command is executed.<span
style='mso-spacerun:yes'>  </span>Note: extenders can not rely on the UI pages
that they contribute to always being displayed, since the user could click the
finish button on the first page of the wizard.<span style='mso-spacerun:yes'> 
</span>This means that extenders need to have default values for all parameters
that they expose via the UI.<span style='mso-spacerun:yes'>  </span></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>Let’s have a closer look at the WidgetContributorFactory for
the bottom up scenario in this example.<span style='mso-spacerun:yes'> 
</span>The <span style='font-size:10.0pt;font-family:"Courier New";color:black'>BeanConfigWidgetFactory
</span>class contains two methods called getFirstNamedWidget and
getNextNamedWidget.<span style='mso-spacerun:yes'>  </span>These two methods
determine the order your UI page objects will be displayed.<span
style='mso-spacerun:yes'>  </span>The getFirstNamedWidget method returns the
first UI page and the getNextNamedWidget object returns subsequent pages.<span
style='mso-spacerun:yes'>  </span>These methods are called dynamically by the
framework which allows them to return different results depending on its model
data.<span style='mso-spacerun:yes'>  </span>This is how UI pages can be
optionally added as was shown above.<span style='mso-spacerun:yes'>  </span>If
either of these methods returns null it indicates that no UI page is available.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1036" type="#_x0000_t75"
style='width:531pt;height:168.75pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image023.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=708 height=225
src="ContributingWebServiceRTWithUI_files/image024.jpg" v:shapes="_x0000_i1036"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>Now let’s look at how the DataModel object gets passed into
the <span style='font-size:10.0pt;font-family:"Courier New";color:black'>BeanConfigWidgetFactory
</span>class.<span style='mso-spacerun:yes'>  </span>This is accomplished via
two methods, the registerDataMappings method and the SetWebServiceDataModel
method.<span style='mso-spacerun:yes'>  </span>The first method is part of the
WidgetContributorFactory interface.<span style='mso-spacerun:yes'>  </span>This
method specifies property mappings between objects in the Web services
framework.<span style='mso-spacerun:yes'>  </span>In this case we want the
framework to associate the WebServiceDataModel property with the
ExampleDefaultingCommand and the BeanConfigWidgetFactory object.<span
style='mso-spacerun:yes'>  </span>When the framework first loads the
BeanConfigWidgetFactory class it will see that there is an association with the
ExampleDefaultingCommand.<span style='mso-spacerun:yes'>  </span>It will then
use Java introspection to call the getWebServiceDataModel method on the
ExampleDefaultingCommand object to retrieve the DataModel object.<span
style='mso-spacerun:yes'>  </span>It will then pass this DataModel object to
the BeanConfigWidgetFactory object by calling the setWebServiceDataModel
method.<span style='mso-spacerun:yes'>  </span>Extenders can chose any property
name that they want as long as they ensure that the getter and setter method
names match the property name and that the type of the property object passed
between the getter and setter is the same.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1037" type="#_x0000_t75"
style='width:477pt;height:182.25pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image025.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=636 height=243
src="ContributingWebServiceRTWithUI_files/image026.jpg" v:shapes="_x0000_i1037"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>Now let’s have a look at the init method in the <span
style='font-size:10.0pt;font-family:"Courier New";color:black'>BeanConfigWidgetFactory
</span>class.<span style='mso-spacerun:yes'>  </span>This method creates two
SimpleWidgetContributor objects, one for each page in the bean configuration
scenario.<span style='mso-spacerun:yes'>  </span>Each WidgetContributor
specifies a title, a description, and a Widget object for the page.<span
style='mso-spacerun:yes'>  </span>Have a look at the screen shots above to see
where this title and description text is displayed on the page.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1038" type="#_x0000_t75"
style='width:531pt;height:171pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image027.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=708 height=228
src="ContributingWebServiceRTWithUI_files/image028.jpg" v:shapes="_x0000_i1038"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>The last item that we will talk about is the class that
contributes the main composite for each page.<span style='mso-spacerun:yes'> 
</span></p>
<p class=MsoNormal>The addControls method is where all the code for the
creation of the page’s controls should go.<span style='mso-spacerun:yes'> 
</span>The parent parameter should be used as the composite parent for the
controls that your code creates.<span style='mso-spacerun:yes'>  </span>The
statusListener parameter is used to control when validation should be performed
on this page.<span style='mso-spacerun:yes'>  </span>This listener object
should be associated with any UI controls that could affect the validity of the
page.<span style='mso-spacerun:yes'>  </span>If your page is always valid this
statusListener parameter can be ignored.</p>
<p class=MsoNormal>Note:<span style='mso-spacerun:yes'>  </span>if a control
affects whether subsequent pages appear after this page the statusListener must
be associated with this control so that changes in the controls state will
result in the handleEvent method being called.<span style='mso-spacerun:yes'> 
</span>Alternatively, the handleEvent method on the statusListener object can
be called directly with a parameter of null to force the page to be validated.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>As discussed above the statusListener object is used to
determine <b style='mso-bidi-font-weight:normal'>when </b>validation should
occur.<span style='mso-spacerun:yes'>  </span>The getStatus method is used to
determine <b style='mso-bidi-font-weight:normal'>if </b>the page is valid or
not.<span style='mso-spacerun:yes'>  </span>If the getStatus method returns
null or a status with a severity of OK, WARNING, or INFO it indicates that the
page is valid.<span style='mso-spacerun:yes'>   </span>If the status severity
is WARNING or INFO the message text specified in the status object will be
displayed in the description area of the page.<span style='mso-spacerun:yes'> 
</span>If the page is valid the next button will be enabled if there is a subsequent
page in the wizard.<span style='mso-spacerun:yes'>  </span>The finish button
will also be enabled.<span style='mso-spacerun:yes'>  </span>If the status
severity is ERROR this indicates that the page is not valid.<span
style='mso-spacerun:yes'>  </span>The message text from the status object will
be displayed in the description area of the page.<span
style='mso-spacerun:yes'>  </span>In addition the next button and finish button
will be disabled until the page is made valid again.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1039" type="#_x0000_t75"
style='width:477pt;height:199.5pt'>
<v:imagedata src="ContributingWebServiceRTWithUI_files/image029.png" o:title=""/>
</v:shape><![endif]--><![if !vml]><img border=0 width=636 height=266
src="ContributingWebServiceRTWithUI_files/image030.jpg" v:shapes="_x0000_i1039"><![endif]></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
<p class=MsoNormal>Have a look at the BeanConfigWidget and the
OptionalBeanConfigWidget classes for concrete implementations of this
SimpleWidgetDataContributor class.</p>
<p class=MsoNormal><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>