Installing i7 Build
From Eclipsepedia
| |
Contents |
Download Build
Download the following zip files:
Installation
Unzip the packages
- Install Tomcat 5.5.23.
- Unzip the first three zip files (COSMOS UI, Domain and Broker) into webapps directory of Tomcat. Note: Doing so I got a "Enter Password" for file "Activator.class" in the first file. Any idea why? And how to avoid or fix this ? / mmo 10:57, 13 December 2007 (EST)
- Unzip SML MDR zip file into any directory.
- Unzip Example MDR zip file into any directory.
- Unzip the command line client zip file into any directory.
Configurations
Management Domain
- Open <tomcat_install_dir>\webapps\domain\WEB-INF\classes\muse.xml in an editor.
- Set path to the management domain registry XML file. This file contains information about brokers registered at the management domain.
- The management domain registry XML file will be created automatically if it is not already present.
<capability>
<capability-uri>http://www.eclipse.org/domainRegistry</capability-uri>
<java-capability-class>org.eclipse.cosmos.dc.management.domain.ManagementDomain</java-capability-class>
<init-param>
<param-name>registryLocation</param-name>
<param-value>c:/ManagementDomainRegistry.xml</param-value>
</init-param>
</capability>
Broker
- Open <tomcat_install_dir>\webapps\broker\WEB-INF\classes\muse.xml in an editor.
- Set path to the broker registry XML file and URI of the management domain. The Broker registry file contains information about data managers registered at the broker. The URI of the management domain is for contacting the management domain, where the broker will register itself.
- The broker registry XML file will be created automatically if it is not already present.
<capability>
<capability-uri>http://www.eclipse.org/cosmos/broker</capability-uri>
<java-capability-class>org.eclipse.cosmos.dc.data.broker.Broker</java-capability-class>
<init-param>
<param-name>RegistryLocation</param-name>
<param-value>c:/BrokerRegistry.xml</param-value>
</init-param>
<init-param>
<param-name>ManagementDomainURI</param-name>
<param-value>http://localhost:8080/domain/services/managementDomain</param-value>
</init-param>
</capability>
SML MDR
- Open SMLMDR\configuration\config.ini in an editor. Set port number in the following line (usually default value works fine):
org.osgi.service.http.port=8081
- Open SMLMDR\plugins\org.eclipse.cosmos.rm.sml.mdr_1.0.0\META-INF\config.properties, set values in the file. For most usages, the only setting that will need to change is SMLCONFIGFILE.
- URI of SML MDR
- resource ID of SML MDR
- display name of SML MDR
- Classification of SML MDR
- DIALECT of SML MDR
- Location of SML repository configuration file (SMLCONFIGFILE). This file is in SMLMDR/smlRepositoryConfig/configuration7.properties
- URI of management domain
- Edit SMLMDR/smlRepositoryConfig/configuration7.properties to update the root directory of SML repository. This directory is in SMLMDR/smlRepository.
Example MDR
- Open ExampleMdr\configuration\config.ini in an editor. Set port number in the following line:
org.osgi.service.http.port=8082
For testing purposes, you can usually leave this as-is.
- Open ExampleMdr\plugins\org.eclipse.cosmos.
rm.example.mdr_1.0.0\META-INF\config.properties, set values in the file.
Note 1: For testing purposes, you can usually leave this file as-is.
Note 2: I think the package name is wrong: I only have a directory without the rm part / mmo 10:54, 13 December 2007 (EST)
- URI of Example MDR
- resource ID of Example MDR
- display name of Example MDR
- Classification of Example MDR
- DIALECT of Example MDR
- URI of management domain
COSMOS UI
- Update <tomcat_install_dir>\webapps\COSMOSUI\WEB-INF\web.xml to set URI of the domain:
<context-param> <param-name>MANAGEMENT_DOMAIN_EPR</param-name> <param-value>http://localhost:8080/domain/services/managementDomain</param-value> </context-param>
- Edit the catalina.properties under <tomcat_install_dir>/conf to point to the database. Add the following line:
derby.system.home=<tomcat_install_dir>/webapps/database
- Download and unzip the dojo toolkit 0.9.0 in a temporary directory
- Copy the directories under dojo-release-0.9.0 into <tomcat_install_dir>/webapps/COSMOSUI/dojo
Note: only the Firefox 2.0 browser can be used to view the UI. Internet Explorer currently does not work
Running End-to-end Testcase
Starting the components
- Start Tomcat by running <tomcat_install_dir>/bin/startup.bat
- Start SML MDR by executing startup.bat at the root of the SMLMDR directory
- Start Example MDR by executing startup.bat at the root of the ExampleMdr directory
Register Broker and Data Managers
- The command line client is a simple Java application for connecting to the endpoints within COSMOS, and execute operations required in the end-to-end test case. The link to download the command line client is in the "Download" section above.
- The code of this application in CVS (org.eclipse.cosmos/examples/org.eclipse.cosmos.example.end2endTestClient) and can be run within eclipse as well. This build is provided for convenience.
- At a CMD prompt, enter the End2EndClient directory, and run "client.bat". This is a batch file that starts a Java application.
- After you have run client.bat, you will see the COSMOS prompt.
- Follow the following steps to register the broker and data managers with the management domain and the broker respectively.
- Assumption: we are running a brand new install, with no brokers or data managers already registered with the system. You can remove any existing registry XML files before running the following steps.
- At the COSMOS prompt, first type the component you want to connect (domain, broker, smlmdr, examplemdr), followed by the action (e.g. start, query, etc.) The list of actions is printed if you provided the component name with no action. Type "exit" to terminate the application.
- Note: The term "data manager" and "MDR" are used interchangeably in this document.
Register Broker with Management Domain
COSMOS> domain
Commands:
domain getDefaultBroker
domain getBrokers
exit
COSMOS> domain getDefaultBroker
Management Domain EPR (terminate by an empty line):
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://____:8080/domain/services/managementDomain</wsa:Address>
</wsa:EndpointReference>
EPR of default broker:
No brokers are registered.
- You need to provide the EPR of the management domain in order to connect to it. You can copy the EPR from above, and replace ____ with the hostname of the server hosting the management domain.
- Since we don't have any brokers registered with the broker yet, you will see the "No brokers are registered." message.
- Now, lets register the broker with the management domain:
COSMOS> broker
Commands:
broker start
broker getDataManagers [classification]
exit
COSMOS> broker start
Broker EPR (terminate by an empty line):
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8080/broker/services/broker</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">DataBroker</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Broker has been registered with the management domain.
- You need to provide the EPR of the broker to connect to it. You can copy the EPR from above, and replace ____ with the hostname of the server hosting the broker.
- Now that the broker is registered, we ask the management domain for the default broker again and we should expect to get the EPR of the broker.
COSMOS> domain getDefaultBroker
EPR of default broker:
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8080/broker/services/broker</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">DataBroker</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Register Data Managers with the Broker
- Before we register any data managers, we ask the broker for the list of data managers registered.
COSMOS> broker getDataManagers No data managers are registered.
- As expected, you get the "No data managers are registered." message.
- There are two data managers provided by the build. One is the data manager (MDR) for a SML Repository and another is a data manager (MDR) for a data store with information about teachers, students and classes. Both data managers support CMDBf query.
- When you started the data managers, the EPR of the data manager is printed on the console. You will need these values when connecting them.
COSMOS> smlmdr start
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8081/cosmos/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
MDR has started and registered with broker.
COSMOS> examplemdr start
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8082/cosmos/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
MDR has started and registered with broker.
- Now that the MDRs are registered with the broker, you can get the EPRs from the broker.
COSMOS> broker getDataManagers
EPR of data mangers:
Data Manager 1:
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8081/cosmos/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Data Manager 2:
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8082/cosmos/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Executing CMDBf Queries
Using command line client
- Some sample queries for the SML MDR are included in the End2EndClient.zip, in the "CBDMfQuery" directory.
- Invoke a query by typing "smlmdr query" followed by the path to the query file. All query files for the SML repository start with "test" in the file name.
COSMOS> smlmdr query D:\End2EndClient\cmdbfQuery\testInstanceIdQuery.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://____:8081/cosmos/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Query response:
<?xml version="1.0" encoding="UTF-8"?><dyn:queryResponseType xmlns:dyn="http://www.eclipse.org/cosmos/mdrquery">
<dyn:queryResponseType xmlns="http://schemas.cmdbf.org/0-9-5/datamodel">
<nodes templateId="cableTemplate">
........ Content omitted .........
</nodes>
</dyn:queryResponseType>
</dyn:queryResponseType>
- You can invoke queries on the Example MDR in a similar way. There are only 3 queries for the example MDR. They are all-students.txt, all-teachers.txt and teaches-relationship.txt.
Note: Those three query-files are missing from the cmdbfQuery directory. I found these files in the eclipse project "org.eclipse.cosmos.samples.cmdbf.services" (in the src folder) in CVS. / mmo 09:05, 14 December 2007 (EST)
COSMOS> examplemdr query D:\End2EndClient\cmdbfQuery\all-students.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://_____:8082/cosmos/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Query response:
<?xml version="1.0" encoding="UTF-8"?><dyn:queryResponseType xmlns:dyn="http://w
ww.eclipse.org/cosmos/mdrquery">
<dyn:queryResponseType xmlns="http://schemas.cmdbf.org/0-9-5/datamodel">
<nodes templateId="items">
........ Content omitted .........
</nodes>
</dyn:queryResponseType>
</dyn:queryResponseType>
Using COSMOS Web UI
- From a Firefox web browser, browse to http://____:8080/COSMOSUI/?view=cosmos. Replace ____ with your hostname.
- You should see 4 top level nodes in the navaigation tree on the left.
- Right click on SML_REPO_ID node, and select "Create Query..."
- In the dialog build, paste in the content of one of the queries for the SML repostory, and click "Submit".
- You should then see the query response in the "Details" view, in the form of a navigation tree. The tree represents the structure of the response XML file.
- Similarly, you can query the Example MDR.
Here is an example query for the Example MDR
<s:query xmlns:s="http://schemas.cmdbf.org/0-9-5/datamodel"> <s:itemTemplate id="items"> <s:recordTypeSelector namespace="" localName="student"/> </s:itemTemplate> </s:query>
--Marty 04:00, 22 November 2007 (EST)
Displaying reports with COSMOS Web UI
- Expand the "Statistical Data" node, and right click on "Tomcat Application Server" node. Select "Statistical Report".
- You should see a statistical data report generated in the "Details" view.
- Expand the "Monitoring Data" node, and right click on the "Windows XP Application Log" node. Select "Top 10 Log Report".
- You should see a log report generated in the "Details" view.
Setting Up Development Environment
- Extract code from CVS using this project set file.
- You will see errors in org.eclipse.cosmos.management.wsdm plugin. Apply this patch to remove the errors.
- You will see errors in domain and broker projects, but they not really errors.


