From 34ca7df798da5031aa91b0d04039983cb077ba42 Mon Sep 17 00:00:00 2001 From: kelvingoodson Date: Fri, 29 Jan 2010 14:02:16 +0000 Subject: checkpoint - almost got example RSS feed of JIRA being consumed - some issues over Item git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904500 13f79535-47bb-0310-9956-ffa450edef68 --- .../jagg/src/main/java/services/PlanViewImpl.java | 53 ++++++++++++++-------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'sandbox/kgoodson/jagg/src/main/java') diff --git a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java index b432522917..13edacaaea 100644 --- a/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java +++ b/sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java @@ -33,7 +33,9 @@ import org.oasisopen.sca.annotation.Init; import com.example.ipo.jaxb.Milestone; import com.example.ipo.jaxb.Plan; +import com.example.ipo.jaxb.RSS; import com.example.ipo.jaxb.WorkItem; +import com.example.ipo.jaxb.JiraRSS; import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.FeedException; @@ -82,25 +84,40 @@ public class PlanViewImpl implements PlanView { 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 +// 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(); +// } + + try { + JAXBContext jaxbContext = JAXBContext + .newInstance("com.example.ipo.jaxb"); + Unmarshaller m2 = jaxbContext.createUnmarshaller(); + File inputFile = new File("src/main/resources/exampleJira.xml") + .getAbsoluteFile(); + + RSS j = ((JAXBElement) m2.unmarshal(inputFile)).getValue(); + augment_plan(_p); + } catch (Exception e) { e.printStackTrace(); + } finally { + } -- cgit v1.2.3