You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2010/01/28 14:48:46 UTC

svn commit: r904085 - in /tuscany/sandbox/kgoodson/jagg: ./ src/main/java/services/PlanViewImpl.java src/main/resources/JiraSideband.xml src/main/resources/JiraSideband.xsd src/main/resources/uiservices/plan.html

Author: kelvingoodson
Date: Thu Jan 28 13:48:45 2010
New Revision: 904085

URL: http://svn.apache.org/viewvc?rev=904085&view=rev
Log:
checkpoint - working but SyndEntrys don't reveal JIRA status

Modified:
    tuscany/sandbox/kgoodson/jagg/   (props changed)
    tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
    tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml
    tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd
    tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html

Propchange: tuscany/sandbox/kgoodson/jagg/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 28 13:48:45 2010
@@ -0,0 +1,3 @@
+.project
+.classpath
+target

Modified: tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java?rev=904085&r1=904084&r2=904085&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java Thu Jan 28 13:48:45 2010
@@ -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 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 @@
 						.getAbsoluteFile();
 
 				_p = ((JAXBElement<Plan>) m.unmarshal(inputFile)).getValue();
+				augment_plan(_p);
 			} catch (Exception e) {
 				e.printStackTrace();
 			} finally {
@@ -63,6 +76,38 @@
 	
 
 
+	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();
 	

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml?rev=904085&r1=904084&r2=904085&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml Thu Jan 28 13:48:45 2010
@@ -1,56 +1,51 @@
 <?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>
+  	</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>
-  		<jira>TUSCANY-0000</jira>
+  		<jira>TUSCANY-3397</jira>
   		<status>in progress</status>
   		<repository_vid>repository_vid</repository_vid>
   		<note>note</note>
-  	</workitem>
-  	<workitem ID='CONTRIBS_IDENT_SPEC_VERS'>
-  		<title>Add support for identifying the SCA Spec Version for contribution metadata</title>
-  		<responsible>LR</responsible>
+  	</workItem>
+</milestone>
+<milestone ID="Dummy">
+  	<workItem ID='Activity  1'>
+  		<title>Add support for ....</title>
+  		<responsible>FB</responsible>
   		<dueDate>2001-01-01</dueDate>
-  		<jira>TUSCANY-3397</jira>
+  		<jira>TUSCANY-3333</jira>
   		<status>in progress</status>
   		<repository_vid>repository_vid</repository_vid>
   		<note>note</note>
-  	</workitem>
+  	</workItem>
+</milestone>
+  	
 
-  </workitems>
 </jagg:plan>

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd
URL: http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd?rev=904085&r1=904084&r2=904085&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd Thu Jan 28 13:48:45 2010
@@ -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:element>
+
+    		<xsd:element name="workItem" type="jagg:WorkItem"
+    			maxOccurs="unbounded" minOccurs="0">
+    		</xsd:element>
     	</xsd:sequence>
-    	<xsd:attribute name="ID" type="xsd:ID"></xsd:attribute>
 
-    	<xsd:attribute name="workItems" type="xsd:IDREFS"></xsd:attribute>
+
+    	<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>
\ No newline at end of file

Modified: tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html
URL: http://svn.apache.org/viewvc/tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html?rev=904085&r1=904084&r2=904085&view=diff
==============================================================================
--- tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html (original)
+++ tuscany/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html Thu Jan 28 13:48:45 2010
@@ -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;