| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you 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. |
| --> |
| <cheatsheet title="Create a Hello World composite application"> |
| <intro> |
| <description>This cheat sheet shows you how to create a simple hello world composite application using Sigil.</description> |
| </intro> |
| |
| <item title="Create an empty Newton project" href="/org.cauldron.sigil.help/html/tasks/new_project.html" dialog="true" skip="true"> |
| <description> |
| First, you must create a new "org.example.helloworld" empty Newton project to house the java classes and SCA composites. |
| </description> |
| |
| <subitem label="Select "File >New >Project...". Expand "Sigil", select "Newton Project" and click "Next"." skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.OpenEmptyNewtonProjectWizardAction" |
| param1="org.example.helloworld" |
| translate="" /> |
| </subitem> |
| |
| <subitem label="Enter "org.example.helloworld" as the "Project name", then click "Finish"." skip="false" /> |
| </item> |
| |
| <item title="Create The Java Interfaces and Classes" skip="true"> |
| <description> |
| Create a new "org.example.helloworld.api" package and add a HelloWorld interface to this package. |
| Then create a new "org.example.helloworld.impl" package and add a HelloWorldImpl class which implements HelloWorld to the impl package. |
| Finally create a new "org.example.helloworld.cli" package and add a HelloWorldCli class which references the HelloWorld api to the cli package. |
| </description> |
| |
| <subitem label="Create the HelloWorld API" skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin" |
| param1="org.example.helloworld" |
| param2="src/org/example/helloworld/api" |
| param3="org.cauldron.sigil.help" |
| param4="archive/java/HelloWorld.java" |
| param5="org.eclipse.jdt.ui.CompilationUnitEditor" |
| translate="" /> |
| </subitem> |
| <subitem label="Create the HelloWorld Impl" skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin" |
| param1="org.example.helloworld" |
| param2="src/org/example/helloworld/impl" |
| param3="org.cauldron.sigil.help" |
| param4="archive/java/HelloWorldImpl.java" |
| param5="org.eclipse.jdt.ui.CompilationUnitEditor" |
| translate="" /> |
| </subitem> |
| <subitem label="Create the HelloWorld CLI" skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin" |
| param1="org.example.helloworld" |
| param2="src/org/example/helloworld/cli" |
| param3="org.cauldron.sigil.help" |
| param4="archive/java/HelloWorldCli.java" |
| param5="org.eclipse.jdt.ui.CompilationUnitEditor" |
| translate="" /> |
| </subitem> |
| </item> |
| <item |
| title="Add OSGi Package Imports To The HelloWorld Project"> |
| <description> |
| 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. |
| </description> |
| <subitem |
| label="Open the "org.example.helloworld" project editor by double-clicking on the "sigil.properties" file in the project directory." |
| skip="false"> |
| </subitem> |
| <subitem |
| label="Select the "Overview" tab."> |
| </subitem> |
| <subitem |
| label="Click on the "Resolve missing dependencies" link in the "Tools" section."> |
| </subitem> |
| <subitem |
| label="Wait for the background task to complete. When the "Review New Imports" dialog appears, click "OK"."> |
| </subitem> |
| </item> |
| |
| |
| <item title="Create The SCA Composites That Describe The Java Resources" skip="true"> |
| <description> |
| Create a new HelloWorld service composite that exports the HelloWorldImpl class using the HelloWorld interface. |
| Then create a new HelloWorld cli composite that imports the HelloWorld interface and exports a ConsoleCommandHandler |
| service to allow user interaction via the command handler. |
| </description> |
| |
| <subitem label="Create the HelloWorld Service" skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin" |
| param1="org.example.helloworld" |
| param2="sca" |
| param3="org.cauldron.sigil.help" |
| param4="archive/sca/org.example.helloworld.service.composite" |
| param5="org.cauldron.sigil.editors.SCACompositeEditor" |
| translate="" /> |
| </subitem> |
| <subitem label="Create the HelloWorld Command Line" skip="true"> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.CopyResourceFromPlugin" |
| param1="org.example.helloworld" |
| param2="sca" |
| param3="org.cauldron.sigil.help" |
| param4="archive/sca/org.example.helloworld.cli.composite" |
| param5="org.cauldron.sigil.editors.SCACompositeEditor" |
| translate="" /> |
| </subitem> |
| </item> |
| |
| <item |
| title="Add The SCA Composites To The HelloWorld Bundle"> |
| <description> |
| 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. |
| </description> |
| <subitem |
| label="Open the "org.example.helloworld" project editor by double-clicking on the "sigil.properties" file in the project directory."> |
| </subitem> |
| <subitem |
| label="Select the "Exports" tab."> |
| </subitem> |
| <subitem |
| label="Click on the "Add" button in the Composites section."> |
| </subitem> |
| <subitem |
| label="Add the "org.example.helloworld.service" and "org.example.helloworld.cli" composites to the OSGi bundle."> |
| </subitem> |
| <subitem |
| label="Save the "org.example.helloworld" project editor."> |
| </subitem> |
| </item> |
| |
| <item |
| title="Launch A Newton Container"> |
| <description> |
| Launch a Newton enabled JVM in which to host the SCA composites you have just created. |
| </description> |
| <subitem |
| label="Make sure that the the "org.example.helloworld" project editor is open."> |
| </subitem> |
| <subitem |
| label="Select the "Overview" tab."> |
| </subitem> |
| <subitem |
| label="Click on the "Launch a newton container" link in the "Testing" section."> |
| </subitem> |
| <subitem |
| label="Wait for the newton container to finish launching. This is signified by the console message: "Boot complete""> |
| </subitem> |
| </item> |
| |
| <item |
| title="Install The HelloWorld Composites In The Newton Container"> |
| <description> |
| 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. |
| </description> |
| <subitem |
| label="Open the "org.example.helloworld.service.composite" document using the Sigil "SCA Composite Editor"."> |
| </subitem> |
| <subitem |
| label="Click on the "Install Composite" short-cut menu item in the navigation bar."> |
| </subitem> |
| <subitem |
| label="Select the "org.example.helloworld" instance and click ok"> |
| </subitem> |
| <subitem |
| label="Open the "org.example.helloworld.cli.composite" document using the Sigil "SCA Composite Editor"."> |
| </subitem> |
| <subitem |
| label="Again, click on the "Install Composite" short-cut menu item in the navigation bar and install into the "org.example.helloworld" Newton instance."> |
| </subitem> |
| </item> |
| |
| <item title="Type "sayhello" on the Newton console" skip="false"> |
| <description> |
| |
| </description> |
| <subitem |
| label="Select the Newton console."> |
| <action |
| pluginId="org.cauldron.sigil.help" |
| class="org.cauldron.sigil.cheatsheets.actions.ShowViewAction" |
| param1="org.eclipse.ui.console.ConsoleView" |
| translate="" /> |
| |
| </subitem> |
| <subitem |
| label="Type "sayhello". You should see the response:<br/>Hello World"> |
| </subitem> |
| </item> |
| |
| <onCompletion>Congratulations you have created your first composite application using Sigil.</onCompletion> |
| |
| |
| </cheatsheet> |