aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorttsanton2014-01-29 14:05:45 (EST)
committerttsanton2014-02-04 10:21:42 (EST)
commit8711bd522478b370f6736512556bad0b5822cd36 (patch)
treebdada481b5254bc554f3ab994a0d9c6bf50d7d5f
parenta592a4bafd8c420820af9209df2cd426d07b4d39 (diff)
downloadorg.eclipse.lyo.rio-8711bd522478b370f6736512556bad0b5822cd36.zip
org.eclipse.lyo.rio-8711bd522478b370f6736512556bad0b5822cd36.tar.gz
org.eclipse.lyo.rio-8711bd522478b370f6736512556bad0b5822cd36.tar.bz2
Bug 426822 - Add test plan selection to the test case creation dialogrefs/changes/91/21291/3
- Update with new html pages for all QM resources - Update with selection dialogs for all QM resources - Update with Large preview for resources - Update with index page having links to UIs for all QM resources - Added JSTL code for html and creation pages Change-Id: Iee708aac13c73838a6f9f8270d9bad18a0d593c7 Signed-off-by: ttsanton <ttsanton@us.ibm.com>
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/QmResource.java20
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestCase.java20
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestPlan.java20
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestScript.java17
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmDialogs.js37
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmcase_creator.jsp104
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmplan_creator.jsp (renamed from org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_creator.jsp)12
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_preview_large.jsp39
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testcase_html.jsp13
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testexecution_html.jsp116
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testplan_html.jsp13
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testresult_html.jsp120
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testscript_html.jsp120
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/BaseQmResource.java72
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestCaseResource.java40
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestExecutionRecordResource.java29
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestPlanResource.java43
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestResultResource.java23
-rw-r--r--org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestScriptResource.java30
19 files changed, 760 insertions, 128 deletions
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/QmResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/QmResource.java
index 1a7da42..63de926 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/QmResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/QmResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -48,7 +48,9 @@ public abstract class QmResource
private Date modified;
private URI serviceProvider;
private String title;
-
+
+ private String description;
+
public QmResource()
{
super();
@@ -135,6 +137,15 @@ public abstract class QmResource
return title;
}
+ @OslcDescription("Descriptive text (reference: Dublin Core) about resource represented as rich text in XHTML content.")
+ @OslcPropertyDefinition(OslcConstants.DCTERMS_NAMESPACE + "description")
+ @OslcTitle("Description")
+ @OslcValueType(ValueType.XMLLiteral)
+ public String getDescription()
+ {
+ return description;
+ }
+
public void setCreated(final Date created)
{
this.created = created;
@@ -175,4 +186,9 @@ public abstract class QmResource
this.title = title;
}
+ public void setDescription(final String description)
+ {
+ this.description = description;
+ }
+
}
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestCase.java b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestCase.java
index 9131914..e200dbd 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestCase.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -29,10 +29,8 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcRange;
import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly;
import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape;
import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType;
import org.eclipse.lyo.oslc4j.core.model.Link;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
-import org.eclipse.lyo.oslc4j.core.model.ValueType;
@OslcResourceShape(title = "Quality Management Resource Shape", describes = Constants.TYPE_TEST_CASE)
@OslcNamespace(Constants.QUALITY_MANAGEMENT_NAMESPACE)
@@ -50,8 +48,6 @@ public final class TestCase
private final Set<Link> usesTestScripts = new HashSet<Link>();
private final Set<Link> validatesRequirements = new HashSet<Link>();
- private String description;
-
public TestCase()
{
super();
@@ -116,15 +112,6 @@ public final class TestCase
return creators.toArray(new URI[creators.size()]);
}
- @OslcDescription("Descriptive text (reference: Dublin Core) about resource represented as rich text in XHTML content.")
- @OslcPropertyDefinition(OslcConstants.DCTERMS_NAMESPACE + "description")
- @OslcTitle("Description")
- @OslcValueType(ValueType.XMLLiteral)
- public String getDescription()
- {
- return description;
- }
-
@OslcDescription("A related change request.")
@OslcName("relatedChangeRequest")
@OslcPropertyDefinition(Constants.QUALITY_MANAGEMENT_NAMESPACE + "relatedChangeRequest")
@@ -199,11 +186,6 @@ public final class TestCase
}
}
- public void setDescription(final String description)
- {
- this.description = description;
- }
-
public void setRelatedChangeRequests(final Link[] relatedChangeRequests)
{
this.relatedChangeRequests.clear();
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestPlan.java b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestPlan.java
index ccc8b53..45092f9 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestPlan.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestPlan.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -29,10 +29,8 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcRange;
import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly;
import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape;
import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType;
import org.eclipse.lyo.oslc4j.core.model.Link;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
-import org.eclipse.lyo.oslc4j.core.model.ValueType;
@OslcResourceShape(title = "Quality Management Resource Shape", describes = Constants.TYPE_TEST_PLAN)
@OslcNamespace(Constants.QUALITY_MANAGEMENT_NAMESPACE)
@@ -49,8 +47,6 @@ public final class TestPlan
private final Set<Link> usesTestCases = new HashSet<Link>();
private final Set<Link> validatesRequirementCollections = new HashSet<Link>();
- private String description;
-
public TestPlan()
{
super();
@@ -110,15 +106,6 @@ public final class TestPlan
return creators.toArray(new URI[creators.size()]);
}
- @OslcDescription("Descriptive text (reference: Dublin Core) about resource represented as rich text in XHTML content.")
- @OslcPropertyDefinition(OslcConstants.DCTERMS_NAMESPACE + "description")
- @OslcTitle("Description")
- @OslcValueType(ValueType.XMLLiteral)
- public String getDescription()
- {
- return description;
- }
-
@OslcDescription("A related change request.")
@OslcName("relatedChangeRequest")
@OslcPropertyDefinition(Constants.QUALITY_MANAGEMENT_NAMESPACE + "relatedChangeRequest")
@@ -182,11 +169,6 @@ public final class TestPlan
}
}
- public void setDescription(final String description)
- {
- this.description = description;
- }
-
public void setRelatedChangeRequests(final Link[] relatedChangeRequests)
{
this.relatedChangeRequests.clear();
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestScript.java b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestScript.java
index 52153a8..52aa65d 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestScript.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement.common/src/org/eclipse/lyo/oslc4j/qualitymanagement/TestScript.java
@@ -29,10 +29,8 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcRange;
import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly;
import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape;
import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType;
import org.eclipse.lyo.oslc4j.core.model.Link;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
-import org.eclipse.lyo.oslc4j.core.model.ValueType;
@OslcResourceShape(title = "Quality Management Resource Shape", describes = Constants.TYPE_TEST_SCRIPT)
@OslcNamespace(Constants.QUALITY_MANAGEMENT_NAMESPACE)
@@ -48,7 +46,6 @@ public final class TestScript
private final Set<Link> validatesRequirements = new HashSet<Link>();
private URI executionInstructions;
- private String description;
public TestScript()
{
@@ -99,15 +96,6 @@ public final class TestScript
return creators.toArray(new URI[creators.size()]);
}
- @OslcDescription("Descriptive text (reference: Dublin Core) about resource represented as rich text in XHTML content.")
- @OslcPropertyDefinition(OslcConstants.DCTERMS_NAMESPACE + "description")
- @OslcTitle("Description")
- @OslcValueType(ValueType.XMLLiteral)
- public String getDescription()
- {
- return description;
- }
-
@OslcDescription("Instructions for executing the test script.")
@OslcPropertyDefinition(Constants.QUALITY_MANAGEMENT_NAMESPACE + "executionInstructions")
@OslcTitle("Execution Instructions")
@@ -158,11 +146,6 @@ public final class TestScript
}
}
- public void setDescription(final String description)
- {
- this.description = description;
- }
-
public void setExecutionInstructions(final URI executionInstructions)
{
this.executionInstructions = executionInstructions;
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmDialogs.js b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmDialogs.js
index 2ae2c2f..c313302 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmDialogs.js
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmDialogs.js
@@ -63,7 +63,8 @@ function create(baseUrl){
var postData="";
var title = document.getElementById("title").value;
var description = document.getElementById("description").value;
-
+ var planId = document.getElementById("testPlan").value;
+
if (title) {
postData += "title=" + encodeURIComponent(title);
}
@@ -72,6 +73,40 @@ function create(baseUrl){
postData += "&description=" + encodeURIComponent(description);
}
+ if (testPlan) {
+ postData += "&testPlanId=" + encodeURIComponent(planId);
+ }
+
+ xmlhttp.open("POST", baseUrl, true);
+ xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
+ xmlhttp.setRequestHeader("Content-length",postData.length);
+ xmlhttp.send(postData);
+}
+
+function createPlan(baseUrl){
+ var form = document.getElementById("Create");
+ xmlhttp = new XMLHttpRequest();
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState==4 && (xmlhttp.status==201)) {
+ txt = xmlhttp.responseText;
+ resp = eval('(' + txt + ')');
+ // Send response to listener
+ sendResponse(resp["dcterms:title"], resp["rdf:about"]);
+ }
+ };
+
+ var postData="";
+ var title = document.getElementById("title").value;
+ var description = document.getElementById("description").value;
+
+ if (title) {
+ postData += "title=" + encodeURIComponent(title);
+ }
+
+ if (description){
+ postData += "&description=" + encodeURIComponent(description);
+ }
+
xmlhttp.open("POST", baseUrl, true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length",postData.length);
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmcase_creator.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmcase_creator.jsp
new file mode 100644
index 0000000..7aff687
--- /dev/null
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmcase_creator.jsp
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<%--
+ Copyright (c) 2011, 2014 IBM Corporation.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Eclipse Distribution License v. 1.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+ Contributors:
+
+ Sam Padgett - initial API and implementation
+ Michael Fiedler - adapted for OSLC4J
+ Malcolm McKinney - design and UI integration
+--%>
+<%@ page contentType="text/html" language="java" pageEncoding="UTF-8"%>
+<%@ page import="java.util.List"%>
+<%@ page import="java.util.Map"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%
+ String creatorUri = (String) request.getAttribute("creatorUri");
+%>
+<html>
+<head>
+
+<script type="text/javascript" src="../../web/qmDialogs.js"></script>
+<script type="text/javascript"
+ src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+<script type="text/javascript"
+ src="../../web/jquery-ui-1.8.18.custom.min.js"></script>
+
+<script>
+ $(function() {
+ $("#submit").click(function() {
+ create('<%=creatorUri%>');
+ });
+ $("#cancel").click(function() {
+ cancel();
+ });
+ });
+</script>
+
+<link rel="stylesheet" type="text/css"
+ href="../../web/jquery-ui-1.8.18.custom.css"></link>
+<style>
+#logo {
+ padding-top: 20px;
+}
+
+body {
+ width: 700px;
+}
+</style>
+
+</head>
+
+<body>
+ <div>
+ <img src="http://open-services.net/css/images/logo-forflip.png"
+ alt="Logo" id="logo" width="71" height="80" align="left"
+ style="padding-top: 20px" />
+ </div>
+ <div>
+ <h2 class="ui-widget-header">Test Case Creation Dialog</h2>
+
+ <form class="ui-widget input" id="Create" method="POST">
+ <table class="ui-widget-content" id="inputTable">
+ <tr>
+ <th colspan="2"><p id="createStart">Input Information:</p></th>
+ </tr>
+ <tr>
+ <td><label for="title">Title:</label>
+ <td><input type="text" name="user" id="title"></td>
+ </tr>
+ <tr>
+ <td><label for="description">Description:</label>
+ <td><textarea rows = "2" cols = "30" name="description" id="description"></textarea></td>
+ </tr>
+ <th>Test Plan:</th>
+ <td>
+
+ <select class="ui-widget select" id="plan">
+ <c:forEach items="${testPlans}" var="getPlan">
+ <option value="${getPlan.identifier}" id="testPlan"><c:out value="${getPlan.identifier}"/>: <c:out value="${getPlan.title}"/></option>
+ </c:forEach>
+ </select>
+
+ </td>
+ <tr>
+ <td></td>
+ <td><input class="ui-button" type="button" id=cancel
+ value="Cancel"> <input class="ui-button" type="button"
+ id="submit" value="Submit"></td>
+ </tr>
+ </table>
+
+ </form>
+ </div>
+</body>
+</html>
+
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_creator.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmplan_creator.jsp
index 062a3e3..c365bee 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_creator.jsp
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmplan_creator.jsp
@@ -21,7 +21,6 @@
<%@ page import="java.util.Map"%>
<%
String creatorUri = (String) request.getAttribute("creatorUri");
- String resourceType = (String) request.getAttribute("resourceType");
%>
<html>
<head>
@@ -35,7 +34,7 @@
<script>
$(function() {
$("#submit").click(function() {
- create('<%=creatorUri%>');
+ createPlan('<%=creatorUri%>');
});
$("#cancel").click(function() {
cancel();
@@ -64,15 +63,12 @@ body {
style="padding-top: 20px" />
</div>
<div>
- <h2 class="ui-widget-header">Test Creation Dialog</h2>
- <h3>
- <font face="verdana">Resource Type: <%=resourceType%></font>
- </h3>
+ <h2 class="ui-widget-header">Test Plan Creation Dialog</h2>
<form class="ui-widget input" id="Create" method="POST">
<table class="ui-widget-content" id="inputTable">
<tr>
- <th><p id="createStart">Input Information:</p></th>
+ <th colspan="2"><p id="createStart">Input Information:</p></th>
</tr>
<tr>
<td><label for="title">Title:</label>
@@ -80,7 +76,7 @@ body {
</tr>
<tr>
<td><label for="description">Description:</label>
- <td><textarea rows = "3" cols = "30" name="description" id="description"></textarea></td>
+ <td><textarea rows = "2" cols = "30" name="description" id="description"></textarea></td>
</tr>
<tr>
<td></td>
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_preview_large.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_preview_large.jsp
new file mode 100644
index 0000000..c5320b4
--- /dev/null
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/qmrequest_preview_large.jsp
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<%--
+ Copyright (c) 2011, 2014 IBM Corporation.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Eclipse Distribution License v. 1.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+ Contributors:
+
+ Sam Padgett - initial API and implementation
+ Michael Fiedler - adapt for OSLC4J
+--%>
+<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
+<%@ page import="java.net.*,java.util.*" %>
+<%@ page import="org.eclipse.lyo.oslc4j.qualitymanagement.QmResource" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%
+QmResource qmRequest = (QmResource) request.getAttribute("qmRequest");
+%>
+<html>
+<head>
+<title>: <c:out value="${qmRequest.getTitle()}"/> (<c:out value="${qmRequest.getIdentifier()}"/>)</title>
+</head>
+<body>
+Large Compact Preview<hr/>
+Resource Type: <c:out value="${qmRequest.getClass().getSimpleName()}"/><br/>
+URI: <a href="<c:out value="${qmRequest.getAbout().toString()}"/>"><c:out value="${qmRequest.getAbout().toString()}"/></a> <br/>
+Title: <c:out value="${qmRequest.getTitle()}"/><br/>
+Description: <c:out value="${qmRequest.getDescription()}">No Description Available</c:out><br/>
+Identifier: <c:out value="${qmRequest.getIdentifier()}"/><br/>
+Created: <c:out value="${qmRequest.getCreated().toLocaleString()}"/><br/>
+Last Modified: <c:out value="${qmRequest.getModified().toLocaleString()}"/><br/>
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testcase_html.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testcase_html.jsp
index bc16910..5e28e01 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testcase_html.jsp
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testcase_html.jsp
@@ -22,6 +22,7 @@
<%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%>
<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
<%@ page import="java.util.List" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
TestCase testCase = (TestCase) request.getAttribute("testCase");
@@ -87,27 +88,27 @@
</div>
<div>
<h2 class="ui-widget-header">OSLC4J Quality Management Test Cases</h2>
- <h3><%= testCase.getIdentifier() %>: <%= testCase.getTitle() %></h3>
+ <h3><c:out value="${testCase.identifier}"/>: <c:out value="${testCase.title}"/></h3>
<table id="resourceTable">
<tr>
<td>ID</td>
- <td><%= testCase.getIdentifier() %></td>
+ <td><c:out value="${testCase.identifier}"/></td>
</tr>
<tr>
<td>Title</td>
- <td><%= testCase.getTitle() %></td>
+ <td><c:out value="${testCase.title}"/></td>
</tr>
<tr>
<td>Description</td>
- <td><%= testCase.getDescription() %></td>
+ <td><c:out value="${testCase.description}"/></td>
</tr>
<tr>
<td>Created</td>
- <td><%= testCase.getCreated().toLocaleString() %></td>
+ <td><%=testCase.getCreated().toLocaleString()%></td>
</tr>
<tr>
<td>Modified</td>
- <td><%= testCase.getModified().toLocaleString() %></td>
+ <td><%=testCase.getModified().toLocaleString()%></td>
</tr>
<tr></tr><tr></tr>
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testexecution_html.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testexecution_html.jsp
new file mode 100644
index 0000000..dece485
--- /dev/null
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testexecution_html.jsp
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<%--
+ Copyright (c) 2011, 2014 IBM Corporation.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Eclipse Distribution License v. 1.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+ Contributors:
+
+ Michael Fiedler - initial implementation
+
+--%>
+
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.TestExecutionRecord"%>
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.QmResource"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.Property"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%>
+<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
+<%@ page import="java.util.List" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%
+ TestExecutionRecord testExecutionRecord = (TestExecutionRecord) request.getAttribute("testExecutionRecord");
+
+%>
+<html>
+
+<head>
+
+ <script type="text/javascript" src="../../web/qmDialogs.js"></script>
+ <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+ <script type="text/javascript" src="../../web/jquery-ui-1.8.18.custom.min.js"></script>
+ <script>
+ $().ready(function(){
+ $("th").each(function(){
+
+ $(this).addClass("ui-state-default");
+
+ });
+ $("td").each(function(){
+
+ $(this).addClass("ui-widget-content");
+
+ });
+ $("tr").hover(
+ function()
+ {
+ $(this).children("td").addClass("ui-state-hover");
+ },
+ function()
+ {
+ $(this).children("td").removeClass("ui-state-hover");
+ }
+ );
+ $("tr").click(function(){
+
+ $(this).children("td").toggleClass("ui-state-highlight");
+ });
+
+ });
+ </script>
+ <link rel="stylesheet" type="text/css" href="../../web/jquery-ui-1.8.18.custom.css"></link>
+ <style>
+ #logo {
+ padding-top: 35px;
+ }
+ body {
+ width: 700px;
+ padding: 50px 0px 0px 50px;
+ }
+ td {
+ font-weight: bold
+ }
+ #resourceTable {
+ width: 700px;
+ }
+ </style>
+
+</head>
+
+<body>
+ <div>
+ <img src="http://open-services.net/css/images/logo-forflip.png" id="logo" alt="O" width="71" height="80" align= "left"/>
+ </div>
+ <div>
+ <h2 class="ui-widget-header">OSLC4J Quality Management Test Execution Record</h2>
+ <h3><c:out value="${testExecutionRecord.identifier}"/>: <c:out value="${testExecutionRecord.title}"/></h3>
+ <table id="resourceTable">
+ <tr>
+ <td>ID</td>
+ <td><c:out value="${testExecutionRecord.identifier}"/></td>
+ </tr>
+ <tr>
+ <td>Title</td>
+ <td><c:out value="${testExecutionRecord.title}"/></td>
+ </tr>
+ <tr>
+ <td>Created</td>
+ <td><%=testExecutionRecord.getCreated().toLocaleString()%></td>
+ </tr>
+ <tr>
+ <td>Modified</td>
+ <td><%=testExecutionRecord.getModified().toLocaleString()%></td>
+ </tr>
+ <tr></tr><tr></tr>
+
+ </table>
+ </div>
+
+</body>
+</html>
+
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testplan_html.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testplan_html.jsp
index d12ece2..a842595 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testplan_html.jsp
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testplan_html.jsp
@@ -22,6 +22,7 @@
<%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%>
<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
<%@ page import="java.util.List" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
TestPlan testPlan = (TestPlan) request.getAttribute("testPlan");
@@ -87,27 +88,27 @@
</div>
<div>
<h2 class="ui-widget-header">OSLC4J Quality Management Test Plans</h2>
- <h3><%= testPlan.getIdentifier() %>: <%= testPlan.getTitle() %></h3>
+ <h3><c:out value="${testPlan.identifier}"/>: <c:out value="${testPlan.title}"/></h3>
<table id="resourceTable">
<tr>
<td>ID</td>
- <td><%= testPlan.getIdentifier() %></td>
+ <td><c:out value="${testPlan.identifier}"/></td>
</tr>
<tr>
<td>Title</td>
- <td><%= testPlan.getTitle() %></td>
+ <td><c:out value="${testPlan.title}"/></td>
</tr>
<tr>
<td>Description</td>
- <td><%= testPlan.getDescription() %></td>
+ <td><c:out value="${testPlan.description}"/></td>
</tr>
<tr>
<td>Created</td>
- <td><%= testPlan.getCreated().toLocaleString() %></td>
+ <td><%=testPlan.getCreated().toLocaleString()%></td>
</tr>
<tr>
<td>Modified</td>
- <td><%= testPlan.getModified().toLocaleString() %></td>
+ <td><%=testPlan.getModified().toLocaleString()%></td>
</tr>
<tr></tr><tr></tr>
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testresult_html.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testresult_html.jsp
new file mode 100644
index 0000000..8936bc8
--- /dev/null
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testresult_html.jsp
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<%--
+ Copyright (c) 2011, 2014 IBM Corporation.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Eclipse Distribution License v. 1.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+ Contributors:
+
+ Michael Fiedler - initial implementation
+
+--%>
+
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.TestResult"%>
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.QmResource"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.Property"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%>
+<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
+<%@ page import="java.util.List" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%
+ TestResult testResult = (TestResult) request.getAttribute("testResult");
+
+%>
+<html>
+
+<head>
+
+ <script type="text/javascript" src="../../web/qmDialogs.js"></script>
+ <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+ <script type="text/javascript" src="../../web/jquery-ui-1.8.18.custom.min.js"></script>
+ <script>
+ $().ready(function(){
+ $("th").each(function(){
+
+ $(this).addClass("ui-state-default");
+
+ });
+ $("td").each(function(){
+
+ $(this).addClass("ui-widget-content");
+
+ });
+ $("tr").hover(
+ function()
+ {
+ $(this).children("td").addClass("ui-state-hover");
+ },
+ function()
+ {
+ $(this).children("td").removeClass("ui-state-hover");
+ }
+ );
+ $("tr").click(function(){
+
+ $(this).children("td").toggleClass("ui-state-highlight");
+ });
+
+ });
+ </script>
+ <link rel="stylesheet" type="text/css" href="../../web/jquery-ui-1.8.18.custom.css"></link>
+ <style>
+ #logo {
+ padding-top: 35px;
+ }
+ body {
+ width: 700px;
+ padding: 50px 0px 0px 50px;
+ }
+ td {
+ font-weight: bold
+ }
+ #resourceTable {
+ width: 700px;
+ }
+ </style>
+
+</head>
+
+<body>
+ <div>
+ <img src="http://open-services.net/css/images/logo-forflip.png" id="logo" alt="O" width="71" height="80" align= "left"/>
+ </div>
+ <div>
+ <h2 class="ui-widget-header">OSLC4J Quality Management Test Result</h2>
+ <h3><c:out value="${testResult.identifier}"/>: <c:out value="${testResult.title}"/></h3>
+ <table id="resourceTable">
+ <tr>
+ <td>ID</td>
+ <td><c:out value="${testResult.identifier}"/></td>
+ </tr>
+ <tr>
+ <td>Title</td>
+ <td><c:out value="${testResult.title}"/></td>
+ </tr>
+ <tr>
+ <tr>
+ <td>Status</td>
+ <td><c:out value="${testResult.status}"/></td>
+ </tr>
+ <td>Created</td>
+ <td><%=testResult.getCreated().toLocaleString()%></td>
+ </tr>
+ <tr>
+ <td>Modified</td>
+ <td><%=testResult.getModified().toLocaleString()%></td>
+ </tr>
+ <tr></tr><tr></tr>
+
+ </table>
+ </div>
+
+</body>
+</html>
+
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testscript_html.jsp b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testscript_html.jsp
new file mode 100644
index 0000000..286ee40
--- /dev/null
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/WebContent/web/testscript_html.jsp
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<%--
+ Copyright (c) 2011, 2014 IBM Corporation.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ and Eclipse Distribution License v. 1.0 which accompanies this distribution.
+
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+ Contributors:
+
+ Michael Fiedler - initial implementation
+
+--%>
+
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.TestScript"%>
+<%@page import="org.eclipse.lyo.oslc4j.qualitymanagement.QmResource"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.Property"%>
+<%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%>
+<%@ page contentType="text/html" language="java" pageEncoding="UTF-8" %>
+<%@ page import="java.util.List" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%
+ TestScript testScript = (TestScript) request.getAttribute("testScript");
+
+%>
+<html>
+
+<head>
+
+ <script type="text/javascript" src="../../web/qmDialogs.js"></script>
+ <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+ <script type="text/javascript" src="../../web/jquery-ui-1.8.18.custom.min.js"></script>
+ <script>
+ $().ready(function(){
+ $("th").each(function(){
+
+ $(this).addClass("ui-state-default");
+
+ });
+ $("td").each(function(){
+
+ $(this).addClass("ui-widget-content");
+
+ });
+ $("tr").hover(
+ function()
+ {
+ $(this).children("td").addClass("ui-state-hover");
+ },
+ function()
+ {
+ $(this).children("td").removeClass("ui-state-hover");
+ }
+ );
+ $("tr").click(function(){
+
+ $(this).children("td").toggleClass("ui-state-highlight");
+ });
+
+ });
+ </script>
+ <link rel="stylesheet" type="text/css" href="../../web/jquery-ui-1.8.18.custom.css"></link>
+ <style>
+ #logo {
+ padding-top: 35px;
+ }
+ body {
+ width: 700px;
+ padding: 50px 0px 0px 50px;
+ }
+ td {
+ font-weight: bold
+ }
+ #resourceTable {
+ width: 700px;
+ }
+ </style>
+
+</head>
+
+<body>
+ <div>
+ <img src="http://open-services.net/css/images/logo-forflip.png" id="logo" alt="O" width="71" height="80" align= "left"/>
+ </div>
+ <div>
+ <h2 class="ui-widget-header">OSLC4J Quality Management Test Script</h2>
+ <h3><c:out value="${testScript.identifier}"/>: <c:out value="${testScript.title}"/></h3>
+ <table id="resourceTable">
+ <tr>
+ <td>ID</td>
+ <td><c:out value="${testScript.identifier}"/></td>
+ </tr>
+ <tr>
+ <td>Title</td>
+ <td><c:out value="${testScript.title}"/></td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td><c:out value="${testScript.description}"/></td>
+ </tr>
+ <tr>
+ <td>Created</td>
+ <td><%=testScript.getCreated().toLocaleString()%></td>
+ </tr>
+ <tr>
+ <td>Modified</td>
+ <td><%=testScript.getModified().toLocaleString()%></td>
+ </tr>
+ <tr></tr><tr></tr>
+
+ </table>
+ </div>
+
+</body>
+</html>
+
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/BaseQmResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/BaseQmResource.java
index 5599f06..48088e4 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/BaseQmResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/BaseQmResource.java
@@ -15,15 +15,15 @@
*******************************************************************************/
package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
+import java.io.IOException;
import java.lang.reflect.Array;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
@@ -40,6 +40,7 @@ import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.model.Compact;
import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
+import org.eclipse.lyo.oslc4j.core.model.Preview;
import org.eclipse.lyo.oslc4j.qualitymanagement.Persistence;
import org.eclipse.lyo.oslc4j.qualitymanagement.QmResource;
import org.eclipse.lyo.oslc4j.qualitymanagement.servlet.ServiceProviderSingleton;
@@ -113,14 +114,44 @@ public class BaseQmResource<T extends QmResource>
httpServletRequest.getContextPath() + "UI/images/resources/" + getPath() + "/icon.png",
null,
null);
-
+
compact.setIcon(iconURI);
+ //Create and set attributes for preview resource
+ final Preview largePreview = new Preview();
+ largePreview.setHintHeight("20em");
+ largePreview.setHintWidth("35em");
+ largePreview.setDocument(new URI(compact.getAbout().toString() + "/largePreview"));
+ compact.setLargePreview(largePreview);
+
return compact;
}
throw new WebApplicationException(Status.NOT_FOUND);
}
+
+ @GET
+ @Path("{resourceId}/largePreview")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getLargePreview(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @PathParam("resourceId") final String resourceId) throws ServletException, IOException, URISyntaxException
+ {
+ final T qmRequest = Persistence.getQmResource(resourceId, resourceType);
+
+ if (qmRequest != null)
+ {
+
+ httpServletRequest.setAttribute("qmRequest", qmRequest);
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/qmrequest_preview_large.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+
+ }
public Response addResource(final HttpServletRequest httpServletRequest,
final HttpServletResponse httpServletResponse,
@@ -273,39 +304,4 @@ public class BaseQmResource<T extends QmResource>
}
}
- @GET
- @Path("creator")
- @Produces({MediaType.TEXT_HTML, MediaType.WILDCARD})
-
- public void autoRequestCreator(@Context final HttpServletRequest httpServletRequest,
- @Context final HttpServletResponse httpServletResponse,
- @Context final UriInfo uriInfo,
- @QueryParam("testPlan") final String testPlan)
- {
- httpServletRequest.setAttribute("creatorUri",uriInfo.getAbsolutePath().toString());
- httpServletRequest.setAttribute("resourceType", this.resourceType.getSimpleName());
-
- if (testPlan == null)
- {
- Map<String,String> testPlanIDs = new HashMap<String,String>();
-
- for (QmResource thisResource:Persistence.getQmResources())
- {
- if (thisResource.getClass().equals(QmResource.class))
- {
- testPlanIDs.put(thisResource.getIdentifier(), thisResource.getTitle());
- }
- }
- try {
- httpServletRequest.setAttribute("testPlans", testPlanIDs);
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/qmrequest_creator.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
- } catch (Exception e) {
- System.out.println("err");
- throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
- }
-
- }
- }
-
}
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestCaseResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestCaseResource.java
index 9765c64..8533f17 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestCaseResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestCaseResource.java
@@ -17,6 +17,10 @@ package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
@@ -36,6 +40,7 @@ import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
@@ -46,7 +51,10 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
import org.eclipse.lyo.oslc4j.qualitymanagement.Constants;
+import org.eclipse.lyo.oslc4j.qualitymanagement.Persistence;
+import org.eclipse.lyo.oslc4j.qualitymanagement.QmResource;
import org.eclipse.lyo.oslc4j.qualitymanagement.TestCase;
+import org.eclipse.lyo.oslc4j.qualitymanagement.TestPlan;
@OslcService(Constants.QUALITY_MANAGEMENT_DOMAIN)
@Path("testCases")
@@ -110,7 +118,7 @@ public class TestCaseResource extends BaseQmResource<TestCase> {
@GET
@Path("{resourceId}")
@Produces({MediaType.TEXT_HTML})
- public Response getResource(@Context final HttpServletRequest httpServletRequest,
+ public void getResource(@Context final HttpServletRequest httpServletRequest,
@Context final HttpServletResponse httpServletResponse,
@PathParam("resourceId") final String resourceId)
{
@@ -124,8 +132,6 @@ public class TestCaseResource extends BaseQmResource<TestCase> {
} catch (Exception e) {
throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
}
-
- throw new WebApplicationException(Status.NOT_FOUND);
}
@OslcDialog
@@ -174,6 +180,34 @@ public class TestCaseResource extends BaseQmResource<TestCase> {
{
return super.deleteResource(identifier);
}
+
+ @GET
+ @Path("creator")
+ @Produces({MediaType.TEXT_HTML, MediaType.WILDCARD})
+
+ public void caseRequestCreator(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @Context final UriInfo uriInfo,
+ @QueryParam("testPlan") final String testPlan)
+ {
+ httpServletRequest.setAttribute("creatorUri",uriInfo.getAbsolutePath().toString());
+
+ if (testPlan == null)
+ {
+ List<TestPlan> testPlanIDs = new ArrayList<TestPlan>();
+
+ testPlanIDs = Persistence.getQmResources(TestPlan.class);
+
+ try {
+ httpServletRequest.setAttribute("testPlans", testPlanIDs);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/qmcase_creator.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+ } catch (Exception e) {
+ throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+ }
@POST
@Path("creator")
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestExecutionRecordResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestExecutionRecordResource.java
index 53b3d63..e533f61 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestExecutionRecordResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestExecutionRecordResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -17,6 +17,7 @@ package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
import java.net.URISyntaxException;
+import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
@@ -29,8 +30,11 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog;
@@ -60,7 +64,7 @@ public class TestExecutionRecordResource extends BaseQmResource<TestExecutionRec
(
title = "Test Execution Record Selection Dialog",
label = "Test Execution Record Selection Dialog",
- uri = "",
+ uri = "testExecutionRecords/selector",
hintWidth = "1000px",
hintHeight = "600px",
resourceTypes = {Constants.TYPE_TEST_EXECUTION_RECORD},
@@ -70,7 +74,7 @@ public class TestExecutionRecordResource extends BaseQmResource<TestExecutionRec
(
title = "Test Execution Record List Dialog",
label = "Test Execution Record List Dialog",
- uri = "UI/testExecutionRecords/list.jsp",
+ uri = "",
hintWidth = "1000px",
hintHeight = "600px",
resourceTypes = {Constants.TYPE_TEST_EXECUTION_RECORD},
@@ -101,6 +105,25 @@ public class TestExecutionRecordResource extends BaseQmResource<TestExecutionRec
return super.getResource(httpServletResponse, resourceId);
}
+ @GET
+ @Path("{resourceId}")
+ @Produces({MediaType.TEXT_HTML})
+ public void getResource(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @PathParam("resourceId") final String resourceId)
+ {
+
+ httpServletRequest.setAttribute("testExecutionRecord",super.getResource(httpServletResponse, resourceId));
+
+ try {
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/testexecution_html.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+
+ } catch (Exception e) {
+ throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
+ }
+ }
+
@OslcCreationFactory
(
title = "Test Execution Record Creation Factory",
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestPlanResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestPlanResource.java
index dd88b73..7f75950 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestPlanResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestPlanResource.java
@@ -17,6 +17,8 @@ package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
@@ -36,6 +38,7 @@ import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
@@ -46,6 +49,8 @@ import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
import org.eclipse.lyo.oslc4j.qualitymanagement.Constants;
+import org.eclipse.lyo.oslc4j.qualitymanagement.Persistence;
+import org.eclipse.lyo.oslc4j.qualitymanagement.QmResource;
import org.eclipse.lyo.oslc4j.qualitymanagement.TestPlan;
@OslcService(Constants.QUALITY_MANAGEMENT_DOMAIN)
@@ -110,7 +115,7 @@ public class TestPlanResource extends BaseQmResource<TestPlan> {
@GET
@Path("{resourceId}")
@Produces({MediaType.TEXT_HTML})
- public Response getResource(@Context final HttpServletRequest httpServletRequest,
+ public void getResource(@Context final HttpServletRequest httpServletRequest,
@Context final HttpServletResponse httpServletResponse,
@PathParam("resourceId") final String resourceId)
{
@@ -124,8 +129,6 @@ public class TestPlanResource extends BaseQmResource<TestPlan> {
} catch (Exception e) {
throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
}
-
- throw new WebApplicationException(Status.NOT_FOUND);
}
@@ -176,6 +179,40 @@ public class TestPlanResource extends BaseQmResource<TestPlan> {
{
return super.deleteResource(identifier);
}
+
+ @GET
+ @Path("creator")
+ @Produces({MediaType.TEXT_HTML, MediaType.WILDCARD})
+
+ public void planRequestCreator(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @Context final UriInfo uriInfo,
+ @QueryParam("testPlan") final String testPlan)
+ {
+ httpServletRequest.setAttribute("creatorUri",uriInfo.getAbsolutePath().toString());
+
+ if (testPlan == null)
+ {
+ Map<String,String> testPlanIDs = new HashMap<String,String>();
+
+ for (QmResource thisResource:Persistence.getQmResources())
+ {
+ if (thisResource.getClass().equals(TestPlan.class))
+ {
+ testPlanIDs.put(thisResource.getIdentifier(), thisResource.getTitle());
+ }
+ }
+ try {
+ httpServletRequest.setAttribute("testPlans", testPlanIDs);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/qmplan_creator.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+ } catch (Exception e) {
+ System.out.println("err");
+ throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+ }
@POST
@Path("creator")
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestResultResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestResultResource.java
index 8978dc2..e0bcd85 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestResultResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestResultResource.java
@@ -17,6 +17,7 @@ package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
import java.net.URISyntaxException;
+import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
@@ -29,8 +30,11 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog;
@@ -101,6 +105,25 @@ public class TestResultResource extends BaseQmResource<TestResult> {
return super.getResource(httpServletResponse, resourceId);
}
+ @GET
+ @Path("{resourceId}")
+ @Produces({MediaType.TEXT_HTML})
+ public void getResource(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @PathParam("resourceId") final String resourceId)
+ {
+
+ httpServletRequest.setAttribute("testResult",super.getResource(httpServletResponse, resourceId));
+
+ try {
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/testresult_html.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+
+ } catch (Exception e) {
+ throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
+ }
+ }
+
@OslcCreationFactory
(
title = "Test Result Creation Factory",
diff --git a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestScriptResource.java b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestScriptResource.java
index 0d93dae..bd5421d 100644
--- a/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestScriptResource.java
+++ b/org.eclipse.lyo.oslc4j.qualitymanagement/src/org/eclipse/lyo/oslc4j/qualitymanagement/resources/TestScriptResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation.
+ * Copyright (c) 2012, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -17,6 +17,7 @@ package org.eclipse.lyo.oslc4j.qualitymanagement.resources;
import java.net.URISyntaxException;
+import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
@@ -29,8 +30,11 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog;
@@ -60,7 +64,7 @@ public class TestScriptResource extends BaseQmResource<TestScript> {
(
title = "Test Script Selection Dialog",
label = "Test Script Selection Dialog",
- uri = "",
+ uri = "testScripts/selector",
hintWidth = "1000px",
hintHeight = "600px",
resourceTypes = {Constants.TYPE_TEST_SCRIPT},
@@ -70,7 +74,7 @@ public class TestScriptResource extends BaseQmResource<TestScript> {
(
title = "Test Script List Dialog",
label = "Test Script List Dialog",
- uri = "UI/testScripts/list.jsp",
+ uri = "",
hintWidth = "1000px",
hintHeight = "600px",
resourceTypes = {Constants.TYPE_TEST_SCRIPT},
@@ -101,6 +105,26 @@ public class TestScriptResource extends BaseQmResource<TestScript> {
return super.getResource(httpServletResponse, resourceId);
}
+ @GET
+ @Path("{resourceId}")
+ @Produces({MediaType.TEXT_HTML})
+ public void getResource(@Context final HttpServletRequest httpServletRequest,
+ @Context final HttpServletResponse httpServletResponse,
+ @PathParam("resourceId") final String resourceId)
+ {
+
+ httpServletRequest.setAttribute("testScript",super.getResource(httpServletResponse, resourceId));
+
+ try {
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/web/testscript_html.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+
+ } catch (Exception e) {
+ throw new WebApplicationException(e,Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+
@OslcCreationFactory
(
title = "Test Script Creation Factory",