Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Lyo/BuildTRS4JBugzilla"

< Lyo
m
(Build the projects)
 
(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''* DRAFT IN PROGRESS *'''
 
 
 
This application is an example of Tracked Resource Set(TRS) provider for the Bugzilla application. It is built on top of [[Lyo/BuildOSLC4JBugzilla|OSLC-CM compatible adapter]] which implements OSLC Change Management provider, so it is recommended to take a look at [[Lyo/BuildOSLC4JBugzilla|OSLC-CM compatible adapter]] as well.  
 
This application is an example of Tracked Resource Set(TRS) provider for the Bugzilla application. It is built on top of [[Lyo/BuildOSLC4JBugzilla|OSLC-CM compatible adapter]] which implements OSLC Change Management provider, so it is recommended to take a look at [[Lyo/BuildOSLC4JBugzilla|OSLC-CM compatible adapter]] as well.  
  
Line 8: Line 6:
  
 
== Prerequisites  ==
 
== Prerequisites  ==
 
+
*The following [[Lyo/BuildOSLC4JBugzilla#Prerequisites|prerequisites of OSLC-CM compatible adapter]] if you have not done yet.
In addition to the prerequisites of [[Lyo/BuildOSLC4JBugzilla#Prerequisites|OSLC-CM compatible adapter]], it requires the following SDK.  
+
**[http://eclipse.org/downloads Eclipse 3.6 or higher IDE]
 
+
**[http://eclipse.org/egit/download/ EGit] team provider for git (recommended) or [http://git-scm.com/download git command line package].
*The [[Lyo/TRSSDK|TRS]] SDK libraries - currently must be built from source (see below)
+
**[http://www.eclipse.org/m2e/download/ m2eclipse] for Maven support in the Eclipse IDE
 +
*The [[Lyo/TRSSDK|TRS]] SDK libraries - currently must be built from source (see below)
 +
*Oracle Java SE 6.0 JDK (Update 37 or later) or IBM JDK 6.0 (Service Refresh 11 or later) ( Note. Java 7.x doesn't work with this workshop. )
  
 
== Clone the Lyo Docs, Core and Server Git repositories  ==
 
== Clone the Lyo Docs, Core and Server Git repositories  ==
  
The code resides in the Lyo docs repository since it is part of the [[Lyo/TRSWorkshop|TRS Workshop]] and is built on top of [[Lyo/BuildOSLC4JBugzilla|OSLC-CM compatible adapter]], the same Git repositories are necessary. In addition to them, the following Git repository will be used to download the source of [[Lyo/TRSSDK|TRS]] SDK libraries.  
+
* Open the Git Repositories view in Eclipse and click the Clone Git Repository icon
 
+
* Use the following URIs for the location. User/Password are not required.  
*<tt>git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.core.git</tt>
+
** git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.core.git
 +
** git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.server.git
 +
** git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.docs.git
 +
* On the Branch Selection page, select the following branch
 +
** If [[Lyo/TRSSDKPreview]] release needs to be used ( For example, Rational Engineering Lifecycle Manager (RELM) v1.0.0.1 or v4.0.3 releases ),
 +
*** trs-0.5 : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.core.git
 +
*** master : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.server.git
 +
*** trs-0.5 : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.docs.git
 +
** If the latest release needs to be used ( For example, Rational Engineering Lifecycle Manager (RELM). v4.0.4 or later releases),
 +
*** master : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.core.git
 +
*** master : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.server.git
 +
*** master : git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.docs.git
 +
* On the Local Destination page, specify a location or accept the default and click Finish
  
 
== Import Eclipse projects from the Git repositories  ==
 
== Import Eclipse projects from the Git repositories  ==
Line 24: Line 36:
 
*Select the Import Existing Projects wizard and click Next  
 
*Select the Import Existing Projects wizard and click Next  
 
*Import the following projects:  
 
*Import the following projects:  
**org.eclipse.lyo.oslc4j.bugzilla.trs
+
**org.eclipse.lyo.oslc4j.bugzilla.trs  
 
+
*org.eclipse.lyo.oslc4j.bugzilla.trs project has Tracked Resource Set Provider for Bugzilla Workshop source code and documentation (TRS-SDK.pdf)
 
*In the Git Repositories view, right click org.eclipse.lyo.server and select Import Projects  
 
*In the Git Repositories view, right click org.eclipse.lyo.server and select Import Projects  
 
*Select the Import Existing Projects wizard and click Next  
 
*Select the Import Existing Projects wizard and click Next  
Line 38: Line 50:
 
**org.eclipse.lyo.core.query  
 
**org.eclipse.lyo.core.query  
 
**org.eclipse.lyo.core.trs  
 
**org.eclipse.lyo.core.trs  
**OSLC4J
+
**org.eclipse.lyo.oslc4j.build
**OSLC4JJenaProvider
+
**org.eclipse.lyo.oslc4j.core
**OSLC4JJson4JProvider
+
**org.eclipse.lyo.oslc4j.provider.jena
**OSLC4JWink
+
**org.eclipse.lyo.oslc4j.provider.json4j
 +
**org.eclipse.lyo.oslc4j.wink
  
 
*[Optional] Add the projects to a new working set.  
 
*[Optional] Add the projects to a new working set.  
Line 48: Line 61:
 
== Edit the Bugzilla configuration  ==
 
== Edit the Bugzilla configuration  ==
  
The sample requires Bugzilla 4.0.10 or later. Also it requires Bugzilla administrator's password, so Bugzilla needs to be installed on your PC. You can refer to [[Lyo/BuildTRS4JBugzilla/BugzillaInstallation|Reference instruction for Bugzilla installation]] for the instruction.  
+
The sample requires Bugzilla 4.0.10 or later. Also it requires Bugzilla administrator's password, Bugzilla needs to be installed on your PC. The instruction to install Bugzilla and its prerequisite software is available at [http://www.bugzilla.org/docs/4.0/en/html/installing-bugzilla.html Bugzilla documentation] or [https://wiki.mozilla.org/Bugzilla:Win32Install this wiki page at MozillaWiki]. You will need to ensure that Bugzilla's XML-RPC support is working. The SOAP::Lite and Test::Taint Perl modules must be installed for XML-RPC to work. <br>
  
*Edit org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties.  
+
*Edit org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties.  
**Change the bugzilla_uri property to the URL of your Bugzilla server. The full qualified host name is recommended.  
+
**Change the bugzilla_uri property to the URL of your Bugzilla server. The trailing slash character is necessary. The full qualified host name is recommended.  
**Change the admin property to your Bugzilla Administrator ID. This ID has authority to manage OAuth consumers.  
+
**Change the admin property to your Bugzilla Administrator ID. This ID has authority to manage OAuth consumers.<br>
 
**Change the adapter_host property to the URL of the server where this TRS provider runs. The full qualified host name is recommended.  
 
**Change the adapter_host property to the URL of the server where this TRS provider runs. The full qualified host name is recommended.  
**Change the rebuild_interval property to the interval in milliseconds. If the request to Tracked Resource Set is after "rebuild_interval" milliseconds than the precious call, all Base Resources will be rebuilt. If you aren't sure what value is appropriate, please leave it as is.
+
**Change the admin_password to your Bugzilla Administrator's password.<br>
 +
**Change the rebuild_interval property to the interval in milliseconds. If the request to Tracked Resource Set is after "rebuild_interval" milliseconds than the previous call, all Base Resources will be rebuilt. If you aren't sure what value is appropriate, please leave it as is. If -1 is specified, Base Resource is built at the only first call.
 +
**Change the max_number_of_products to the max number of Products TRS Provider will access.
 +
**Change the max_number_of_bugs to the max number of Bugs TRS provider will access to generate their Change Logs.
 +
**Change the start_date_year, start_date_month and start_date_day to the date. TRS Provider will access Bugs which were modified after this specified date. The time zone of this date is same as your PC setting.
  
<br>  
+
Note that you can create a test Bugzilla installation at [https://landfill.bugzilla.org/ landfill]&nbsp; ( the direct link to create a test Bugzilla installation is [http://demo.bugzilla.org/create.cgi this]. ) If you will use this test Bugzilla installation, please make sure that&nbsp;:
 +
 
 +
*Use the smaller values to "max_number_of_products" and "the max_number_of_bugs" properties in org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties. For example, <br>  
 +
**max_number_of_products=1
 +
**max_number_of_bugs=3 <br>
 +
 
 +
This is because this test Bugzilla installation has many Bugs already, using their default values could cause the very slow performance.
 +
 
 +
*Disable Bugzilla SSL redirect otpion by the following steps
 +
**Login Bugzilla as an asministrator ID
 +
**Click "Administration" link
 +
**Click "Parameters" link
 +
**Click "off" radio button of "ssl_redirect"
 +
*Use "http" protocol for bugzilla_uri property in&nbsp;org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties even if the given URL for the created test Bugzilla installation uses "https". For example,
 +
**bugzilla_uri=http://foobar.demo.bugzilla.org/
  
 
== Build the projects  ==
 
== Build the projects  ==
Line 62: Line 93:
 
*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.  
 
*Run Maven Install on each project in this order,  
 
*Run Maven Install on each project in this order,  
**OSLC4J
+
**org.eclipse.lyo.oslc4j.build
**OSLC4JJenaProvider
+
**OSLC4JJson4JProvider
+
**OSLC4JWink
+
 
**org.eclipse.lyo.core.trs  
 
**org.eclipse.lyo.core.trs  
 
**org.eclipse.lyo.server.oauth.core  
 
**org.eclipse.lyo.server.oauth.core  
Line 82: Line 110:
 
*You may need to check [http://git.eclipse.org/c/lyo/org.eclipse.lyo.server.git/tree/org.eclipse.lyo.samples.bugzilla/README.txtorg.eclipse.lyo.server.samples.bugzilla's README.txt] for instructions on how to install the missing <tt>j2bugzilla</tt> dependency in case the Maven install fails for this project.
 
*You may need to check [http://git.eclipse.org/c/lyo/org.eclipse.lyo.server.git/tree/org.eclipse.lyo.samples.bugzilla/README.txtorg.eclipse.lyo.server.samples.bugzilla's README.txt] for instructions on how to install the missing <tt>j2bugzilla</tt> dependency in case the Maven install fails for this project.
  
== Run the Bugzilla sample web application  ==
+
== Run the TRS Adapter for Bugzilla web application  ==
  
 +
*Make sure that Internet is accessible.
 +
*Start Bugzilla
 
*Select Run-&gt;Run Configurations and double click Maven Build  
 
*Select Run-&gt;Run Configurations and double click Maven Build  
 
*Select the '''Launch TRS Reference App for Bugzilla''' launch and click Run
 
*Select the '''Launch TRS Reference App for Bugzilla''' launch and click Run
  
 
[[Image:TRS4JBugzillaLaunchpng.png]]
 
[[Image:TRS4JBugzillaLaunchpng.png]]
 +
 +
You should now be able to point a local web browser at http://localhost:8085/OSLC4JBugzilla/services/trs/base to make sure that TRS Adapter for Bugzilla is working.

Latest revision as of 11:24, 22 November 2013

This application is an example of Tracked Resource Set(TRS) provider for the Bugzilla application. It is built on top of OSLC-CM compatible adapter which implements OSLC Change Management provider, so it is recommended to take a look at OSLC-CM compatible adapter as well.

This application uses the OSLC4J SDK as well as TRS 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

Clone the Lyo Docs, Core and Server Git repositories

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 the following projects:
    • org.eclipse.lyo.oslc4j.bugzilla.trs
  • org.eclipse.lyo.oslc4j.bugzilla.trs project has Tracked Resource Set Provider for Bugzilla Workshop source code and documentation (TRS-SDK.pdf)
  • 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
  • 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:
    • org.eclipse.lyo.core.query
    • org.eclipse.lyo.core.trs
    • org.eclipse.lyo.oslc4j.build
    • org.eclipse.lyo.oslc4j.core
    • org.eclipse.lyo.oslc4j.provider.jena
    • org.eclipse.lyo.oslc4j.provider.json4j
    • org.eclipse.lyo.oslc4j.wink
  • [Optional] Add the projects to a new working set.
  • [Optional] You can download OSLC4JBugzilla project in org.eclipse.lyo.docs repository. When you will compare OSLC4JBugzilla and org.eclipse.lyo.oslc4j.bugzilla.trs projects, you will see what changes are made to implement TRS provider.

Edit the Bugzilla configuration

The sample requires Bugzilla 4.0.10 or later. Also it requires Bugzilla administrator's password, Bugzilla needs to be installed on your PC. The instruction to install Bugzilla and its prerequisite software is available at Bugzilla documentation or this wiki page at MozillaWiki. You will need to ensure that Bugzilla's XML-RPC support is working. The SOAP::Lite and Test::Taint Perl modules must be installed for XML-RPC to work.

  • Edit org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties.
    • Change the bugzilla_uri property to the URL of your Bugzilla server. The trailing slash character is necessary. The full qualified host name is recommended.
    • Change the admin property to your Bugzilla Administrator ID. This ID has authority to manage OAuth consumers.
    • Change the adapter_host property to the URL of the server where this TRS provider runs. The full qualified host name is recommended.
    • Change the admin_password to your Bugzilla Administrator's password.
    • Change the rebuild_interval property to the interval in milliseconds. If the request to Tracked Resource Set is after "rebuild_interval" milliseconds than the previous call, all Base Resources will be rebuilt. If you aren't sure what value is appropriate, please leave it as is. If -1 is specified, Base Resource is built at the only first call.
    • Change the max_number_of_products to the max number of Products TRS Provider will access.
    • Change the max_number_of_bugs to the max number of Bugs TRS provider will access to generate their Change Logs.
    • Change the start_date_year, start_date_month and start_date_day to the date. TRS Provider will access Bugs which were modified after this specified date. The time zone of this date is same as your PC setting.

Note that you can create a test Bugzilla installation at landfill  ( the direct link to create a test Bugzilla installation is this. ) If you will use this test Bugzilla installation, please make sure that :

  • Use the smaller values to "max_number_of_products" and "the max_number_of_bugs" properties in org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties. For example,
    • max_number_of_products=1
    • max_number_of_bugs=3

This is because this test Bugzilla installation has many Bugs already, using their default values could cause the very slow performance.

  • Disable Bugzilla SSL redirect otpion by the following steps
    • Login Bugzilla as an asministrator ID
    • Click "Administration" link
    • Click "Parameters" link
    • Click "off" radio button of "ssl_redirect"
  • Use "http" protocol for bugzilla_uri property in org.eclipse.lyo.oslc4j.bugzilla.trs/src/main/resources/bugz.properties even if the given URL for the created test Bugzilla installation uses "https". For example,

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 each project in this order,
    • org.eclipse.lyo.oslc4j.build
    • org.eclipse.lyo.core.trs
    • org.eclipse.lyo.server.oauth.core
    • org.eclipse.lyo.server.oauth.consumerstore
    • org.eclipse.lyo.server.oauth.webapp
    • org.eclipse.lyo.oslc4j.bugzilla.trs
  • To run Maven Install,
    • Expand the project
    • Right click pom.xml and select Run As->Maven install.
  • IBM JVM/JRE Users: There is an issue with m2eclipse and the IBM JRE. If you have see the error java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder when running a Maven install, you need to copy a newer slf4j api jar into your JRE directory to work around the issue until it is fixed:
  • You may need to check README.txt for instructions on how to install the missing j2bugzilla dependency in case the Maven install fails for this project.

Run the TRS Adapter for Bugzilla web application

  • Make sure that Internet is accessible.
  • Start Bugzilla
  • Select Run->Run Configurations and double click Maven Build
  • Select the Launch TRS Reference App for Bugzilla launch and click Run

TRS4JBugzillaLaunchpng.png

You should now be able to point a local web browser at http://localhost:8085/OSLC4JBugzilla/services/trs/base to make sure that TRS Adapter for Bugzilla is working.

Back to the top