From a6c94f1da365b95c8981c86a5f9c05e583b23b76 Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Thu, 28 Jan 2010 13:48:45 +0000 Subject: 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 --- .../jagg/src/main/java/services/PlanViewImpl.java | 47 +++++++++++++++++- .../jagg/src/main/resources/JiraSideband.xml | 57 ++++++++++------------ .../jagg/src/main/resources/JiraSideband.xsd | 52 ++++++++++++-------- .../jagg/src/main/resources/uiservices/plan.html | 27 +++------- 4 files changed, 111 insertions(+), 72 deletions(-) (limited to 'sandbox/kgoodson') diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index c8ebf5afdd..b432522917 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -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) 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 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(); diff --git a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml index f9509f9f9d..8f27510a0a 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml +++ b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xml @@ -1,56 +1,51 @@ https://issues.apache.org/jira/browse/ - - - 2001-01-01 - deliveredby - note - - - xxx - - - - - - - support reference on other impl type than impl.widget + + + 2001-01-01 + deliveredby + note + + + support reference on other impl type than impl.widget LR 2001-01-01 TUSCANY-2850 in progress repository_vid note - - - Enhance artfact processing performance by returning URI and location URL in one call + + + Enhance artefact processing performance by returning URI and location URL in one call LR 2001-01-01 TUSCANY-3395 in progress repository_vid note - - - Something to do - KG + + + Add support for identifying the SCA Spec Version for contribution metadata + LR 2001-01-01 - TUSCANY-0000 + TUSCANY-3397 in progress repository_vid note - - - Add support for identifying the SCA Spec Version for contribution metadata - LR + + + + + Add support for .... + FB 2001-01-01 - TUSCANY-3397 + TUSCANY-3333 in progress repository_vid note - + + + - diff --git a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd index 41f25b1961..e868645dce 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd +++ b/sandbox/kgoodson/jagg/src/main/resources/JiraSideband.xsd @@ -25,14 +25,11 @@ - - - - - - + + + + + @@ -45,8 +42,8 @@ - - + - + + + - - - - - + + + + + + @@ -86,11 +87,15 @@ - + + + + - - + + @@ -112,4 +117,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html index ace495dbe7..3420bf907b 100644 --- a/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html +++ b/sandbox/kgoodson/jagg/src/main/resources/uiservices/plan.html @@ -34,12 +34,12 @@ alert(exception.message); return; } - var mscontent = "

Milestones

\n"; - ms = plan.milestones.milestone.list; + var mscontent = "
"; + ms = plan.milestone.list; for(var i=0; i" + ms[i].ID + ""; - var mswi = ms[i].workItems.list; - mscontent +=""; + mscontent += ""; + var mswi = ms[i].workItem.list; + mscontent +=""; for (var j=0; j Work Items to be Scheduled"; - mscontent += "
TitleJIRAResponsibleStatus
Milestone " + ms[i].ID + "
TitleJIRAResponsibleStatus
"; - // unassigned work items (in terms of milestones) - var uawi = plan.workitems.workitem.list; - for(var j=0; j" - +"" + ""+ ""+ ""+ "" - +""; - } - } - - mscontent += "
TitleJIRAResponsibleStatus
"+uawi[j].title+""+uawi[j].jira - +""+uawi[j].responsible+""+uawi[j].status+"
"; + mscontent += ""; document.getElementById('milestones').innerHTML='

' + mscontent; return; -- cgit v1.2.3