summaryrefslogtreecommitdiffstats
path: root/sandbox/kgoodson/jagg/src/main/java
diff options
context:
space:
mode:
authorkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 14:02:16 +0000
committerkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-01-29 14:02:16 +0000
commit34ca7df798da5031aa91b0d04039983cb077ba42 (patch)
tree173eb1b20e542ac487d69db181f68a0fbb2afdeb /sandbox/kgoodson/jagg/src/main/java
parentb8e7a0344f363bf360bc3ad99e6a0c44e4ba4731 (diff)
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
Diffstat (limited to 'sandbox/kgoodson/jagg/src/main/java')
-rw-r--r--sandbox/kgoodson/jagg/src/main/java/services/PlanViewImpl.java53
1 files changed, 35 insertions, 18 deletions
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<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
+// 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();
+// }
+
+ 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<RSS>) m2.unmarshal(inputFile)).getValue();
+ augment_plan(_p);
+ } catch (Exception e) {
e.printStackTrace();
+ } finally {
+
}