Jump to: navigation, search

Difference between revisions of "Lyo/TRSSDK"

< Lyo
Line 101: Line 101:
 
== Learning Objectives  ==
 
== Learning Objectives  ==
  
<span style="line-height: 1.5em;">By working through the material for the TRS Reference Application, you will learn how to perform the following tasks:</span>
+
<span style="line-height: 1.5em;">By working through the material for the TRS Reference Application, you will learn how to perform the following tasks:</span>  
  
 
*Use the TRS toolkit from the JLIP SDK to create a TRS provider, using JAX-RS  
 
*Use the TRS toolkit from the JLIP SDK to create a TRS provider, using JAX-RS  
 
*Configure and use the TRS compliance test suite to verify the validity of a TRS provider<br>
 
*Configure and use the TRS compliance test suite to verify the validity of a TRS provider<br>
  
 +
<br>
  
 
+
== <span style="line-height: 1.5em;">TRS Reference Application Prerequisites</span> ==
== <span style="line-height: 1.5em;">TRS Reference Application Prerequisites</span> ==
+
  
 
*The TRS Reference Application saves change requests to c:\temp\ChangeRequests.xml. Ensure that you have write access to this file.  
 
*The TRS Reference Application saves change requests to c:\temp\ChangeRequests.xml. Ensure that you have write access to this file.  
 
*Before following the steps in the following sections please make sure the TRS Toolkit from section 2.1 has been loaded into your workspace.
 
*Before following the steps in the following sections please make sure the TRS Toolkit from section 2.1 has been loaded into your workspace.
  
 +
<br>
  
 +
== Loading the TRS Reference Application  ==
  
== Loading the TRS Reference Application ==
+
=== Clone the Lyo Rio git repository  ===
  
=== Clone the Lyo Rio git repository ===
+
This example assumes EGit is being used.
  
This example assumes EGit is being used.
+
*Open the Git Repositories view in Eclipse and click the Clone Git Repository icon  
 
+
*Usegit://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.rio.git as the URI (browse it also on line). User/Password are not required.  
*Open the Git Repositories view in Eclipse and click the Clone Git Repository icon
+
*On the Branch Selection page, select the master branch  
*Usegit://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.rio.git as the URI (browse it also on line). User/Password are not required.
+
*On the Branch Selection page, select the master branch
+
 
*On the Local Destination page, specify a location or accept the default and click Finish
 
*On the Local Destination page, specify a location or accept the default and click Finish
  
The repository should now show up in your Git Repositories view.
+
The repository should now show up in your Git Repositories view.  
  
 +
<br>
  
 +
=== Import Eclipse projects from the git repository  ===
  
=== Import Eclipse projects from the git repository ===
+
*In the Git Repositories view, right click org.eclipse.lyo.rio and select Import Projects  
 
+
*Select the Import Existing Projects wizard and click Next  
*In the Git Repositories view, right click org.eclipse.lyo.rio and select Import Projects
+
*Select the Import Existing Projects wizard and click Next
+
 
*Import the org.eclipse.lyo.rio.trs project<br><br>
 
*Import the org.eclipse.lyo.rio.trs project<br><br>
  
== Building and Running the TRS Reference Application ==
+
== Building and Running the TRS Reference Application ==
  
*Expand the org.eclipse.lyo.rio.trs project
+
*Expand the org.eclipse.lyo.rio.trs project  
*Right click pom.xml -&gt; Run As -&gt; Maven clean
+
*Right click pom.xml -&gt; Run As -&gt; Maven clean  
 
*Right click pom.xml -&gt; Run As -&gt; Maven install
 
*Right click pom.xml -&gt; Run As -&gt; Maven install
  
Once the build completes,&nbsp;right-click Launch TRS Reference App.launch and click Run As -&gt; Launch TRS Reference App.
+
Once the build completes,&nbsp;right-click Launch TRS Reference App.launch and click Run As -&gt; Launch TRS Reference App.  
 +
 
 +
The reference application is launched within an embedded Jetty server and the message "TRS Reference Application launched at http://localhost:8082/org.eclipse.lyo.rio.trs/index.html" is displayed in the Console view. The link in the message opens a web page that describes the various links that are available in the reference application.
 +
 
 +
 
 +
 
 +
== TRS Reference Application Guided Tour ==
  
The reference application is launched within an embedded Jetty server and the message "TRS Reference Application launched at http://localhost:8082/org.eclipse.lyo.rio.trs/index.html" is displayed in the Console view. The link in the message opens a web page that describes the various links that are available in the reference application.
+
For a walkthrough of the TRS reference application and its capabilities please see the [[ http://wiki.eclipse.org/Lyo/TRSReferenceApplication|TRS Reference Application Guided Tour]].

Revision as of 13:45, 8 March 2013

The Tracked Resource Set (TRS) Software Development Kit (SDK) consists of two primary pieces; a toolkit and reference applications.


TRS SDK Prerequisites

  • Eclipse 3.6 or higher IDE
  • EGit team provider for git (recommended) or git command line package.
  • m2eclipse for Maven support in the Eclipse IDE
  • The Lyo projects requires a Java 1.6 compiler and Java 1.6 runtime. The Eclipse project settings have been set appropriately. If you are building outside of Eclipse, please use Java 1.6.


TRS Toolkit

The goal of the TRS toolkit is to provide a simple set of java beans that represent the entities within the TRS specification. Additionally, a convenient set of string constants that represent the TRS properties is provided.


Loading the TRS Toolkit

Clone the Lyo Core git repository

This example assumes EGit is being used.

  • Open the Git Repositories view in Eclipse and click the Clone Git Repository icon
  • Use git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.core.git as the URI (browse it also on line). User/Password are not required.
  • On the Branch Selection page, select the master branch
  • On the Local Destination page, specify a location or accept the default and click Finish

The repository should now show up in your Git Repositories view.


Import Eclipse projects from the git repository

  • In the Git Repositories view, right click org.eclipse.lyo.core and select Import Projects
  • Select the Import Existing Projects wizard and click Next
  • Import the following projects:

   OSLC4J

   OSLC4JJenaProvider

   OSLC4JJson4JProvider

   OSLC4JWink

   org.eclipse.lyo.core.utils

   org.eclipse.lyo.core.trs


You may import the other projects if you like, but they are not required for building the TRS Toolkit.

[Optional] Add the projects to a new working set.


Build all projects

  • Expand the OSLC4J project
  • Right click pom.xml -> Run As -> Maven clean
  • Right click pom.xml -> Run As -> Maven install
  • Repeat these steps for the following projects in the listed order:

    OSLC4JJenaProvider
    OSLC4JJson4JProvider
    OSLC4JWink
    org.eclipse.lyo.core.utils
    org.eclipse.lyo.core.trs


Exploring the TRS Toolkit

The goal of the TRS toolkit is to provide an inclusive library stack for adopting TRS. This framework will provide the ability for:

  • Generating the TRS services via JAX-RS using Apache Wink
  • (De)Serialization of the TRS Beans through OSLC4J

In addition to the framework provided by OSLC4J the TRS toolkit consists of a set of Java beans that may be used with or without the provided framework.


Beans

  • TrackedResourceSet
  • Base
  • AbstractChangeLog
  • ChangeLog
  • EmptyChangeLog
  • ChangeEvent
  • Creation
  • Modification
  • Deletion


TRS Reference Application

The reference application is written in Java and demonstrates the implementation of a TRS Provider using change requests as the resources that are being created, modified and deleted.  JAX-RS, an annotation based Java RESTful specification, and Apache Wink, a JAX-RS server side component, are used to define and serve up the TRS provider endpoints.

While this reference application depends on certain technlogoies, the core TRS concepts demonstrated within may be applied to other languages, frameworks, and resource domains.


Learning Objectives

By working through the material for the TRS Reference Application, you will learn how to perform the following tasks:

  • Use the TRS toolkit from the JLIP SDK to create a TRS provider, using JAX-RS
  • Configure and use the TRS compliance test suite to verify the validity of a TRS provider


TRS Reference Application Prerequisites

  • The TRS Reference Application saves change requests to c:\temp\ChangeRequests.xml. Ensure that you have write access to this file.
  • Before following the steps in the following sections please make sure the TRS Toolkit from section 2.1 has been loaded into your workspace.


Loading the TRS Reference Application

Clone the Lyo Rio git repository

This example assumes EGit is being used.

  • Open the Git Repositories view in Eclipse and click the Clone Git Repository icon
  • Usegit://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.rio.git as the URI (browse it also on line). User/Password are not required.
  • On the Branch Selection page, select the master branch
  • On the Local Destination page, specify a location or accept the default and click Finish

The repository should now show up in your Git Repositories view.


Import Eclipse projects from the git repository

  • In the Git Repositories view, right click org.eclipse.lyo.rio and select Import Projects
  • Select the Import Existing Projects wizard and click Next
  • Import the org.eclipse.lyo.rio.trs project

Building and Running the TRS Reference Application

  • Expand the org.eclipse.lyo.rio.trs project
  • Right click pom.xml -> Run As -> Maven clean
  • Right click pom.xml -> Run As -> Maven install

Once the build completes, right-click Launch TRS Reference App.launch and click Run As -> Launch TRS Reference App.

The reference application is launched within an embedded Jetty server and the message "TRS Reference Application launched at http://localhost:8082/org.eclipse.lyo.rio.trs/index.html" is displayed in the Console view. The link in the message opens a web page that describes the various links that are available in the reference application.


TRS Reference Application Guided Tour

For a walkthrough of the TRS reference application and its capabilities please see the TRS Reference Application Guided Tour.