diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-26 11:43:42 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-26 11:43:42 +0000 |
commit | 9cda7f1d4fd99777d7dea4ff707d178c16bc42b8 (patch) | |
tree | 512d8c106998a601e74ab6408020427a0729d0d3 /branches/sca-java-1.5/tutorials/store | |
parent | 3578386a355cb93f6533ad3f55d015a708e29ead (diff) |
TUSCANY-3062 don't resolve composites in the deployable composite collection. Remove unused contributions from domain. Upgrade the README to describe each store scenario and how to run it.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@778660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/tutorials/store')
4 files changed, 202 insertions, 33 deletions
diff --git a/branches/sca-java-1.5/tutorials/store/README b/branches/sca-java-1.5/tutorials/store/README index 26687177aa..036f43ebf2 100644 --- a/branches/sca-java-1.5/tutorials/store/README +++ b/branches/sca-java-1.5/tutorials/store/README @@ -1,34 +1,203 @@ Store Tutorial -====================================== +============== -This is a tutorial that shows how to use SCA and Tuscany to build multiple -variations of an online Store application. +This tutorial that shows how to use SCA and Tuscany to build multiple +variations of an online Store application. The variations demostrate the +evolution of the Store as it goes through the following stages: -For an overview of the scenarios covered here, please refer to Tutorial.pdf. - -For more detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html +1 - Initial online fruit store +2 - Fruit store merges with vegetable store to form the fruit and vegetable store +3 - The fruit and vegetable store move to using a database for storing the cart +4 - The fruit and vegetable store acts as a supplier to other online stores +5 - The fruit and vegetable store ships their software solution to another geography +For diagrams of the scenarios covered here, please refer to Tutorial.pdf Running The Tutorial Application -------------------------------- -Start the SCA Domain Manager: +Start the SCA Domain Manager on linux: + cd domain java -jar ../../../modules/tuscany-node-launcher-1.5.jar domain -To access the SCA Manager application, point your Web browser to: +Start the SCA Domain Manager on windows: + + cd domain + java -jar ..\..\..\modules\tuscany-node-launcher-1.5.jar domain + +Access the SCA Domain Manager application by pointing your Web browser at: + http://localhost:9990/ui/cloud/ -Select the node you want to start (e.g StoreNode), then click the Start button. -Note that the distribution does not include a prebuilt .war file for the catalog-webapp -so before you can start the store node you need to first build this by going the the -store/catalog-webapp folder and running +This shows you all of the Tuscany nodes that are configured to run +in the store tutorial domain. If you are interested, the configuration +is stored on disc in the store/domain directory but for now let's just +start some nodes and see what happens. + +The different nodes you see are used to start different scenarios in +the tutorial. Select the node you want to start (e.g StoreNode), then click the +Start button. You may need to give the nodes a little time to start up. Check the +console where you lauched the domain manager application and you will see the +following message when nodes have started. + +INFO: INFO: Press 'q' to quit, 'r' to restart. + +Remember to shut down the nodes before you exit the domain manager application. + +The following describes the nodes you have to start for each scenario and some +usful links to explore once the node has started. + +1 - Initial online fruit store +---------------------------- + +Start + + StoreNode + +The store itself can be found at + + http://localhost:8100/ui/ + +If you want to look at how Tuscany provides remote bindings you can take +a look at the service description that Tuscany created automatically +for the store catalog service which is exposed over a JSONRPC binding +Point your browser at: + + http://l3localhost:8100/StoreCatalog?smd + +The service is configured in the SCA composite file in the following way: + + <component name="StoreCatalog"> + <implementation.java class="services.FruitsCatalogImpl"/> + <property name="currencyCode">USD</property> + <service name="Catalog"> + <t:binding.jsonrpc/> + </service> + <reference name="currencyConverter" target="StoreCurrencyConverter"/> + </component> + +Note the inclusion of <t:binding.jsonrpc/>. This is all that is required to +make this service available over JSONRPC. If you want to expose the service +over web services simply add <binding.ws/> instead of (or as well as) <t:binding.jsonrpc/>. + +2 - Fruit store merges with vegetable store to form the fruit and vegetable store +--------------------------------------------------------------------------------- + +Start + + CatalogsNode + StoreMergerNode + +The store itself can be found at + + http://localhost:8101/ui/ + +Now you see that there are more items in the catalog as the fruit and +vegetable catalogs are both providing content. The vegetable catalog +that was introduced during the merger is contacted using web services. +If you want to see the WSDL for the vegetable catalog point your browser +at + +http://l3aw203:8200/VegetablesCatalogWebService?wsdl + +The vegetable catalog service is configured in an SCA composite file +in the following way: + + <component name="VegetablesCatalogWebService"> + <implementation.java class="services.VegetablesCatalogImpl"/> + <service name="Catalog"> + <binding.ws/> + </service> + </component> + +3 - The fruit and vegetable store move to using a database to storing the cart +------------------------------------------------------------------------------ + +Start + + StoreDBNode + +The store itself can be found at + + http://l3aw203:8102/ui/ + +This looks the same as the scenario 2 store but this time a database is used +for storing items put into the shopping cart. When you add items you +will see messages on the console indicating that items are added to the +database. For example. + +INFO: insert into Cart values ('cart-8c8bcc43-5036-4e9a-b282-0dd3d00d350c', 'Apple', '$2.99') + +This scenario shows how you change the implementation of a service without +changing any of the configuration of the rest of the application + +4 - The fruit and vegetable store acts as a supplier to other online stores +--------------------------------------------------------------------------- + +Start + + StoreSupplierNode + +The store itself can be found at + + http://localhost:8103/ui/ + +Again this is the same basic store as in scenario 3. However this time the +shopping cart and catalog serivces have been given additional remote bindings so that +the services can be accessed by others. For example, take a look at the WSDL +description of the shopping cart service that is now available at: + + http://l3aw203:8333/ShoppinCartTotalWebService?wsdl + +This WSDL is available as the shopping cart total service is now configured with a web services +binding in the following way: + + <component name="StoreSupplierShoppingCart"> + <implementation.java class="services.db.ShoppingCartTableImpl"/> + <property name="database">../store-supplier/target/cart-db</property> + <service name="Cart"> + <t:binding.atom uri="/ShoppingCart/Cart"/> + </service> + <service name="Total"> + <t:binding.jsonrpc/> + <binding.ws uri="/ShoppinCartTotalWebService"/> + </service> + </component> + +If you want to actually exercise these services from a standalone application +you can run up the StoreClientNode using the provided launcher + +store/store-client/launch/LaunchStoreClientNode + + +5 - The fruit and vegetable store ships their software solution to another geography +------------------------------------------------------------------------------------ + +Start + + CurrencyNode + StoreEUNode + +The store itself can be found at + + http://localhost:8104/ui/ + +Notice now that the prices are quoted in Euros and the language is French. This was +achieved by editing the store.html file to change the language and presentation to +be appropriate for Europe. The curreny was changed by reconfiguring the catalog +component to use EUR instead of USD. + + <component name="StoreEUCatalog"> + <implementation.java class="services.merger.MergedCatalogImpl"/> + <property name="currencyCode">EUR</property> + ... + </component> + + - ant compile +For more detailed information about how to get started with Apache Tuscany +see our online guides at: -You should now be able to access the online Store application. Point your Web -browser to: - http://localhost:8100/ui/ +http://tuscany.apache.org/sca-java-getting-started-guides-1x.html diff --git a/branches/sca-java-1.5/tutorials/store/domain/cloud.composite b/branches/sca-java-1.5/tutorials/store/domain/cloud.composite index 8f879c5261..c01653adb7 100644 --- a/branches/sca-java-1.5/tutorials/store/domain/cloud.composite +++ b/branches/sca-java-1.5/tutorials/store/domain/cloud.composite @@ -28,9 +28,9 @@ <include name="ns2:StoreDBNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> <include name="ns2:StoreSupplierNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> <include name="ns2:StoreEUNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> - <include name="ns2:StoreMashupNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> - <include name="ns2:StoreMarketNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> - <include name="ns2:CatalogWebAppNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> - <include name="ns2:CatalogMediationNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> - <include name="ns2:CatalogEJBNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/> + <!--include name="ns2:StoreMashupNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/--> + <!--include name="ns2:StoreMarketNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/--> + <!--include name="ns2:CatalogWebAppNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/--> + <!--include name="ns2:CatalogMediationNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/--> + <!--include name="ns2:CatalogEJBNode" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://tuscany.apache.org/cloud"/--> </composite> diff --git a/branches/sca-java-1.5/tutorials/store/domain/domain.composite b/branches/sca-java-1.5/tutorials/store/domain/domain.composite index 8d47697df8..aa56546ab7 100644 --- a/branches/sca-java-1.5/tutorials/store/domain/domain.composite +++ b/branches/sca-java-1.5/tutorials/store/domain/domain.composite @@ -25,12 +25,12 @@ <include name="ns2:store-client" uri="store-client" xmlns:ns2="http://store"/> <include name="ns2:store-db" uri="store-db" xmlns:ns2="http://store"/> <include name="ns2:store-supplier" uri="store-supplier" xmlns:ns2="http://store"/> - <include name="ns2:store-market" uri="store-market" xmlns:ns2="http://store"/> + <!--include name="ns2:store-market" uri="store-market" xmlns:ns2="http://store"/--> <include name="ns2:store-eu" uri="store-eu" xmlns:ns2="http://store"/> - <include name="ns2:store-mashup" uri="store-mashup" xmlns:ns2="http://store"/> + <!-- include name="ns2:store-mashup" uri="store-mashup" xmlns:ns2="http://store"/--> <include name="ns2:catalogs" uri="web-services" xmlns:ns2="http://services"/> <include name="ns2:currency" uri="web-services" xmlns:ns2="http://services"/> - <include name="ns2:catalog-web" uri="catalog-webapp" xmlns:ns2="http://catalog"/> - <include name="ns2:catalog-mediation" uri="catalog-mediation" xmlns:ns2="http://catalog"/> - <include name="ns2:catalog-ejb" uri="catalog-ejb" xmlns:ns2="http://catalog"/> + <!--include name="ns2:catalog-web" uri="catalog-webapp" xmlns:ns2="http://catalog"/--> + <!--include name="ns2:catalog-mediation" uri="catalog-mediation" xmlns:ns2="http://catalog"/--> + <!--include name="ns2:catalog-ejb" uri="catalog-ejb" xmlns:ns2="http://catalog"/--> </composite> diff --git a/branches/sca-java-1.5/tutorials/store/domain/workspace.xml b/branches/sca-java-1.5/tutorials/store/domain/workspace.xml index 9cdbe04ac7..b982255012 100644 --- a/branches/sca-java-1.5/tutorials/store/domain/workspace.xml +++ b/branches/sca-java-1.5/tutorials/store/domain/workspace.xml @@ -24,12 +24,12 @@ <contribution location="file:../store-client/target/tutorial-store-client.jar" uri="store-client"/> <contribution location="file:../store-db/target/tutorial-store-db.jar" uri="store-db"/> <contribution location="file:../store-supplier/target/tutorial-store-supplier.jar" uri="store-supplier"/> - <contribution location="file:../store-market/target/tutorial-store-market.jar" uri="store-market"/> + <!-- contribution location="file:../store-market/target/tutorial-store-market.jar" uri="store-market"/--> <contribution location="file:../store-eu/target/tutorial-store-eu.jar" uri="store-eu"/> - <contribution location="file:../store-mashup" uri="store-mashup"/> + <!-- contribution location="file:../store-mashup" uri="store-mashup"/--> <contribution location="file:../web-services/target/tutorial-web-services.jar" uri="web-services"/> - <contribution location="file:../catalog-webapp/target/tutorial-catalog-webapp.war" uri="catalog-webapp"/> - <contribution location="file:../catalog-mediation/target/tutorial-catalog-mediation.jar" uri="catalog-mediation"/> - <contribution location="file:../catalog-ejb/target/tutorial-catalog-ejb.jar" uri="catalog-ejb"/> + <!-- contribution location="file:../catalog-webapp/target/tutorial-catalog-webapp.war" uri="catalog-webapp"/--> + <!-- contribution location="file:../catalog-mediation/target/tutorial-catalog-mediation.jar" uri="catalog-mediation"/--> + <!-- contribution location="file:../catalog-ejb/target/tutorial-catalog-ejb.jar" uri="catalog-ejb"/--> <contribution location="file:../domain/cloud" uri="http://tuscany.apache.org/cloud"/> </workspace> |