Jump to: navigation, search

Difference between revisions of "Lyo/BuildOSLC4JBugzilla"

< Lyo
(Build the projects)
(Build the projects)
 
(5 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
*[http://eclipse.org/egit/download/ EGit] team provider for git (recommended) or [http://git-scm.com/download git command line package]. We use Git for source control.
 
*[http://eclipse.org/egit/download/ EGit] team provider for git (recommended) or [http://git-scm.com/download git command line package]. We use Git for source control.
 
*[http://www.eclipse.org/m2e/download/ m2eclipse] for Maven support in the Eclipse IDE. We use Maven for dependency management and builds.
 
*[http://www.eclipse.org/m2e/download/ m2eclipse] for Maven support in the Eclipse IDE. We use Maven for dependency management and builds.
*[[Lyo/LyoOSLC4J|OSLC4J]] - You can download the source [[ Lyo/BuildingOSLC4J | here ]] or download a zip of the library and dependencies [http://eclipse.org/lyo/download.php here].
+
*[[Lyo/LyoOSLC4J|OSLC4J]] - This dependency will automatically be downloaded from the Eclipse Maven repository.
*The Lyo OAuth libraries - currently must be built from source (see below)
+
*The Lyo OAuth libraries - This dependency will automatically be downloaded from the Eclipse Maven repository.
  
== Clone the Lyo Docs and Server Git repositories ==
+
== Clone the Lyo Docs Git repository ==
  
 
The code resides in the Lyo docs repository since it is part of the [[ Lyo/OSLCWorkshop | Lyo OSLC Workshop.]]
 
The code resides in the Lyo docs repository since it is part of the [[ Lyo/OSLCWorkshop | Lyo OSLC Workshop.]]
Line 24: Line 24:
 
*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
  
*Repeat the above instructions for the Lyo Server repository.  Use <tt>git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.server.git</tt> as the URI.
+
The repository should now show up in your Git Repositories view.
 
+
The repositories should now show up in your Git Repositories view.
+
  
 
== Import Eclipse projects from the Git repositories  ==
 
== Import Eclipse projects from the Git repositories  ==
Line 32: Line 30:
 
*In the Git Repositories view, right click org.eclipse.lyo.docs and select Import Projects  
 
*In the Git Repositories view, right click org.eclipse.lyo.docs and select Import Projects  
 
*Select the Import Existing Projects wizard and click Next  
 
*Select the Import Existing Projects wizard and click Next  
*Import the following projects:
+
*Import org.eclipse.lyo.oslc4j.bugzilla
**org.eclipse.lyo.oslc4j.bugzilla
+
 
+
*In the Git Repositories view, right click org.eclipse.lyo.server and select Import Projects
+
*Select the Import Existing Projects wizard and click Next
+
*Import the following projects:
+
**org.eclipse.lyo.server.oauth.consumerstore
+
**org.eclipse.lyo.server.oauth.core
+
**org.eclipse.lyo.server.oauth.webapp
+
 
+
*[Optional] Add the projects to a new working set.
+
  
 
== Edit the Bugzilla configuration  ==
 
== Edit the Bugzilla configuration  ==
Line 55: Line 43:
  
 
*In the Eclipse Package Explorer view, select all the projects you've imported, right click, and select Maven-&gt;Update Project Configuration. Click OK.  
 
*In the Eclipse Package Explorer view, select all the projects you've imported, right click, and select Maven-&gt;Update Project Configuration. Click OK.  
*You'll need to run Maven Install on several projects. To run Maven Install,
+
*Run Maven Install on org.eclipse.lyo.oslc4j.bugzilla:
 
**Expand the project  
 
**Expand the project  
 
**Right click pom.xml and select Run As-&gt;Maven install
 
**Right click pom.xml and select Run As-&gt;Maven install
*Run Maven Install on each project in this order,
 
** org.eclipse.lyo.server.oauth.core
 
** org.eclipse.lyo.server.oauth.consumerstore
 
** org.eclipse.lyo.server.oauth.webapp
 
** org.eclipse.lyo.oslc4j.bugzilla
 
  
 
== Run the Bugzilla sample web application  ==
 
== Run the Bugzilla sample web application  ==

Latest revision as of 14:15, 7 January 2014

This application is an example of what Eclipse Lyo can be used for, in the form of an OSLC-CM compatible adapter for the Bugzilla bugtracker application. It wraps Bugzilla (interacting with it through Bugzilla's native XMLRPC API) with an OSLC-CM provider server accessible through REST calls.

This application uses the OSLC4J SDK to build up the adapter from Plain Old Java Objects and relatively simple JAX-RS web services.

Building and Running the Lyo Bugzilla Sample in Eclipse

Prerequisites

  • Eclipse 3.6 or higher IDE
  • EGit team provider for git (recommended) or git command line package. We use Git for source control.
  • m2eclipse for Maven support in the Eclipse IDE. We use Maven for dependency management and builds.
  • OSLC4J - This dependency will automatically be downloaded from the Eclipse Maven repository.
  • The Lyo OAuth libraries - This dependency will automatically be downloaded from the Eclipse Maven repository.

Clone the Lyo Docs Git repository

The code resides in the Lyo docs repository since it is part of the Lyo OSLC Workshop.

This example assumes EGit is being used to download the code.

  • Open the Git Repositories view in Eclipse and click the Clone Git Repository icon
  • Use git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.docs.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 repositories

  • In the Git Repositories view, right click org.eclipse.lyo.docs and select Import Projects
  • Select the Import Existing Projects wizard and click Next
  • Import org.eclipse.lyo.oslc4j.bugzilla

Edit the Bugzilla configuration

The sample requires Bugzilla 4.0. By default, it uses the Bugzilla Landfill test server, but you can specify your own. If you use Landfill, you will need to [ https://landfill.bugzilla.org/bugzilla-4.2-branch/createaccount.cgi create a userID ] for yourself .

  • Edit org.eclipse.lyo.oslc4j.bugzilla/src/main/resources/bugz.properties.
    • Change the bugzilla_uri property to the URL of your Bugzilla server.
    • Change the admin property to your Bugzilla user ID. This ID has authority to manage OAuth consumers.

Build the projects

  • In the Eclipse Package Explorer view, select all the projects you've imported, right click, and select Maven->Update Project Configuration. Click OK.
  • Run Maven Install on org.eclipse.lyo.oslc4j.bugzilla:
    • Expand the project
    • Right click pom.xml and select Run As->Maven install

Run the Bugzilla sample web application

  • Select Run->Run Configurations and double click Maven Build
  • Select the OSLC4JBugzilla launch and click Run

OSLC4JBugzillaLaunch.png

You should now be able to point a local web browser at http://localhost:8080/OSLC4JBugzilla/services/catalog/singleton to see the OSLC Catalog and explore the service providers. OAuth users can be managed at the following URL: http://localhost:8080/OSLC4JBugzilla/services/oauth/admin. Provide your Bugzilla userid/password as configured in bugz.properties when prompted.