summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2012-01-13 11:36:41 (EST)
committer Michael Fiedler2012-01-16 11:49:11 (EST)
commitda329cc8e818463e6fce78b93787087fbf13115f (patch)
tree601081fc3e5357c2eda370e8dc468718f2ec279d
parent08db5326ace380900d0f15b0c89f0209eed0cc6f (diff)
downloadorg.eclipse.lyo.server-da329cc8e818463e6fce78b93787087fbf13115f.zip
org.eclipse.lyo.server-da329cc8e818463e6fce78b93787087fbf13115f.tar.gz
org.eclipse.lyo.server-da329cc8e818463e6fce78b93787087fbf13115f.tar.bz2
Bug 368564 - Bugzilla Adapter: Adopt j2buzilla 1.0
-rw-r--r--org.eclipse.lyo.samples.bugzilla/README.txt22
-rw-r--r--org.eclipse.lyo.samples.bugzilla/pom.xml15
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/BugzillaInitializer.java10
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java22
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCreatorService.java43
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestSelectorService.java8
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java16
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/CreationShapeService.java4
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/QueryShapeService.java4
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderCatalogService.java4
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderService.java32
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedBugSearch.java27
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedGetBug.java12
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetAccessibleProducts.java2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetLegalValues.java2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetProducts.java4
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/BugzillaChangeRequest.java120
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties10
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_html.jsp7
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_created.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_desc.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_large.jsp8
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_small.jsp8
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_selector.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_creation_rdfxml.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_cr_rdfxml.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_rdfxml.jsp2
-rw-r--r--org.eclipse.lyo.samples.bugzilla/src/test/java/org/eclipse/lyo/samples/bugzilla/test/TestConnection.java54
28 files changed, 209 insertions, 237 deletions
diff --git a/org.eclipse.lyo.samples.bugzilla/README.txt b/org.eclipse.lyo.samples.bugzilla/README.txt
index 1581156..b19698e 100644
--- a/org.eclipse.lyo.samples.bugzilla/README.txt
+++ b/org.eclipse.lyo.samples.bugzilla/README.txt
@@ -1,17 +1,21 @@
-You must have Subversion and Maven command line tools installed to run this sample. You
-must also have Bugzilla 3.4 (or 3.6). Consider using the ALMWorks Bugzilla 3.4 VMWare
-image.
+You must have Bugzilla 3.4 to run this sample. You can connect to the
+Bugzilla Landfull <http://landfill.bugzilla.org/> or use a VM image
+such as the ALMWorks Bugzilla 3.4 VMWare image.
http://almworks.com/vbs/download.html
-To install j2bugzilla, a Bugzilla Java API, into your local maven repository,
+This project also relies on j2bugzilla, a Java API for Bugzilla.
-svn checkout http://j2bugzilla.googlecode.com/svn/trunk/ j2bugzilla-read-only
-cd j2bugzilla-read-only/JBugz
-mvn install
+Download j2bugzilla 1.0 from Google Code.
+
+ http://j2bugzilla.googlecode.com/files/j2bugzilla-1.0.jar
+
+Install j2bugzilla into your local repository with the command,
+
+ mvn install:install-file -Dfile=j2bugzilla-1.0.jar -DgroupId=j2bugzilla -DartifactId=j2bugzilla -Dversion=1.0 -Dpackaging=jar
-To run the Bugzilla adapter, edit src/main/resources/bugz.properties to point to your
-Bugzilla server. Then from the project root directory,
+To run the Bugzilla adapter, edit src/main/resources/bugz.properties to
+point to your Bugzilla server. Then from the project root directory,
mvn install
mvn jetty:run
diff --git a/org.eclipse.lyo.samples.bugzilla/pom.xml b/org.eclipse.lyo.samples.bugzilla/pom.xml
index fb7f476..10d8ea4 100644
--- a/org.eclipse.lyo.samples.bugzilla/pom.xml
+++ b/org.eclipse.lyo.samples.bugzilla/pom.xml
@@ -61,17 +61,18 @@
</dependency>
<!--
- To install j2bugzilla in your local maven repository,
-
- svn checkout http://j2bugzilla.googlecode.com/svn/trunk/ j2bugzilla-read-only
- cd j2bugzilla-read-only/JBugz
- mvn install
-
+ Download j2bugzilla 1.0 from Google Code.
+
+ http://j2bugzilla.googlecode.com/files/j2bugzilla-1.0.jar
+
+ Install j2bugzilla into your local repository with the command,
+
+ mvn install:install-file -Dfile=j2bugzilla-1.0.jar -DgroupId=j2bugzilla -DartifactId=j2bugzilla -Dversion=1.0 -Dpackaging=jar
-->
<dependency>
<groupId>j2bugzilla</groupId>
<artifactId>j2bugzilla</artifactId>
- <version>0.2</version>
+ <version>1.0</version>
</dependency>
</dependencies>
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/BugzillaInitializer.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/BugzillaInitializer.java
index 2a958ad..4d492c7 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/BugzillaInitializer.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/BugzillaInitializer.java
@@ -22,14 +22,14 @@ import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import jbugz.base.BugzillaConnector;
-import jbugz.exceptions.BugzillaException;
-import jbugz.exceptions.ConnectionException;
-import jbugz.rpc.LogIn;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.base.BugzillaException;
+import com.j2bugzilla.base.ConnectionException;
+import com.j2bugzilla.rpc.LogIn;
+
public class BugzillaInitializer {
private static final String CONNECTOR_SESSION_ATTRIBUTE = "org.eclipse.lyo.samples.bugzilla.BugzillaConnector";
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
index 299ddbf..d6bcaa3 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCollectionService.java
@@ -27,13 +27,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.Bug;
-import jbugz.base.BugzillaConnector;
-import jbugz.exceptions.BugzillaException;
-import jbugz.exceptions.ConnectionException;
-import jbugz.exceptions.InvalidDescriptionException;
-import jbugz.rpc.ReportBug;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.ExtendedBugSearch;
@@ -51,6 +44,12 @@ import thewebsemantic.RDF2Bean;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.base.BugzillaException;
+import com.j2bugzilla.base.ConnectionException;
+import com.j2bugzilla.rpc.BugSearch;
+import com.j2bugzilla.rpc.ReportBug;
/**
@@ -96,7 +95,7 @@ public class ChangeRequestCollectionService extends HttpServlet {
HttpServletResponse response,
Collection<BugzillaChangeRequest> changeRequests)
throws ConnectionException, BugzillaException,
- InvalidDescriptionException, UnauthroziedException {
+ UnauthroziedException {
BugzillaConnector bc = BugzillaInitializer
.getBugzillaConnector(request);
@@ -159,7 +158,7 @@ public class ChangeRequestCollectionService extends HttpServlet {
BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(request);
ExtendedBugSearch bugSearch = new ExtendedBugSearch(
- ExtendedBugSearch.ExtendedSearchLimiter.PRODUCT,
+ BugSearch.SearchLimiter.PRODUCT,
product.getName());
// request one extra to see if there's more
@@ -168,7 +167,6 @@ public class ChangeRequestCollectionService extends HttpServlet {
bc.executeMethod(bugSearch);
List<Bug> results = bugSearch.getSearchResults();
-
response.setHeader("OSLC-Core-Version", "2.0");
if (AcceptType.willAccept("text/html", request) && BugzillaInitializer.isProvideHtml()) {
@@ -187,10 +185,6 @@ public class ChangeRequestCollectionService extends HttpServlet {
+ "&amp;oslc.paging=true&amp;page=" + (page + 1));
}
- for (Bug bug : results) {
- bug.getInternalState().put("oslc_uri", URLStrategy.getChangeRequestURL(bug.getID()));
- }
-
final RequestDispatcher rd = request.getRequestDispatcher("/cm/changerequest_collection_html.jsp");
rd.forward(request, response);
response.flushBuffer();
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCreatorService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCreatorService.java
index e123721..521cf8d 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCreatorService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestCreatorService.java
@@ -19,9 +19,7 @@ package org.eclipse.lyo.samples.bugzilla;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -29,10 +27,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.Bug;
-import jbugz.base.BugzillaConnector;
-import jbugz.rpc.ReportBug;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetLegalValues;
@@ -40,6 +34,11 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
import org.eclipse.lyo.samples.bugzilla.utils.StringUtils;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugFactory;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.rpc.ReportBug;
+
/**
* GET returns Delegated UI and POST accepts form post of new bug data.
@@ -138,21 +137,27 @@ public class ChangeRequestCreatorService extends HttpServlet {
String summary = request.getParameter("summary");
String component = request.getParameter("component");
String version = request.getParameter("version");
- String op_sys = request.getParameter("op_sys");
+ String operatingSystem = request.getParameter("op_sys");
String platform = request.getParameter("platform");
- Map<String, Object> bugState = new HashMap<String, Object>();
-
- bugState.put("product", products.get(0).getName());
- bugState.put("component", component);
- bugState.put("summary", summary);
- bugState.put("version", version);
- bugState.put("op_sys", op_sys);
- bugState.put("platform", platform);
-
- System.err.println("Bug="+bugState);
-
- Bug bug = new Bug(bugState);
+ BugFactory factory = new BugFactory().newBug().setProduct(products.get(0).getName());
+ if (summary != null) {
+ factory.setSummary(summary);
+ }
+ if (version != null) {
+ factory.setVersion(version);
+ }
+ if (component != null) {
+ factory.setComponent(component);
+ }
+ if (platform != null) {
+ factory.setPlatform(platform);
+ }
+ if (operatingSystem != null) {
+ factory.setOperatingSystem(operatingSystem);
+ }
+
+ Bug bug = factory.createBug();
ReportBug reportBug = new ReportBug(bug);
bc.executeMethod(reportBug);
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestSelectorService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestSelectorService.java
index 78a7a26..4e1bd6f 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestSelectorService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestSelectorService.java
@@ -25,14 +25,14 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.Bug;
-import jbugz.base.BugzillaConnector;
-import jbugz.rpc.BugSearch;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.ExtendedBugSearch;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.rpc.BugSearch;
+
/**
* Servlet implementation class ResourceFactory
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
index 7d3c224..f9f0c3b 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ChangeRequestService.java
@@ -29,13 +29,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.Bug;
-import jbugz.base.BugzillaConnector;
-import jbugz.exceptions.BugzillaException;
-import jbugz.exceptions.ConnectionException;
-import jbugz.exceptions.InvalidDescriptionException;
-import jbugz.rpc.CommentBug;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.ExtendedGetBug;
import org.eclipse.lyo.samples.bugzilla.resources.BugzillaChangeRequest;
@@ -48,6 +41,11 @@ import thewebsemantic.RDF2Bean;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.base.BugzillaException;
+import com.j2bugzilla.base.ConnectionException;
+import com.j2bugzilla.rpc.CommentBug;
/**
@@ -173,10 +171,10 @@ public class ChangeRequestService extends HttpServlet {
throw new ServletException(e);
}
}
-
+
private void updateBug(HttpServletRequest request, BugzillaChangeRequest cr)
throws ConnectionException, BugzillaException,
- InvalidDescriptionException, UnauthroziedException {
+ UnauthroziedException {
BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(request);
// No built in field to hold external links. Just add the new link as a comment for now.
String comment = getLinksComment(cr);
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/CreationShapeService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/CreationShapeService.java
index 06203f0..8622b65 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/CreationShapeService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/CreationShapeService.java
@@ -26,8 +26,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.BugzillaConnector;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
@@ -36,6 +34,8 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
+import com.j2bugzilla.base.BugzillaConnector;
+
/**
* OSLC CM Change Request Service
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/QueryShapeService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/QueryShapeService.java
index 741ed33..a1d9f47 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/QueryShapeService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/QueryShapeService.java
@@ -26,8 +26,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.BugzillaConnector;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
@@ -36,6 +34,8 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
+import com.j2bugzilla.base.BugzillaConnector;
+
/**
* OSLC CM Change Request Service
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderCatalogService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderCatalogService.java
index cd44713..c015047 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderCatalogService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderCatalogService.java
@@ -25,8 +25,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import jbugz.base.BugzillaConnector;
-
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
@@ -34,6 +32,8 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
+import com.j2bugzilla.base.BugzillaConnector;
+
/**
* OSLC CM Change Request Service
*/
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderService.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderService.java
index a5247cd..5202fd1 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderService.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/ServiceProviderService.java
@@ -15,24 +15,24 @@
*******************************************************************************/
package org.eclipse.lyo.samples.bugzilla;
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import jbugz.base.BugzillaConnector;
-
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.eclipse.lyo.samples.bugzilla.exception.UnauthroziedException;
-import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
-import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
-import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
-import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
+import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
+import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
+import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
+import org.eclipse.lyo.samples.bugzilla.utils.AcceptType;
import org.eclipse.lyo.samples.bugzilla.utils.HttpUtils;
-import org.eclipse.lyo.samples.bugzilla.utils.StringUtils;
+import org.eclipse.lyo.samples.bugzilla.utils.StringUtils;
+
+import com.j2bugzilla.base.BugzillaConnector;
/**
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedBugSearch.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedBugSearch.java
index 3792a15..c9855f9 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedBugSearch.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedBugSearch.java
@@ -20,12 +20,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import jbugz.base.Bug;
-import jbugz.exceptions.InvalidDescriptionException;
-import jbugz.rpc.BugSearch;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugFactory;
+import com.j2bugzilla.rpc.BugSearch;
/**
* Adds additional search limiters to those provided by j2bugzilla and fixes a
@@ -35,11 +32,6 @@ import jbugz.rpc.BugSearch;
*/
public class ExtendedBugSearch extends BugSearch {
private Map<Object, Object> hash = new HashMap<Object, Object>();
-
- /**
- * Private logging instance
- */
- private static final Log LOG = LogFactory.getLog(ExtendedBugSearch.class);
public enum ExtendedSearchLimiter {
/**
@@ -50,12 +42,7 @@ public class ExtendedBugSearch extends BugSearch {
/**
* An offset into bugs returned by search.
*/
- OFFSET("offset"),
-
- /**
- * The product affected by this bug.
- */
- PRODUCT("product");
+ OFFSET("offset");
private final String name;
@@ -125,11 +112,7 @@ public class ExtendedBugSearch extends BugSearch {
// Work around a bug in j2bugzilla where version isn't correctly recognized.
Map<?, ?> internals = (Map<?, ?>) bugMap.get("internals");
bugMap.put("version", internals.get("version"));
- try {
- results.add(new Bug(bugMap));
- } catch (InvalidDescriptionException e) {
- LOG.debug("A bug retrieved via search was invalid", e);
- }
+ results.add(new BugFactory().createBug(bugMap));
}
}
return results;
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedGetBug.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedGetBug.java
index 64beb7e..a94a97a 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedGetBug.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/ExtendedGetBug.java
@@ -18,9 +18,9 @@ package org.eclipse.lyo.samples.bugzilla.jbugzx.rpc;
import java.util.HashMap;
import java.util.Map;
-import jbugz.base.Bug;
-import jbugz.exceptions.InvalidDescriptionException;
-import jbugz.rpc.GetBug;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugFactory;
+import com.j2bugzilla.rpc.GetBug;
/**
* Allows users to retrieve a specific bug for which the ID is already known.
@@ -66,11 +66,7 @@ public class ExtendedGetBug extends GetBug {
// recognized.
Map<?, ?> internals = (Map<?, ?>) bugMap.get("internals");
bugMap.put("version", internals.get("version"));
- try {
- return new Bug(bugMap);
- } catch (InvalidDescriptionException e) {
- throw new RuntimeException(e);
- }
+ return new BugFactory().createBug(bugMap);
}
}
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetAccessibleProducts.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetAccessibleProducts.java
index c48749b..fccbac5 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetAccessibleProducts.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetAccessibleProducts.java
@@ -18,7 +18,7 @@ package org.eclipse.lyo.samples.bugzilla.jbugzx.rpc;
import java.util.HashMap;
import java.util.Map;
-import jbugz.base.BugzillaMethod;
+import com.j2bugzilla.base.BugzillaMethod;
public class GetAccessibleProducts implements BugzillaMethod {
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetLegalValues.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetLegalValues.java
index bd61c63..d6fb680 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetLegalValues.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetLegalValues.java
@@ -18,7 +18,7 @@ package org.eclipse.lyo.samples.bugzilla.jbugzx.rpc;
import java.util.HashMap;
import java.util.Map;
-import jbugz.base.BugzillaMethod;
+import com.j2bugzilla.base.BugzillaMethod;
public class GetLegalValues implements BugzillaMethod {
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetProducts.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetProducts.java
index 0df8afd..4f82346 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetProducts.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/jbugzx/rpc/GetProducts.java
@@ -20,10 +20,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import jbugz.base.BugzillaMethod;
-
import org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product;
+import com.j2bugzilla.base.BugzillaMethod;
+
public class GetProducts implements BugzillaMethod {
/**
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/BugzillaChangeRequest.java b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/BugzillaChangeRequest.java
index 4d7f540..be96cb0 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/BugzillaChangeRequest.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/java/org/eclipse/lyo/samples/bugzilla/resources/BugzillaChangeRequest.java
@@ -15,26 +15,25 @@
*******************************************************************************/
package org.eclipse.lyo.samples.bugzilla.resources;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import jbugz.base.Bug;
-import jbugz.base.Bug.Priority;
-import jbugz.base.Bug.Status;
-import jbugz.exceptions.BugzillaException;
-import jbugz.exceptions.ConnectionException;
-import jbugz.exceptions.InvalidDescriptionException;
-
-import org.eclipse.lyo.samples.bugzilla.URLStrategy;
-
-import thewebsemantic.Namespace;
-import thewebsemantic.RdfProperty;
-import thewebsemantic.RdfType;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Map;
+
+import org.eclipse.lyo.samples.bugzilla.URLStrategy;
+
+import thewebsemantic.Namespace;
+import thewebsemantic.RdfProperty;
+import thewebsemantic.RdfType;
+
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.Bug.Priority;
+import com.j2bugzilla.base.Bug.Status;
+import com.j2bugzilla.base.BugFactory;
+import com.j2bugzilla.base.BugzillaException;
+import com.j2bugzilla.base.ConnectionException;
/**
* An OSLC-CM ChangeRequest with some Bugzilla-specific properties.
@@ -77,10 +76,13 @@ public class BugzillaChangeRequest extends ChangeRequest {
throws URISyntaxException, UnsupportedEncodingException {
BugzillaChangeRequest cr = new BugzillaChangeRequest();
cr.setIdentifier(bug.getID());
- cr.setTitle(bug.getSummary());
- cr.setStatus(bug.getStatus());
+ cr.setTitle(bug.getSummary());
+
+ // j2bugzilla does not handle all status values properly.
+ //cr.setStatus(bug.getStatus());
+ cr.setStatus((String) bug.getParameterMap().get("status"));
- Object assignedTo = bug.getInternalState().get("assigned_to");
+ Object assignedTo = bug.getParameterMap().get("assigned_to");
if (assignedTo != null) {
Person contributor = new Person();
String email = assignedTo.toString();
@@ -89,12 +91,12 @@ public class BugzillaChangeRequest extends ChangeRequest {
cr.setContributor(contributor);
}
- Date createdDate = (Date) bug.getInternalState().get("creation_time");
+ Date createdDate = (Date) bug.getParameterMap().get("creation_time");
Calendar createdCal = Calendar.getInstance();
createdCal.setTime(createdDate);
cr.setCreated(createdCal);
- Date modifiedDate = (Date) bug.getInternalState().get("last_change_time");
+ Date modifiedDate = (Date) bug.getParameterMap().get("last_change_time");
Calendar modifiedCal = Calendar.getInstance();
modifiedCal.setTime(modifiedDate);
cr.setModified(modifiedCal);
@@ -103,7 +105,7 @@ public class BugzillaChangeRequest extends ChangeRequest {
cr.setComponent(bug.getComponent());
// Work around a bug in j2bugzilla. Bug.getVersion() results in a class cast exception.
- Object version = bug.getInternalState().get("version");
+ Object version = bug.getParameterMap().get("version");
if (version != null) {
cr.setVersion(version.toString());
}
@@ -114,7 +116,7 @@ public class BugzillaChangeRequest extends ChangeRequest {
// Do nothing, priority is not set.
}
- Map<?, ?> internals = (Map<?, ?>) bug.getInternalState().get("internals");
+ Map<?, ?> internals = (Map<?, ?>) bug.getParameterMap().get("internals");
cr.setPlatform((String) internals.get("rep_platform"));
cr.setOperatingSystem((String) internals.get("op_sys"));
@@ -131,45 +133,31 @@ public class BugzillaChangeRequest extends ChangeRequest {
* @throws InvalidDescriptionException
* @throws URISyntaxException on errors setting the bug URI
*/
- public Bug toBug() throws ConnectionException, BugzillaException, InvalidDescriptionException {
- Map<String, Object> bugState = new HashMap<String, Object>();
- fillInBugState(bugState);
-
- return new Bug(bugState);
- }
-
- /**
- * Updates {@link Bug} state from an OSLC-CM ChangeRequest.
- *
- * @param bug the bug
- * @return the ChangeRequest to be serialized
- * @throws BugzillaException
- * @throws ConnectionException
- * @throws URISyntaxException on errors setting the bug URI
- */
- public void toBug(Bug bug) throws ConnectionException, BugzillaException {
- fillInBugState(bug.getInternalState());
- }
-
- private void fillInBugState(Map<String, Object> bugState) {
- if (identifier != null)
- bugState.put("id", new Integer(identifier));
- if (product != null)
- bugState.put("product", product);
- if (title != null)
- bugState.put("summary", title);
- if (description != null)
- bugState.put("description", description);
- if (version != null)
- bugState.put("version", version);
- if (component != null)
- bugState.put("component", component);
- if (platform != null)
- bugState.put("platform", platform);
- if (operatingSystem != null)
- bugState.put("op_sys", operatingSystem);
- if (status != null)
- bugState.put("status", status);
+ public Bug toBug() throws ConnectionException, BugzillaException {
+ BugFactory factory = new BugFactory().newBug();
+ if (product != null) {
+ factory.setProduct(product);
+ }
+ if (title != null) {
+ factory.setSummary(title);
+ }
+ if (description != null) {
+ factory.setDescription(description);
+ }
+ if (version != null) {
+ factory.setVersion(version);
+ }
+ if (component != null) {
+ factory.setComponent(component);
+ }
+ if (platform != null) {
+ factory.setPlatform(platform);
+ }
+ if (operatingSystem != null) {
+ factory.setOperatingSystem(operatingSystem);
+ }
+
+ return factory.createBug();
}
public void setIdentifier(int identifier) throws URISyntaxException {
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties b/org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties
index 72aced6..6f7beda 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/resources/bugz.properties
@@ -14,7 +14,11 @@
# IBM Corporation - initial API and implementation
###############################################################################
adapter_uri=http://localhost:8282/bugz
-bugzilla_uri=http://oslc1.rtp.raleigh.ibm.com/bugzilla
-username=nina@oslc1.rtp.raleigh.ibm.com
-password=ninanina
+#bugzilla_uri=http://192.168.113.128
+#username=admin
+#password=admin
provideHtml=true
+
+bugzilla_uri=https://landfill.bugzilla.org/bugzilla-3.4-branch/
+username=spadgett@us.ibm.com
+password=lyo
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_html.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_html.jsp
index 0a1421d..cc213ea 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_html.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_collection_html.jsp
@@ -14,9 +14,10 @@
IBM Corporation - initial API and implementation
--%>
+<%@page import="org.eclipse.lyo.samples.bugzilla.URLStrategy"%>
<%@page import="org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product"%>
<%@ page contentType="text/html" language="java" %>
-<%@ page import="jbugz.base.*" %>
+<%@ page import="com.j2bugzilla.base.*" %>
<%@ page import="org.eclipse.lyo.samples.bugzilla.jbugzx.base.*" %>
<%@ page import="java.util.List" %>
<%
@@ -67,8 +68,8 @@
<h1>Query Results</h1>
<% for (Bug bug : bugs) { %>
- <p>Summary: <%= bug.getSummary() %><br /><a href="<%= bug.getInternalState().get("oslc_uri") %>">
- <%= bug.getInternalState().get("oslc_uri") %></a></p>
+ <p>Summary: <%= bug.getSummary() %><br /><a href="<%= URLStrategy.getChangeRequestURL(bug.getID()) %>">
+ <%= URLStrategy.getChangeRequestURL(bug.getID()) %></a></p>
<% } %>
<% if (nextPageUri != null) { %><a href="<%= nextPageUri %>">Next Page</a><% } %>
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_created.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_created.jsp
index 17b0597..edbff0c 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_created.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_created.jsp
@@ -15,7 +15,7 @@
IBM Corporation - initial API and implementation
--%>
<%@ page import="java.net.*,java.util.*,java.text.SimpleDateFormat" %>
-<%@ page import="jbugz.base.Bug" %>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%
Bug bug = (Bug)request.getAttribute("bug");
String bugUri = (String)request.getAttribute("bugUri");
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_desc.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_desc.jsp
index af4ce49..ee2d0d6 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_desc.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_desc.jsp
@@ -15,7 +15,7 @@
IBM Corporation - initial API and implementation
--%>
<%@ page contentType="application/x-oslc-compact+xml" language="java" %>
-<%@ page import="jbugz.base.Bug" %>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%@ page import="org.eclipse.lyo.samples.bugzilla.URLStrategy"%>
<%
Bug bug = (Bug)request.getAttribute("bug");
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_large.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_large.jsp
index 53dd0e6..6c31527 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_large.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_large.jsp
@@ -16,21 +16,21 @@
<%@ page contentType="text/html" language="java" %>
<%@ page import="java.net.*,java.util.*" %>
<%@ page import="java.net.*,java.util.*,java.text.SimpleDateFormat" %>
-<%@ page import="jbugz.base.Bug" %>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%
Bug bug = (Bug)request.getAttribute("bug");
String bugzillaUri = (String) request.getAttribute("bugzillaUri");
String bugUri = (String)request.getAttribute("bugUri");
String title = bug.getSummary();
-Date createdDate = (Date)bug.getInternalState().get("creation_time");
+Date createdDate = (Date)bug.getParameterMap().get("creation_time");
SimpleDateFormat formatter = new SimpleDateFormat();
String created = formatter.format(createdDate);
-Date modifiedDate = (Date)bug.getInternalState().get("last_change_time");
+Date modifiedDate = (Date)bug.getParameterMap().get("last_change_time");
String modified = formatter.format(modifiedDate);
String identifier = bug.getID()+"";
String description = "None";
-String assignee = (String)bug.getInternalState().get("assigned_to");
+String assignee = (String)bug.getParameterMap().get("assigned_to");
%>
<html>
<head>
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_small.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_small.jsp
index dfe26be..747df07 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_small.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_preview_small.jsp
@@ -15,21 +15,21 @@
-->
<%@ page contentType="text/html" language="java" %>
<%@ page import="java.net.*,java.util.*,java.text.SimpleDateFormat" %>
-<%@ page import="jbugz.base.Bug" %>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%
Bug bug = (Bug)request.getAttribute("bug");
String bugzillaUri = (String) request.getAttribute("bugzillaUri");
String bugUri = (String)request.getAttribute("bugUri");
String title = bug.getSummary();
-Date createdDate = (Date)bug.getInternalState().get("creation_time");
+Date createdDate = (Date)bug.getParameterMap().get("creation_time");
SimpleDateFormat formatter = new SimpleDateFormat();
String created = formatter.format(createdDate);
-Date modifiedDate = (Date)bug.getInternalState().get("last_change_time");
+Date modifiedDate = (Date)bug.getParameterMap().get("last_change_time");
String modified = formatter.format(modifiedDate);
String identifier = bug.getID()+"";
String description = "None";
-String assignee = (String)bug.getInternalState().get("assigned_to");
+String assignee = (String)bug.getParameterMap().get("assigned_to");
%>
<html>
<head>
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_selector.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_selector.jsp
index 8e2924b..2947af2 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_selector.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/changerequest_selector.jsp
@@ -14,7 +14,7 @@
IBM Corporation - initial API and implementation
--%>
-<%@ page import="jbugz.rpc.*" %>
+<%@ page import="com.j2bugzilla.base.*" %>
<%@ page import="org.eclipse.lyo.samples.bugzilla.URLStrategy"%>
<%
int productId= (Integer)request.getAttribute("productId");
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_creation_rdfxml.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_creation_rdfxml.jsp
index 36ae5a7..a0bf54b 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_creation_rdfxml.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_creation_rdfxml.jsp
@@ -16,7 +16,7 @@
--%>
<%@ page contentType="application/x-oslc-compact+xml" language="java"%>
<%@ page import="java.util.List" %>
-<%@ page import="jbugz.base.Bug"%>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%
String bugzillaUri = (String) request.getAttribute("bugzillaUri");
List<String> operatingSystems = (List<String>)request.getAttribute("operatingSystems");
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_cr_rdfxml.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_cr_rdfxml.jsp
index 433557d..c1d7fc8 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_cr_rdfxml.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_cr_rdfxml.jsp
@@ -16,7 +16,7 @@
--%>
<%@ page contentType="application/x-oslc-compact+xml" language="java"%>
<%@ page import="java.util.List" %>
-<%@ page import="jbugz.base.Bug"%>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%
String bugzillaUri = (String) request.getAttribute("bugzillaUri");
List<String> operatingSystems = (List<String>) request.getAttribute("operatingSystems");
diff --git a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_rdfxml.jsp b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_rdfxml.jsp
index 5f1e71e..5c38848 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_rdfxml.jsp
+++ b/org.eclipse.lyo.samples.bugzilla/src/main/webapp/cm/resourceshape_query_rdfxml.jsp
@@ -16,7 +16,7 @@
--%>
<%@ page contentType="application/x-oslc-compact+xml" language="java"%>
<%@ page import="java.util.List" %>
-<%@ page import="jbugz.base.Bug"%>
+<%@ page import="com.j2bugzilla.base.Bug" %>
<%@ page import="org.eclipse.lyo.samples.bugzilla.jbugzx.base.Product" %>
<%@ page import="org.eclipse.lyo.samples.bugzilla.URLStrategy"%>
<%
diff --git a/org.eclipse.lyo.samples.bugzilla/src/test/java/org/eclipse/lyo/samples/bugzilla/test/TestConnection.java b/org.eclipse.lyo.samples.bugzilla/src/test/java/org/eclipse/lyo/samples/bugzilla/test/TestConnection.java
index 2c724e2..f6e2003 100644
--- a/org.eclipse.lyo.samples.bugzilla/src/test/java/org/eclipse/lyo/samples/bugzilla/test/TestConnection.java
+++ b/org.eclipse.lyo.samples.bugzilla/src/test/java/org/eclipse/lyo/samples/bugzilla/test/TestConnection.java
@@ -16,14 +16,9 @@
package org.eclipse.lyo.samples.bugzilla.test;
import java.io.IOException;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
-import jbugz.base.Bug;
-import jbugz.base.BugzillaConnector;
-import jbugz.rpc.ReportBug;
import junit.framework.TestCase;
import org.eclipse.lyo.samples.bugzilla.BugzillaInitializer;
@@ -34,6 +29,12 @@ import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetAccessibleProducts;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetLegalValues;
import org.eclipse.lyo.samples.bugzilla.jbugzx.rpc.GetProducts;
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugFactory;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.rpc.BugSearch;
+import com.j2bugzilla.rpc.ReportBug;
+
public class TestConnection extends TestCase {
@@ -67,28 +68,25 @@ public class TestConnection extends TestCase {
}
}
- public void testReportBug() {
-
- try {
- BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(credentials);
-
- Map<String, Object> bugState = new HashMap<String, Object>();
- bugState.put("product", "FakePortal");
- bugState.put("component", "Datastore");
- bugState.put("summary", "New Bug: " + System.currentTimeMillis());
- bugState.put("version", "1.0");
- bugState.put("op_sys", "Mac OS");
- bugState.put("platform", "Macintosh");
- Bug bug = new Bug(bugState);
- ReportBug reportBug = new ReportBug(bug);
-
- bc.executeMethod(reportBug);
-
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
+// public void testReportBug() {
+//
+// try {
+// BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(credentials);
+//
+// BugFactory factory = new BugFactory();
+// Bug bug = factory.newBug().setProduct("FakePortal")
+// .setComponent("Datastore")
+// .setSummary("New Bug: " + System.currentTimeMillis())
+// .setVersion("1.0").setOperatingSystem("Mac OS")
+// .setPlatform("Macintosh").createBug();
+// ReportBug reportBug = new ReportBug(bug);
+// bc.executeMethod(reportBug);
+//
+// } catch (Exception e) {
+// e.printStackTrace();
+// fail();
+// }
+// }
public void testGetLegalValues() {
@@ -135,7 +133,7 @@ public class TestConnection extends TestCase {
try {
BugzillaConnector bc = BugzillaInitializer.getBugzillaConnector(credentials);
- ExtendedBugSearch search = new ExtendedBugSearch(ExtendedBugSearch.ExtendedSearchLimiter.PRODUCT, "FakePortal");
+ ExtendedBugSearch search = new ExtendedBugSearch(BugSearch.SearchLimiter.PRODUCT, "FakePortal");
bc.executeMethod(search);
System.out.println("Search returned = " + search.getSearchResults().size());