summaryrefslogtreecommitdiffstats
path: root/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java')
-rw-r--r--sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java47
1 files changed, 46 insertions, 1 deletions
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<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();