summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/readme.htm
blob: b4c4a8cbadd8e1500c8dc40131a96fe2f61bd1d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!--
  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
<html><head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <meta http-equiv="Content-Style-Type" content="text/css">
    <title>Tuscany Customers</title><!-- LINK rel="stylesheet" href="ait.css" type="text/css" --></head>

<body>

<h2>Tuscany Customer Sample</h2>

<h3>Overview</h3>

<p>This sample employs the Tuscany runtime in collaboration with the RDB DAS to demonstrate a simple read of a customer 
record from a relational database in the context of a web application.  The user provides a customer 
ID and the application responds with the corresponding customer record </p>


<h3>Setup</h3>Run the Maven 'acceptance' task as described in the <a href="../readme.htm#Tomcat_Setup" target="_blank">Tomcat
    Setup</a>. &nbsp;Running this task will configure and start a Tomcat server and deploy the sample application along with a 
canned Derby database for use by the example.  Instructions will be posted soon for manually deploying the 
sample to an existing Tomcat install.<br>


<ol>

</ol>

<h3>Running</h3>

As mentioned above, running the Maven acceptance task deploys and runs the sample as part of the Tuscany acceptance testing.  After the task has completed
you can manually run the sample by pointing a browser to:  <a href="http://localhost:8080/tuscany-samples-customerWEB/">http://localhost:8080/tuscany-samples-customerWEB/</a>.
A page is displayed that prompts the user for a customer id. Submit an integer from 1 to 3.

<h3>Results</h3>

<p>Submitting an integer from 1 to 3 will result in the display of the corresponding employee record<br>

<h3>Code Overview</h3>

The following illustrates the structure of the sample application components:

<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">

    <tbody>

        <tr>

            <td>main<br>

                +---java<br>

                &brvbar;&nbsp;&nbsp; &brvbar;&nbsp;&nbsp;
                sca.module<br>

                &brvbar;&nbsp;&nbsp; &brvbar;<br>

                &brvbar;&nbsp;&nbsp; +---org<br>

                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                +---apache<br>

                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                +---tuscany<br>

                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                +---samples<br>

                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                +---customers<br>
                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                CustomerClient.java<br>
                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                CustomerServiceComponent.java<br>
                &brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                CustomerServiceComponentImpl.java<br>

                &brvbar;<br>

                +---webapp<br>

                &nbsp;&nbsp;&nbsp; &brvbar;&nbsp;&nbsp;
                Customer.jsp<br>

                &nbsp;&nbsp;&nbsp; &brvbar;<br>

                &nbsp;&nbsp;&nbsp; +---customerdb<br>

                &nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;
                <!--service.properties<br> -->

		    
		    &nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;&nbsp;&nbsp;<br>
		    			
		    <!--&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;<br> -->
		    &nbsp;&nbsp;&nbsp;&nbsp;&brvbar;<br>	

		    &nbsp;&nbsp;&nbsp; +---WEB-INF<br>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp; web.xml


                <br><br><br>

            </td>

        </tr>

    </tbody>
</table>


<br>

<table style="text-align: left; width: 879px; height: 154px;" border="2" cellpadding="4" cellspacing="4">

    <tbody>

        <tr>

            <td >sca.module</td>

            <td>  Defines the SCA module and component. Defines for the CustomerServiceComponent.</td>

        </tr>

	<tr>

            <td >CustomerClient.java</td>

            <td>	Wraps the get customer service to provide a clean "getCustomer()" API.</td>

        </tr>

	<tr>

            <td >CustomerServiceComponent.java</td>

            <td> 	Defines the interface of the service.</td>

        </tr>

	<tr>

            <td >Customer.jsp</td>

            <td>  Handles Web form input. Instantiates a CustomerClient instance and calls getCustomer()</td>

        </tr>

	<tr>

            <td >customerdb</td>

            <td>	The canned Derby database with Customer records </td>

        </tr>

	<tr>

            <td >web.xml </td>

            <td>Standard J2EE web application web.xml</td>

        </tr>


    
    </tbody>
</table>



</body></html>