checkpoint - working but SyndEntrys don't reveal JIRA status
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904085 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
19a4e89793
commit
a6c94f1da3
4 changed files with 113 additions and 74 deletions
|
@ -20,6 +20,10 @@
|
|||
package services;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
|
@ -27,12 +31,20 @@ import javax.xml.bind.Unmarshaller;
|
|||
|
||||
import org.oasisopen.sca.annotation.Init;
|
||||
|
||||
import com.example.ipo.jaxb.Milestone;
|
||||
import com.example.ipo.jaxb.Plan;
|
||||
import com.example.ipo.jaxb.WorkItem;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import com.sun.syndication.io.SyndFeedInput;
|
||||
import com.sun.syndication.io.XmlReader;
|
||||
|
||||
public class PlanViewImpl implements PlanView {
|
||||
|
||||
private com.example.ipo.jaxb.Plan _p = null;
|
||||
|
||||
static String rssPrefix = "http://issues.apache.org/jira/si/jira.issueviews:issue-xml/";
|
||||
// TUSCANY-1178/TUSCANY-1178.xml
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
|
@ -50,6 +62,7 @@ public class PlanViewImpl implements PlanView {
|
|||
.getAbsoluteFile();
|
||||
|
||||
_p = ((JAXBElement<Plan>) m.unmarshal(inputFile)).getValue();
|
||||
augment_plan(_p);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
@ -63,6 +76,38 @@ public class PlanViewImpl implements PlanView {
|
|||
|
||||
|
||||
|
||||
private void augment_plan(Plan plan) {
|
||||
for(Milestone m : plan.getMilestone()) {
|
||||
for (WorkItem wi: m.getWorkItem()) {
|
||||
String jira = wi.getJira();
|
||||
String feed = rssPrefix += jira + "/" + jira + ".xml";
|
||||
|
||||
SyndFeedInput input = new SyndFeedInput();
|
||||
try {
|
||||
SyndFeed sfeed = input.build(new XmlReader(new URL(feed)));
|
||||
List<SyndEntry> entries = sfeed.getEntries();
|
||||
SyndEntry jiraEntry = (SyndEntry)entries.toArray()[0];
|
||||
String title = jiraEntry.getTitle();
|
||||
System.out.println(sfeed.toString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (FeedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Plan get() {
|
||||
com.example.ipo.jaxb.Plan modelplan = getPlan();
|
||||
|
||||
|
|
|
@ -1,48 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jagg:plan xmlns:jagg="http://www.example.com/tracking" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/tracking JiraSideband.xsd ">
|
||||
<issueBase>https://issues.apache.org/jira/browse/</issueBase>
|
||||
<milestones>
|
||||
<milestone ID="V8_M5I14a" workItems=
|
||||
'SUPPORT_REFS_ON_OTHERS ENHANCE_ART_PROC_PERF'>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<deliveredby>deliveredby</deliveredby>
|
||||
<note>note</note>
|
||||
</milestone>
|
||||
<milestone ID="DummyMS1" workItems="DUMMYWI1">
|
||||
<dueDate>xxx</dueDate>
|
||||
<deliveredby></deliveredby>
|
||||
<note></note>
|
||||
</milestone>
|
||||
</milestones>
|
||||
<workitems>
|
||||
<workitem ID='SUPPORT_REFS_ON_OTHERS'>
|
||||
<title>support reference on other impl type than impl.widget</title>
|
||||
|
||||
<milestone ID="M1">
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<deliveredby>deliveredby</deliveredby>
|
||||
<note>note</note>
|
||||
|
||||
<workItem>
|
||||
<title>support reference on other impl type than impl.widget</title>
|
||||
<responsible>LR</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<jira>TUSCANY-2850</jira>
|
||||
<status>in progress</status>
|
||||
<repository_vid>repository_vid</repository_vid>
|
||||
<note>note</note>
|
||||
</workitem>
|
||||
<workitem ID='ENHANCE_ART_PROC_PERF'>
|
||||
<title>Enhance artfact processing performance by returning URI and location URL in one call</title>
|
||||
</workItem>
|
||||
<workItem ID='ENHANCE_ART_PROC_PERF'>
|
||||
<title>Enhance artefact processing performance by returning URI and location URL in one call</title>
|
||||
<responsible>LR</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<jira>TUSCANY-3395</jira>
|
||||
<status>in progress</status>
|
||||
<repository_vid>repository_vid</repository_vid>
|
||||
<note>note</note>
|
||||
</workitem>
|
||||
<workitem ID='DUMMYWI1'>
|
||||
<title>Something to do</title>
|
||||
<responsible>KG</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<jira>TUSCANY-0000</jira>
|
||||
<status>in progress</status>
|
||||
<repository_vid>repository_vid</repository_vid>
|
||||
<note>note</note>
|
||||
</workitem>
|
||||
<workitem ID='CONTRIBS_IDENT_SPEC_VERS'>
|
||||
</workItem>
|
||||
<workItem ID='CONTRIBS_IDENT_SPEC_VERS'>
|
||||
<title>Add support for identifying the SCA Spec Version for contribution metadata</title>
|
||||
<responsible>LR</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
|
@ -50,7 +33,19 @@
|
|||
<status>in progress</status>
|
||||
<repository_vid>repository_vid</repository_vid>
|
||||
<note>note</note>
|
||||
</workitem>
|
||||
</workItem>
|
||||
</milestone>
|
||||
<milestone ID="Dummy">
|
||||
<workItem ID='Activity 1'>
|
||||
<title>Add support for ....</title>
|
||||
<responsible>FB</responsible>
|
||||
<dueDate>2001-01-01</dueDate>
|
||||
<jira>TUSCANY-3333</jira>
|
||||
<status>in progress</status>
|
||||
<repository_vid>repository_vid</repository_vid>
|
||||
<note>note</note>
|
||||
</workItem>
|
||||
</milestone>
|
||||
|
||||
|
||||
</workitems>
|
||||
</jagg:plan>
|
||||
|
|
|
@ -25,14 +25,11 @@
|
|||
|
||||
<xsd:complexType name="Plan">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="issueBase" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="milestones" type="jagg:Milestones"
|
||||
maxOccurs="1" minOccurs="1">
|
||||
</xsd:element>
|
||||
<xsd:element name="workitems" type="jagg:WorkItems"
|
||||
maxOccurs="1" minOccurs="1">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:element name="issueBase" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
|
||||
|
||||
<xsd:element name="milestone" type="jagg:Milestone" maxOccurs="unbounded" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
|
@ -45,8 +42,8 @@
|
|||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
|
||||
<xsd:element name="title" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="responsible" type="xsd:string"
|
||||
<xsd:element name="title" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
|
||||
<xsd:element name="responsible" type="xsd:string"
|
||||
maxOccurs="1" minOccurs="0">
|
||||
</xsd:element>
|
||||
<xsd:element name="dueDate" type="xsd:string" maxOccurs="1"
|
||||
|
@ -64,17 +61,21 @@
|
|||
</xsd:element>
|
||||
<xsd:element name="note" type="xsd:string" maxOccurs="1"
|
||||
minOccurs="0">
|
||||
</xsd:element>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="jiraData" type="jagg:JiraData" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="Milestone">
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="dueDate" type="xsd:string"></xsd:element>
|
||||
|
||||
<xsd:complexType name="Milestone">
|
||||
|
||||
<xsd:sequence>
|
||||
<xsd:element name="dueDate" type="xsd:string" maxOccurs="1"
|
||||
minOccurs="0">
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="deliveredby" type="xsd:string"
|
||||
maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
|
@ -86,11 +87,15 @@
|
|||
</xsd:element>
|
||||
<xsd:element name="note" type="xsd:string" maxOccurs="1"
|
||||
minOccurs="0">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:attribute name="workItems" type="xsd:IDREFS"></xsd:attribute>
|
||||
<xsd:element name="workItem" type="jagg:WorkItem"
|
||||
maxOccurs="unbounded" minOccurs="0">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="ID" type="xsd:string"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="Milestones">
|
||||
|
@ -112,4 +117,13 @@
|
|||
<xsd:element name="workitems" type="jagg:WorkItem" maxOccurs="unbounded" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="JiraData">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="title" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="status" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="assignedTo" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="ID" type="xsd:string"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
|
@ -34,12 +34,12 @@
|
|||
alert(exception.message);
|
||||
return;
|
||||
}
|
||||
var mscontent = "<h2>Milestones</h2>\n<table border=\"1\">";
|
||||
ms = plan.milestones.milestone.list;
|
||||
var mscontent = "<table border=\"1\" align=\"left\">";
|
||||
ms = plan.milestone.list;
|
||||
for(var i=0; i<ms.length; i++) {
|
||||
mscontent += "<tr><th colspan=\"4\">" + ms[i].ID + "</th></tr>";
|
||||
var mswi = ms[i].workItems.list;
|
||||
mscontent +="<tr><th>Title</th><td>JIRA</th><td>Responsible</th><th>Status</th></tr>";
|
||||
mscontent += "<tr><th colspan=\"4\" align=\"left\">Milestone " + ms[i].ID + "</th></tr>";
|
||||
var mswi = ms[i].workItem.list;
|
||||
mscontent +="<tr><th align=\"left\">Title</th><td>JIRA</th><td>Responsible</th><th>Status</th></tr>";
|
||||
for (var j=0; j<mswi.length; j++) {
|
||||
mscontent +=
|
||||
"<tr>"
|
||||
|
@ -50,23 +50,8 @@
|
|||
|
||||
}
|
||||
|
||||
mscontent += "</table>"
|
||||
+"<h2> Work Items to be Scheduled</h2>";
|
||||
mscontent += "<table border=\"1\"><tr><th>Title</th><th>JIRA</th><th>Responsible</th><th>Status</th></tr>";
|
||||
|
||||
// unassigned work items (in terms of milestones)
|
||||
var uawi = plan.workitems.workitem.list;
|
||||
for(var j=0; j<uawi.length; j++) {
|
||||
if(uawi[j]) {
|
||||
mscontent +=
|
||||
"<tr>"
|
||||
+"<td>"+uawi[j].title+"</td>" + "<td>"+uawi[j].jira
|
||||
+"</td>"+ "<td>"+uawi[j].responsible+"</td>"+ "<td>"+uawi[j].status+"</td>"+ "<td></td>"
|
||||
+"</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
mscontent += "</table>";
|
||||
mscontent += "</table>";
|
||||
|
||||
document.getElementById('milestones').innerHTML='<h2>' + mscontent;
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue