blob: 94ce68d89e46545283c13f5b519ae33c4e9c707d [file] [log] [blame]
Richard S. Hall85bafab2009-07-13 13:25:46 +00001<?xml version="1.0" encoding="UTF-8" ?>
2<!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19-->
20<cheatsheet title="Create a Hello World composite application">
21 <intro>
22 <description>This cheat sheet shows you how to create a simple hello world composite application using Sigil.</description>
23 </intro>
24
25 <item title="Create an empty Newton project" href="/org.cauldron.sigil.help/html/tasks/new_project.html" dialog="true" skip="true">
26 <description>
27 First, you must create a new &quot;org.example.helloworld&quot; empty Newton project to house the java classes and SCA composites.
28 </description>
29
30 <subitem label="Select &quot;File &gt;New &gt;Project...&quot;. Expand &quot;Sigil&quot;, select &quot;Newton Project&quot; and click &quot;Next&quot;." skip="true">
31 <action
32 pluginId="org.cauldron.sigil.help"
33 class="org.cauldron.sigil.cheatsheets.actions.OpenEmptyNewtonProjectWizardAction"
34 param1="org.example.helloworld"
35 translate="" />
36 </subitem>
37
38 <subitem label="Enter &quot;org.example.helloworld&quot; as the &quot;Project name&quot;, then click &quot;Finish&quot;." skip="false" />
39 </item>
40
41 <item title="Create The Java Interfaces and Classes" skip="true">
42 <description>
43 Create a new &quot;org.example.helloworld.api&quot; package and add a HelloWorld interface to this package.
44 Then create a new &quot;org.example.helloworld.impl&quot; package and add a HelloWorldImpl class which implements HelloWorld to the impl package.
45 Finally create a new &quot;org.example.helloworld.cli&quot; package and add a HelloWorldCli class which references the HelloWorld api to the cli package.
46 </description>
47
48 <subitem label="Create the HelloWorld API" skip="true">
49 <action
50 pluginId="org.cauldron.sigil.help"
51 class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin"
52 param1="org.example.helloworld"
53 param2="src/org/example/helloworld/api"
54 param3="org.cauldron.sigil.help"
55 param4="archive/java/HelloWorld.java"
56 param5="org.eclipse.jdt.ui.CompilationUnitEditor"
57 translate="" />
58 </subitem>
59 <subitem label="Create the HelloWorld Impl" skip="true">
60 <action
61 pluginId="org.cauldron.sigil.help"
62 class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin"
63 param1="org.example.helloworld"
64 param2="src/org/example/helloworld/impl"
65 param3="org.cauldron.sigil.help"
66 param4="archive/java/HelloWorldImpl.java"
67 param5="org.eclipse.jdt.ui.CompilationUnitEditor"
68 translate="" />
69 </subitem>
70 <subitem label="Create the HelloWorld CLI" skip="true">
71 <action
72 pluginId="org.cauldron.sigil.help"
73 class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin"
74 param1="org.example.helloworld"
75 param2="src/org/example/helloworld/cli"
76 param3="org.cauldron.sigil.help"
77 param4="archive/java/HelloWorldCli.java"
78 param5="org.eclipse.jdt.ui.CompilationUnitEditor"
79 translate="" />
80 </subitem>
81 </item>
82 <item
83 title="Add OSGi Package Imports To The HelloWorld Project">
84 <description>
85 The HelloWorldCli class references classes which are exported from other OSGi bundles. In order to satisfy the OSGi classloading rules the HelloWorld project must import the required packages.
86 </description>
87 <subitem
88 label="Open the &quot;org.example.helloworld&quot; project editor by double-clicking on the &quot;sigil.properties&quot; file in the project directory."
89 skip="false">
90 </subitem>
91 <subitem
92 label="Select the &quot;Overview&quot; tab.">
93 </subitem>
94 <subitem
95 label="Click on the &quot;Resolve missing dependencies&quot; link in the &quot;Tools&quot; section.">
96 </subitem>
97 <subitem
98 label="Wait for the background task to complete. When the &quot;Review New Imports&quot; dialog appears, click &quot;OK&quot;.">
99 </subitem>
100 </item>
101
102
103 <item title="Create The SCA Composites That Describe The Java Resources" skip="true">
104 <description>
105 Create a new HelloWorld service composite that exports the HelloWorldImpl class using the HelloWorld interface.
106 Then create a new HelloWorld cli composite that imports the HelloWorld interface and exports a ConsoleCommandHandler
107 service to allow user interaction via the command handler.
108 </description>
109
110 <subitem label="Create the HelloWorld Service" skip="true">
111 <action
112 pluginId="org.cauldron.sigil.help"
113 class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin"
114 param1="org.example.helloworld"
115 param2="sca"
116 param3="org.cauldron.sigil.help"
117 param4="archive/sca/org.example.helloworld.service.composite"
118 param5="org.cauldron.sigil.editors.SCACompositeEditor"
119 translate="" />
120 </subitem>
121 <subitem label="Create the HelloWorld Command Line" skip="true">
122 <action
123 pluginId="org.cauldron.sigil.help"
124 class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin"
125 param1="org.example.helloworld"
126 param2="sca"
127 param3="org.cauldron.sigil.help"
128 param4="archive/sca/org.example.helloworld.cli.composite"
129 param5="org.cauldron.sigil.editors.SCACompositeEditor"
130 translate="" />
131 </subitem>
132 </item>
133
134 <item
135 title="Add The SCA Composites To The HelloWorld Bundle">
136 <description>
137 In order to load a composite in a Newton container it needs to be associated with an OSGi bundle that will act as the classpath for that bundle.
138 </description>
139 <subitem
140 label="Open the &quot;org.example.helloworld&quot; project editor by double-clicking on the &quot;sigil.properties&quot; file in the project directory.">
141 </subitem>
142 <subitem
143 label="Select the &quot;Exports&quot; tab.">
144 </subitem>
145 <subitem
146 label="Click on the &quot;Add&quot; button in the Composites section.">
147 </subitem>
148 <subitem
149 label="Add the &quot;org.example.helloworld.service&quot; and &quot;org.example.helloworld.cli&quot; composites to the OSGi bundle.">
150 </subitem>
151 <subitem
152 label="Save the &quot;org.example.helloworld&quot; project editor.">
153 </subitem>
154 </item>
155
156 <item
157 title="Launch A Newton Container">
158 <description>
159 Launch a Newton enabled JVM in which to host the SCA composites you have just created.
160 </description>
161 <subitem
162 label="Make sure that the the &quot;org.example.helloworld&quot; project editor is open.">
163 </subitem>
164 <subitem
165 label="Select the &quot;Overview&quot; tab.">
166 </subitem>
167 <subitem
168 label="Click on the &quot;Launch a newton container&quot; link in the &quot;Testing&quot; section.">
169 </subitem>
170 <subitem
171 label="Wait for the newton container to finish launching. This is signified by the console message: &quot;Boot complete&quot;">
172 </subitem>
173 </item>
174
175 <item
176 title="Install The HelloWorld Composites In The Newton Container">
177 <description>
178 We will now install the two composites in the Newton container we just launched using the short-cut menu items in the eclipse navigation bar.
179 </description>
180 <subitem
181 label="Open the &quot;org.example.helloworld.service.composite&quot; document using the Sigil &quot;SCA Composite Editor&quot;.">
182 </subitem>
183 <subitem
184 label="Click on the &quot;Install Composite&quot; short-cut menu item in the navigation bar.">
185 </subitem>
186 <subitem
187 label="Select the &quot;org.example.helloworld&quot; instance and click ok">
188 </subitem>
189 <subitem
190 label="Open the &quot;org.example.helloworld.cli.composite&quot; document using the Sigil &quot;SCA Composite Editor&quot;.">
191 </subitem>
192 <subitem
193 label="Again, click on the &quot;Install Composite&quot; short-cut menu item in the navigation bar and install into the &quot;org.example.helloworld&quot; Newton instance.">
194 </subitem>
195 </item>
196
197 <item title="Type &quot;sayhello&quot; on the Newton console" skip="false">
198 <description>
199
200 </description>
201 <subitem
202 label="Select the Newton console.">
203 <action
204 pluginId="org.cauldron.sigil.help"
205 class="org.cauldron.sigil.cheatsheets.actions.ShowViewAction"
206 param1="org.eclipse.ui.console.ConsoleView"
207 translate="" />
208
209 </subitem>
210 <subitem
211 label="Type &quot;sayhello&quot;. You should see the response:&lt;br/&gt;Hello World">
212 </subitem>
213 </item>
214
215 <onCompletion>Congratulations you have created your first composite application using Sigil.</onCompletion>
216
217
218</cheatsheet>